From d53ef027f2ace2339aa976d435bcf27be1dbe163 Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Mon, 15 Jan 2024 12:38:07 -0500 Subject: [PATCH] `@slack/web-api` argument type safety (#1673) Co-authored-by: Kazuhiro Sera --- lint-configs/.eslintignore | 2 +- lint-configs/.eslintrc.js | 20 +- packages/oauth/package.json | 34 +- packages/oauth/src/callback-options.ts | 2 + packages/oauth/src/install-provider.ts | 4 +- packages/rtm-api/package.json | 16 +- packages/rtm-api/src/KeepAlive.ts | 1 + packages/rtm-api/src/RTMClient.ts | 2 +- packages/socket-mode/package.json | 30 +- packages/socket-mode/src/SocketModeClient.ts | 4 +- packages/types/package.json | 16 +- packages/web-api/package.json | 3 +- packages/web-api/src/WebClient.spec.js | 20 - packages/web-api/src/WebClient.ts | 106 +- packages/web-api/src/file-upload.ts | 68 +- packages/web-api/src/index.ts | 3 +- packages/web-api/src/methods.ts | 2848 +++++++---------- .../src/types/request/admin/analytics.ts | 44 + .../web-api/src/types/request/admin/apps.ts | 96 + .../web-api/src/types/request/admin/auth.ts | 24 + .../src/types/request/admin/barriers.ts | 28 + .../src/types/request/admin/conversations.ts | 203 ++ .../web-api/src/types/request/admin/emoji.ts | 39 + .../src/types/request/admin/functions.ts | 26 + .../src/types/request/admin/inviteRequests.ts | 26 + .../web-api/src/types/request/admin/roles.ts | 33 + .../web-api/src/types/request/admin/teams.ts | 54 + .../src/types/request/admin/usergroups.ts | 38 + .../web-api/src/types/request/admin/users.ts | 149 + .../src/types/request/admin/workflows.ts | 44 + packages/web-api/src/types/request/api.ts | 5 + packages/web-api/src/types/request/apps.ts | 35 + packages/web-api/src/types/request/auth.ts | 23 + .../web-api/src/types/request/bookmarks.ts | 35 + packages/web-api/src/types/request/bots.ts | 7 + packages/web-api/src/types/request/calls.ts | 63 + packages/web-api/src/types/request/chat.ts | 227 ++ packages/web-api/src/types/request/common.ts | 138 + .../src/types/request/conversations.ts | 170 + packages/web-api/src/types/request/dialog.ts | 10 + packages/web-api/src/types/request/dnd.ts | 21 + packages/web-api/src/types/request/emoji.ts | 6 + packages/web-api/src/types/request/files.ts | 197 ++ .../web-api/src/types/request/functions.ts | 15 + .../web-api/src/types/request/manifest.ts | 547 ++++ .../web-api/src/types/request/migration.ts | 9 + packages/web-api/src/types/request/oauth.ts | 11 + packages/web-api/src/types/request/openid.ts | 7 + packages/web-api/src/types/request/pins.ts | 11 + .../web-api/src/types/request/reactions.ts | 25 + .../web-api/src/types/request/reminders.ts | 54 + packages/web-api/src/types/request/rtm.ts | 29 + packages/web-api/src/types/request/search.ts | 23 + packages/web-api/src/types/request/stars.ts | 13 + packages/web-api/src/types/request/team.ts | 46 + packages/web-api/src/types/request/tooling.ts | 5 + .../web-api/src/types/request/usergroups.ts | 59 + packages/web-api/src/types/request/users.ts | 88 + packages/web-api/src/types/request/views.ts | 59 + .../web-api/src/types/request/workflows.ts | 39 + .../response/AdminAnalyticsGetFileResponse.ts | 15 +- .../AdminAppsActivitiesListResponse.ts | 2 +- .../response/AdminAppsApproveResponse.ts | 2 +- .../response/AdminAppsApprovedListResponse.ts | 2 +- .../AdminAppsClearResolutionResponse.ts | 2 +- .../response/AdminAppsConfigLookupResponse.ts | 2 +- .../response/AdminAppsConfigSetResponse.ts | 2 +- .../AdminAppsRequestsCancelResponse.ts | 2 +- .../response/AdminAppsRequestsListResponse.ts | 2 +- .../response/AdminAppsRestrictResponse.ts | 2 +- .../AdminAppsRestrictedListResponse.ts | 2 +- .../response/AdminAppsUninstallResponse.ts | 2 +- .../AdminAuthPolicyAssignEntitiesResponse.ts | 2 +- .../AdminAuthPolicyGetEntitiesResponse.ts | 2 +- .../AdminAuthPolicyRemoveEntitiesResponse.ts | 2 +- .../response/AdminBarriersCreateResponse.ts | 2 +- .../response/AdminBarriersDeleteResponse.ts | 2 +- .../response/AdminBarriersListResponse.ts | 2 +- .../response/AdminBarriersUpdateResponse.ts | 2 +- .../AdminConversationsArchiveResponse.ts | 2 +- .../AdminConversationsBulkArchiveResponse.ts | 2 +- .../AdminConversationsBulkDeleteResponse.ts | 2 +- .../AdminConversationsBulkMoveResponse.ts | 2 +- ...inConversationsConvertToPrivateResponse.ts | 2 +- ...minConversationsConvertToPublicResponse.ts | 2 +- .../AdminConversationsCreateResponse.ts | 2 +- .../AdminConversationsDeleteResponse.ts | 2 +- ...inConversationsDisconnectSharedResponse.ts | 2 +- ...istOriginalConnectedChannelInfoResponse.ts | 2 +- ...nversationsGetConversationPrefsResponse.ts | 2 +- ...ConversationsGetCustomRetentionResponse.ts | 2 +- .../AdminConversationsGetTeamsResponse.ts | 2 +- .../AdminConversationsInviteResponse.ts | 2 +- .../AdminConversationsLookupResponse.ts | 2 +- ...versationsRemoveCustomRetentionResponse.ts | 2 +- .../AdminConversationsRenameResponse.ts | 2 +- ...ersationsRestrictAccessAddGroupResponse.ts | 2 +- ...sationsRestrictAccessListGroupsResponse.ts | 2 +- ...ationsRestrictAccessRemoveGroupResponse.ts | 2 +- .../AdminConversationsSearchResponse.ts | 2 +- ...nversationsSetConversationPrefsResponse.ts | 2 +- ...ConversationsSetCustomRetentionResponse.ts | 2 +- .../AdminConversationsSetTeamsResponse.ts | 2 +- .../AdminConversationsUnarchiveResponse.ts | 2 +- .../AdminConversationsWhitelistAddResponse.ts | 2 +- ...telistListGroupsLinkedToChannelResponse.ts | 2 +- ...minConversationsWhitelistRemoveResponse.ts | 2 +- .../response/AdminEmojiAddAliasResponse.ts | 2 +- .../response/AdminEmojiAddResponse.ts | 2 +- .../response/AdminEmojiListResponse.ts | 2 +- .../response/AdminEmojiRemoveResponse.ts | 2 +- .../response/AdminEmojiRenameResponse.ts | 2 +- .../response/AdminFunctionsListResponse.ts | 2 +- ...AdminFunctionsPermissionsLookupResponse.ts | 2 +- .../AdminFunctionsPermissionsSetResponse.ts | 2 +- .../AdminInviteRequestsApproveResponse.ts | 2 +- ...AdminInviteRequestsApprovedListResponse.ts | 2 +- .../AdminInviteRequestsDeniedListResponse.ts | 2 +- .../AdminInviteRequestsDenyResponse.ts | 2 +- .../AdminInviteRequestsListResponse.ts | 2 +- .../AdminRolesAddAssignmentsResponse.ts | 2 +- .../AdminRolesListAssignmentsResponse.ts | 2 +- .../AdminRolesRemoveAssignmentsResponse.ts | 2 +- .../response/AdminTeamsAdminsListResponse.ts | 2 +- .../response/AdminTeamsCreateResponse.ts | 2 +- .../response/AdminTeamsListResponse.ts | 2 +- .../response/AdminTeamsOwnersListResponse.ts | 2 +- .../AdminTeamsSettingsInfoResponse.ts | 2 +- ...TeamsSettingsSetDefaultChannelsResponse.ts | 2 +- ...dminTeamsSettingsSetDescriptionResponse.ts | 2 +- ...TeamsSettingsSetDiscoverabilityResponse.ts | 2 +- .../AdminTeamsSettingsSetIconResponse.ts | 2 +- .../AdminTeamsSettingsSetNameResponse.ts | 2 +- .../AdminUsergroupsAddChannelsResponse.ts | 2 +- .../AdminUsergroupsAddTeamsResponse.ts | 2 +- .../AdminUsergroupsListChannelsResponse.ts | 2 +- .../AdminUsergroupsRemoveChannelsResponse.ts | 2 +- .../response/AdminUsersAssignResponse.ts | 2 +- .../response/AdminUsersInviteResponse.ts | 2 +- .../response/AdminUsersListResponse.ts | 2 +- .../response/AdminUsersRemoveResponse.ts | 2 +- .../AdminUsersSessionClearSettingsResponse.ts | 2 +- .../AdminUsersSessionGetSettingsResponse.ts | 2 +- .../AdminUsersSessionInvalidateResponse.ts | 2 +- .../response/AdminUsersSessionListResponse.ts | 2 +- .../AdminUsersSessionResetBulkResponse.ts | 2 +- .../AdminUsersSessionResetResponse.ts | 2 +- .../AdminUsersSessionSetSettingsResponse.ts | 2 +- .../response/AdminUsersSetAdminResponse.ts | 2 +- .../AdminUsersSetExpirationResponse.ts | 2 +- .../response/AdminUsersSetOwnerResponse.ts | 2 +- .../response/AdminUsersSetRegularResponse.ts | 2 +- ...nUsersUnsupportedVersionsExportResponse.ts | 2 +- .../AdminWorkflowsCollaboratorsAddResponse.ts | 2 +- ...minWorkflowsCollaboratorsRemoveResponse.ts | 2 +- ...AdminWorkflowsPermissionsLookupResponse.ts | 2 +- .../response/AdminWorkflowsSearchResponse.ts | 2 +- .../AdminWorkflowsUnpublishResponse.ts | 2 +- .../{ => types}/response/ApiTestResponse.ts | 2 +- .../response/AppsConnectionsOpenResponse.ts | 2 +- .../AppsEventAuthorizationsListResponse.ts | 2 +- .../response/AppsManifestCreateResponse.ts | 2 +- .../response/AppsManifestDeleteResponse.ts | 2 +- .../response/AppsManifestExportResponse.ts | 2 +- .../response/AppsManifestUpdateResponse.ts | 2 +- .../response/AppsManifestValidateResponse.ts | 2 +- .../response/AppsPermissionsInfoResponse.ts | 2 +- .../AppsPermissionsRequestResponse.ts | 2 +- .../AppsPermissionsResourcesListResponse.ts | 2 +- .../AppsPermissionsScopesListResponse.ts | 2 +- .../AppsPermissionsUsersListResponse.ts | 2 +- .../AppsPermissionsUsersRequestResponse.ts | 2 +- .../response/AppsUninstallResponse.ts | 2 +- .../response/AuthRevokeResponse.ts | 2 +- .../response/AuthTeamsListResponse.ts | 2 +- .../{ => types}/response/AuthTestResponse.ts | 2 +- .../response/BookmarksAddResponse.ts | 2 +- .../response/BookmarksEditResponse.ts | 2 +- .../response/BookmarksListResponse.ts | 2 +- .../response/BookmarksRemoveResponse.ts | 2 +- .../{ => types}/response/BotsInfoResponse.ts | 2 +- .../{ => types}/response/CallsAddResponse.ts | 2 +- .../{ => types}/response/CallsEndResponse.ts | 2 +- .../{ => types}/response/CallsInfoResponse.ts | 2 +- .../response/CallsParticipantsAddResponse.ts | 2 +- .../CallsParticipantsRemoveResponse.ts | 2 +- .../response/CallsUpdateResponse.ts | 2 +- .../response/ChannelsArchiveResponse.ts | 2 +- .../response/ChannelsCreateResponse.ts | 2 +- .../response/ChannelsHistoryResponse.ts | 2 +- .../response/ChannelsInfoResponse.ts | 2 +- .../response/ChannelsInviteResponse.ts | 2 +- .../response/ChannelsJoinResponse.ts | 2 +- .../response/ChannelsKickResponse.ts | 2 +- .../response/ChannelsLeaveResponse.ts | 2 +- .../response/ChannelsListResponse.ts | 2 +- .../response/ChannelsMarkResponse.ts | 2 +- .../response/ChannelsRenameResponse.ts | 2 +- .../response/ChannelsRepliesResponse.ts | 2 +- .../response/ChannelsSetPurposeResponse.ts | 2 +- .../response/ChannelsSetTopicResponse.ts | 2 +- .../response/ChannelsUnarchiveResponse.ts | 2 +- .../response/ChatDeleteResponse.ts | 2 +- .../ChatDeleteScheduledMessageResponse.ts | 2 +- .../response/ChatGetPermalinkResponse.ts | 2 +- .../response/ChatMeMessageResponse.ts | 2 +- .../response/ChatPostEphemeralResponse.ts | 2 +- .../response/ChatPostMessageResponse.ts | 2 +- .../response/ChatScheduleMessageResponse.ts | 2 +- .../ChatScheduledMessagesListResponse.ts | 2 +- .../response/ChatUnfurlResponse.ts | 2 +- .../response/ChatUpdateResponse.ts | 2 +- ...ConversationsAcceptSharedInviteResponse.ts | 2 +- ...onversationsApproveSharedInviteResponse.ts | 2 +- .../response/ConversationsArchiveResponse.ts | 2 +- .../response/ConversationsCloseResponse.ts | 2 +- .../response/ConversationsCreateResponse.ts | 2 +- ...onversationsDeclineSharedInviteResponse.ts | 2 +- .../response/ConversationsHistoryResponse.ts | 2 +- .../response/ConversationsInfoResponse.ts | 2 +- .../response/ConversationsInviteResponse.ts | 2 +- .../ConversationsInviteSharedResponse.ts | 2 +- .../response/ConversationsJoinResponse.ts | 2 +- .../response/ConversationsKickResponse.ts | 2 +- .../response/ConversationsLeaveResponse.ts | 2 +- ...ConversationsListConnectInvitesResponse.ts | 2 +- .../response/ConversationsListResponse.ts | 2 +- .../response/ConversationsMarkResponse.ts | 2 +- .../response/ConversationsMembersResponse.ts | 2 +- .../response/ConversationsOpenResponse.ts | 2 +- .../response/ConversationsRenameResponse.ts | 2 +- .../response/ConversationsRepliesResponse.ts | 2 +- .../ConversationsSetPurposeResponse.ts | 2 +- .../response/ConversationsSetTopicResponse.ts | 2 +- .../ConversationsUnarchiveResponse.ts | 2 +- .../response/DialogOpenResponse.ts | 2 +- .../{ => types}/response/DndEndDndResponse.ts | 2 +- .../response/DndEndSnoozeResponse.ts | 2 +- .../{ => types}/response/DndInfoResponse.ts | 2 +- .../response/DndSetSnoozeResponse.ts | 2 +- .../response/DndTeamInfoResponse.ts | 2 +- .../{ => types}/response/EmojiListResponse.ts | 2 +- .../response/FilesCommentsAddResponse.ts | 2 +- .../response/FilesCommentsDeleteResponse.ts | 2 +- .../response/FilesCommentsEditResponse.ts | 2 +- .../FilesCompleteUploadExternalResponse.ts | 2 +- .../response/FilesDeleteResponse.ts | 2 +- .../FilesGetUploadURLExternalResponse.ts | 2 +- .../{ => types}/response/FilesInfoResponse.ts | 2 +- .../{ => types}/response/FilesListResponse.ts | 2 +- .../response/FilesRemoteAddResponse.ts | 2 +- .../response/FilesRemoteInfoResponse.ts | 2 +- .../response/FilesRemoteListResponse.ts | 2 +- .../response/FilesRemoteRemoveResponse.ts | 2 +- .../response/FilesRemoteShareResponse.ts | 2 +- .../response/FilesRemoteUpdateResponse.ts | 2 +- .../response/FilesRevokePublicURLResponse.ts | 2 +- .../response/FilesSharedPublicURLResponse.ts | 2 +- .../response/FilesUploadResponse.ts | 2 +- .../FunctionsCompleteErrorResponse.ts | 2 +- .../FunctionsCompleteSuccessResponse.ts | 2 +- .../response/GroupsArchiveResponse.ts | 2 +- .../response/GroupsCloseResponse.ts | 2 +- .../response/GroupsCreateChildResponse.ts | 2 +- .../response/GroupsCreateResponse.ts | 2 +- .../response/GroupsHistoryResponse.ts | 2 +- .../response/GroupsInfoResponse.ts | 2 +- .../response/GroupsInviteResponse.ts | 2 +- .../response/GroupsKickResponse.ts | 2 +- .../response/GroupsLeaveResponse.ts | 2 +- .../response/GroupsListResponse.ts | 2 +- .../response/GroupsMarkResponse.ts | 2 +- .../response/GroupsOpenResponse.ts | 2 +- .../response/GroupsRenameResponse.ts | 2 +- .../response/GroupsRepliesResponse.ts | 2 +- .../response/GroupsSetPurposeResponse.ts | 2 +- .../response/GroupsSetTopicResponse.ts | 2 +- .../response/GroupsUnarchiveResponse.ts | 2 +- .../{ => types}/response/ImCloseResponse.ts | 2 +- .../{ => types}/response/ImHistoryResponse.ts | 2 +- .../{ => types}/response/ImListResponse.ts | 2 +- .../{ => types}/response/ImMarkResponse.ts | 2 +- .../{ => types}/response/ImOpenResponse.ts | 2 +- .../{ => types}/response/ImRepliesResponse.ts | 2 +- .../response/MigrationExchangeResponse.ts | 2 +- .../{ => types}/response/MpimCloseResponse.ts | 2 +- .../response/MpimHistoryResponse.ts | 2 +- .../{ => types}/response/MpimListResponse.ts | 2 +- .../{ => types}/response/MpimMarkResponse.ts | 2 +- .../{ => types}/response/MpimOpenResponse.ts | 2 +- .../response/MpimRepliesResponse.ts | 2 +- .../response/OauthAccessResponse.ts | 2 +- .../response/OauthTokenResponse.ts | 2 +- .../response/OauthV2AccessResponse.ts | 2 +- .../response/OauthV2ExchangeResponse.ts | 2 +- .../response/OpenIDConnectTokenResponse.ts | 2 +- .../response/OpenIDConnectUserInfoResponse.ts | 2 +- .../{ => types}/response/PinsAddResponse.ts | 2 +- .../{ => types}/response/PinsListResponse.ts | 2 +- .../response/PinsRemoveResponse.ts | 2 +- .../response/ReactionsAddResponse.ts | 2 +- .../response/ReactionsGetResponse.ts | 2 +- .../response/ReactionsListResponse.ts | 2 +- .../response/ReactionsRemoveResponse.ts | 2 +- .../response/RemindersAddResponse.ts | 2 +- .../response/RemindersCompleteResponse.ts | 2 +- .../response/RemindersDeleteResponse.ts | 2 +- .../response/RemindersInfoResponse.ts | 2 +- .../response/RemindersListResponse.ts | 2 +- .../response/RtmConnectResponse.ts | 2 +- .../{ => types}/response/RtmStartResponse.ts | 2 +- .../{ => types}/response/SearchAllResponse.ts | 2 +- .../response/SearchFilesResponse.ts | 2 +- .../response/SearchMessagesResponse.ts | 2 +- .../{ => types}/response/StarsAddResponse.ts | 2 +- .../{ => types}/response/StarsListResponse.ts | 2 +- .../response/StarsRemoveResponse.ts | 2 +- .../response/TeamAccessLogsResponse.ts | 2 +- .../response/TeamBillableInfoResponse.ts | 2 +- .../response/TeamBillingInfoResponse.ts | 2 +- .../{ => types}/response/TeamInfoResponse.ts | 2 +- .../response/TeamIntegrationLogsResponse.ts | 2 +- .../response/TeamPreferencesListResponse.ts | 2 +- .../response/TeamProfileGetResponse.ts | 2 +- .../response/ToolingTokensRotateResponse.ts | 2 +- .../response/UsergroupsCreateResponse.ts | 2 +- .../response/UsergroupsDisableResponse.ts | 2 +- .../response/UsergroupsEnableResponse.ts | 2 +- .../response/UsergroupsListResponse.ts | 2 +- .../response/UsergroupsUpdateResponse.ts | 2 +- .../response/UsergroupsUsersListResponse.ts | 2 +- .../response/UsergroupsUsersUpdateResponse.ts | 2 +- .../response/UsersConversationsResponse.ts | 2 +- .../response/UsersDeletePhotoResponse.ts | 2 +- .../response/UsersGetPresenceResponse.ts | 2 +- .../response/UsersIdentityResponse.ts | 2 +- .../{ => types}/response/UsersInfoResponse.ts | 2 +- .../{ => types}/response/UsersListResponse.ts | 2 +- .../response/UsersLookupByEmailResponse.ts | 2 +- .../response/UsersProfileGetResponse.ts | 2 +- .../response/UsersProfileSetResponse.ts | 2 +- .../response/UsersSetActiveResponse.ts | 2 +- .../response/UsersSetPhotoResponse.ts | 2 +- .../response/UsersSetPresenceResponse.ts | 2 +- .../{ => types}/response/ViewsOpenResponse.ts | 2 +- .../response/ViewsPublishResponse.ts | 2 +- .../{ => types}/response/ViewsPushResponse.ts | 2 +- .../response/ViewsUpdateResponse.ts | 2 +- .../WorkflowsStepCompletedResponse.ts | 2 +- .../response/WorkflowsStepFailedResponse.ts | 2 +- .../response/WorkflowsUpdateStepResponse.ts | 2 +- .../web-api/src/{ => types}/response/index.ts | 0 .../types/methods/admin.analytics.test-d.ts | 45 + .../test/types/methods/admin.apps.test-d.ts | 244 ++ .../test/types/methods/admin.auth.test-d.ts | 77 + .../types/methods/admin.barriers.test-d.ts | 130 + .../methods/admin.conversations.test-d.ts | 343 ++ .../test/types/methods/admin.emoji.test-d.ts | 67 + .../types/methods/admin.functions.test-d.ts | 41 + .../methods/admin.inviteRequests.test-d.ts | 63 + .../test/types/methods/admin.roles.test-d.ts | 94 + .../test/types/methods/admin.teams.test-d.ts | 137 + .../types/methods/admin.usergroups.test-d.ts | 73 + .../test/types/methods/admin.users.test-d.ts | 264 ++ .../types/methods/admin.workflows.test-d.ts | 84 + .../web-api/test/types/methods/api.test-d.ts | 10 + .../web-api/test/types/methods/apps.test-d.ts | 103 + .../web-api/test/types/methods/auth.test-d.ts | 22 + .../test/types/methods/bookmarks.test-d.ts | 123 + .../web-api/test/types/methods/bots.test-d.ts | 10 + .../test/types/methods/calls.test-d.ts | 79 + .../web-api/test/types/methods/chat.test-d.ts | 500 +++ .../types/methods/conversations.test-d.ts | 290 ++ .../test/types/methods/dialog.test-d.ts | 26 + .../web-api/test/types/methods/dnd.test-d.ts | 40 + .../test/types/methods/emoji.test-d.ts | 10 + .../test/types/methods/files.test-d.ts | 223 ++ .../test/types/methods/functions.test-d.ts | 36 + .../test/types/methods/migration.test-d.ts | 13 + .../test/types/methods/oauth.test-d.ts | 52 + .../test/types/methods/openid.test-d.ts | 28 + .../web-api/test/types/methods/pins.test-d.ts | 46 + .../test/types/methods/reactions.test-d.ts | 96 + .../test/types/methods/reminders.test-d.ts | 79 + .../web-api/test/types/methods/rtm.test-d.ts | 16 + .../test/types/methods/search.test-d.ts | 31 + .../web-api/test/types/methods/team.test-d.ts | 40 + .../test/types/methods/tooling.test-d.ts | 13 + .../test/types/methods/usergroups.test-d.ts | 67 + .../test/types/methods/users.test-d.ts | 82 + .../test/types/methods/views.test-d.ts | 122 + .../webclient-named-method-types.test-d.ts | 91 - .../test/types/webclient-no-token.test-d.ts | 4 +- scripts/code_generator.rb | 6 +- 394 files changed, 8156 insertions(+), 2319 deletions(-) create mode 100644 packages/web-api/src/types/request/admin/analytics.ts create mode 100644 packages/web-api/src/types/request/admin/apps.ts create mode 100644 packages/web-api/src/types/request/admin/auth.ts create mode 100644 packages/web-api/src/types/request/admin/barriers.ts create mode 100644 packages/web-api/src/types/request/admin/conversations.ts create mode 100644 packages/web-api/src/types/request/admin/emoji.ts create mode 100644 packages/web-api/src/types/request/admin/functions.ts create mode 100644 packages/web-api/src/types/request/admin/inviteRequests.ts create mode 100644 packages/web-api/src/types/request/admin/roles.ts create mode 100644 packages/web-api/src/types/request/admin/teams.ts create mode 100644 packages/web-api/src/types/request/admin/usergroups.ts create mode 100644 packages/web-api/src/types/request/admin/users.ts create mode 100644 packages/web-api/src/types/request/admin/workflows.ts create mode 100644 packages/web-api/src/types/request/api.ts create mode 100644 packages/web-api/src/types/request/apps.ts create mode 100644 packages/web-api/src/types/request/auth.ts create mode 100644 packages/web-api/src/types/request/bookmarks.ts create mode 100644 packages/web-api/src/types/request/bots.ts create mode 100644 packages/web-api/src/types/request/calls.ts create mode 100644 packages/web-api/src/types/request/chat.ts create mode 100644 packages/web-api/src/types/request/common.ts create mode 100644 packages/web-api/src/types/request/conversations.ts create mode 100644 packages/web-api/src/types/request/dialog.ts create mode 100644 packages/web-api/src/types/request/dnd.ts create mode 100644 packages/web-api/src/types/request/emoji.ts create mode 100644 packages/web-api/src/types/request/files.ts create mode 100644 packages/web-api/src/types/request/functions.ts create mode 100644 packages/web-api/src/types/request/manifest.ts create mode 100644 packages/web-api/src/types/request/migration.ts create mode 100644 packages/web-api/src/types/request/oauth.ts create mode 100644 packages/web-api/src/types/request/openid.ts create mode 100644 packages/web-api/src/types/request/pins.ts create mode 100644 packages/web-api/src/types/request/reactions.ts create mode 100644 packages/web-api/src/types/request/reminders.ts create mode 100644 packages/web-api/src/types/request/rtm.ts create mode 100644 packages/web-api/src/types/request/search.ts create mode 100644 packages/web-api/src/types/request/stars.ts create mode 100644 packages/web-api/src/types/request/team.ts create mode 100644 packages/web-api/src/types/request/tooling.ts create mode 100644 packages/web-api/src/types/request/usergroups.ts create mode 100644 packages/web-api/src/types/request/users.ts create mode 100644 packages/web-api/src/types/request/views.ts create mode 100644 packages/web-api/src/types/request/workflows.ts rename packages/web-api/src/{ => types}/response/AdminAnalyticsGetFileResponse.ts (75%) rename packages/web-api/src/{ => types}/response/AdminAppsActivitiesListResponse.ts (97%) rename packages/web-api/src/{ => types}/response/AdminAppsApproveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminAppsApprovedListResponse.ts (97%) rename packages/web-api/src/{ => types}/response/AdminAppsClearResolutionResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminAppsConfigLookupResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminAppsConfigSetResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminAppsRequestsCancelResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminAppsRequestsListResponse.ts (97%) rename packages/web-api/src/{ => types}/response/AdminAppsRestrictResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminAppsRestrictedListResponse.ts (97%) rename packages/web-api/src/{ => types}/response/AdminAppsUninstallResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminAuthPolicyAssignEntitiesResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminAuthPolicyGetEntitiesResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminAuthPolicyRemoveEntitiesResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminBarriersCreateResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminBarriersDeleteResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminBarriersListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminBarriersUpdateResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminConversationsArchiveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsBulkArchiveResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsBulkDeleteResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsBulkMoveResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsConvertToPrivateResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsConvertToPublicResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsCreateResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsDeleteResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsDisconnectSharedResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsGetConversationPrefsResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsGetCustomRetentionResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsGetTeamsResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsInviteResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsLookupResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsRemoveCustomRetentionResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsRenameResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsRestrictAccessAddGroupResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsRestrictAccessListGroupsResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsSearchResponse.ts (98%) rename packages/web-api/src/{ => types}/response/AdminConversationsSetConversationPrefsResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsSetCustomRetentionResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsSetTeamsResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsUnarchiveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminConversationsWhitelistAddResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminConversationsWhitelistRemoveResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminEmojiAddAliasResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminEmojiAddResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminEmojiListResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminEmojiRemoveResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminEmojiRenameResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminFunctionsListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminFunctionsPermissionsLookupResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminFunctionsPermissionsSetResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminInviteRequestsApproveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminInviteRequestsApprovedListResponse.ts (97%) rename packages/web-api/src/{ => types}/response/AdminInviteRequestsDeniedListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminInviteRequestsDenyResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminInviteRequestsListResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminRolesAddAssignmentsResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminRolesListAssignmentsResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminRolesRemoveAssignmentsResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminTeamsAdminsListResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminTeamsCreateResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminTeamsListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminTeamsOwnersListResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminTeamsSettingsInfoResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminTeamsSettingsSetDescriptionResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminTeamsSettingsSetIconResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminTeamsSettingsSetNameResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsergroupsAddChannelsResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsergroupsAddTeamsResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsergroupsListChannelsResponse.ts (97%) rename packages/web-api/src/{ => types}/response/AdminUsergroupsRemoveChannelsResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersAssignResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersInviteResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminUsersListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminUsersRemoveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersSessionClearSettingsResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersSessionGetSettingsResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminUsersSessionInvalidateResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminUsersSessionListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AdminUsersSessionResetBulkResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersSessionResetResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersSessionSetSettingsResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersSetAdminResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersSetExpirationResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersSetOwnerResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersSetRegularResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminUsersUnsupportedVersionsExportResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AdminWorkflowsCollaboratorsAddResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminWorkflowsCollaboratorsRemoveResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminWorkflowsPermissionsLookupResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AdminWorkflowsSearchResponse.ts (97%) rename packages/web-api/src/{ => types}/response/AdminWorkflowsUnpublishResponse.ts (95%) rename packages/web-api/src/{ => types}/response/ApiTestResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AppsConnectionsOpenResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AppsEventAuthorizationsListResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AppsManifestCreateResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AppsManifestDeleteResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AppsManifestExportResponse.ts (98%) rename packages/web-api/src/{ => types}/response/AppsManifestUpdateResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AppsManifestValidateResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AppsPermissionsInfoResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AppsPermissionsRequestResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AppsPermissionsResourcesListResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AppsPermissionsScopesListResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AppsPermissionsUsersListResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AppsPermissionsUsersRequestResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AppsUninstallResponse.ts (95%) rename packages/web-api/src/{ => types}/response/AuthRevokeResponse.ts (94%) rename packages/web-api/src/{ => types}/response/AuthTeamsListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/AuthTestResponse.ts (96%) rename packages/web-api/src/{ => types}/response/BookmarksAddResponse.ts (96%) rename packages/web-api/src/{ => types}/response/BookmarksEditResponse.ts (96%) rename packages/web-api/src/{ => types}/response/BookmarksListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/BookmarksRemoveResponse.ts (95%) rename packages/web-api/src/{ => types}/response/BotsInfoResponse.ts (95%) rename packages/web-api/src/{ => types}/response/CallsAddResponse.ts (96%) rename packages/web-api/src/{ => types}/response/CallsEndResponse.ts (96%) rename packages/web-api/src/{ => types}/response/CallsInfoResponse.ts (96%) rename packages/web-api/src/{ => types}/response/CallsParticipantsAddResponse.ts (96%) rename packages/web-api/src/{ => types}/response/CallsParticipantsRemoveResponse.ts (96%) rename packages/web-api/src/{ => types}/response/CallsUpdateResponse.ts (96%) rename packages/web-api/src/{ => types}/response/ChannelsArchiveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChannelsCreateResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ChannelsHistoryResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ChannelsInfoResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ChannelsInviteResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ChannelsJoinResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ChannelsKickResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChannelsLeaveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChannelsListResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ChannelsMarkResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChannelsRenameResponse.ts (96%) rename packages/web-api/src/{ => types}/response/ChannelsRepliesResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ChannelsSetPurposeResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChannelsSetTopicResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChannelsUnarchiveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChatDeleteResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChatDeleteScheduledMessageResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChatGetPermalinkResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChatMeMessageResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChatPostEphemeralResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChatPostMessageResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ChatScheduleMessageResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ChatScheduledMessagesListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/ChatUnfurlResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ChatUpdateResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ConversationsAcceptSharedInviteResponse.ts (95%) rename packages/web-api/src/{ => types}/response/ConversationsApproveSharedInviteResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ConversationsArchiveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ConversationsCloseResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ConversationsCreateResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ConversationsDeclineSharedInviteResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ConversationsHistoryResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ConversationsInfoResponse.ts (98%) rename packages/web-api/src/{ => types}/response/ConversationsInviteResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ConversationsInviteSharedResponse.ts (95%) rename packages/web-api/src/{ => types}/response/ConversationsJoinResponse.ts (98%) rename packages/web-api/src/{ => types}/response/ConversationsKickResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ConversationsLeaveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ConversationsListConnectInvitesResponse.ts (98%) rename packages/web-api/src/{ => types}/response/ConversationsListResponse.ts (98%) rename packages/web-api/src/{ => types}/response/ConversationsMarkResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ConversationsMembersResponse.ts (95%) rename packages/web-api/src/{ => types}/response/ConversationsOpenResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ConversationsRenameResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ConversationsRepliesResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ConversationsSetPurposeResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ConversationsSetTopicResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ConversationsUnarchiveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/DialogOpenResponse.ts (95%) rename packages/web-api/src/{ => types}/response/DndEndDndResponse.ts (94%) rename packages/web-api/src/{ => types}/response/DndEndSnoozeResponse.ts (95%) rename packages/web-api/src/{ => types}/response/DndInfoResponse.ts (95%) rename packages/web-api/src/{ => types}/response/DndSetSnoozeResponse.ts (95%) rename packages/web-api/src/{ => types}/response/DndTeamInfoResponse.ts (95%) rename packages/web-api/src/{ => types}/response/EmojiListResponse.ts (95%) rename packages/web-api/src/{ => types}/response/FilesCommentsAddResponse.ts (94%) rename packages/web-api/src/{ => types}/response/FilesCommentsDeleteResponse.ts (94%) rename packages/web-api/src/{ => types}/response/FilesCommentsEditResponse.ts (95%) rename packages/web-api/src/{ => types}/response/FilesCompleteUploadExternalResponse.ts (98%) rename packages/web-api/src/{ => types}/response/FilesDeleteResponse.ts (94%) rename packages/web-api/src/{ => types}/response/FilesGetUploadURLExternalResponse.ts (95%) rename packages/web-api/src/{ => types}/response/FilesInfoResponse.ts (99%) rename packages/web-api/src/{ => types}/response/FilesListResponse.ts (99%) rename packages/web-api/src/{ => types}/response/FilesRemoteAddResponse.ts (99%) rename packages/web-api/src/{ => types}/response/FilesRemoteInfoResponse.ts (99%) rename packages/web-api/src/{ => types}/response/FilesRemoteListResponse.ts (99%) rename packages/web-api/src/{ => types}/response/FilesRemoteRemoveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/FilesRemoteShareResponse.ts (99%) rename packages/web-api/src/{ => types}/response/FilesRemoteUpdateResponse.ts (99%) rename packages/web-api/src/{ => types}/response/FilesRevokePublicURLResponse.ts (99%) rename packages/web-api/src/{ => types}/response/FilesSharedPublicURLResponse.ts (99%) rename packages/web-api/src/{ => types}/response/FilesUploadResponse.ts (99%) rename packages/web-api/src/{ => types}/response/FunctionsCompleteErrorResponse.ts (94%) rename packages/web-api/src/{ => types}/response/FunctionsCompleteSuccessResponse.ts (94%) rename packages/web-api/src/{ => types}/response/GroupsArchiveResponse.ts (95%) rename packages/web-api/src/{ => types}/response/GroupsCloseResponse.ts (94%) rename packages/web-api/src/{ => types}/response/GroupsCreateChildResponse.ts (97%) rename packages/web-api/src/{ => types}/response/GroupsCreateResponse.ts (97%) rename packages/web-api/src/{ => types}/response/GroupsHistoryResponse.ts (96%) rename packages/web-api/src/{ => types}/response/GroupsInfoResponse.ts (97%) rename packages/web-api/src/{ => types}/response/GroupsInviteResponse.ts (97%) rename packages/web-api/src/{ => types}/response/GroupsKickResponse.ts (95%) rename packages/web-api/src/{ => types}/response/GroupsLeaveResponse.ts (95%) rename packages/web-api/src/{ => types}/response/GroupsListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/GroupsMarkResponse.ts (95%) rename packages/web-api/src/{ => types}/response/GroupsOpenResponse.ts (95%) rename packages/web-api/src/{ => types}/response/GroupsRenameResponse.ts (96%) rename packages/web-api/src/{ => types}/response/GroupsRepliesResponse.ts (97%) rename packages/web-api/src/{ => types}/response/GroupsSetPurposeResponse.ts (95%) rename packages/web-api/src/{ => types}/response/GroupsSetTopicResponse.ts (95%) rename packages/web-api/src/{ => types}/response/GroupsUnarchiveResponse.ts (95%) rename packages/web-api/src/{ => types}/response/ImCloseResponse.ts (95%) rename packages/web-api/src/{ => types}/response/ImHistoryResponse.ts (98%) rename packages/web-api/src/{ => types}/response/ImListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/ImMarkResponse.ts (95%) rename packages/web-api/src/{ => types}/response/ImOpenResponse.ts (95%) rename packages/web-api/src/{ => types}/response/ImRepliesResponse.ts (97%) rename packages/web-api/src/{ => types}/response/MigrationExchangeResponse.ts (95%) rename packages/web-api/src/{ => types}/response/MpimCloseResponse.ts (95%) rename packages/web-api/src/{ => types}/response/MpimHistoryResponse.ts (97%) rename packages/web-api/src/{ => types}/response/MpimListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/MpimMarkResponse.ts (95%) rename packages/web-api/src/{ => types}/response/MpimOpenResponse.ts (97%) rename packages/web-api/src/{ => types}/response/MpimRepliesResponse.ts (97%) rename packages/web-api/src/{ => types}/response/OauthAccessResponse.ts (97%) rename packages/web-api/src/{ => types}/response/OauthTokenResponse.ts (94%) rename packages/web-api/src/{ => types}/response/OauthV2AccessResponse.ts (97%) rename packages/web-api/src/{ => types}/response/OauthV2ExchangeResponse.ts (97%) rename packages/web-api/src/{ => types}/response/OpenIDConnectTokenResponse.ts (95%) rename packages/web-api/src/{ => types}/response/OpenIDConnectUserInfoResponse.ts (98%) rename packages/web-api/src/{ => types}/response/PinsAddResponse.ts (94%) rename packages/web-api/src/{ => types}/response/PinsListResponse.ts (99%) rename packages/web-api/src/{ => types}/response/PinsRemoveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ReactionsAddResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ReactionsGetResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ReactionsListResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ReactionsRemoveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/RemindersAddResponse.ts (96%) rename packages/web-api/src/{ => types}/response/RemindersCompleteResponse.ts (94%) rename packages/web-api/src/{ => types}/response/RemindersDeleteResponse.ts (94%) rename packages/web-api/src/{ => types}/response/RemindersInfoResponse.ts (95%) rename packages/web-api/src/{ => types}/response/RemindersListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/RtmConnectResponse.ts (95%) rename packages/web-api/src/{ => types}/response/RtmStartResponse.ts (99%) rename packages/web-api/src/{ => types}/response/SearchAllResponse.ts (99%) rename packages/web-api/src/{ => types}/response/SearchFilesResponse.ts (99%) rename packages/web-api/src/{ => types}/response/SearchMessagesResponse.ts (99%) rename packages/web-api/src/{ => types}/response/StarsAddResponse.ts (94%) rename packages/web-api/src/{ => types}/response/StarsListResponse.ts (99%) rename packages/web-api/src/{ => types}/response/StarsRemoveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/TeamAccessLogsResponse.ts (96%) rename packages/web-api/src/{ => types}/response/TeamBillableInfoResponse.ts (95%) rename packages/web-api/src/{ => types}/response/TeamBillingInfoResponse.ts (94%) rename packages/web-api/src/{ => types}/response/TeamInfoResponse.ts (96%) rename packages/web-api/src/{ => types}/response/TeamIntegrationLogsResponse.ts (96%) rename packages/web-api/src/{ => types}/response/TeamPreferencesListResponse.ts (95%) rename packages/web-api/src/{ => types}/response/TeamProfileGetResponse.ts (97%) rename packages/web-api/src/{ => types}/response/ToolingTokensRotateResponse.ts (95%) rename packages/web-api/src/{ => types}/response/UsergroupsCreateResponse.ts (96%) rename packages/web-api/src/{ => types}/response/UsergroupsDisableResponse.ts (96%) rename packages/web-api/src/{ => types}/response/UsergroupsEnableResponse.ts (96%) rename packages/web-api/src/{ => types}/response/UsergroupsListResponse.ts (96%) rename packages/web-api/src/{ => types}/response/UsergroupsUpdateResponse.ts (96%) rename packages/web-api/src/{ => types}/response/UsergroupsUsersListResponse.ts (94%) rename packages/web-api/src/{ => types}/response/UsergroupsUsersUpdateResponse.ts (96%) rename packages/web-api/src/{ => types}/response/UsersConversationsResponse.ts (98%) rename packages/web-api/src/{ => types}/response/UsersDeletePhotoResponse.ts (94%) rename packages/web-api/src/{ => types}/response/UsersGetPresenceResponse.ts (95%) rename packages/web-api/src/{ => types}/response/UsersIdentityResponse.ts (95%) rename packages/web-api/src/{ => types}/response/UsersInfoResponse.ts (98%) rename packages/web-api/src/{ => types}/response/UsersListResponse.ts (98%) rename packages/web-api/src/{ => types}/response/UsersLookupByEmailResponse.ts (98%) rename packages/web-api/src/{ => types}/response/UsersProfileGetResponse.ts (97%) rename packages/web-api/src/{ => types}/response/UsersProfileSetResponse.ts (97%) rename packages/web-api/src/{ => types}/response/UsersSetActiveResponse.ts (94%) rename packages/web-api/src/{ => types}/response/UsersSetPhotoResponse.ts (95%) rename packages/web-api/src/{ => types}/response/UsersSetPresenceResponse.ts (94%) rename packages/web-api/src/{ => types}/response/ViewsOpenResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ViewsPublishResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ViewsPushResponse.ts (99%) rename packages/web-api/src/{ => types}/response/ViewsUpdateResponse.ts (99%) rename packages/web-api/src/{ => types}/response/WorkflowsStepCompletedResponse.ts (94%) rename packages/web-api/src/{ => types}/response/WorkflowsStepFailedResponse.ts (94%) rename packages/web-api/src/{ => types}/response/WorkflowsUpdateStepResponse.ts (94%) rename packages/web-api/src/{ => types}/response/index.ts (100%) create mode 100644 packages/web-api/test/types/methods/admin.analytics.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.apps.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.auth.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.barriers.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.conversations.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.emoji.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.functions.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.inviteRequests.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.roles.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.teams.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.usergroups.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.users.test-d.ts create mode 100644 packages/web-api/test/types/methods/admin.workflows.test-d.ts create mode 100644 packages/web-api/test/types/methods/api.test-d.ts create mode 100644 packages/web-api/test/types/methods/apps.test-d.ts create mode 100644 packages/web-api/test/types/methods/auth.test-d.ts create mode 100644 packages/web-api/test/types/methods/bookmarks.test-d.ts create mode 100644 packages/web-api/test/types/methods/bots.test-d.ts create mode 100644 packages/web-api/test/types/methods/calls.test-d.ts create mode 100644 packages/web-api/test/types/methods/chat.test-d.ts create mode 100644 packages/web-api/test/types/methods/conversations.test-d.ts create mode 100644 packages/web-api/test/types/methods/dialog.test-d.ts create mode 100644 packages/web-api/test/types/methods/dnd.test-d.ts create mode 100644 packages/web-api/test/types/methods/emoji.test-d.ts create mode 100644 packages/web-api/test/types/methods/files.test-d.ts create mode 100644 packages/web-api/test/types/methods/functions.test-d.ts create mode 100644 packages/web-api/test/types/methods/migration.test-d.ts create mode 100644 packages/web-api/test/types/methods/oauth.test-d.ts create mode 100644 packages/web-api/test/types/methods/openid.test-d.ts create mode 100644 packages/web-api/test/types/methods/pins.test-d.ts create mode 100644 packages/web-api/test/types/methods/reactions.test-d.ts create mode 100644 packages/web-api/test/types/methods/reminders.test-d.ts create mode 100644 packages/web-api/test/types/methods/rtm.test-d.ts create mode 100644 packages/web-api/test/types/methods/search.test-d.ts create mode 100644 packages/web-api/test/types/methods/team.test-d.ts create mode 100644 packages/web-api/test/types/methods/tooling.test-d.ts create mode 100644 packages/web-api/test/types/methods/usergroups.test-d.ts create mode 100644 packages/web-api/test/types/methods/users.test-d.ts create mode 100644 packages/web-api/test/types/methods/views.test-d.ts delete mode 100644 packages/web-api/test/types/webclient-named-method-types.test-d.ts diff --git a/lint-configs/.eslintignore b/lint-configs/.eslintignore index b512c09d4..3c3629e64 100644 --- a/lint-configs/.eslintignore +++ b/lint-configs/.eslintignore @@ -1 +1 @@ -node_modules \ No newline at end of file +node_modules diff --git a/lint-configs/.eslintrc.js b/lint-configs/.eslintrc.js index a1ebd902c..ea7ac3ea4 100644 --- a/lint-configs/.eslintrc.js +++ b/lint-configs/.eslintrc.js @@ -204,6 +204,10 @@ module.exports = { format: ['camelCase'], leadingUnderscore: 'allow', }, + { + selector: 'import', + format: null, // do not force conventions on imports + }, { selector: 'variable', // PascalCase for variables is added to allow exporting a singleton, function library, or bare object as in @@ -246,8 +250,7 @@ module.exports = { allow: [ '**/middleware/*', // the src/middleware directory doesn't export a module, it's just a namespace. '**/receivers/*', // the src/receivers directory doesn't export a module, it's just a namespace. - '**/types/**/*', - '**/types/*', // type heirarchies should be used however one wants + '**/types/**/*', // type heirarchies should be used however one wants ], }], @@ -296,6 +299,19 @@ module.exports = { 'symbol-description': 'off', }, }, + { + files: ['test/types/**/*.test-d.ts'], + extends: ['plugin:@typescript-eslint/disable-type-checked'], + rules: { + 'import/no-internal-modules': ['error', { + // Use the following option to set a list of allowable globs in this project. + allow: [ + '**/src/**/*', // allow type tests to reach into src/ + '**/types/**/*', // type heirarchies should be used however one wants + ], + }], + } + }, ], }; diff --git a/packages/oauth/package.json b/packages/oauth/package.json index 8066c2513..4f3d59258 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -34,7 +34,6 @@ "lint": "eslint --fix --ext .ts src", "test": "npm run lint && npm run test:mocha", "test:mocha": "nyc mocha --config .mocharc.json src/*.spec.js src/**/*.spec.js src/*.spec.ts src/**/*.spec.ts", - "coverage": "codecov -F oauthhelper --root=$PWD", "ref-docs:model": "api-extractor run", "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build" }, @@ -47,29 +46,28 @@ "lodash.isstring": "^4.0.1" }, "devDependencies": { - "@microsoft/api-extractor": "^7.19.4", - "@types/chai": "^4.2.11", - "@types/mocha": "^9.1.0", - "@types/sinon": "^10.0.11", - "@typescript-eslint/eslint-plugin": "^4.4.1", - "@typescript-eslint/parser": "^4.4.0", - "chai": "^4.2.0", - "codecov": "^3.0.4", - "eslint": "^7.32.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-config-airbnb-typescript": "^12.3.1", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jsdoc": "^30.6.1", + "@microsoft/api-extractor": "^7.38.0", + "@types/chai": "^4.3.5", + "@types/mocha": "^10.0.1", + "@types/sinon": "^10.0.20", + "@typescript-eslint/eslint-plugin": "^6.4.1", + "@typescript-eslint/parser": "^6.4.0", + "chai": "^4.3.8", + "eslint": "^8.47.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsdoc": "^46.5.0", "eslint-plugin-node": "^11.1.0", - "mocha": "^9.2.1", + "mocha": "^10.2.0", "nop": "^1.0.0", "nyc": "^15.1.0", "rewiremock": "^3.13.9", "shx": "^0.3.2", - "sinon": "^9.0.2", - "source-map-support": "^0.5.12", + "sinon": "^15.2.0", + "source-map-support": "^0.5.21", "superagent": "^3.3.1", - "ts-node": "^8.2.0", + "ts-node": "^10.8.1", "typescript": "^4.1", "uncaughtException": "^1.0.0" } diff --git a/packages/oauth/src/callback-options.ts b/packages/oauth/src/callback-options.ts index a061edc9b..a37968bf0 100644 --- a/packages/oauth/src/callback-options.ts +++ b/packages/oauth/src/callback-options.ts @@ -118,6 +118,7 @@ export function defaultCallbackSuccess(

Redirecting to the Slack App... click here. If you use the browser version of Slack, click this link instead.

`; + // eslint-disable-next-line @typescript-eslint/naming-convention res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' }); res.end(htmlResponse); } @@ -139,6 +140,7 @@ export function defaultCallbackFailure( default: httpStatus = 500; } + // eslint-disable-next-line @typescript-eslint/naming-convention res.writeHead(httpStatus, { 'Content-Type': 'text/html; charset=utf-8' }); const html = ` diff --git a/packages/oauth/src/install-provider.ts b/packages/oauth/src/install-provider.ts index 206a7f37c..7975508f3 100644 --- a/packages/oauth/src/install-provider.ts +++ b/packages/oauth/src/install-provider.ts @@ -677,9 +677,7 @@ export class InstallProvider { // End: Build the installation object if (options?.afterInstallation !== undefined) { - shouldProceed = await options.afterInstallation( - installation, installOptions, req, res, - ); + shouldProceed = await options.afterInstallation(installation, installOptions, req, res); } if (!shouldProceed) { // When options.beforeInstallation returns false, diff --git a/packages/rtm-api/package.json b/packages/rtm-api/package.json index a9a9a3a5b..07d9f8565 100644 --- a/packages/rtm-api/package.json +++ b/packages/rtm-api/package.json @@ -54,14 +54,14 @@ "ws": "^7.5.3" }, "devDependencies": { - "@microsoft/api-extractor": "^7.3.4", - "@typescript-eslint/eslint-plugin": "^4.4.1", - "@typescript-eslint/parser": "^4.4.0", - "eslint": "^7.32.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-config-airbnb-typescript": "^12.3.1", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jsdoc": "^30.6.1", + "@microsoft/api-extractor": "^7.38.0", + "@typescript-eslint/eslint-plugin": "^6.4.1", + "@typescript-eslint/parser": "^6.4.0", + "eslint": "^8.47.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsdoc": "^46.5.0", "eslint-plugin-node": "^11.1.0", "shx": "^0.3.2", "typescript": "^4.1.0" diff --git a/packages/rtm-api/src/KeepAlive.ts b/packages/rtm-api/src/KeepAlive.ts index 079ce46fa..6c043e0e6 100644 --- a/packages/rtm-api/src/KeepAlive.ts +++ b/packages/rtm-api/src/KeepAlive.ts @@ -219,6 +219,7 @@ export class KeepAlive extends EventEmitter { .catch((error) => { this.logger.error(`Unhandled error: ${error.message}. Please report to @slack/rtm-api package maintainers.`); }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { this.logger.error(`Unhandled error: ${error.message}. Please report to @slack/rtm-api package maintainers.`); } diff --git a/packages/rtm-api/src/RTMClient.ts b/packages/rtm-api/src/RTMClient.ts index f4fb19ae3..ac3417cab 100644 --- a/packages/rtm-api/src/RTMClient.ts +++ b/packages/rtm-api/src/RTMClient.ts @@ -484,7 +484,6 @@ export class RTMClient extends EventEmitter { * * If the awaitReply parameter is set to false, then the returned Promise is resolved as soon as the message is sent * from the websocket. - * * @param awaitReply - whether to wait for an acknowledgement response from the platform before resolving the returned * Promise. * @param type - the message type @@ -629,6 +628,7 @@ export class RTMClient extends EventEmitter { let event; try { event = JSON.parse(data); + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (parseError: any) { // prevent application from crashing on a bad message, but log an error to bring attention this.logger.error( diff --git a/packages/socket-mode/package.json b/packages/socket-mode/package.json index c44ef2c1a..277cbdb85 100644 --- a/packages/socket-mode/package.json +++ b/packages/socket-mode/package.json @@ -56,23 +56,23 @@ "ws": "^7.5.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^4.4.1", - "@typescript-eslint/parser": "^4.4.0", - "@types/chai": "^4.1.7", - "@types/mocha": "^5.2.6", - "chai": "^4.2.0", - "eslint": "^7.32.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-config-airbnb-typescript": "^12.3.1", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jsdoc": "^30.6.1", + "@typescript-eslint/eslint-plugin": "^6.4.1", + "@typescript-eslint/parser": "^6.4.0", + "@types/chai": "^4.3.5", + "@types/mocha": "^10.0.1", + "chai": "^4.3.8", + "eslint": "^8.47.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsdoc": "^46.5.0", "eslint-plugin-node": "^11.1.0", - "mocha": "^9.1.0", - "nyc": "^14.1.1", + "mocha": "^10.2.0", + "nyc": "^15.1.0", "shx": "^0.3.2", - "ts-node": "^8.2.0", - "sinon": "^7.3.2", - "source-map-support": "^0.5.12", + "sinon": "^15.2.0", + "source-map-support": "^0.5.21", + "ts-node": "^10.8.1", "typescript": "^4.1.0" } } diff --git a/packages/socket-mode/src/SocketModeClient.ts b/packages/socket-mode/src/SocketModeClient.ts index ede1d6d24..b3af15a11 100644 --- a/packages/socket-mode/src/SocketModeClient.ts +++ b/packages/socket-mode/src/SocketModeClient.ts @@ -189,8 +189,8 @@ export class SocketModeClient extends EventEmitter { private numOfConsecutiveReconnectionFailures: number = 0; /* eslint-disable @typescript-eslint/indent, newline-per-chained-call */ - private connectingStateMachineConfig: Configuration - = Finity.configure() + private connectingStateMachineConfig: Configuration = Finity + .configure() .global() .onStateEnter((state) => { this.logger.debug(`Transitioning to state: ${State.Connecting}:${state}`); diff --git a/packages/types/package.json b/packages/types/package.json index 0c5a332a8..d42cf2d90 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -36,14 +36,14 @@ "ref-docs:model": "api-extractor run" }, "devDependencies": { - "@microsoft/api-extractor": "^7.3.4", - "@typescript-eslint/eslint-plugin": "^4.4.1", - "@typescript-eslint/parser": "^4.4.0", - "eslint": "^7.32.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-config-airbnb-typescript": "^12.3.1", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jsdoc": "^30.6.1", + "@microsoft/api-extractor": "^7.38.0", + "@typescript-eslint/eslint-plugin": "^6.4.1", + "@typescript-eslint/parser": "^6.4.0", + "eslint": "^8.47.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsdoc": "^46.5.0", "eslint-plugin-node": "^11.1.0", "shx": "^0.3.2", "typescript": "^4.1.0" diff --git a/packages/web-api/package.json b/packages/web-api/package.json index b2cb7b50b..cfd7fee16 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -1,6 +1,6 @@ { "name": "@slack/web-api", - "version": "6.9.0", + "version": "7.0.0-rc.0", "description": "Official library for using the Slack Platform's Web API", "author": "Slack Technologies, LLC", "license": "MIT", @@ -62,6 +62,7 @@ "@microsoft/api-extractor": "^7.38.0", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", + "@types/sinon": "^10.0.20", "@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/parser": "^6.4.0", "busboy": "^1.6.0", diff --git a/packages/web-api/src/WebClient.spec.js b/packages/web-api/src/WebClient.spec.js index 9eb148237..22719fe14 100644 --- a/packages/web-api/src/WebClient.spec.js +++ b/packages/web-api/src/WebClient.spec.js @@ -797,26 +797,6 @@ describe('WebClient', function () { this.method = 'conversations.list'; }); - describe('logging', function () { - beforeEach(function () { - this.capture = new CaptureConsole(); - this.capture.startCapture(); - }); - it('should log a warning when called with a method not known to be cursor pagination enabled', function () { - this.client.paginate('method'); - const output = this.capture.getCapturedText(); - assert.isNotEmpty(output); - }); - it('should not log a warning when called with a known cursor pagination enabled', function () { - this.client.paginate(this.method); - const output = this.capture.getCapturedText(); - assert.isEmpty(output); - }); - afterEach(function () { - this.capture.stopCapture(); - }); - }); - describe('when not given shouldStop predicate', function () { it('should return an AsyncIterator', function () { const iterator = this.client.paginate(this.method); diff --git a/packages/web-api/src/WebClient.ts b/packages/web-api/src/WebClient.ts index 9e1597a35..e69c68ff8 100644 --- a/packages/web-api/src/WebClient.ts +++ b/packages/web-api/src/WebClient.ts @@ -19,9 +19,10 @@ import { AdminAnalyticsPublicChannelMetadataDetails, FilesCompleteUploadExternalResponse, FilesGetUploadURLExternalResponse, -} from './response'; - -import { Methods, CursorPaginationEnabled, cursorPaginationEnabledMethods, FilesUploadV2Arguments, FileUploadV2Job, FilesGetUploadURLExternalArguments, FilesCompleteUploadExternalArguments } from './methods'; +} from './types/response'; +import { CursorPaginationEnabled } from './types/request/common'; +import { Methods } from './methods'; +import type { FilesUploadV2Arguments, FileUploadV2Job, FilesGetUploadURLExternalArguments, FilesCompleteUploadExternalArguments } from './types/request/files'; import { getUserAgent } from './instrument'; import { requestErrorWithOriginal, httpErrorFromResponse, platformErrorFromResult, rateLimitedErrorWithDelay, @@ -65,10 +66,6 @@ export enum WebClientEvent { RATE_LIMITED = 'rate_limited', } -export interface WebAPICallOptions { - [argument: string]: unknown; -} - export interface WebAPICallResult { ok: boolean; error?: string; @@ -83,7 +80,6 @@ export interface WebAPICallResult { // `chat.postMessage` returns an array of error messages (e.g., "messages": ["[ERROR] invalid_keys"]) messages?: string[]; }; - [key: string]: unknown; } // NOTE: should there be an async predicate? @@ -226,7 +222,7 @@ export class WebClient extends Methods { * @param method - the Web API method to call {@link https://api.slack.com/methods} * @param options - options */ - public async apiCall(method: string, options: WebAPICallOptions = {}): Promise { + public async apiCall(method: string, options: Record = {}): Promise { this.logger.debug(`apiCall('${method}') start`); warnDeprecations(method, this.logger); @@ -238,6 +234,8 @@ export class WebClient extends Methods { } warnIfNotUsingFilesUploadV2(method, this.logger); + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore if (method === 'files.uploadV2') return this.filesUploadV2(options); const headers: Record = {}; @@ -306,28 +304,24 @@ export class WebClient extends Methods { * @param shouldStop - a predicate that is called with each page, and should return true when pagination can end. * @param reduce - a callback that can be used to accumulate a value that the return promise is resolved to */ - public paginate(method: string, options?: WebAPICallOptions): AsyncIterable; + public paginate(method: string, options?: Record): AsyncIterable; public paginate( method: string, - options: WebAPICallOptions, + options: Record, shouldStop: PaginatePredicate, ): Promise; public paginate>( method: string, - options: WebAPICallOptions, + options: Record, shouldStop: PaginatePredicate, reduce?: PageReducer, ): Promise; public paginate>( method: string, - options?: WebAPICallOptions, + options?: Record, shouldStop?: PaginatePredicate, reduce?: PageReducer, ): (Promise | AsyncIterable) { - if (!cursorPaginationEnabledMethods.has(method)) { - this.logger.warn(`paginate() called with method ${method}, which is not known to be cursor pagination enabled.`); - } - const pageSize = (() => { if (options !== undefined && typeof options.limit === 'number') { const { limit } = options; @@ -396,21 +390,22 @@ export class WebClient extends Methods { })(); } - /* eslint-disable no-trailing-spaces */ /** * This wrapper method provides an easy way to upload files using the following endpoints: - * + * * **#1**: For each file submitted with this method, submit filenames * and file metadata to {@link https://api.slack.com/methods/files.getUploadURLExternal files.getUploadURLExternal} to request a URL to * which to send the file data to and an id for the file - * + * * **#2**: for each returned file `upload_url`, upload corresponding file to * URLs returned from step 1 (e.g. https://files.slack.com/upload/v1/...\") - * + * * **#3**: Complete uploads {@link https://api.slack.com/methods/files.completeUploadExternal files.completeUploadExternal} * @param options */ - public async filesUploadV2(options: FilesUploadV2Arguments): Promise { + public async filesUploadV2(options: FilesUploadV2Arguments): Promise< + WebAPICallResult & { files: FilesCompleteUploadExternalResponse[] } + > { this.logger.debug('files.uploadV2() start'); // 1 const fileUploads = await this.getAllFileUploads(options); @@ -426,7 +421,7 @@ export class WebClient extends Methods { // 3 const completion = await this.completeFileUploads(fileUploads); - + return { ok: true, files: completion }; } @@ -457,7 +452,7 @@ export class WebClient extends Methods { * @returns */ private async completeFileUploads(fileUploads: FileUploadV2Job[]): - Promise> { + Promise> { const toComplete: FilesCompleteUploadExternalArguments[] = Object.values(getAllFileUploadsToComplete(fileUploads)); return Promise.all( toComplete.map((job: FilesCompleteUploadExternalArguments) => this.files.completeUploadExternal(job)), @@ -486,10 +481,10 @@ export class WebClient extends Methods { }, headers); if (uploadRes.status !== 200) { return Promise.reject(Error(`Failed to upload file (id:${file_id}, filename: ${filename})`)); - } + } const returnData = { ok: true, body: uploadRes.data } as WebAPICallResult; return Promise.resolve(returnData); - } + } return Promise.reject(Error(`No upload url found for file (id: ${file_id}, filename: ${filename}`)); })); } @@ -502,10 +497,10 @@ export class WebClient extends Methods { let fileUploads: FileUploadV2Job[] = []; // add single file data to uploads if file or content exists at the top level - if (options.file || options.content) { + if ('file' in options || 'content' in options) { fileUploads.push(await getFileUploadJob(options, this.logger)); } - + // add multiple files data when file_uploads is supplied if (options.file_uploads) { fileUploads = fileUploads.concat(await getMultipleFileUploadJobs(options, this.logger)); @@ -595,8 +590,8 @@ export class WebClient extends Methods { * @param options - arguments for the Web API method * @param headers - a mutable object representing the HTTP headers for the outgoing request */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - private serializeApiCallOptions(options: WebAPICallOptions, headers?: any): string | Readable { + private serializeApiCallOptions(options: Record, headers?: Record): string | + Readable { // The following operation both flattens complex objects into a JSON-encoded strings and searches the values for // binary content let containsBinaryData: boolean = false; @@ -649,18 +644,20 @@ export class WebClient extends Methods { }, new FormData(), ); - // Copying FormData-generated headers into headers param - // not reassigning to headers param since it is passed by reference and behaves as an inout param - Object.entries(form.getHeaders()).forEach(([header, value]) => { - // eslint-disable-next-line no-param-reassign - headers[header] = value; - }); + if (headers) { + // Copying FormData-generated headers into headers param + // not reassigning to headers param since it is passed by reference and behaves as an inout param + Object.entries(form.getHeaders()).forEach(([header, value]) => { + // eslint-disable-next-line no-param-reassign + headers[header] = value; + }); + } return form; } // Otherwise, a simple key-value object is returned // eslint-disable-next-line no-param-reassign - headers['Content-Type'] = 'application/x-www-form-urlencoded'; + if (headers) headers['Content-Type'] = 'application/x-www-form-urlencoded'; // eslint-disable-next-line @typescript-eslint/no-explicit-any const initialValue: { [key: string]: any; } = {}; return qsStringify(flattened.reduce( @@ -797,23 +794,14 @@ function parseRetryHeaders(response: AxiosResponse): number | undefined { * @param logger instance of web clients logger */ function warnDeprecations(method: string, logger: Logger): void { - const deprecatedConversationsMethods = ['channels.', 'groups.', 'im.', 'mpim.']; - - const deprecatedMethods = ['admin.conversations.whitelist.', 'stars.']; - - const isDeprecatedConversations = deprecatedConversationsMethods.some((depMethod) => { - const re = new RegExp(`^${depMethod}`); - return re.test(method); - }); + const deprecatedMethods = ['workflows.']; const isDeprecated = deprecatedMethods.some((depMethod) => { const re = new RegExp(`^${depMethod}`); return re.test(method); }); - if (isDeprecatedConversations) { - logger.warn(`${method} is deprecated. Please use the Conversations API instead. For more info, go to https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api`); - } else if (isDeprecated) { + if (isDeprecated) { logger.warn(`${method} is deprecated. Please check on https://api.slack.com/methods for an alternative.`); } } @@ -824,16 +812,16 @@ function warnDeprecations(method: string, logger: Logger): void { * @param logger instance of we clients logger * @param options arguments for the Web API method */ -function warnIfFallbackIsMissing(method: string, logger: Logger, options?: WebAPICallOptions): void { +function warnIfFallbackIsMissing(method: string, logger: Logger, options?: Record): void { const targetMethods = ['chat.postEphemeral', 'chat.postMessage', 'chat.scheduleMessage']; const isTargetMethod = targetMethods.includes(method); - const hasAttachments = (args: WebAPICallOptions) => Array.isArray(args.attachments) && args.attachments.length; + const hasAttachments = (args: Record) => Array.isArray(args.attachments) && args.attachments.length; - const missingAttachmentFallbackDetected = (args: WebAPICallOptions) => Array.isArray(args.attachments) && + const missingAttachmentFallbackDetected = (args: Record) => Array.isArray(args.attachments) && args.attachments.some((attachment) => !attachment.fallback || attachment.fallback.trim() === ''); - const isEmptyText = (args: WebAPICallOptions) => args.text === undefined || args.text === null || args.text === ''; + const isEmptyText = (args: Record) => args.text === undefined || args.text === null || args.text === ''; const buildMissingTextWarning = () => `The top-level \`text\` argument is missing in the request payload for a ${method} call - ` + 'It\'s a best practice to always provide a `text` argument when posting a message. ' + @@ -861,23 +849,23 @@ function warnIfFallbackIsMissing(method: string, logger: Logger, options?: WebAP * @param logger instance of web clients logger * @param options arguments for the Web API method */ -function warnIfThreadTsIsNotString(method: string, logger: Logger, options?: WebAPICallOptions): void { +function warnIfThreadTsIsNotString(method: string, logger: Logger, options?: Record): void { const targetMethods = ['chat.postEphemeral', 'chat.postMessage', 'chat.scheduleMessage', 'files.upload']; const isTargetMethod = targetMethods.includes(method); - + if (isTargetMethod && options?.thread_ts !== undefined && typeof options?.thread_ts !== 'string') { logger.warn(buildThreadTsWarningMessage(method)); } } -export function buildThreadTsWarningMessage(method: string): string { +export function buildThreadTsWarningMessage(method: string): string { return `The given thread_ts value in the request payload for a ${method} call is a float value. We highly recommend using a string value instead.`; } /** * Takes an object and redacts specific items - * @param body - * @returns + * @param body + * @returns */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function redact(body: any): any { @@ -887,7 +875,7 @@ function redact(body: any): any { if (value === undefined || value === null) { return []; } - + let serializedValue = value; // redact possible tokens @@ -904,7 +892,7 @@ function redact(body: any): any { return [key, serializedValue]; }); - // return as object + // return as object // eslint-disable-next-line @typescript-eslint/no-explicit-any const initialValue: { [key: string]: any; } = {}; return flattened.reduce( diff --git a/packages/web-api/src/file-upload.ts b/packages/web-api/src/file-upload.ts index 560c81017..baeaab01c 100644 --- a/packages/web-api/src/file-upload.ts +++ b/packages/web-api/src/file-upload.ts @@ -2,7 +2,7 @@ import { readFileSync } from 'fs'; import { Readable } from 'stream'; import { Logger } from '@slack/logger'; import { errorWithCode, ErrorCode } from './errors'; -import { FilesCompleteUploadExternalArguments, FilesUploadV2Arguments, FileUploadV2, FileUploadV2Job } from './methods'; +import { FilesCompleteUploadExternalArguments, FilesUploadV2Arguments, FileUploadBinaryContents, FileUploadStringContents, FileUploadV2, FileUploadV2Job } from './types/request/files'; /** * Returns a fileUploadJob used to represent the of the file upload job and @@ -23,22 +23,31 @@ export async function getFileUploadJob( const fileData = await getFileData(options); const fileDataBytesLength = getFileDataLength(fileData); - const fileUploadJob = { + const fileUploadJob: Record = { // supplied by user alt_text: options.alt_text, channel_id: options.channels ?? options.channel_id, - content: options.content, - file: options.file, filename: options.filename ?? fileName, initial_comment: options.initial_comment, snippet_type: options.snippet_type, - thread_ts: options.thread_ts, title: options.title ?? (options.filename ?? fileName), // default title to filename unless otherwise specified // calculated data: fileData, length: fileDataBytesLength, }; - return fileUploadJob; + if ('thread_ts' in options) { + fileUploadJob.thread_ts = options.thread_ts; + } + if ('content' in options) { + return { + content: options.content, + ...fileUploadJob, + }; + } + return { + file: options.file, + ...fileUploadJob, + }; } /** @@ -83,15 +92,26 @@ export async function getMultipleFileUploadJobs( ErrorCode.FileUploadInvalidArgumentsError, ); } - // takes any channel_id, initial_comment and thread_ts // supplied at the top level. - return getFileUploadJob({ + const uploadJobArgs: Record = { ...upload, channels: options.channels, channel_id: options.channel_id, initial_comment: options.initial_comment, - thread_ts: options.thread_ts, + }; + if ('thread_ts' in options) { + uploadJobArgs.thread_ts = options.thread_ts; + } + if ('content' in upload) { + return getFileUploadJob({ + content: (upload as FileUploadStringContents).content, + ...uploadJobArgs, + }, logger); + } + return getFileUploadJob({ + file: (upload as FileUploadBinaryContents).file, + ...uploadJobArgs, }, logger); })); } @@ -108,8 +128,8 @@ export async function getMultipleFileUploadJobs( export async function getFileData(options: FilesUploadV2Arguments | FileUploadV2): Promise { errorIfInvalidOrMissingFileData(options); - const { file, content } = options; - if (file) { + if ('file' in options) { + const { file } = options; // try to handle as buffer if (Buffer.isBuffer(file)) return file; @@ -131,7 +151,7 @@ export async function getFileData(options: FilesUploadV2Arguments | FileUploadV2 const data = await getFileDataAsStream(file as Readable); if (data) return data; } - if (content) return Buffer.from(content); + if ('content' in options) return Buffer.from(options.content); // general catch-all error throw errorWithCode( @@ -193,8 +213,10 @@ Record { files: [{ id: file_id, title }], channel_id, initial_comment, - thread_ts, }; + if (thread_ts) { + toComplete[compareString].thread_ts = upload.thread_ts; + } } else { toComplete[compareString].files.push({ id: file_id, @@ -253,22 +275,26 @@ export function errorIfChannelsCsv(options: FilesUploadV2Arguments | FileUploadV * @param options */ export function errorIfInvalidOrMissingFileData(options: FilesUploadV2Arguments | FileUploadV2): void { - const { file, content } = options; + const hasFile = 'file' in options; + const hasContent = 'content' in options; - if (!(file || content) || (file && content)) { + if (!(hasFile || hasContent) || (hasFile && hasContent)) { throw errorWithCode( new Error('Either a file or content field is required for valid file upload. You cannot supply both'), ErrorCode.FileUploadInvalidArgumentsError, ); } /* eslint-disable @typescript-eslint/no-explicit-any */ - if (file && !(typeof file === 'string' || Buffer.isBuffer(file) || (file as any) instanceof Readable)) { - throw errorWithCode( - new Error('file must be a valid string path, buffer or Readable'), - ErrorCode.FileUploadInvalidArgumentsError, - ); + if ('file' in options) { + const { file } = options; + if (file && !(typeof file === 'string' || Buffer.isBuffer(file) || (file as any) instanceof Readable)) { + throw errorWithCode( + new Error('file must be a valid string path, buffer or Readable'), + ErrorCode.FileUploadInvalidArgumentsError, + ); + } } - if (content && typeof content !== 'string') { + if ('content' in options && options.content && typeof options.content !== 'string') { throw errorWithCode( new Error('content must be a string'), ErrorCode.FileUploadInvalidArgumentsError, diff --git a/packages/web-api/src/index.ts b/packages/web-api/src/index.ts index 2565c4952..0ab1e18df 100644 --- a/packages/web-api/src/index.ts +++ b/packages/web-api/src/index.ts @@ -3,7 +3,6 @@ export { WebClient, WebClientOptions, - WebAPICallOptions, WebAPICallResult, PageAccumulator, PageReducer, @@ -31,4 +30,4 @@ export { addAppMetadata } from './instrument'; export * from './methods'; export { default as Method } from './methods'; -export * from './response'; +export * from './types/response'; diff --git a/packages/web-api/src/methods.ts b/packages/web-api/src/methods.ts index fd8ddf00f..c40f0b032 100644 --- a/packages/web-api/src/methods.ts +++ b/packages/web-api/src/methods.ts @@ -1,8 +1,7 @@ -import { Stream } from 'stream'; -import { Dialog, View, KnownBlock, Block, MessageAttachment, LinkUnfurls, CallUser, MessageMetadata } from '@slack/types'; import { EventEmitter } from 'eventemitter3'; -import { WebAPICallOptions, WebAPICallResult, WebClient, WebClientEvent } from './WebClient'; -import { +import { WebAPICallResult, WebClient, WebClientEvent } from './WebClient'; +// Response types +import type { AdminAnalyticsGetFileResponse, AdminAppsApproveResponse, AdminAppsApprovedListResponse, @@ -237,14 +236,64 @@ import { AdminWorkflowsPermissionsLookupResponse, AdminAppsConfigLookupResponse, AdminAppsConfigSetResponse, -} from './response'; +} from './types/response'; +// Request types +import type { WorkflowsStepCompletedArguments, WorkflowsStepFailedArguments, WorkflowsUpdateStepArguments } from './types/request/workflows'; +import type { ViewsUpdateArguments, ViewsOpenArguments, ViewsPushArguments, ViewsPublishArguments } from './types/request/views'; +import type { UsersConversationsArguments, UsersInfoArguments, UsersListArguments, UsersIdentityArguments, UsersSetPhotoArguments, UsersProfileGetArguments, UsersProfileSetArguments, UsersDeletePhotoArguments, UsersGetPresenceArguments, UsersSetPresenceArguments, UsersLookupByEmailArguments } from './types/request/users'; +import type { ToolingTokensRotateArguments } from './types/request/tooling'; +import type { SearchAllArguments, SearchFilesArguments, SearchMessagesArguments } from './types/request/search'; +import type { UsergroupsCreateArguments, UsergroupsDisableArguments, UsergroupsEnableArguments, UsergroupsListArguments, UsergroupsUpdateArguments, UsergroupsUsersListArguments, UsergroupsUsersUpdateArguments } from './types/request/usergroups'; +import type { TeamAccessLogsArguments, TeamBillableInfoArguments, TeamBillingInfoArguments, TeamInfoArguments, TeamIntegrationLogsArguments, TeamPreferencesListArguments, TeamProfileGetArguments } from './types/request/team'; +import type { StarsAddRemoveArguments, StarsListArguments } from './types/request/stars'; +import type { RTMConnectArguments, RTMStartArguments } from './types/request/rtm'; +import type { RemindersAddArguments, RemindersInfoArguments, RemindersListArguments, RemindersDeleteArguments, RemindersCompleteArguments } from './types/request/reminders'; +import type { ReactionsAddArguments, ReactionsGetArguments, ReactionsListArguments, ReactionsRemoveArguments } from './types/request/reactions'; +import type { PinsAddArguments, PinsListArguments, PinsRemoveArguments } from './types/request/pins'; +import type { OpenIDConnectTokenArguments, OpenIDConnectUserInfoArguments } from './types/request/openid'; +import type { OAuthAccessArguments, OAuthV2AccessArguments, OAuthV2ExchangeArguments } from './types/request/oauth'; +import type { MigrationExchangeArguments } from './types/request/migration'; +import type { FilesDeleteArguments, FilesInfoArguments, FilesListArguments, FilesRevokePublicURLArguments, FilesSharedPublicURLArguments, FilesUploadArguments, FilesUploadV2Arguments, FilesCompleteUploadExternalArguments, FilesGetUploadURLExternalArguments, FilesCommentsDeleteArguments, FilesRemoteUpdateArguments, FilesRemoteRemoveArguments, FilesRemoteShareArguments, FilesRemoteListArguments, FilesRemoteInfoArguments, FilesRemoteAddArguments } from './types/request/files'; +import type { EmojiListArguments } from './types/request/emoji'; +import type { DndEndDndArguments, DndEndSnoozeArguments, DndInfoArguments, DndSetSnoozeArguments, DndTeamInfoArguments } from './types/request/dnd'; +import type { DialogOpenArguments } from './types/request/dialog'; +import type { ConversationsAcceptSharedInviteArguments, ConversationsApproveSharedInviteArguments, ConversationsArchiveArguments, ConversationsCloseArguments, ConversationsCreateArguments, ConversationsDeclineSharedInviteArguments, ConversationsHistoryArguments, ConversationsInfoArguments, ConversationsInviteArguments, ConversationsInviteSharedArguments, ConversationsJoinArguments, ConversationsKickArguments, ConversationsLeaveArguments, ConversationsListArguments, ConversationsListConnectInvitesArguments, ConversationsMarkArguments, ConversationsMembersArguments, ConversationsOpenArguments, ConversationsRenameArguments, ConversationsRepliesArguments, ConversationsSetPurposeArguments, ConversationsSetTopicArguments, ConversationsUnarchiveArguments } from './types/request/conversations'; +import type { ChatDeleteArguments, ChatDeleteScheduledMessageArguments, ChatGetPermalinkArguments, ChatMeMessageArguments, ChatPostEphemeralArguments, ChatPostMessageArguments, ChatScheduleMessageArguments, ChatScheduledMessagesListArguments, ChatUnfurlArguments, ChatUpdateArguments } from './types/request/chat'; +import type { CallsAddArguments, CallsEndArguments, CallsInfoArguments, CallsUpdateArguments, CallsParticipantsAddArguments, CallsParticipantsRemoveArguments } from './types/request/calls'; +import type { BotsInfoArguments } from './types/request/bots'; +import type { BookmarksAddArguments, BookmarksEditArguments, BookmarksListArguments, BookmarksRemoveArguments } from './types/request/bookmarks'; +import type { AuthRevokeArguments, AuthTestArguments, AuthTeamsListArguments } from './types/request/auth'; +import type { AppsConnectionsOpenArguments, AppsEventAuthorizationsListArguments, AppsManifestCreateArguments, AppsManifestDeleteArguments, AppsManifestExportArguments, AppsManifestUpdateArguments, AppsManifestValidateArguments, AppsUninstallArguments } from './types/request/apps'; +import type { APITestArguments } from './types/request/api'; +import type { AdminAnalyticsGetFileArguments } from './types/request/admin/analytics'; +import type { AdminAppsActivitiesListArguments, AdminAppsApproveArguments, AdminAppsApprovedListArguments, AdminAppsClearResolutionArguments, AdminAppsConfigLookupArguments, AdminAppsConfigSetArguments, AdminAppsRequestsCancelArguments, AdminAppsRequestsListArguments, AdminAppsRestrictArguments, AdminAppsRestrictedListArguments, AdminAppsUninstallArguments } from './types/request/admin/apps'; +import type { AdminAuthPolicyAssignEntitiesArguments, AdminAuthPolicyGetEntitiesArguments, AdminAuthPolicyRemoveEntitiesArguments } from './types/request/admin/auth'; +import type { AdminBarriersCreateArguments, AdminBarriersDeleteArguments, AdminBarriersListArguments, AdminBarriersUpdateArguments } from './types/request/admin/barriers'; +import type { 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 } from './types/request/admin/conversations'; +import type { AdminEmojiAddArguments, AdminEmojiAddAliasArguments, AdminEmojiListArguments, AdminEmojiRemoveArguments, AdminEmojiRenameArguments } from './types/request/admin/emoji'; +import type { AdminFunctionsListArguments, AdminFunctionsPermissionsLookupArguments, AdminFunctionsPermissionsSetArguments } from './types/request/admin/functions'; +import type { FunctionsCompleteErrorArguments, FunctionsCompleteSuccessArguments } from './types/request/functions'; +import type { AdminInviteRequestsApproveArguments, AdminInviteRequestsApprovedListArguments, AdminInviteRequestsDeniedListArguments, AdminInviteRequestsDenyArguments, AdminInviteRequestsListArguments } from './types/request/admin/inviteRequests'; +import type { AdminRolesAddAssignmentsArguments, AdminRolesListAssignmentsArguments, AdminRolesRemoveAssignmentsArguments } from './types/request/admin/roles'; +import type { AdminTeamsAdminsListArguments, AdminTeamsCreateArguments, AdminTeamsListArguments, AdminTeamsOwnersListArguments, AdminTeamsSettingsInfoArguments, AdminTeamsSettingsSetDefaultChannelsArguments, AdminTeamsSettingsSetDescriptionArguments, AdminTeamsSettingsSetDiscoverabilityArguments, AdminTeamsSettingsSetIconArguments, AdminTeamsSettingsSetNameArguments } from './types/request/admin/teams'; +import type { AdminUsergroupsAddChannelsArguments, AdminUsergroupsAddTeamsArguments, AdminUsergroupsListChannelsArguments, AdminUsergroupsRemoveChannelsArguments } from './types/request/admin/usergroups'; +import type { AdminUsersAssignArguments, AdminUsersInviteArguments, AdminUsersListArguments, AdminUsersRemoveArguments, AdminUsersSessionListArguments, AdminUsersSessionClearSettingsArguments, AdminUsersSessionGetSettingsArguments, AdminUsersSessionInvalidateArguments, AdminUsersSessionResetArguments, AdminUsersSessionResetBulkArguments, AdminUsersSessionSetSettingsArguments, AdminUsersSetAdminArguments, AdminUsersSetExpirationArguments, AdminUsersSetOwnerArguments, AdminUsersSetRegularArguments, AdminUsersUnsupportedVersionsExportArguments } from './types/request/admin/users'; +import type { AdminWorkflowsCollaboratorsAddArguments, AdminWorkflowsCollaboratorsRemoveArguments, AdminWorkflowsPermissionsLookupArguments, AdminWorkflowsSearchArguments, AdminWorkflowsUnpublishArguments } from './types/request/admin/workflows'; -// NOTE: could create a named type alias like data types like `SlackUserID: string` +/** + * Generic method definition + */ +export default interface Method< + MethodArguments, + MethodResult extends WebAPICallResult = WebAPICallResult, +> { + (options: MethodArguments): Promise; +} /** * Binds a certain `method` and its arguments and result types to the `apiCall` method in `WebClient`. */ -function bindApiCall( +function bindApiCall( self: Methods, method: string, ): Method { @@ -253,7 +302,7 @@ function bindApiCall; } -function bindFilesUploadV2( +function bindFilesUploadV2( self: Methods, ): Method { return self.filesUploadV2.bind(self) as unknown as Method; @@ -264,13 +313,6 @@ function bindFilesUploadV2 { - // TODO: As of writing, `WebClient` already extends EventEmitter... - // and I want WebClient to extend this class... - // and multiple inheritance in JS is cursed... - // so I'm just making this class extend EventEmitter. - // - // It shouldn't be here, indeed. Nothing here uses it, indeed. But it must be here for the sake of sanity. - protected constructor() { super(); @@ -280,73 +322,190 @@ export abstract class Methods extends EventEmitter { } } - public abstract apiCall(method: string, options?: WebAPICallOptions): Promise; - public abstract filesUploadV2(options?: WebAPICallOptions): Promise; + public abstract apiCall(method: string, options?: Record): Promise; + public abstract filesUploadV2(options: FilesUploadV2Arguments): Promise; public readonly admin = { analytics: { + /** + * @description Retrieve analytics data for a given date, presented as a compressed JSON file. + * @see {@link https://api.slack.com/methods/api.test `api.test` API reference}. + */ getFile: bindApiCall(this, 'admin.analytics.getFile'), }, apps: { + activities: { + /** + * @description Get logs for a specified team/org. + * @see {@link https://api.slack.com/methods/admin.apps.activities.list `admin.apps.activities.list` API reference}. + */ + list: bindApiCall(this, 'admin.apps.activities.list'), + }, + /** + * @description Approve an app for installation on a workspace. + * @see {@link https://api.slack.com/methods/admin.apps.approve `admin.apps.approve` API reference}. + */ approve: bindApiCall(this, 'admin.apps.approve'), approved: { + /** + * @description List approved apps for an org or workspace. + * @see {@link https://api.slack.com/methods/admin.apps.approved.list `admin.apps.approved.list` API reference}. + */ list: bindApiCall(this, 'admin.apps.approved.list'), }, + /** + * @description Clear an app resolution. + * @see {@link https://api.slack.com/methods/admin.apps.clearResolution `admin.apps.clearResolution` API reference}. + */ clearResolution: bindApiCall(this, 'admin.apps.clearResolution'), + config: { + /** + * @description Look up the app config for connectors by their IDs. + * @see {@link https://api.slack.com/methods/admin.apps.config.lookup `admin.apps.config.lookup` API reference}. + */ + lookup: bindApiCall(this, 'admin.apps.config.lookup'), + /** + * @description Set the app config for a connector. + * @see {@link https://api.slack.com/methods/admin.apps.config.set `admin.apps.config.set` API reference}. + */ + set: bindApiCall(this, 'admin.apps.config.set'), + }, requests: { + /** + * @description Cancel app request for team. + * @see {@link https://api.slack.com/methods/admin.apps.requests.cancel `admin.apps.requests.cancel` API reference}. + */ cancel: bindApiCall(this, 'admin.apps.requests.cancel'), + /** + * @description List app requests for a team/workspace. + * @see {@link https://api.slack.com/methods/admin.apps.requests.list `admin.apps.requests.list` API reference}. + */ list: bindApiCall(this, 'admin.apps.requests.list'), }, + /** + * @description Restrict an app for installation on a workspace. + * @see {@link https://api.slack.com/methods/admin.apps.restrict `admin.apps.restrict` API reference}. + */ restrict: bindApiCall(this, 'admin.apps.restrict'), restricted: { + /** + * @description List restricted apps for an org or workspace. + * @see {@link https://api.slack.com/methods/admin.apps.restricted.list `admin.apps.restricted.list` API reference}. + */ list: bindApiCall(this, 'admin.apps.restricted.list'), }, + /** + * @description Uninstall an app from one or many workspaces, or an entire enterprise organization. + * @see {@link https://api.slack.com/methods/admin.apps.uninstall `admin.apps.uninstall` API reference}. + */ uninstall: bindApiCall(this, 'admin.apps.uninstall'), - activities: { - list: bindApiCall(this, 'admin.apps.activities.list'), - }, - config: { - lookup: bindApiCall(this, 'admin.apps.config.lookup'), - set: bindApiCall(this, 'admin.apps.config.set'), - }, }, auth: { policy: { + /** + * @description Assign entities to a particular authentication policy. + * @see {@link https://api.slack.com/methods/admin.auth.policy.assignEntities `admin.auth.policy.assignEntities` API reference}. + */ assignEntities: bindApiCall(this, 'admin.auth.policy.assignEntities'), + /** + * @description Fetch all the entities assigned to a particular authentication policy by name. + * @see {@link https://api.slack.com/methods/admin.auth.policy.getEntities `admin.auth.policy.getEntities` API reference}. + */ getEntities: bindApiCall(this, 'admin.auth.policy.getEntities'), + /** + * @description Remove specified entities from a specified authentication policy. + * @see {@link https://api.slack.com/methods/admin.auth.policy.removeEntities `admin.auth.policy.removeEntities` API reference}. + */ removeEntities: bindApiCall(this, 'admin.auth.policy.removeEntities'), }, }, barriers: { + /** + * @description Create an Information Barrier. + * @see {@link https://api.slack.com/methods/admin.barriers.create `admin.barriers.create` API reference}. + */ create: bindApiCall(this, 'admin.barriers.create'), + /** + * @description Delete an existing Information Barrier. + * @see {@link https://api.slack.com/methods/admin.barriers.delete `admin.barriers.delete` API reference}. + */ delete: bindApiCall(this, 'admin.barriers.delete'), + /** + * @description Get all Information Barriers for your organization. + * @see {@link https://api.slack.com/methods/admin.barriers.list `admin.barriers.list` API reference}. + */ list: bindApiCall(this, 'admin.barriers.list'), + /** + * @description Update an existing Information Barrier. + * @see {@link https://api.slack.com/methods/admin.barriers.update `admin.barriers.update` API reference}. + */ update: bindApiCall(this, 'admin.barriers.update'), }, conversations: { + /** + * @description Archive a public or private channel. + * @see {@link https://api.slack.com/methods/admin.conversations.archive `admin.conversations.archive` API reference}. + */ archive: bindApiCall(this, 'admin.conversations.archive'), + /** + * @description Archive public or private channels in bulk. + * @see {@link https://api.slack.com/methods/admin.conversations.bulkArchive `admin.conversations.bulkArchive` API reference}. + */ bulkArchive: bindApiCall(this, 'admin.conversations.bulkArchive'), + /** + * @description Delete public or private channels in bulk. + * @see {@link https://api.slack.com/methods/admin.conversations.bulkDelet `admin.conversations.bulkDelete` API reference}. + */ bulkDelete: bindApiCall(this, 'admin.conversations.bulkDelete'), + /** + * @description Move public or private channels in bulk. + * @see {@link https://api.slack.com/methods/admin.conversations.bulkMove `admin.conversations.bulkMove` API reference}. + */ bulkMove: bindApiCall(this, 'admin.conversations.bulkMove'), + /** + * @description Convert a public channel to a private channel. + * @see {@link https://api.slack.com/methods/admin.conversations.convertToPrivate `admin.conversations.convertToPrivate` API reference}. + */ convertToPrivate: bindApiCall( this, 'admin.conversations.convertToPrivate', ), + /** + * @description Convert a private channel to a public channel. + * @see {@link https://api.slack.com/methods/admin.conversations.convertToPublic `admin.conversations.convertToPublic` API reference}. + */ convertToPublic: bindApiCall( this, 'admin.conversations.convertToPublic', ), + /** + * @description Create a public or private channel-based conversation. + * @see {@link https://api.slack.com/methods/admin.conversations.create `admin.conversations.create` API reference}. + */ create: bindApiCall(this, 'admin.conversations.create'), + /** + * @description Delete a public or private channel. + * @see {@link https://api.slack.com/methods/admin.conversations.delete `admin.conversations.delete` API reference}. + */ delete: bindApiCall(this, 'admin.conversations.delete'), + /** + * @description Disconnect a connected channel from one or more workspaces. + * @see {@link https://api.slack.com/methods/admin.conversations.disconnectShared `admin.conversations.disconnectShared` API reference}. + */ disconnectShared: bindApiCall( this, 'admin.conversations.disconnectShared', ), ekm: { + /** + * @description List all disconnected channels — i.e., channels that were once connected to other workspaces + * and then disconnected — and the corresponding original channel IDs for key revocation with EKM. + * @see {@link https://api.slack.com/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo `admin.conversations.ekm.listOriginalConnectedChannelInfo` API reference}. + */ listOriginalConnectedChannelInfo: bindApiCall( @@ -354,29 +513,81 @@ export abstract class Methods extends EventEmitter { 'admin.conversations.ekm.listOriginalConnectedChannelInfo', ), }, + /** + * @description Get conversation preferences for a public or private channel. + * @see {@link https://api.slack.com/methods/admin.conversations.getConversationPrefs `admin.conversations.getConversationPrefs` API reference}. + */ getConversationPrefs: bindApiCall( this, 'admin.conversations.getConversationPrefs', ), + /** + * @description Get a conversation's retention policy. + * @see {@link https://api.slack.com/methods/admin.conversations.getCustomRetention `admin.conversations.getCustomRetention` API reference}. + */ + getCustomRetention: + bindApiCall( + this, + 'admin.conversations.getCustomRetention', + ), + /** + * @description Get all the workspaces a given public or private channel is connected to within + * this Enterprise org. + * @see {@link https://api.slack.com/methods/admin.conversations.getTeams `admin.conversations.getTeams` API reference}. + */ getTeams: bindApiCall( this, 'admin.conversations.getTeams', ), + /** + * @description Invite a user to a public or private channel. + * @see {@link https://api.slack.com/methods/admin.conversations.invite `admin.conversations.invite` API reference}. + */ invite: bindApiCall(this, 'admin.conversations.invite'), + /** + * @description Returns channels on the given team using the filters. + * @see {@link https://api.slack.com/methods/admin.conversations.lookup `admin.conversations.lookup` API reference}. + */ + lookup: bindApiCall(this, 'admin.conversations.lookup'), + /** + * @description Remove a conversation's retention policy. + * @see {@link https://api.slack.com/methods/admin.conversations.removeCustomRetention `admin.conversations.removeCustomRetention` API reference}. + */ + removeCustomRetention: + bindApiCall( + this, + 'admin.conversations.removeCustomRetention', + ), + /** + * @description Rename a public or private channel. + * @see {@link https://api.slack.com/methods/admin.conversations.rename `admin.conversations.rename` API reference}. + */ rename: bindApiCall(this, 'admin.conversations.rename'), restrictAccess: { + /** + * @description Add an allowlist of IDP groups for accessing a channel. + * @see {@link https://api.slack.com/methods/admin.conversations.restrictAccess.addGroup `admin.conversations.restrictAccess.addGroup` API reference}. + */ addGroup: bindApiCall( this, 'admin.conversations.restrictAccess.addGroup', ), + /** + * @description List all IDP Groups linked to a channel. + * @see {@link https://api.slack.com/methods/admin.conversations.restrictAccess.listGroups `admin.conversations.restrictAccess.listGroups` API reference}. + */ listGroups: bindApiCall( this, 'admin.conversations.restrictAccess.listGroups', ), + /** + * @description Remove a linked IDP group linked from a private channel. + * @see {@link https://api.slack.com/methods/admin.conversations.restrictAccess.removeGroup `admin.conversations.restrictAccess.removeGroup` API reference}. + */ removeGroup: bindApiCall( @@ -384,201 +595,435 @@ export abstract class Methods extends EventEmitter { 'admin.conversations.restrictAccess.removeGroup', ), }, - getCustomRetention: - bindApiCall( + /** + * @description Search for public or private channels in an Enterprise organization. + * @see {@link https://api.slack.com/methods/admin.conversations.search `admin.conversations.search` API reference}. + */ + search: bindApiCall(this, 'admin.conversations.search'), + /** + * @description Set the posting permissions for a public or private channel. + * @see {@link https://api.slack.com/methods/admin.conversations.setConversationPrefs `admin.conversations.setConversationPrefs` API reference}. + */ + setConversationPrefs: + bindApiCall( this, - 'admin.conversations.getCustomRetention', + 'admin.conversations.setConversationPrefs', ), + /** + * @description Set a conversation's retention policy. + * @see {@link https://api.slack.com/methods/admin.conversations.setCustomRetention `admin.conversations.setCustomRetention` API reference}. + */ setCustomRetention: bindApiCall( this, 'admin.conversations.setCustomRetention', ), - removeCustomRetention: - bindApiCall( - this, - 'admin.conversations.removeCustomRetention', - ), - lookup: bindApiCall(this, 'admin.conversations.lookup'), - search: bindApiCall(this, 'admin.conversations.search'), - setConversationPrefs: - bindApiCall( - this, - 'admin.conversations.setConversationPrefs', - ), + /** + * @description Set the workspaces in an Enterprise grid org that connect to a public or private channel. + * @see {@link https://api.slack.com/methods/admin.conversations.setTeams `admin.conversations.setTeams` API reference}. + */ setTeams: bindApiCall( this, 'admin.conversations.setTeams', ), + /** + * @description Unarchive a public or private channel. + * @see {@link https://api.slack.com/methods/admin.conversations.unarchive `admin.conversations.unarchive` API reference}. + */ unarchive: bindApiCall( this, 'admin.conversations.unarchive', ), }, emoji: { + /** + * @description Add an emoji. + * @see {@link https://api.slack.com/methods/admin.emoji.add `admin.emoji.add` API reference}. + */ add: bindApiCall(this, 'admin.emoji.add'), + /** + * @description Add an emoji alias. + * @see {@link https://api.slack.com/methods/admin.emoji.addAlias `admin.emoji.addAlias` API reference}. + */ addAlias: bindApiCall(this, 'admin.emoji.addAlias'), + /** + * @description List emoji for an Enterprise Grid organization. + * @see {@link https://api.slack.com/methods/admin.emoji.list `admin.emoji.list` API reference}. + */ list: bindApiCall(this, 'admin.emoji.list'), + /** + * @description Remove an emoji across an Enterprise Grid organization. + * @see {@link https://api.slack.com/methods/admin.emoji.remove `admin.emoji.remove` API reference}. + */ remove: bindApiCall(this, 'admin.emoji.remove'), + /** + * @description Rename an emoji. + * @see {@link https://api.slack.com/methods/admin.emoji.rename `admin.emoji.rename` API reference}. + */ rename: bindApiCall(this, 'admin.emoji.rename'), }, functions: { + /** + * @description Look up functions by a set of apps. + * @see {@link https://api.slack.com/methods/admin.functions.list `admin.functions.list` API reference}. + */ list: bindApiCall(this, 'admin.functions.list'), permissions: { + /** + * @description Lookup the visibility of multiple Slack functions and include the users if + * it is limited to particular named entities. + * @see {@link https://api.slack.com/methods/admin.functions.permissions.lookup `admin.functions.permissions.lookup` API reference}. + */ lookup: bindApiCall(this, 'admin.functions.permissions.lookup'), + /** + * @description Set the visibility of a Slack function and define the users or workspaces if + * it is set to named_entities. + * @see {@link https://api.slack.com/methods/admin.functions.permissions.set `admin.functions.permissions.set` API reference}. + */ set: bindApiCall(this, 'admin.functions.permissions.set'), }, }, inviteRequests: { + /** + * @description Approve a workspace invite request. + * @see {@link https://api.slack.com/methods/admin.inviteRequests.approve `admin.inviteRequests.approve` API reference}. + */ approve: bindApiCall( this, 'admin.inviteRequests.approve', ), approved: { + /** + * @description List all approved workspace invite requests. + * @see {@link https://api.slack.com/methods/admin.inviteRequests.approved.list `admin.inviteRequests.approved.list` API reference}. + */ list: bindApiCall( this, 'admin.inviteRequests.approved.list', ), }, denied: { + /** + * @description List all denied workspace invite requests. + * @see {@link https://api.slack.com/methods/admin.inviteRequests.denied.list `admin.inviteRequests.denied.list` API reference}. + */ list: bindApiCall( this, 'admin.inviteRequests.denied.list', ), }, + /** + * @description Deny a workspace invite request. + * @see {@link https://api.slack.com/methods/admin.inviteRequests.deny `admin.inviteRequests.deny` API reference}. + */ deny: bindApiCall(this, 'admin.inviteRequests.deny'), + /** + * @description List all pending workspace invite requests. + * @see {@link https://api.slack.com/methods/admin.inviteRequests.list `admin.inviteRequests.list` API reference}. + */ list: bindApiCall(this, 'admin.inviteRequests.list'), }, + roles: { + /** + * @description Adds members to the specified role with the specified scopes. + * @see {@link https://api.slack.com/methods/admin.roles.addAssignments `admin.roles.addAssignments` API reference}. + */ + addAssignments: bindApiCall(this, 'admin.roles.addAssignments'), + /** + * @description Lists assignments for all roles across entities. + * Options to scope results by any combination of roles or entities. + * @see {@link https://api.slack.com/methods/admin.roles.listAssignments `admin.roles.listAssignments` API reference}. + */ + listAssignments: bindApiCall(this, 'admin.roles.listAssignments'), + /** + * @description Removes a set of users from a role for the given scopes and entities. + * @see {@link https://api.slack.com/methods/admin.roles.removeAssignments `admin.roles.removeAssignments` API reference}. + */ + removeAssignments: bindApiCall(this, 'admin.roles.removeAssignments'), + }, teams: { admins: { + /** + * @description List all of the admins on a given workspace. + * @see {@link https://api.slack.com/methods/admin.teams.admins.list `admin.teams.admins.list` API reference}. + */ list: bindApiCall(this, 'admin.teams.admins.list'), }, + /** + * @description Create an Enterprise team. + * @see {@link https://api.slack.com/methods/admin.teams.create `admin.teams.create` API reference}. + */ create: bindApiCall(this, 'admin.teams.create'), + /** + * @description List all teams on an Enterprise organization. + * @see {@link https://api.slack.com/methods/admin.teams.list `admin.teams.list` API reference}. + */ list: bindApiCall(this, 'admin.teams.list'), owners: { + /** + * @description List all of the owners on a given workspace. + * @see {@link https://api.slack.com/methods/admin.teams.owners.list `admin.teams.owners.list` API reference}. + */ list: bindApiCall(this, 'admin.teams.owners.list'), }, settings: { + /** + * @description Fetch information about settings in a workspace. + * @see {@link https://api.slack.com/methods/admin.teams.owners.list `admin.teams.owners.list` API reference}. + */ info: bindApiCall(this, 'admin.teams.settings.info'), + /** + * @description Set the default channels of a workspace. + * @see {@link https://api.slack.com/methods/admin.teams.settings.setDefaultChannels `admin.teams.settings.setDefaultChannels` API reference}. + */ setDefaultChannels: bindApiCall( this, 'admin.teams.settings.setDefaultChannels', ), + /** + * @description Set the description of a given workspace. + * @see {@link https://api.slack.com/methods/admin.teams.settings.setDescription `admin.teams.settings.setDescription` API reference}. + */ setDescription: bindApiCall( this, 'admin.teams.settings.setDescription', ), + /** + * @description Set the discoverability of a given workspace. + * @see {@link https://api.slack.com/methods/admin.teams.settings.setDiscoverability `admin.teams.settings.setDiscoverability` API reference}. + */ setDiscoverability: bindApiCall( this, 'admin.teams.settings.setDiscoverability', ), + /** + * @description Sets the icon of a workspace. + * @see {@link https://api.slack.com/methods/admin.teams.settings.setIcon `admin.teams.settings.setIcon` API reference}. + */ setIcon: bindApiCall( this, 'admin.teams.settings.setIcon', ), + /** + * @description Set the name of a given workspace. + * @see {@link https://api.slack.com/methods/admin.teams.settings.setName `admin.teams.settings.setName` API reference}. + */ setName: bindApiCall( this, 'admin.teams.settings.setName', ), }, }, - roles: { - addAssignments: bindApiCall(this, 'admin.roles.addAssignments'), - listAssignments: bindApiCall(this, 'admin.roles.listAssignments'), - removeAssignments: bindApiCall(this, 'admin.roles.removeAssignments'), - }, usergroups: { + /** + * @description Add up to one hundred default channels to an IDP group. + * @see {@link https://api.slack.com/methods/admin.usergroups.addChannels `admin.teams.usergroups.addChannels` API reference}. + */ addChannels: bindApiCall( this, 'admin.usergroups.addChannels', ), + /** + * @description Associate one or more default workspaces with an organization-wide IDP group. + * @see {@link https://api.slack.com/methods/admin.usergroups.addTeams `admin.teams.usergroups.addTeams` API reference}. + */ addTeams: bindApiCall( this, 'admin.usergroups.addTeams', ), + /** + * @description List the channels linked to an org-level IDP group (user group). + * @see {@link https://api.slack.com/methods/admin.usergroups.listChannels `admin.teams.usergroups.listChannels` API reference}. + */ listChannels: bindApiCall( this, 'admin.usergroups.listChannels', ), + /** + * @description Remove one or more default channels from an org-level IDP group (user group). + * @see {@link https://api.slack.com/methods/admin.usergroups.removeChannels `admin.teams.usergroups.removeChannels` API reference}. + */ removeChannels: bindApiCall( this, 'admin.usergroups.removeChannels', ), }, users: { + /** + * @description Add an Enterprise user to a workspace. + * @see {@link https://api.slack.com/methods/admin.users.assign `admin.users.assign` API reference}. + */ assign: bindApiCall(this, 'admin.users.assign'), + /** + * @description Invite a user to a workspace. + * @see {@link https://api.slack.com/methods/admin.users.invite `admin.users.invite` API reference}. + */ invite: bindApiCall(this, 'admin.users.invite'), + /** + * @description List users on a workspace. + * @see {@link https://api.slack.com/methods/admin.users.list `admin.users.list` API reference}. + */ list: bindApiCall(this, 'admin.users.list'), + /** + * @description Remove a user from a workspace. + * @see {@link https://api.slack.com/methods/admin.users.remove `admin.users.remove` API reference}. + */ remove: bindApiCall(this, 'admin.users.remove'), session: { - list: bindApiCall(this, 'admin.users.session.list'), - reset: bindApiCall(this, 'admin.users.session.reset'), - resetBulk: bindApiCall(this, 'admin.users.session.resetBulk'), - invalidate: bindApiCall( + /** + * @description Clear user-specific session settings—the session duration and what happens when the client + * closes—for a list of users. + * @see {@link https://api.slack.com/methods/admin.users.session.clearSettings `admin.users.session.clearSettings` API reference}. + */ + clearSettings: bindApiCall( this, - 'admin.users.session.invalidate', + 'admin.users.session.clearSettings', ), + /** + * @description Get user-specific session settings—the session duration and what happens when the client + * closes—given a list of users. + * @see {@link https://api.slack.com/methods/admin.users.session.getSettings `admin.users.session.getSettings` API reference}. + */ getSettings: bindApiCall( this, 'admin.users.session.getSettings', ), - setSettings: bindApiCall( - this, - 'admin.users.session.setSettings', - ), - clearSettings: bindApiCall( + /** + * @description Revoke a single session for a user. The user will be forced to login to Slack. + * @see {@link https://api.slack.com/methods/admin.users.session.invalidate `admin.users.session.invalidate` API reference}. + */ + invalidate: bindApiCall( this, - 'admin.users.session.clearSettings', + 'admin.users.session.invalidate', ), - }, - unsupportedVersions: { - export: bindApiCall( + /** + * @description List active user sessions for an organization. + * @see {@link https://api.slack.com/methods/admin.users.session.list `admin.users.session.list` API reference}. + */ + list: bindApiCall(this, 'admin.users.session.list'), + /** + * @description Wipes all valid sessions on all devices for a given user. + * @see {@link https://api.slack.com/methods/admin.users.session.reset `admin.users.session.reset` API reference}. + */ + reset: bindApiCall(this, 'admin.users.session.reset'), + /** + * @description Enqueues an asynchronous job to wipe all valid sessions on all devices for a given user list. + * @see {@link https://api.slack.com/methods/admin.users.session.resetBulk `admin.users.session.resetBulk` API reference}. + */ + resetBulk: bindApiCall(this, 'admin.users.session.resetBulk'), + /** + * @description Configure the user-level session settings—the session duration and what happens when the client + * closes—for one or more users. + * @see {@link https://api.slack.com/methods/admin.users.session.setSettings `admin.users.session.setSettings` API reference}. + */ + setSettings: bindApiCall( this, - 'admin.users.unsupportedVersions.export', + 'admin.users.session.setSettings', ), }, + /** + * @description Set an existing guest, regular user, or owner to be an admin user. + * @see {@link https://api.slack.com/methods/admin.users.setAdmin `admin.users.setAdmin` API reference}. + */ setAdmin: bindApiCall(this, 'admin.users.setAdmin'), + /** + * @description Set an expiration for a guest user. + * @see {@link https://api.slack.com/methods/admin.users.setExpiration `admin.users.setExpiration` API reference}. + */ setExpiration: bindApiCall( this, 'admin.users.setExpiration', ), + /** + * @description Set an existing guest, regular user, or admin user to be a workspace owner. + * @see {@link https://api.slack.com/methods/admin.users.setOwner `admin.users.setOwner` API reference}. + */ setOwner: bindApiCall( this, 'admin.users.setOwner', ), + /** + * @description Set an existing guest user, admin user, or owner to be a regular user. + * @see {@link https://api.slack.com/methods/admin.users.setRegular `admin.users.setRegular` API reference}. + */ setRegular: bindApiCall( this, 'admin.users.setRegular', ), + unsupportedVersions: { + /** + * @description Ask Slackbot to send you an export listing all workspace members using unsupported software, + * presented as a zipped CSV file. + * @see {@link https://api.slack.com/methods/admin.users.unsupportedVersions.export `admin.users.unsupportedVersions.export` API reference}. + */ + export: bindApiCall( + this, + 'admin.users.unsupportedVersions.export', + ), + }, }, workflows: { - search: bindApiCall(this, 'admin.workflows.search'), - unpublish: bindApiCall(this, 'admin.workflows.unpublish'), collaborators: { + /** + * @description Add collaborators to workflows within the team or enterprise. + * @see {@link https://api.slack.com/methods/admin.workflows.collaborators.add `admin.workflows.collaborators.add` API reference}. + */ add: bindApiCall(this, 'admin.workflows.collaborators.add'), + /** + * @description Remove collaborators from workflows within the team or enterprise. + * @see {@link https://api.slack.com/methods/admin.workflows.collaborators.remove `admin.workflows.collaborators.remove` API reference}. + */ remove: bindApiCall(this, 'admin.workflows.collaborators.remove'), }, permissions: { + /** + * @description Look up the permissions for a set of workflows. + * @see {@link https://api.slack.com/methods/admin.workflows.permissions.lookup `admin.workflows.permissions.lookup` API reference}. + */ lookup: bindApiCall(this, 'admin.workflows.permissions.lookup'), }, + /** + * @description Search workflows within the team or enterprise. + * @see {@link https://api.slack.com/methods/admin.workflows.search `admin.workflows.search` API reference}. + */ + search: bindApiCall(this, 'admin.workflows.search'), + /** + * @description Unpublish workflows within the team or enterprise. + * @see {@link https://api.slack.com/methods/admin.workflows.unpublish `admin.workflows.unpublish` API reference}. + */ + unpublish: bindApiCall(this, 'admin.workflows.unpublish'), }, }; public readonly api = { + /** + * @description Checks API calling code. + * @see {@link https://api.slack.com/methods/api.test `api.test` API reference}. + */ test: bindApiCall(this, 'api.test'), }; public readonly apps = { connections: { + /** + * @description Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive + * events and interactive payloads over. + * @see {@link https://api.slack.com/methods/apps.connections.open `apps.connections.open` API reference}. + */ open: bindApiCall(this, 'apps.connections.open'), }, event: { authorizations: { + /** + * @description Get a list of authorizations for the given event context. + * Each authorization represents an app installation that the event is visible to. + * @see {@link https://api.slack.com/methods/apps.event.authorizations.list `apps.event.authorizations.list` API reference}. + */ list: bindApiCall( this, 'apps.event.authorizations.list', @@ -586,113 +1031,318 @@ export abstract class Methods extends EventEmitter { }, }, manifest: { + /** + * @description Create an app from an app manifest. + * @see {@link https://api.slack.com/methods/apps.manifest.create `apps.manifest.create` API reference}. + */ create: bindApiCall(this, 'apps.manifest.create'), + /** + * @description Permanently deletes an app created through app manifests. + * @see {@link https://api.slack.com/methods/apps.manifest.delete `apps.manifest.delete` API reference}. + */ delete: bindApiCall(this, 'apps.manifest.delete'), + /** + * @description Export an app manifest from an existing app. + * @see {@link https://api.slack.com/methods/apps.manifest.export `apps.manifest.export` API reference}. + */ export: bindApiCall(this, 'apps.manifest.export'), + /** + * @description Update an app from an app manifest. + * @see {@link https://api.slack.com/methods/apps.manifest.update `apps.manifest.update` API reference}. + */ update: bindApiCall(this, 'apps.manifest.update'), + /** + * @description Validate an app manifest. + * @see {@link https://api.slack.com/methods/apps.manifest.validate `apps.manifest.validate` API reference}. + */ validate: bindApiCall(this, 'apps.manifest.validate'), }, + /** + * @description Uninstalls your app from a workspace. + * @see {@link https://api.slack.com/methods/apps.uninstall `apps.uninstall` API reference}. + */ uninstall: bindApiCall(this, 'apps.uninstall'), }; public readonly auth = { + /** + * @description Revokes a token. + * @see {@link https://api.slack.com/methods/auth.revoke `auth.revoke` API reference}. + */ revoke: bindApiCall(this, 'auth.revoke'), teams: { + /** + * @description Obtain a full list of workspaces your org-wide app has been approved for. + * @see {@link https://api.slack.com/methods/auth.teams.list `auth.teams.list` API reference}. + */ list: bindApiCall(this, 'auth.teams.list'), }, test: bindApiCall(this, 'auth.test'), }; - public readonly bots = { - info: bindApiCall(this, 'bots.info'), - }; - public readonly bookmarks = { + /** + * @description Add bookmark to a channel. + * @see {@link https://api.slack.com/methods/bookmarks.add `bookmarks.add` API reference}. + */ add: bindApiCall(this, 'bookmarks.add'), + /** + * @description Edit bookmark. + * @see {@link https://api.slack.com/methods/bookmarks.edit `bookmarks.edit` API reference}. + */ edit: bindApiCall(this, 'bookmarks.edit'), + /** + * @description List bookmarks for a channel. + * @see {@link https://api.slack.com/methods/bookmarks.list `bookmarks.list` API reference}. + */ list: bindApiCall(this, 'bookmarks.list'), + /** + * @description Remove bookmark from a channel. + * @see {@link https://api.slack.com/methods/bookmarks.remove `bookmarks.remove` API reference}. + */ remove: bindApiCall(this, 'bookmarks.remove'), }; + public readonly bots = { + /** + * @description Gets information about a bot user. + * @see {@link https://api.slack.com/methods/bots.info `bots.info` API reference}. + */ + info: bindApiCall(this, 'bots.info'), + }; + public readonly calls = { + /** + * @description Registers a new Call. + * @see {@link https://api.slack.com/methods/calls.add `calls.add` API reference}. + */ add: bindApiCall(this, 'calls.add'), + /** + * @description Ends a Call. + * @see {@link https://api.slack.com/methods/calls.end `calls.end` API reference}. + */ end: bindApiCall(this, 'calls.end'), + /** + * @description Returns information about a Call. + * @see {@link https://api.slack.com/methods/calls.info `calls.info` API reference}. + */ info: bindApiCall(this, 'calls.info'), + /** + * @description Updates information about a Call. + * @see {@link https://api.slack.com/methods/calls.info `calls.info` API reference}. + */ update: bindApiCall(this, 'calls.update'), participants: { + /** + * @description Registers new participants added to a Call. + * @see {@link https://api.slack.com/methods/calls.participants.add `calls.participants.add` API reference}. + */ add: bindApiCall(this, 'calls.participants.add'), remove: bindApiCall(this, 'calls.participants.remove'), }, }; public readonly chat = { + /** + * @description Deletes a message. + * @see {@link https://api.slack.com/methods/chat.delete `chat.delete` API reference}. + */ delete: bindApiCall(this, 'chat.delete'), + /** + * @description Deletes a pending scheduled message from the queue. + * @see {@link https://api.slack.com/methods/chat.deleteScheduledMessage `chat.deleteScheduledMessage` API reference}. + */ deleteScheduledMessage: bindApiCall(this, 'chat.deleteScheduledMessage'), + /** + * @description Retrieve a permalink URL for a specific extant message. + * @see {@link https://api.slack.com/methods/chat.getPermalink `chat.getPermalink` API reference}. + */ getPermalink: bindApiCall(this, 'chat.getPermalink'), + /** + * @description Share a me message into a channel. + * @see {@link https://api.slack.com/methods/chat.meMessage `chat.meMessage` API reference}. + */ meMessage: bindApiCall(this, 'chat.meMessage'), + /** + * @description Sends an ephemeral message to a user in a channel. + * @see {@link https://api.slack.com/methods/chat.postEphemeral `chat.postEphemeral` API reference}. + */ postEphemeral: bindApiCall(this, 'chat.postEphemeral'), + /** + * @description Sends a message to a channel. + * @see {@link https://api.slack.com/methods/chat.postMessage `chat.postMessage` API reference}. + */ postMessage: bindApiCall(this, 'chat.postMessage'), + /** + * @description Schedules a message to be sent to a channel. + * @see {@link https://api.slack.com/methods/chat.scheduleMessage `chat.scheduleMessage` API reference}. + */ scheduleMessage: bindApiCall( this, 'chat.scheduleMessage', ), scheduledMessages: { + /** + * @description Returns a list of scheduled messages. + * @see {@link https://api.slack.com/methods/chat.scheduledMessages.list `chat.scheduledMessages.list` API reference}. + */ list: bindApiCall( this, 'chat.scheduledMessages.list', ), }, + /** + * @description Provide custom unfurl behavior for user-posted URLs. + * @see {@link https://api.slack.com/methods/chat.unfurl `chat.unfurl` API reference}. + */ unfurl: bindApiCall(this, 'chat.unfurl'), + /** + * @description Updates a message. + * @see {@link https://api.slack.com/methods/chat.update `chat.update` API reference}. + */ update: bindApiCall(this, 'chat.update'), }; public readonly conversations = { + /** + * @description Accepts an invitation to a Slack Connect channel. + * @see {@link https://api.slack.com/methods/conversations.acceptSharedInvite `conversations.acceptSharedInvite` API reference}. + */ acceptSharedInvite: bindApiCall( this, 'conversations.acceptSharedInvite', ), + /** + * @description Approves an invitation to a Slack Connect channel. + * @see {@link https://api.slack.com/methods/conversations.approveSharedInvite `conversations.approveSharedInvite` API reference}. + */ approveSharedInvite: bindApiCall( this, 'conversations.approveSharedInvite', ), + /** + * @description Archives a conversation. + * @see {@link https://api.slack.com/methods/conversations.archive `conversations.archive` API reference}. + */ archive: bindApiCall(this, 'conversations.archive'), + /** + * @description Closes a direct message or multi-person direct message. + * @see {@link https://api.slack.com/methods/conversations.close `conversations.close` API reference}. + */ close: bindApiCall(this, 'conversations.close'), + /** + * @description Initiates a public or private channel-based conversation. + * @see {@link https://api.slack.com/methods/conversations.create `conversations.create` API reference}. + */ create: bindApiCall(this, 'conversations.create'), + /** + * @description Declines an invitation to a Slack Connect channel. + * @see {@link https://api.slack.com/methods/conversations.declineSharedInvite `conversations.declineSharedInvite` API reference}. + */ declineSharedInvite: bindApiCall( this, 'conversations.declineSharedInvite', ), + /** + * @description Fetches a conversation's history of messages and events. + * @see {@link https://api.slack.com/methods/conversations.history `conversations.history` API reference}. + */ history: bindApiCall(this, 'conversations.history'), + /** + * @description Retrieve information about a conversation. + * @see {@link https://api.slack.com/methods/conversations.info `conversations.info` API reference}. + */ info: bindApiCall(this, 'conversations.info'), + /** + * @description Invites users to a channel. + * @see {@link https://api.slack.com/methods/conversations.invite `conversations.invite` API reference}. + */ invite: bindApiCall(this, 'conversations.invite'), + /** + * @description Sends an invitation to a Slack Connect channel. + * @see {@link https://api.slack.com/methods/conversations.inviteShared `conversations.inviteShared` API reference}. + */ inviteShared: bindApiCall( this, 'conversations.inviteShared', ), + /** + * @description Joins an existing conversation. + * @see {@link https://api.slack.com/methods/conversations.join `conversations.join` API reference}. + */ join: bindApiCall(this, 'conversations.join'), + /** + * @description Removes a user from a conversation. + * @see {@link https://api.slack.com/methods/conversations.kick `conversations.kick` API reference}. + */ kick: bindApiCall(this, 'conversations.kick'), + /** + * @description Leaves a conversation. + * @see {@link https://api.slack.com/methods/conversations.leave `conversations.leave` API reference}. + */ leave: bindApiCall(this, 'conversations.leave'), + /** + * @description List all channels in a Slack team. + * @see {@link https://api.slack.com/methods/conversations.list `conversations.list` API reference}. + */ list: bindApiCall(this, 'conversations.list'), + /** + * @description Lists shared channel invites that have been generated or received but have not been approved by + * all parties. + * @see {@link https://api.slack.com/methods/conversations.listConnectInvites `conversations.listConnectInvites` API reference}. + */ listConnectInvites: bindApiCall( this, 'conversations.listConnectInvites', ), + /** + * @description Sets the read cursor in a channel. + * @see {@link https://api.slack.com/methods/conversations.mark `conversations.mark` API reference}. + */ mark: bindApiCall(this, 'conversations.mark'), + /** + * @description Retrieve members of a conversation. + * @see {@link https://api.slack.com/methods/conversations.members `conversations.members` API reference}. + */ members: bindApiCall(this, 'conversations.members'), + /** + * @description Opens or resumes a direct message or multi-person direct message. + * @see {@link https://api.slack.com/methods/conversations.open `conversations.open` API reference}. + */ open: bindApiCall(this, 'conversations.open'), + /** + * @description Renames a conversation. + * @see {@link https://api.slack.com/methods/conversations.rename `conversations.rename` API reference}. + */ rename: bindApiCall(this, 'conversations.rename'), + /** + * @description Retrieve a thread of messages posted to a conversation. + * @see {@link https://api.slack.com/methods/conversations.replies `conversations.replies` API reference}. + */ replies: bindApiCall(this, 'conversations.replies'), + /** + * @description Sets the purpose for a conversation. + * @see {@link https://api.slack.com/methods/conversations.setPurpose `conversations.setPurpose` API reference}. + */ setPurpose: bindApiCall(this, 'conversations.setPurpose'), + /** + * @description Sets the topic for a conversation. + * @see {@link https://api.slack.com/methods/conversations.setTopic `conversations.setTopic` API reference}. + */ setTopic: bindApiCall( this, 'conversations.setTopic', ), + /** + * @description Reverses conversation archival. + * @see {@link https://api.slack.com/methods/conversations.unarchive `conversations.unarchive` API reference}. + */ unarchive: bindApiCall( this, 'conversations.unarchive', @@ -700,32 +1350,96 @@ export abstract class Methods extends EventEmitter { }; public readonly dialog = { + /** + * @description Open a dialog with a user. + * @see {@link https://api.slack.com/methods/dialog.open `dialog.open` API reference}. + */ open: bindApiCall(this, 'dialog.open'), }; public readonly dnd = { + /** + * @description Ends the current user's Do Not Disturb session immediately. + * @see {@link https://api.slack.com/methods/dnd.endDnd `dnd.endDnd` API reference}. + */ endDnd: bindApiCall(this, 'dnd.endDnd'), + /** + * @description Ends the current user's snooze mode immediately. + * @see {@link https://api.slack.com/methods/dnd.endSnooze `dnd.endSnooze` API reference}. + */ endSnooze: bindApiCall(this, 'dnd.endSnooze'), + /** + * @description Retrieves a user's current Do Not Disturb status. + * @see {@link https://api.slack.com/methods/dnd.info `dnd.info` API reference}. + */ info: bindApiCall(this, 'dnd.info'), + /** + * @description Turns on Do Not Disturb mode for the current user, or changes its duration. + * @see {@link https://api.slack.com/methods/dnd.setSnooze `dnd.setSnooze` API reference}. + */ setSnooze: bindApiCall(this, 'dnd.setSnooze'), + /** + * @description Retrieves the Do Not Disturb status for up to 50 users on a team. + * @see {@link https://api.slack.com/methods/dnd.teamInfo `dnd.teamInfo` API reference}. + */ teamInfo: bindApiCall(this, 'dnd.teamInfo'), }; public readonly emoji = { + /** + * @description Lists custom emoji for a team. + * @see {@link https://api.slack.com/methods/emoji.list `emoji.list` API reference}. + */ list: bindApiCall(this, 'emoji.list'), }; public readonly files = { + /** + * @description Finishes an upload started with {@link https://api.slack.com/methods/files.getUploadURLExternal `files.getUploadURLExternal`}. + * @see {@link https://api.slack.com/methods/files.completeUploadExternal `files.completeUploadExternal` API reference}. + */ + completeUploadExternal: + bindApiCall(this, 'files.completeUploadExternal'), + /** + * @description Deletes a file. + * @see {@link https://api.slack.com/methods/files.delete `files.delete` API reference}. + */ delete: bindApiCall(this, 'files.delete'), + /** + * @description Gets a URL for an edge external file upload. + * @see {@link https://api.slack.com/methods/files.getUploadURLExternal `files.getUploadURLExternal` API reference}. + */ + getUploadURLExternal: + bindApiCall(this, 'files.getUploadURLExternal'), + /** + * @description Gets information about a file. + * @see {@link https://api.slack.com/methods/files.info `files.info` API reference}. + */ info: bindApiCall(this, 'files.info'), + /** + * @description List files for a team, in a channel, or from a user with applied filters. + * @see {@link https://api.slack.com/methods/files.list `files.list` API reference}. + */ list: bindApiCall(this, 'files.list'), + /** + * @description Revokes public/external sharing access for a file. + * @see {@link https://api.slack.com/methods/files.revokePublicURL `files.revokePublicURL` API reference}. + */ revokePublicURL: bindApiCall(this, 'files.revokePublicURL'), + /** + * @description Enables a file for public/external sharing. + * @see {@link https://api.slack.com/methods/files.revokePublicURL `files.revokePublicURL` API reference}. + */ sharedPublicURL: bindApiCall(this, 'files.sharedPublicURL'), + /** + * @description Uploads or creates a file. + * @see {@link https://api.slack.com/methods/files.upload `files.upload` API reference}. + */ upload: bindApiCall(this, 'files.upload'), /** - * Custom method to support files upload v2 way of uploading files to Slack + * @description Custom method to support a new way of uploading files to Slack. * Supports a single file upload * Supply: * - (required) single file or content @@ -735,27 +1449,60 @@ export abstract class Methods extends EventEmitter { * - multiple upload_files * Will try to honor both single file or content data supplied as well * as multiple file uploads property. + * @see {@link https://slack.dev/node-slack-sdk/web-api#upload-a-file `@slack/web-api` Upload a file documentation}. */ uploadV2: bindFilesUploadV2(this), - getUploadURLExternal: - bindApiCall(this, 'files.getUploadURLExternal'), - completeUploadExternal: - bindApiCall(this, 'files.completeUploadExternal'), comments: { + /** + * @description Deletes an existing comment on a file. + * @see {@link https://api.slack.com/methods/files.comments.delete `files.comments.delete` API reference}. + */ delete: bindApiCall(this, 'files.comments.delete'), }, remote: { + /** + * @description Adds a file from a remote service. + * @see {@link https://api.slack.com/methods/files.remote.add `files.remote.add` API reference}. + */ + add: bindApiCall(this, 'files.remote.add'), + /** + * @description Retrieve information about a remote file added to Slack. + * @see {@link https://api.slack.com/methods/files.remote.info `files.remote.info` API reference}. + */ info: bindApiCall(this, 'files.remote.info'), + /** + * @description List remote files added to Slack. + * @see {@link https://api.slack.com/methods/files.remote.list `files.remote.list` API reference}. + */ list: bindApiCall(this, 'files.remote.list'), - add: bindApiCall(this, 'files.remote.add'), - update: bindApiCall(this, 'files.remote.update'), + /** + * @description Remove a remote file. + * @see {@link https://api.slack.com/methods/files.remote.remove `files.remote.remove` API reference}. + */ remove: bindApiCall(this, 'files.remote.remove'), + /** + * @description Share a remote file into a channel. + * @see {@link https://api.slack.com/methods/files.remote.share `files.remote.share` API reference}. + */ share: bindApiCall(this, 'files.remote.share'), + /** + * @description Updates an existing remote file. + * @see {@link https://api.slack.com/methods/files.remote.update `files.remote.update` API reference}. + */ + update: bindApiCall(this, 'files.remote.update'), }, }; public readonly functions = { + /** + * @description Signal the failure to execute a Custom Function. + * @see {@link https://api.slack.com/methods/functions.completeError `functions.completeError` API reference}. + */ completeError: bindApiCall(this, 'functions.completeError'), + /** + * @description Signal the successful completion of a Custom Function. + * @see {@link https://api.slack.com/methods/functions.completeSuccess `functions.completeSuccess` API reference}. + */ completeSuccess: bindApiCall( this, 'functions.completeSuccess', @@ -763,96 +1510,246 @@ export abstract class Methods extends EventEmitter { }; public readonly migration = { + /** + * @description For Enterprise Grid workspaces, map local user IDs to global user IDs. + * @see {@link https://api.slack.com/methods/migration.exchange `migration.exchange` API reference}. + */ exchange: bindApiCall(this, 'migration.exchange'), }; public readonly oauth = { + /** + * @description Exchanges a temporary OAuth verifier code for an access token. + * @deprecated This is a legacy method only used by classic Slack apps. Use `oauth.v2.access` for new Slack apps. + * @see {@link https://api.slack.com/methods/oauth.access `oauth.access` API reference}. + */ access: bindApiCall(this, 'oauth.access'), v2: { + /** + * @description Exchanges a temporary OAuth verifier code for an access token. + * @see {@link https://api.slack.com/methods/oauth.v2.access `oauth.v2.access` API reference}. + */ access: bindApiCall(this, 'oauth.v2.access'), + /** + * @description Exchanges a legacy access token for a new expiring access token and refresh token. + * @see {@link https://api.slack.com/methods/oauth.v2.exchange `oauth.v2.exchange` API reference}. + */ exchange: bindApiCall(this, 'oauth.v2.exchange'), }, }; public readonly openid = { connect: { + /** + * @description Exchanges a temporary OAuth verifier code for an access token for {@link https://api.slack.com/authentication/sign-in-with-slack Sign in with Slack}. + * @see {@link https://api.slack.com/methods/openid.connect.token `openid.connect.token` API reference}. + */ token: bindApiCall(this, 'openid.connect.token'), + /** + * @description Get the identity of a user who has authorized {@link https://api.slack.com/authentication/sign-in-with-slack Sign in with Slack}. + * @see {@link https://api.slack.com/methods/openid.connect.userInfo `openid.connect.userInfo` API reference}. + */ userInfo: bindApiCall(this, 'openid.connect.userInfo'), }, }; public readonly pins = { + /** + * @description Pins an item to a channel. + * @see {@link https://api.slack.com/methods/pins.add `pins.add` API reference}. + */ add: bindApiCall(this, 'pins.add'), + /** + * @description Lists items pinned to a channel. + * @see {@link https://api.slack.com/methods/pins.list `pins.list` API reference}. + */ list: bindApiCall(this, 'pins.list'), + /** + * @description Un-pins an item from a channel. + * @see {@link https://api.slack.com/methods/pins.remove `pins.remove` API reference}. + */ remove: bindApiCall(this, 'pins.remove'), }; public readonly reactions = { + /** + * @description Adds a reaction to an item. + * @see {@link https://api.slack.com/methods/reactions.add `reactions.add` API reference}. + */ add: bindApiCall(this, 'reactions.add'), + /** + * @description Gets reactions for an item. + * @see {@link https://api.slack.com/methods/reactions.get `reactions.get` API reference}. + */ get: bindApiCall(this, 'reactions.get'), + /** + * @description List reactions made by a user. + * @see {@link https://api.slack.com/methods/reactions.list `reactions.list` API reference}. + */ list: bindApiCall(this, 'reactions.list'), + /** + * @description Removes a reaction from an item. + * @see {@link https://api.slack.com/methods/reactions.remove `reactions.remove` API reference}. + */ remove: bindApiCall(this, 'reactions.remove'), }; + // TODO: keep tabs on reminders APIs, may be deprecated once Later list APIs land + // See: https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders public readonly reminders = { + /** + * @description Creates a reminder. + * @see {@link https://api.slack.com/methods/reminders.add `reminders.add` API reference}. + */ add: bindApiCall(this, 'reminders.add'), + /** + * @description Marks a reminder as complete. + * @see {@link https://api.slack.com/methods/reminders.complete `reminders.complete` API reference}. + */ complete: bindApiCall(this, 'reminders.complete'), + /** + * @description Deletes a reminder. + * @see {@link https://api.slack.com/methods/reminders.delete `reminders.delete` API reference}. + */ delete: bindApiCall(this, 'reminders.delete'), + /** + * @description Gets information about a reminder. + * @see {@link https://api.slack.com/methods/reminders.info `reminders.info` API reference}. + */ info: bindApiCall(this, 'reminders.info'), + /** + * @description Lists all reminders created by or for a given user. + * @see {@link https://api.slack.com/methods/reminders.list `reminders.list` API reference}. + */ list: bindApiCall(this, 'reminders.list'), }; public readonly rtm = { + /** + * @description Starts a Real Time Messaging session. + * @see {@link https://api.slack.com/methods/rtm.connect `rtm.connect` API reference}. + */ connect: bindApiCall(this, 'rtm.connect'), + /** + * @description Starts a Real Time Messaging session. + * @deprecated Use `rtm.connect` instead. See {@link https://api.slack.com/changelog/2021-10-rtm-start-to-stop our post on retiring `rtm.start`}. + * @see {@link https://api.slack.com/methods/rtm.start `rtm.start` API reference}. + */ start: bindApiCall(this, 'rtm.start'), }; public readonly search = { + /** + * @description Searches for messages and files matching a query. + * @see {@link https://api.slack.com/methods/search.all search.all` API reference}. + */ all: bindApiCall(this, 'search.all'), + /** + * @description Searches for files matching a query. + * @see {@link https://api.slack.com/methods/search.files search.files` API reference}. + */ files: bindApiCall(this, 'search.files'), + /** + * @description Searches for messages matching a query. + * @see {@link https://api.slack.com/methods/search.messages search.messages` API reference}. + */ messages: bindApiCall(this, 'search.messages'), }; - public readonly stars = { - add: bindApiCall(this, 'stars.add'), - list: bindApiCall(this, 'stars.list'), - remove: bindApiCall(this, 'stars.remove'), - }; - public readonly team = { + /** + * @description Gets the access logs for the current team. + * @see {@link https://api.slack.com/methods/team.accessLogs `team.accessLogs` API reference}. + */ accessLogs: bindApiCall(this, 'team.accessLogs'), + /** + * @description Gets billable users information for the current team. + * @see {@link https://api.slack.com/methods/team.billableInfo `team.billableInfo` API reference}. + */ billableInfo: bindApiCall(this, 'team.billableInfo'), billing: { + /** + * @description Reads a workspace's billing plan information. + * @see {@link https://api.slack.com/methods/team.billing.info `team.billing.info` API reference}. + */ info: bindApiCall(this, 'team.billing.info'), }, + /** + * @description Gets information about the current team. + * @see {@link https://api.slack.com/methods/team.info `team.info` API reference}. + */ info: bindApiCall(this, 'team.info'), + /** + * @description Gets the integration logs for the current team. + * @see {@link https://api.slack.com/methods/team.integrationLogs `team.integrationLogs` API reference}. + */ integrationLogs: bindApiCall(this, 'team.integrationLogs'), preferences: { + /** + * @description Retrieve a list of a workspace's team preferences. + * @see {@link https://api.slack.com/methods/team.preferences.list `team.preferences.list` API reference}. + */ list: bindApiCall(this, 'team.preferences.list'), }, profile: { + /** + * @description Retrieve a team's profile. + * @see {@link https://api.slack.com/methods/team.profile.get `team.profile.get` API reference}. + */ get: bindApiCall(this, 'team.profile.get'), }, }; public readonly tooling = { tokens: { + /** + * @description Exchanges a refresh token for a new app configuration token. + * @see {@link https://api.slack.com/methods/tooling.tokens.rotate `tooling.tokens.rotate` API reference}. + */ rotate: bindApiCall(this, 'tooling.tokens.rotate'), }, }; public readonly usergroups = { + /** + * @description Create a User Group. + * @see {@link https://api.slack.com/methods/usergroups.create `usergroups.create` API reference}. + */ create: bindApiCall(this, 'usergroups.create'), + /** + * @description Disable an existing User Group. + * @see {@link https://api.slack.com/methods/usergroups.disable `usergroups.disable` API reference}. + */ disable: bindApiCall(this, 'usergroups.disable'), + /** + * @description Enable an existing User Group. + * @see {@link https://api.slack.com/methods/usergroups.enable `usergroups.enable` API reference}. + */ enable: bindApiCall(this, 'usergroups.enable'), + /** + * @description List all User Groups for a team. + * @see {@link https://api.slack.com/methods/usergroups.list `usergroups.list` API reference}. + */ list: bindApiCall(this, 'usergroups.list'), + /** + * @description Update an existing User Group. + * @see {@link https://api.slack.com/methods/usergroups.update `usergroups.update` API reference}. + */ update: bindApiCall(this, 'usergroups.update'), users: { + /** + * @description List all users in a User Group. + * @see {@link https://api.slack.com/methods/usergroups.users.list `usergroups.users.list` API reference}. + */ list: bindApiCall( this, 'usergroups.users.list', ), + /** + * @description Update the list of users in a User Group. + * @see {@link https://api.slack.com/methods/usergroups.users.update `usergroups.users.update` API reference}. + */ update: bindApiCall( this, 'usergroups.users.update', @@ -861,1719 +1758,148 @@ export abstract class Methods extends EventEmitter { }; public readonly users = { + /** + * @description List conversations the calling user may access. + * @see {@link https://api.slack.com/methods/users.conversations `users.conversations` API reference}. + */ conversations: bindApiCall(this, 'users.conversations'), + /** + * @description Delete the user profile photo. + * @see {@link https://api.slack.com/methods/users.deletePhoto `users.deletePhoto` API reference}. + */ deletePhoto: bindApiCall(this, 'users.deletePhoto'), + /** + * @description Gets user presence information. + * @see {@link https://api.slack.com/methods/users.getPresence `users.getPresence` API reference}. + */ getPresence: bindApiCall(this, 'users.getPresence'), + /** + * @description Get a user's identity. + * @see {@link https://api.slack.com/methods/users.identity `users.identity` API reference}. + */ identity: bindApiCall(this, 'users.identity'), + /** + * @description Gets information about a user. + * @see {@link https://api.slack.com/methods/users.info `users.info` API reference}. + */ info: bindApiCall(this, 'users.info'), + /** + * @description Lists all users in a Slack team. + * @see {@link https://api.slack.com/methods/users.list `users.list` API reference}. + */ list: bindApiCall(this, 'users.list'), + /** + * @description Find a user with an email address. + * @see {@link https://api.slack.com/methods/users.lookupByEmail `users.lookupByEmail` API reference}. + */ lookupByEmail: bindApiCall(this, 'users.lookupByEmail'), + /** + * @description Set the user profile photo. + * @see {@link https://api.slack.com/methods/users.setPhoto `users.setPhoto` API reference}. + */ setPhoto: bindApiCall(this, 'users.setPhoto'), + /** + * @description Manually sets user presence. + * @see {@link https://api.slack.com/methods/users.setPresence `users.setPresence` API reference}. + */ setPresence: bindApiCall(this, 'users.setPresence'), profile: { + /** + * @description Retrieve a user's profile information, including their custom status. + * @see {@link https://api.slack.com/methods/users.profile.get `users.profile.get` API reference}. + */ get: bindApiCall(this, 'users.profile.get'), + /** + * @description Set a user's profile information, including custom status. + * @see {@link https://api.slack.com/methods/users.profile.set `users.profile.set` API reference}. + */ set: bindApiCall(this, 'users.profile.set'), }, }; public readonly views = { + /** + * @description Open a view for a user. + * @see {@link https://api.slack.com/methods/views.open `views.open` API reference}. + */ open: bindApiCall(this, 'views.open'), + /** + * @description Publish a static view for a user. + * @see {@link https://api.slack.com/methods/views.publish `views.publish` API reference}. + */ publish: bindApiCall(this, 'views.publish'), + /** + * @description Push a view onto the stack of a root view. + * @see {@link https://api.slack.com/methods/views.push `views.push` API reference}. + */ push: bindApiCall(this, 'views.push'), + /** + * @description Update an existing view. + * @see {@link https://api.slack.com/methods/views.update `views.update` API reference}. + */ update: bindApiCall(this, 'views.update'), }; + // ------------------ + // Deprecated methods + // ------------------ + // TODO: breaking changes for future majors: + // - stars.* methods are marked as deprecated; once Later has APIs, these will see an official sunsetting timeline + // - workflows.* methods, Sep 12 2024: https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back + + public readonly stars = { + /** + * @description Save an item for later. Formerly known as adding a star. + * @deprecated Stars can still be added but they can no longer be viewed or interacted with by end-users. + * See {@link https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}. + * @see {@link https://api.slack.com/methods/stars.add `stars.add` API reference}. + */ + add: bindApiCall(this, 'stars.add'), + /** + * @description List a user's saved items, formerly known as stars. + * @deprecated Stars can still be listed but they can no longer be viewed or interacted with by end-users. + * See {@link https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}. + * @see {@link https://api.slack.com/methods/stars.list `stars.list` API reference}. + */ + list: bindApiCall(this, 'stars.list'), + /** + * @description Remove a saved item from a user's saved items, formerly known as stars. + * @deprecated Stars can still be removed but they can no longer be viewed or interacted with by end-users. + * See {@link https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}. + * @see {@link https://api.slack.com/methods/stars.remove `stars.remove` API reference}. + */ + remove: bindApiCall(this, 'stars.remove'), + }; + public readonly workflows = { + /** + * @description Indicate that an app's step in a workflow completed execution. + * @deprecated Steps from Apps is deprecated. + * We're retiring all Slack app functionality around Steps from Apps in September 2024. + * See {@link https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}. + * @see {@link https://api.slack.com/methods/workflows.stepCompleted `workflows.stepCompleted` API reference}. + */ stepCompleted: bindApiCall( this, 'workflows.stepCompleted', ), + /** + * @description Indicate that an app's step in a workflow failed to execute. + * @deprecated Steps from Apps is deprecated. + * We're retiring all Slack app functionality around Steps from Apps in September 2024. + * See {@link https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}. + * @see {@link https://api.slack.com/methods/workflows.stepFailed `workflows.stepFailed` API reference}. + */ stepFailed: bindApiCall(this, 'workflows.stepFailed'), + /** + * @description Update the configuration for a workflow step. + * @deprecated Steps from Apps is deprecated. + * We're retiring all Slack app functionality around Steps from Apps in September 2024. + * See {@link https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}. + * @see {@link https://api.slack.com/methods/workflows.updateStep `workflows.updateStep` API reference}. + */ updateStep: bindApiCall(this, 'workflows.updateStep'), }; - - // --------------------------------- - // Deprecated methods - // --------------------------------- - - public readonly channels = { - archive: bindApiCall(this, 'channels.archive'), - create: bindApiCall(this, 'channels.create'), - history: bindApiCall(this, 'channels.history'), - info: bindApiCall(this, 'channels.info'), - invite: bindApiCall(this, 'channels.invite'), - join: bindApiCall(this, 'channels.join'), - kick: bindApiCall(this, 'channels.kick'), - leave: bindApiCall(this, 'channels.leave'), - list: bindApiCall(this, 'channels.list'), - mark: bindApiCall(this, 'channels.mark'), - rename: bindApiCall(this, 'channels.rename'), - replies: bindApiCall(this, 'channels.replies'), - setPurpose: bindApiCall(this, 'channels.setPurpose'), - setTopic: bindApiCall(this, 'channels.setTopic'), - unarchive: bindApiCall(this, 'channels.unarchive'), - }; - - public readonly groups = { - archive: bindApiCall(this, 'groups.archive'), - create: bindApiCall(this, 'groups.create'), - createChild: bindApiCall(this, 'groups.createChild'), - history: bindApiCall(this, 'groups.history'), - info: bindApiCall(this, 'groups.info'), - invite: bindApiCall(this, 'groups.invite'), - kick: bindApiCall(this, 'groups.kick'), - leave: bindApiCall(this, 'groups.leave'), - list: bindApiCall(this, 'groups.list'), - mark: bindApiCall(this, 'groups.mark'), - open: bindApiCall(this, 'groups.open'), - rename: bindApiCall(this, 'groups.rename'), - replies: bindApiCall(this, 'groups.replies'), - setPurpose: bindApiCall(this, 'groups.setPurpose'), - setTopic: bindApiCall(this, 'groups.setTopic'), - unarchive: bindApiCall(this, 'groups.unarchive'), - }; - - public readonly im = { - close: bindApiCall(this, 'im.close'), - history: bindApiCall(this, 'im.history'), - list: bindApiCall(this, 'im.list'), - mark: bindApiCall(this, 'im.mark'), - open: bindApiCall(this, 'im.open'), - replies: bindApiCall(this, 'im.replies'), - }; - - public readonly mpim = { - close: bindApiCall(this, 'mpim.close'), - history: bindApiCall(this, 'mpim.history'), - list: bindApiCall(this, 'mpim.list'), - mark: bindApiCall(this, 'mpim.mark'), - open: bindApiCall(this, 'mpim.open'), - replies: bindApiCall(this, 'mpim.replies'), - }; -} - -/** - * Generic method definition - */ -export default interface Method< - MethodArguments extends WebAPICallOptions, - MethodResult extends WebAPICallResult = WebAPICallResult, -> { - (options?: MethodArguments): Promise; -} - -/* - * Reusable 'protocols' that some MethodArguments types can conform to - */ -export interface TokenOverridable { - token?: string; -} - -export interface LocaleAware { - include_locale?: boolean; -} - -export interface Searchable { - query: string; - highlight?: boolean; - sort: 'score' | 'timestamp'; - sort_dir: 'asc' | 'desc'; - team_id?: string; -} - -// A set of method names is initialized here and added to each time an argument type extends the CursorPaginationEnabled -// interface, so that methods are checked against this set when using the pagination helper. If the method name is not -// found, a warning is emitted to guide the developer to using the method correctly. -export const cursorPaginationEnabledMethods: Set = new Set(); -export interface CursorPaginationEnabled { - limit?: number; // natural integer, max of 1000 - cursor?: string; // find this in a response's `response_metadata.next_cursor` -} - -export interface TimelinePaginationEnabled { - oldest?: string; - latest?: string; - inclusive?: boolean; -} - -export interface TraditionalPagingEnabled { - page?: number; // default: 1 - count?: number; // default: 100 -} - -/* - * MethodArguments types (no formal relationship other than the generic constraint in Method<>) - */ - -/* -* `admin.*` -*/ -export interface AdminAnalyticsGetFileArguments extends WebAPICallOptions, TokenOverridable { - type: string; - date?: string; - metadata_only?: boolean; -} -export interface AdminAppsApproveArguments extends WebAPICallOptions, TokenOverridable { - app_id?: string; - request_id?: string; - team_id?: string; -} -export interface AdminAppsApprovedListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - 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 AdminAppsRequestsCancelArguments extends WebAPICallOptions, TokenOverridable { - request_id: string; - enterprise_id?: string; - team_id?: string; -} -export interface AdminAppsRequestsListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - team_id?: string; -} -cursorPaginationEnabledMethods.add('admin.apps.requests.list'); -export interface AdminAppsRestrictArguments extends WebAPICallOptions, TokenOverridable { - app_id?: string; - request_id?: string; - team_id?: string; -} -export interface AdminAppsRestrictedListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - team_id?: string; - enterprise_id?: string; -} -cursorPaginationEnabledMethods.add('admin.apps.restricted.list'); - -export interface AdminAppsUninstallArguments extends WebAPICallOptions { - app_id: string; - enterprise_id?: string; - team_ids?: string[]; -} -export interface AdminAppsActivitiesListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - app_id?: string; - component_id?: string; - component_type?: string; - log_event_type?: string; - max_date_created?: number; - min_date_created?: number; - min_log_level?: string; - sort_direction?: string; - source?: string; - team_id?: string; - trace_id?: string; -} -cursorPaginationEnabledMethods.add('admin.apps.activities.list'); -export interface AdminAppsConfigLookupArguments extends WebAPICallOptions, TokenOverridable { - app_ids: string[]; -} -export interface AdminAppsConfigSetArguments extends WebAPICallOptions, TokenOverridable { - app_id: string; - domain_restrictions?: { - urls?: string[]; - emails?: string[]; - }; - workflow_auth_strategy?: 'builder_choice' | 'end_user_strategy'; -} -export interface AdminAuthPolicyAssignEntitiesArguments extends WebAPICallOptions, TokenOverridable { - entity_ids: string[]; - entity_type: string; - policy_name: string; -} -export interface AdminAuthPolicyGetEntitiesArguments extends WebAPICallOptions, TokenOverridable, - CursorPaginationEnabled { - policy_name: string; - entity_type?: string; -} -cursorPaginationEnabledMethods.add('admin.auth.policy.getEntities'); -export interface AdminAuthPolicyRemoveEntitiesArguments extends WebAPICallOptions, TokenOverridable { - entity_ids: string[]; - entity_type: string; - policy_name: string; -} -export interface AdminBarriersCreateArguments extends WebAPICallOptions, TokenOverridable { - barriered_from_usergroup_ids: string[]; - primary_usergroup_id: string; - restricted_subjects: string[]; -} - -export interface AdminBarriersDeleteArguments extends WebAPICallOptions, TokenOverridable { - barrier_id: string; -} - -export interface AdminBarriersListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { } -cursorPaginationEnabledMethods.add('admin.barriers.list'); - -export interface AdminBarriersUpdateArguments extends WebAPICallOptions, TokenOverridable { - barrier_id: string; - barriered_from_usergroup_ids: string[]; - primary_usergroup_id: string; - restricted_subjects: string[]; -} - -export interface AdminConversationsArchiveArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; -} -export interface AdminConversationsBulkArchiveArguments extends WebAPICallOptions, TokenOverridable { - channel_ids: string[]; -} -export interface AdminConversationsBulkDeleteArguments extends WebAPICallOptions, TokenOverridable { - channel_ids: string[]; -} -export interface AdminConversationsBulkMoveArguments extends WebAPICallOptions, TokenOverridable { - channel_ids: string[]; - target_team_id: string; -} -export interface AdminConversationsConvertToPrivateArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; -} -export interface AdminConversationsConvertToPublicArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; -} -export interface AdminConversationsCreateArguments extends WebAPICallOptions, TokenOverridable { - is_private: boolean; - name: string; - description?: string; - org_wide?: boolean; - team_id?: string; -} -export interface AdminConversationsDeleteArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; -} -export interface AdminConversationsDisconnectSharedArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; - leaving_team_ids?: string[]; -} -export interface AdminConversationsLookupArguments - extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - last_message_activity_before: number; - team_ids: string[]; - max_member_count?: number; -} -cursorPaginationEnabledMethods.add('admin.conversations.lookup'); -export interface AdminConversationsEKMListOriginalConnectedChannelInfoArguments - extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - channel_ids?: string[]; - team_ids?: string[]; -} -cursorPaginationEnabledMethods.add('admin.conversations.ekm.listOriginalConnectedChannelInfo'); -export interface AdminConversationsGetConversationPrefsArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; -} -export interface AdminConversationsGetTeamsArguments - extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - channel_id: string; -} -cursorPaginationEnabledMethods.add('admin.conversations.getTeams'); -export interface AdminConversationsInviteArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; - user_ids: string[]; -} -export interface AdminConversationsRenameArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; - name: string; -} -export interface AdminConversationsRestrictAccessAddGroupArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; - group_id: string; - team_id?: string; -} -export interface AdminConversationsRestrictAccessListGroupsArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; - team_id?: string; -} -export interface AdminConversationsRestrictAccessRemoveGroupArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; - group_id: string; - team_id: string; -} -export interface AdminConversationsGetCustomRetentionArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; -} -export interface AdminConversationsSetCustomRetentionArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; - duration_days: number; -} -export interface AdminConversationsRemoveCustomRetentionArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; -} -export interface AdminConversationsSearchArguments - extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - query?: string; - search_channel_types?: string[]; - sort?: 'relevant' | 'name' | 'member_count' | 'created'; - sort_dir?: 'asc' | 'desc'; - team_ids?: string[]; -} -cursorPaginationEnabledMethods.add('admin.conversations.search'); -export interface AdminConversationsSetConversationPrefsArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; - prefs: Record; -} -export interface AdminConversationsSetTeamsArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; - team_id?: string; - target_team_ids?: string[]; - org_channel?: boolean; -} -export interface AdminConversationsUnarchiveArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; -} -export interface AdminEmojiAddArguments extends WebAPICallOptions, TokenOverridable { - name: string; - url: string; -} -export interface AdminEmojiAddAliasArguments extends WebAPICallOptions, TokenOverridable { - name: string; - alias_for: string; -} -export interface AdminEmojiListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { } -cursorPaginationEnabledMethods.add('admin.emoji.list'); -export interface AdminEmojiRemoveArguments extends WebAPICallOptions, TokenOverridable { - name: string; -} -export interface AdminEmojiRenameArguments extends WebAPICallOptions, TokenOverridable { - name: string; - new_name: string; -} -export interface AdminFunctionsListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - app_ids: string[]; - team_id?: string; -} -export interface AdminFunctionsPermissionsLookupArguments - extends WebAPICallOptions, TokenOverridable { - function_ids: string[]; -} -export interface AdminFunctionsPermissionsSetArguments extends WebAPICallOptions, TokenOverridable { - function_id: string; - visibility: string; - user_ids?: string[]; -} -export interface AdminInviteRequestsApproveArguments - extends WebAPICallOptions, TokenOverridable { - invite_request_id: string; - team_id: string; -} -export interface AdminInviteRequestsApprovedListArguments - extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - team_id: string; -} -cursorPaginationEnabledMethods.add('admin.inviteRequests.approved.list'); -export interface AdminInviteRequestsDenyArguments - extends WebAPICallOptions, TokenOverridable { - invite_request_id: string; - team_id: string; -} -export interface AdminInviteRequestsDeniedListArguments - extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - team_id: string; -} -cursorPaginationEnabledMethods.add('admin.inviteRequests.denied.list'); -export interface AdminInviteRequestsListArguments - extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - team_id: string; -} -cursorPaginationEnabledMethods.add('admin.inviteRequests.list'); -export interface AdminRolesAddAssignmentsArguments - extends WebAPICallOptions, TokenOverridable { - role_id: string; - entity_ids: string[]; - user_ids: string[]; -} -export interface AdminRolesListAssignmentsArguments - extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - entity_ids?: string[]; - role_ids?: string[]; - sort_dir?: string; -} -cursorPaginationEnabledMethods.add('admin.roles.listAssignments'); -export interface AdminRolesRemoveAssignmentsArguments - extends WebAPICallOptions, TokenOverridable { - role_id: string; - entity_ids: string[]; - user_ids: string[]; -} -cursorPaginationEnabledMethods.add('admin.inviteRequests.list'); -export interface AdminTeamsAdminsListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - team_id: string; -} -cursorPaginationEnabledMethods.add('admin.teams.admins.list'); -export interface AdminTeamsCreateArguments extends WebAPICallOptions, TokenOverridable { - team_domain: string; - team_name: string; - team_description?: string; - team_discoverability?: string; -} -export interface AdminTeamsListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { } -cursorPaginationEnabledMethods.add('admin.teams.list'); -export interface AdminTeamsOwnersListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - team_id: string; -} -cursorPaginationEnabledMethods.add('admin.teams.owners.list'); -export interface AdminTeamsSettingsInfoArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; -} -export interface AdminTeamsSettingsSetDefaultChannelsArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - channel_ids: string[]; -} -export interface AdminTeamsSettingsSetDescriptionArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - description: string; -} -export interface AdminTeamsSettingsSetDiscoverabilityArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - discoverability: 'open' | 'invite_only' | 'closed' | 'unlisted'; -} -export interface AdminTeamsSettingsSetIconArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - image_url: string; -} -export interface AdminTeamsSettingsSetNameArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - name: string; -} -export interface AdminUsergroupsAddChannelsArguments extends WebAPICallOptions, TokenOverridable { - usergroup_id: string; - team_id?: string; - channel_ids: string | string[]; -} -export interface AdminUsergroupsAddTeamsArguments extends WebAPICallOptions, TokenOverridable { - usergroup_id: string; - team_ids: string | string[]; - auto_provision?: boolean; -} -export interface AdminUsergroupsListChannelsArguments extends WebAPICallOptions, TokenOverridable { - usergroup_id: string; - include_num_members?: boolean; - team_id?: string; -} -export interface AdminUsergroupsRemoveChannelsArguments extends WebAPICallOptions, TokenOverridable { - usergroup_id: string; - channel_ids: string | string[]; -} -export interface AdminUsersAssignArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - user_id: string; - is_restricted?: boolean; - is_ultra_restricted?: boolean; -} -export interface AdminUsersInviteArguments extends WebAPICallOptions, TokenOverridable { - channel_ids: string; - email: string; - team_id: string; - custom_message?: string; - email_password_policy_enabled?: boolean; - guest_expiration_ts?: string; - is_restricted?: boolean; - is_ultra_restricted?: boolean; - real_name?: string; - resend?: boolean; -} -export interface AdminUsersListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - team_id: string; - include_deactivated_user_workspaces?: boolean; - is_active?: boolean; -} -cursorPaginationEnabledMethods.add('admin.users.list'); -export interface AdminUsersRemoveArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - user_id: string; -} -export interface AdminUsersSetAdminArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - user_id: string; -} -export interface AdminUsersSetExpirationArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - user_id: string; - expiration_ts: number; -} -export interface AdminUsersSetOwnerArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - user_id: string; -} -export interface AdminUsersSetRegularArguments extends WebAPICallOptions, TokenOverridable { - team_id: string; - user_id: string; -} -cursorPaginationEnabledMethods.add('admin.users.session.list'); -export interface AdminUsersSessionListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - user_id?: string; - team_id?: string; -} -export interface AdminUsersSessionResetArguments extends WebAPICallOptions, TokenOverridable { - user_id: string; - mobile_only?: boolean; - web_only?: boolean; -} -export interface AdminUsersSessionResetBulkArguments extends WebAPICallOptions, TokenOverridable { - user_ids: string[]; - mobile_only?: boolean; - web_only?: boolean; -} -export interface AdminUsersSessionInvalidateArguments extends WebAPICallOptions, TokenOverridable { - session_id: string; - team_id: string; -} -export interface AdminUsersSessionGetSettingsArguments extends WebAPICallOptions, TokenOverridable { - user_ids: string[]; -} -export interface AdminUsersSessionSetSettingsArguments extends WebAPICallOptions, TokenOverridable { - user_ids: string[]; - desktop_app_browser_quit?: boolean; - duration?: number; -} -export interface AdminUsersSessionClearSettingsArguments extends WebAPICallOptions, TokenOverridable { - user_ids: string[]; -} - -export interface AdminUsersUnsupportedVersionsExportArguments extends WebAPICallOptions, TokenOverridable { - date_end_of_support?: number; - date_sessions_started?: number; -} - -export interface AdminWorkflowsCollaboratorsAddArguments - extends WebAPICallOptions, TokenOverridable { - collaborator_ids: string[]; - workflow_ids: string[]; -} -export interface AdminWorkflowsCollaboratorsRemoveArguments - extends WebAPICallOptions, TokenOverridable { - collaborator_ids: string[]; - workflow_ids: string[]; -} -export interface AdminWorkflowsPermissionsLookupArguments - extends WebAPICallOptions, TokenOverridable { - workflow_ids: string[]; - max_workflow_triggers?: number; -} -export interface AdminWorkflowsSearchArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - app_id?: string; - collaborator_ids?: string[]; - no_collaborators?: boolean; - num_trigger_ids?: number; - query?: string; - sort?: string; - sort_dir?: string; - source?: string; -} -cursorPaginationEnabledMethods.add('admin.worfklows.search'); -export interface AdminWorkflowsUnpublishArguments extends WebAPICallOptions, TokenOverridable { - workflow_ids: string[]; -} -/* - * `api.*` - */ -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface APITestArguments extends WebAPICallOptions { } - -/* - * `apps.*` - */ -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface AppsConnectionsOpenArguments extends WebAPICallOptions { - // currently the method page lists Client id and client secret as optional arguments - // circle back here to see if they stay as optional or are removed -} - -export interface AppsEventAuthorizationsListArguments - extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - event_context: string; -} -cursorPaginationEnabledMethods.add('apps.event.authorizations.list'); - -export interface AppsManifestCreateArguments extends WebAPICallOptions, TokenOverridable { - manifest: string; -} - -export interface AppsManifestDeleteArguments extends WebAPICallOptions, TokenOverridable { - app_id: string; -} - -export interface AppsManifestExportArguments extends WebAPICallOptions, TokenOverridable { - app_id: string; -} - -export interface AppsManifestUpdateArguments extends WebAPICallOptions, TokenOverridable { - app_id: string; - manifest: string; -} - -export interface AppsManifestValidateArguments extends WebAPICallOptions, TokenOverridable { - app_id?: string; - manifest: string; -} - -export interface AppsUninstallArguments extends WebAPICallOptions { - client_id: string; - client_secret: string; -} - -/* - * `auth.*` - */ -export interface AuthRevokeArguments extends WebAPICallOptions, TokenOverridable { - test?: boolean; -} -export interface AuthTeamsListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - include_icon?: boolean; -} -cursorPaginationEnabledMethods.add('auth.teams.list'); -export interface AuthTestArguments extends WebAPICallOptions, TokenOverridable { } - -/* - * `bots.*` - */ -export interface BotsInfoArguments extends WebAPICallOptions, TokenOverridable { - bot?: string; - team_id?: string; -} - -/* - * `bookmarks.*` - */ -export interface BookmarksAddArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; - title: string; - type: string; - emoji?: string; - entity_id?: string; - link?: string; - parent_id?: string; -} - -export interface BookmarksEditArguments extends WebAPICallOptions, TokenOverridable { - bookmark_id: string; - channel_id: string; - emoji?: string; - link?: string; - title?: string; -} - -export interface BookmarksListArguments extends WebAPICallOptions, TokenOverridable { - channel_id: string; -} - -export interface BookmarksRemoveArguments extends WebAPICallOptions, TokenOverridable { - bookmark_id: string; - channel_id: string; -} - -/* -* `calls.*` -*/ -export interface CallsAddArguments extends WebAPICallOptions, TokenOverridable { - external_unique_id: string; - join_url: string; - created_by?: string; - date_start?: number; - desktop_app_join_url?: string; - external_display_id?: string; - title?: string; - users?: CallUser[]; -} - -export interface CallsEndArguments extends WebAPICallOptions, TokenOverridable { - id: string; - duration?: number; -} - -export interface CallsInfoArguments extends WebAPICallOptions, TokenOverridable { - id: string; -} - -export interface CallsUpdateArguments extends WebAPICallOptions, TokenOverridable { - id: string; - join_url?: string; - desktop_app_join_url?: string; - title?: string; -} - -export interface CallsParticipantsAddArguments extends WebAPICallOptions, TokenOverridable { - id: string; - users: CallUser[]; -} - -export interface CallsParticipantsRemoveArguments extends WebAPICallOptions, TokenOverridable { - id: string; - users: CallUser[]; -} - -/* - * `channels.*` - */ -export interface ChannelsArchiveArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} - -export interface ChannelsCreateArguments extends WebAPICallOptions, TokenOverridable { - name: string; - validate?: boolean; - team_id?: string; -} -export interface ChannelsHistoryArguments extends WebAPICallOptions, TokenOverridable, TimelinePaginationEnabled { - channel: string; - count?: number; - unreads?: boolean; -} -export interface ChannelsInfoArguments extends WebAPICallOptions, TokenOverridable, LocaleAware { - channel: string; -} -export interface ChannelsInviteArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - user: string; -} -export interface ChannelsJoinArguments extends WebAPICallOptions, TokenOverridable { - name: string; - validate?: boolean; -} -export interface ChannelsKickArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - user: string; -} -export interface ChannelsLeaveArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface ChannelsListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - exclude_archived?: boolean; - exclude_members?: boolean; - team_id?: string; -} -cursorPaginationEnabledMethods.add('channels.list'); -export interface ChannelsMarkArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - ts: string; -} -export interface ChannelsRenameArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - name: string; - validate?: boolean; -} -export interface ChannelsRepliesArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - thread_ts: string; -} -export interface ChannelsSetPurposeArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - purpose: string; -} -export interface ChannelsSetTopicArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - topic: string; -} -export interface ChannelsUnarchiveArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} - -/* - * `chat.*` - */ -export interface ChatDeleteArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - ts: string; - as_user?: boolean; -} -export interface ChatDeleteScheduledMessageArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - scheduled_message_id: string; - as_user?: boolean; -} -export interface ChatGetPermalinkArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - message_ts: string; -} -export interface ChatMeMessageArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - text: string; -} -export interface ChatPostEphemeralArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - text?: string; - user: string; - as_user?: boolean; - attachments?: MessageAttachment[]; - blocks?: (KnownBlock | Block)[]; - link_names?: boolean; - parse?: 'full' | 'none'; - thread_ts?: string; - icon_emoji?: string; // if specified, as_user must be false - icon_url?: string; // if specified, as_user must be false - username?: string; // if specified, as_user must be false -} -export interface ChatPostMessageArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - text?: string; - as_user?: boolean; - attachments?: MessageAttachment[]; - blocks?: (KnownBlock | Block)[]; - icon_emoji?: string; // if specified, as_user must be false - icon_url?: string; // if specified, as_user must be false - metadata?: MessageMetadata; - link_names?: boolean; - mrkdwn?: boolean; - parse?: 'full' | 'none'; - reply_broadcast?: boolean; // if specified, thread_ts must be set - thread_ts?: string; - unfurl_links?: boolean; - unfurl_media?: boolean; - username?: string; // if specified, as_user must be false -} -export interface ChatScheduleMessageArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - text?: string; - post_at: string | number; - as_user?: boolean; - attachments?: MessageAttachment[]; - blocks?: (KnownBlock | Block)[]; - metadata?: MessageMetadata; - link_names?: boolean; - parse?: 'full' | 'none'; - reply_broadcast?: boolean; // if specified, thread_ts must be set - thread_ts?: string; - unfurl_links?: boolean; - unfurl_media?: boolean; - team_id?: string; -} -export interface ChatScheduledMessagesListArguments extends WebAPICallOptions, TokenOverridable, - CursorPaginationEnabled { - channel: string; - latest: number; - oldest: number; - team_id?: string; // required if org token is used -} -cursorPaginationEnabledMethods.add('chat.scheduledMessages.list'); -// ChannelAndTS and SourceAndUnfurlID are used as either-or mixins for ChatUnfurlArguments -interface ChannelAndTSArguments { - /** - * @description Channel ID of the message. Both `channel` and `ts` must be provided together, or `unfurl_id` and - * `source` must be provided together. - */ - channel: string; - /** - * @description Timestamp of the message to add unfurl behavior to. - */ - ts: string; -} - -interface SourceAndUnfurlIDArguments { - /** - * @description The source of the link to unfurl. The source may either be `composer`, when the link is inside the - * message composer, or `conversations_history`, when the link has been posted to a conversation. - */ - source: 'composer' | 'conversations_history'; - /** - * @description The ID of the link to unfurl. Both `unfurl_id` and `source` must be provided together, or `channel` - * and `ts` must be provided together. - */ - unfurl_id: string; -} -export type ChatUnfurlArguments = (ChannelAndTSArguments | SourceAndUnfurlIDArguments) & WebAPICallOptions -& TokenOverridable -& { - /** - * @description URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl - * blocks or message attachments. - */ - unfurls: LinkUnfurls; - /** - * @description Provide a simply-formatted string to send as an ephemeral message to the user as invitation to - * authenticate further and enable full unfurling behavior. Provides two buttons, Not now or Never ask me again. - */ - user_auth_message?: string; - /** - * @description Set to `true` to indicate the user must install your Slack app to trigger unfurls for this domain. - * Defaults to `false`. - */ - user_auth_required?: boolean; - /** - * @description Send users to this custom URL where they will complete authentication in your app to fully trigger - * unfurling. Value should be properly URL-encoded. - */ - user_auth_url?: string; - /** - * @description Provide a JSON based array of structured blocks presented as URL-encoded string to send as an - * ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. - */ - user_auth_blocks?: (KnownBlock | Block)[]; -}; -export interface ChatUpdateArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - ts: string; - as_user?: boolean; - attachments?: MessageAttachment[]; - blocks?: (KnownBlock | Block)[]; - link_names?: boolean; - metadata?: MessageMetadata; - parse?: 'full' | 'none'; - file_ids?: string[]; - reply_broadcast?: boolean; - text?: string; -} - -/* - * `conversations.*` - */ -export interface ConversationsAcceptSharedInviteArguments extends WebAPICallOptions, TokenOverridable { - channel_name: string; - channel_id?: string; - free_trial_accepted?: boolean; - invite_id?: string; - is_private?: boolean; - team_id?: string; -} -export interface ConversationsApproveSharedInviteArguments extends WebAPICallOptions, TokenOverridable { - invite_id: string; - target_team?: string; -} -export interface ConversationsArchiveArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface ConversationsCloseArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface ConversationsCreateArguments extends WebAPICallOptions, TokenOverridable { - name: string; - is_private?: boolean; - team_id?: string; -} -export interface ConversationsDeclineSharedInviteArguments extends WebAPICallOptions, TokenOverridable { - invite_id: string; - target_team?: string; -} -export interface ConversationsHistoryArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled, - TimelinePaginationEnabled { - channel: string; - include_all_metadata?: boolean; -} -cursorPaginationEnabledMethods.add('conversations.history'); -export interface ConversationsInfoArguments extends WebAPICallOptions, TokenOverridable, LocaleAware { - channel: string; - include_num_members?: boolean; -} -export interface ConversationsInviteArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - users: string; // comma-separated list of users -} -export interface ConversationsInviteSharedArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - emails?: string[]; - user_ids?: string[]; -} -export interface ConversationsJoinArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface ConversationsKickArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - user: string; -} -export interface ConversationsLeaveArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface ConversationsListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - exclude_archived?: boolean; - types?: string; // comma-separated list of conversation types - team_id?: string; -} -cursorPaginationEnabledMethods.add('conversations.list'); -export interface ConversationsListConnectInvitesArguments extends WebAPICallOptions, TokenOverridable { - count?: number; - cursor?: string; - team_id?: string; -} -cursorPaginationEnabledMethods.add('conversations.listConnectInvites'); -export interface ConversationsMarkArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - ts: string; -} -export interface ConversationsMembersArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - channel: string; -} -cursorPaginationEnabledMethods.add('conversations.members'); -export interface ConversationsOpenArguments extends WebAPICallOptions, TokenOverridable { - channel?: string; - users?: string; // comma-separated list of users - return_im?: boolean; -} -export interface ConversationsRenameArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - name: string; -} -export interface ConversationsRepliesArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled, - TimelinePaginationEnabled { - channel: string; - ts: string; - include_all_metadata?: boolean; -} -cursorPaginationEnabledMethods.add('conversations.replies'); -export interface ConversationsSetPurposeArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - purpose: string; -} -export interface ConversationsSetTopicArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - topic: string; -} -export interface ConversationsUnarchiveArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} - -/* - * `dialog.*` - */ -export interface DialogOpenArguments extends WebAPICallOptions, TokenOverridable { - trigger_id: string; - dialog: Dialog; -} - -/* - * `dnd.*` - */ -export interface DndEndDndArguments extends WebAPICallOptions, TokenOverridable { } -export interface DndEndSnoozeArguments extends WebAPICallOptions, TokenOverridable { } -export interface DndInfoArguments extends WebAPICallOptions, TokenOverridable { - user: string; -} -export interface DndSetSnoozeArguments extends WebAPICallOptions, TokenOverridable { - num_minutes: number; -} -export interface DndTeamInfoArguments extends WebAPICallOptions, TokenOverridable { - users?: string; // comma-separated list of users -} - -/* - * `emoji.*` - */ -export interface EmojiListArguments extends WebAPICallOptions, TokenOverridable { - include_categories?: boolean; -} - -/* - * `files.*` - */ -export interface FilesDeleteArguments extends WebAPICallOptions, TokenOverridable { - file: string; // file id -} -export interface FilesInfoArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - file: string; // file id - count?: number; - page?: number; -} -cursorPaginationEnabledMethods.add('files.info'); -export interface FilesListArguments extends WebAPICallOptions, TokenOverridable, TraditionalPagingEnabled { - channel?: string; - user?: string; - ts_from?: string; - ts_to?: string; - types?: string; // comma-separated list of file types - show_files_hidden_by_limit?: boolean; - team_id?: string; -} -export interface FilesRevokePublicURLArguments extends WebAPICallOptions, TokenOverridable { - file: string; // file id -} -export interface FilesSharedPublicURLArguments extends WebAPICallOptions, TokenOverridable { - file: string; // file id -} -/** - * Legacy files.upload API files upload arguments - */ -export interface FilesUploadArguments extends FileUpload, WebAPICallOptions, TokenOverridable {} -interface FileUpload { - channels?: string; // comma-separated list of channels - content?: string; // if omitted, must provide `file` - file?: Buffer | Stream | string; // if omitted, must provide `content` - filename?: string; - filetype?: string; - initial_comment?: string; - thread_ts?: string; // if specified, `channels` must be set - title?: string; -} - -export interface FilesUploadV2Arguments extends FileUploadV2, WebAPICallOptions, TokenOverridable { - file_uploads?: Omit[]; - /** - * @deprecated Since v7, this flag is no longer used. You can safely remove it from your code. - */ - request_file_info?: boolean; -} - -export type FileUploadV2 = FileUpload & { - alt_text?: string; // for image uploads - channel_id?: string; - snippet_type?: string; // for code snippets -}; - -// Helper type intended for internal use in filesUploadV2 client method -// Includes additional metadata required to complete a single file upload job -export interface FileUploadV2Job extends FileUploadV2, - Pick { - length?: number; - data?: Buffer; -} - -/** - * Gets a URL for an edge external file upload. Method: - * {@link https://api.slack.com/methods/files.getUploadURLExternal files.getUploadURLExternal} -*/ -export interface FilesGetUploadURLExternalArguments extends WebAPICallOptions, TokenOverridable { - filename: string; - length: number; - alt_text?: string; - snippet_type?: string; -} -/** - * Finishes an upload started with files.getUploadURLExternal. Method: - * {@link https://api.slack.com/methods/files.completeUploadExternal files.completeUploadExternal} - */ -export interface FilesCompleteUploadExternalArguments extends WebAPICallOptions, TokenOverridable { - files: FileUploadComplete[]; - channel_id?: string, // if omitted, file will be private - initial_comment?: string, - thread_ts?: string -} -interface FileUploadComplete { - id: string, // file id - title?: string // filename -} -export interface FilesCommentsDeleteArguments extends WebAPICallOptions, TokenOverridable { - file: string; // file id - id: string; // comment id -} -// either file or external_id is required -export interface FilesRemoteInfoArguments extends WebAPICallOptions, TokenOverridable { - // either one of the file or external_id arguments are required - file?: string; - external_id?: string; -} -export interface FilesRemoteListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - ts_from?: string; - ts_to?: string; - channel?: string; -} -cursorPaginationEnabledMethods.add('files.remote.list'); -export interface FilesRemoteAddArguments extends WebAPICallOptions, TokenOverridable { - title: string; - external_url: string; - external_id: string; // a unique identifier for the file in your system - filetype: string; // possible values (except for 'auto'): https://api.slack.com/types/file#file_types - preview_image?: Buffer | Stream; - indexable_file_contents?: Buffer | Stream; -} -export interface FilesRemoteUpdateArguments extends WebAPICallOptions, TokenOverridable { - title?: string; - external_url?: string; - filetype?: string; // possible values (except for 'auto'): https://api.slack.com/types/file#file_types - preview_image?: Buffer | Stream; - indexable_file_contents?: Buffer | Stream; - - // either one of the file or external_id arguments are required - file?: string; - external_id?: string; -} -export interface FilesRemoteRemoveArguments extends WebAPICallOptions, TokenOverridable { - // either one of the file or external_id arguments are required - file?: string; - external_id?: string; -} -export interface FilesRemoteShareArguments extends WebAPICallOptions, TokenOverridable { - channels: string; // comma-separated list of channel ids - - // either one of the file or external_id arguments are required - file?: string; - 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.*` - */ -export interface GroupsArchiveArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface GroupsCreateArguments extends WebAPICallOptions, TokenOverridable { - name: string; - validate?: boolean; - team_id?: string; -} -export interface GroupsCreateChildArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface GroupsHistoryArguments extends WebAPICallOptions, TokenOverridable, TimelinePaginationEnabled { - channel: string; - unreads?: boolean; - count?: number; -} -export interface GroupsInfoArguments extends WebAPICallOptions, TokenOverridable, LocaleAware { - channel: string; -} -export interface GroupsInviteArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - user: string; -} -export interface GroupsKickArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - user: string; -} -export interface GroupsLeaveArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface GroupsListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - exclude_archived?: boolean; - exclude_members?: boolean; - team_id?: string; -} -cursorPaginationEnabledMethods.add('groups.list'); -export interface GroupsMarkArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - ts: string; -} -export interface GroupsOpenArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface GroupsRenameArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - name: string; - validate?: boolean; -} -export interface GroupsRepliesArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - thread_ts: boolean; -} -export interface GroupsSetPurposeArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - purpose: string; -} -export interface GroupsSetTopicArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - topic: string; -} -export interface GroupsUnarchiveArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} - -/* - * `im.*` - */ -export interface IMCloseArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface IMHistoryArguments extends WebAPICallOptions, TokenOverridable, TimelinePaginationEnabled { - channel: string; - count?: number; - unreads?: boolean; -} -export interface IMListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { } -cursorPaginationEnabledMethods.add('im.list'); -export interface IMMarkArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - ts: string; -} -export interface IMOpenArguments extends WebAPICallOptions, TokenOverridable, LocaleAware { - user: string; - return_im?: boolean; -} -export interface IMRepliesArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - thread_ts?: string; -} - -/* - * `migration.*` - */ -export interface MigrationExchangeArguments extends WebAPICallOptions, TokenOverridable { - users: string; // comma-separated list of users - to_old?: boolean; - team_id?: string; -} - -/* - * `mpim.*` - */ -export interface MPIMCloseArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface MPIMHistoryArguments extends WebAPICallOptions, TokenOverridable, TimelinePaginationEnabled { - channel: string; - count?: number; - unreads?: boolean; -} -export interface MPIMListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { } -cursorPaginationEnabledMethods.add('mpim.list'); -export interface MPIMMarkArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - ts: string; -} -export interface MPIMOpenArguments extends WebAPICallOptions, TokenOverridable { - users: string; // comma-separated list of users -} -export interface MPIMRepliesArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - thread_ts: string; -} - -/* - * `oauth.*` - */ -export interface OAuthAccessArguments extends WebAPICallOptions { - client_id: string; - client_secret: string; - code: string; - redirect_uri?: string; - single_channel?: string; -} -export interface OAuthV2AccessArguments extends WebAPICallOptions { - client_id: string; - client_secret: string; - code?: string; // not required for token rotation - redirect_uri?: string; - grant_type?: string; - refresh_token?: string; -} - -export interface OAuthV2ExchangeArguments extends WebAPICallOptions { - client_id: string; - client_secret: string; -} - -/* - * `openid.connect.*` - */ -export interface OpenIDConnectTokenArguments extends WebAPICallOptions { - client_id: string; - client_secret: string; - code?: string; - redirect_uri?: string; - grant_type?: 'authorization_code' | 'refresh_token'; - refresh_token?: string; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface OpenIDConnectUserInfoArguments extends WebAPICallOptions { -} - -/* - * `pins.*` - */ -export interface PinsAddArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - timestamp: string; -} -export interface PinsListArguments extends WebAPICallOptions, TokenOverridable { - channel: string; -} -export interface PinsRemoveArguments extends WebAPICallOptions, TokenOverridable { - channel: string; - timestamp: string; -} - -/* - * `reactions.*` - */ -export interface ReactionsAddArguments extends WebAPICallOptions, TokenOverridable { - name: string; - // must supply one of: - channel?: string; // paired with timestamp - timestamp?: string; // paired with channel - file?: string; // file id - file_comment?: string; -} -export interface ReactionsGetArguments extends WebAPICallOptions, TokenOverridable { - full?: boolean; - // must supply one of: - channel?: string; // paired with timestamp - timestamp?: string; // paired with channel - file?: string; // file id - file_comment?: string; -} -export interface ReactionsListArguments extends WebAPICallOptions, TokenOverridable, TraditionalPagingEnabled, - CursorPaginationEnabled { - user?: string; - full?: boolean; - team_id?: string; -} -cursorPaginationEnabledMethods.add('reactions.list'); -export interface ReactionsRemoveArguments extends WebAPICallOptions, TokenOverridable { - name: string; - // must supply one of: - channel?: string; // paired with timestamp - timestamp?: string; // paired with channel - file?: string; // file id - file_comment?: string; -} - -/* - * `reminders.*` - */ -export interface RemindersAddArguments extends WebAPICallOptions, TokenOverridable { - text: string; - time: string | number; - user?: string; -} -export interface RemindersCompleteArguments extends WebAPICallOptions, TokenOverridable { - reminder: string; -} -export interface RemindersDeleteArguments extends WebAPICallOptions, TokenOverridable { - reminder: string; -} -export interface RemindersInfoArguments extends WebAPICallOptions, TokenOverridable { - reminder: string; -} -export interface RemindersListArguments extends WebAPICallOptions, TokenOverridable { } - -/* - * `rtm.*` - */ -export interface RTMConnectArguments extends WebAPICallOptions, TokenOverridable { - batch_presence_aware?: boolean; - presence_sub?: boolean; -} -export interface RTMStartArguments extends WebAPICallOptions, TokenOverridable, LocaleAware { - batch_presence_aware?: boolean; - mpim_aware?: boolean; - no_latest?: '0' | '1'; - no_unreads?: string; - presence_sub?: boolean; - simple_latest?: boolean; -} - -/* - * `search.*` - */ -export interface SearchAllArguments extends WebAPICallOptions, TokenOverridable, TraditionalPagingEnabled, - Searchable { } -export interface SearchFilesArguments extends WebAPICallOptions, TokenOverridable, TraditionalPagingEnabled, - Searchable { } -export interface SearchMessagesArguments extends WebAPICallOptions, TokenOverridable, TraditionalPagingEnabled, - Searchable { } - -/* - * `stars.*` - */ -export interface StarsAddArguments extends WebAPICallOptions, TokenOverridable { - // must supply one of: - channel?: string; // paired with `timestamp` - timestamp?: string; // paired with `channel` - file?: string; // file id - file_comment?: string; -} -export interface StarsListArguments extends WebAPICallOptions, TokenOverridable, TraditionalPagingEnabled, - CursorPaginationEnabled { } -cursorPaginationEnabledMethods.add('stars.list'); -export interface StarsRemoveArguments extends WebAPICallOptions, TokenOverridable { - // must supply one of: - channel?: string; // paired with `timestamp` - timestamp?: string; // paired with `channel` - file?: string; // file id - file_comment?: string; -} - -/* - * `team.*` - */ -export interface TeamAccessLogsArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - before?: number; - count?: number; - page?: number; - team_id?: string; -} -cursorPaginationEnabledMethods.add('team.accessLogs'); - -export interface TeamBillableInfoArguments extends WebAPICallOptions, TokenOverridable { - user?: string; - team_id?: string; -} -export interface TeamBillingInfoArguments extends WebAPICallOptions, TokenOverridable { -} -export interface TeamInfoArguments extends WebAPICallOptions, TokenOverridable { - // Team to get info on, if omitted, will return information about the current team. - // Will only return team that the authenticated token is allowed to see through external shared channels - team?: string; - domain?: string; // available only for Enterprise Grid -} -export interface TeamIntegrationLogsArguments extends WebAPICallOptions, TokenOverridable { - app_id?: string; - change_type?: string; // TODO: list types: 'x' | 'y' | 'z' - count?: number; - page?: number; - service_id?: string; - user?: string; - team_id?: string; -} -export interface TeamProfileGetArguments extends WebAPICallOptions, TokenOverridable { - visibility?: 'all' | 'visible' | 'hidden'; - team_id?: string; -} -export interface TeamPreferencesListArguments extends WebAPICallOptions, TokenOverridable { -} - -/* - * `tooling.*` - */ -export interface ToolingTokensRotateArguments extends WebAPICallOptions, TokenOverridable { - refresh_token: string; -} - -/* - * `usergroups.*` - */ -export interface UsergroupsCreateArguments extends WebAPICallOptions, TokenOverridable { - name: string; - channels?: string; // comma-separated list of channels - description?: string; - handle?: string; - include_count?: boolean; -} -export interface UsergroupsDisableArguments extends WebAPICallOptions, TokenOverridable { - usergroup: string; - include_count?: boolean; -} -export interface UsergroupsEnableArguments extends WebAPICallOptions, TokenOverridable { - usergroup: string; - include_count?: boolean; -} -export interface UsergroupsListArguments extends WebAPICallOptions, TokenOverridable { - include_count?: boolean; - include_disabled?: boolean; - include_users?: boolean; -} -export interface UsergroupsUpdateArguments extends WebAPICallOptions, TokenOverridable { - usergroup: string; - channels?: string; // comma-separated list of channels - description?: string; - handle?: string; - include_count?: boolean; - name?: string; -} -export interface UsergroupsUsersListArguments extends WebAPICallOptions, TokenOverridable { - usergroup: string; - include_disabled?: boolean; -} -export interface UsergroupsUsersUpdateArguments extends WebAPICallOptions, TokenOverridable { - usergroup: string; - users: string; // comma-separated list of users - include_count?: boolean; -} - -/* - * `users.*` - */ -export interface UsersConversationsArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { - exclude_archived?: boolean; - types?: string; // comma-separated list of conversation types - user?: string; - team_id?: string; -} -cursorPaginationEnabledMethods.add('users.conversations'); -export interface UsersDeletePhotoArguments extends WebAPICallOptions, TokenOverridable { } -export interface UsersGetPresenceArguments extends WebAPICallOptions, TokenOverridable { - user: string; -} -export interface UsersIdentityArguments extends WebAPICallOptions, TokenOverridable { } -export interface UsersInfoArguments extends WebAPICallOptions, TokenOverridable, LocaleAware { - user: string; -} -export interface UsersListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled, LocaleAware { - presence?: boolean; // deprecated, defaults to false - team_id?: string; -} -cursorPaginationEnabledMethods.add('users.list'); -export interface UsersLookupByEmailArguments extends WebAPICallOptions, TokenOverridable { - email: string; -} -export interface UsersSetPhotoArguments extends WebAPICallOptions, TokenOverridable { - image: Buffer | Stream; - crop_w?: number; - crop_x?: number; - crop_y?: number; -} -export interface UsersSetPresenceArguments extends WebAPICallOptions, TokenOverridable { - presence: 'auto' | 'away'; -} -export interface UsersProfileGetArguments extends WebAPICallOptions, TokenOverridable { - include_labels?: boolean; - user?: string; -} -export interface UsersProfileSetArguments extends WebAPICallOptions, TokenOverridable { - profile?: string; // url-encoded json - user?: string; - name?: string; // usable if `profile` is not passed - value?: string; // usable if `profile` is not passed -} - -export interface ViewsOpenArguments extends WebAPICallOptions, TokenOverridable { - trigger_id: string; - view: View; -} - -export interface ViewsPushArguments extends WebAPICallOptions, TokenOverridable { - trigger_id: string; - view: View; -} - -export interface ViewsPublishArguments extends WebAPICallOptions, TokenOverridable { - user_id: string; - view: View; - hash?: string; -} - -export interface ViewsUpdateArguments extends WebAPICallOptions, TokenOverridable { - view_id?: string; - view: View; - external_id?: string; - hash?: string; -} - -/* - * `workflows.*` - */ -export interface WorkflowsStepCompletedArguments extends WebAPICallOptions, TokenOverridable { - workflow_step_execute_id: string; - outputs?: Record; -} - -export interface WorkflowsStepFailedArguments extends WebAPICallOptions, TokenOverridable { - workflow_step_execute_id: string; - error: { - message: string; - }; -} - -export interface WorkflowsUpdateStepArguments extends WebAPICallOptions, TokenOverridable { - workflow_step_edit_id: string; - step_image_url?: string; - step_name?: string; - inputs?: { - [name: string]: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - value: any; - skip_variable_replacement?: boolean; - variables?: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - [key: string]: any; - }; - }, - }; - outputs?: { - type: string; - name: string; - label: string; - }[]; } export * from '@slack/types'; diff --git a/packages/web-api/src/types/request/admin/analytics.ts b/packages/web-api/src/types/request/admin/analytics.ts new file mode 100644 index 000000000..5229ff446 --- /dev/null +++ b/packages/web-api/src/types/request/admin/analytics.ts @@ -0,0 +1,44 @@ +import type { TokenOverridable } from '../common'; + +interface Date { + /** + * @description Date to retrieve the analytics data for, expressed as `YYYY-MM-DD` in UTC. + * Required unless `metadata_only` is set to `true`. + */ + date: string; +} +interface MemberArgs extends Date { + /** + * @description The type of analytics to retrieve. The options are currently limited to + * `member` (for grid member analytics) and `public_channel` (for public channel analytics). + */ + type: 'member'; +} +interface TypeChannel { + /** + * @description The type of analytics to retrieve. The options are currently limited to + * `member` (for grid member analytics) and `public_channel` (for public channel analytics). + */ + type: 'public_channel'; +} +interface PublicChannelWithDate extends TypeChannel, Date { + /** + * @description Retrieve metadata for the `type` of analytics indicated. Can be used only with `type` set to + * `public_channel` analytics. Omit the date parameter when using this argument. Defaults to `false`. + * @see {@link https://api.slack.com/methods/admin.analytics.getFile#metadata_only Public channel metadata}. + */ + metadata_only?: false; +} +interface PublicChannelWithMetadata extends TypeChannel { + /** + * @description Retrieve metadata for the `type` of analytics indicated. Can be used only with `type` set to + * `public_channel` analytics. Omit the date parameter when using this argument. Defaults to `false`. + * @see {@link https://api.slack.com/methods/admin.analytics.getFile#metadata_only Public channel metadata}. + */ + metadata_only: true; +} +// when type=public_channel, either date must be provided, or metadata_only must be set to true, but not both +type PublicChannelArgs = PublicChannelWithDate | PublicChannelWithMetadata; + +// https://api.slack.com/methods/admin.analytics.getFile +export type AdminAnalyticsGetFileArguments = TokenOverridable & (MemberArgs | PublicChannelArgs); diff --git a/packages/web-api/src/types/request/admin/apps.ts b/packages/web-api/src/types/request/admin/apps.ts new file mode 100644 index 000000000..c8ca8dc59 --- /dev/null +++ b/packages/web-api/src/types/request/admin/apps.ts @@ -0,0 +1,96 @@ +import type { AppID, CursorPaginationEnabled, TokenOverridable } from '../common'; + +interface RequestID { + /** @description The id of the request. */ + request_id: string; +} +// Models either app_id or request_id - but not both. +type AppOrRequestID = (AppID & { request_id?: never; }) | (RequestID & { app_id?: never; }); +interface EnterpriseID { + /** @description The ID of the enterprise. */ + enterprise_id: string; +} +interface TeamID { + /** @description The ID of the workspace. */ + team_id: string; +} +// Models either enterprise_id or team_id - but not both. +type TeamOrEnterpriseID = (EnterpriseID & { team_id?: never; }) | (TeamID & { enterprise_id?: never }); +interface Certified { + /** + * @description Include certified apps. Defaults to `false`. + */ + certified?: boolean; +} + +// https://api.slack.com/methods/admin.apps.activities.list +export interface AdminAppsActivitiesListArguments extends Partial, Partial, TokenOverridable, + CursorPaginationEnabled { + /** + * @description The component ID of log events to be returned. Will be `FnXXXXXX` for functions, + * and `WfXXXXXX` for worflows. + */ + component_id?: string; + /** @description The component type of log events to be returned. */ + component_type?: 'events_api' | 'workflows' | 'functions' | 'tables'; + /** @description The event type of log events to be returned. */ + log_event_type?: string; + /** @description The latest timestamp of the log to retrieve (epoch microseconds). */ + max_date_created?: number; + /** @description The earliest timestamp of the log to retrieve (epoch microseconds). */ + min_date_created?: number; + /** @description The minimum log level of the log events to be returned. Defaults to `info`. */ + min_log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'; + /** @description The direction you want the data sorted by (always by timestamp). */ + sort_direction?: 'asc' | 'desc'; + /** @description The source of log events to be returned. */ + source?: 'slack' | 'developer'; + /** @description The trace ID of log events to be returned. */ + trace_id?: string; +} + +// https://api.slack.com/methods/admin.apps.approve +export type AdminAppsApproveArguments = AppOrRequestID & TeamOrEnterpriseID & TokenOverridable; + +// https://api.slack.com/methods/admin.apps.approved.list +export type AdminAppsApprovedListArguments = Partial & TokenOverridable & CursorPaginationEnabled +& Certified; + +// https://api.slack.com/methods/admin.apps.clearResolution +export type AdminAppsClearResolutionArguments = AppID & TeamOrEnterpriseID; + +// https://api.slack.com/methods/admin.apps.config.lookup +export interface AdminAppsConfigLookupArguments extends TokenOverridable { + /** @description An array of app IDs to get app configs for. */ + app_ids: string[]; +} + +// https://api.slack.com/methods/admin.apps.config.set +export interface AdminAppsConfigSetArguments extends AppID, TokenOverridable { + /** @description Domain restrictions for the app. */ + domain_restrictions?: { + /** @description Sets allowed URLs for the app. */ + urls?: string[]; + /** @description Sets emails for connector authorization. */ + emails?: string[]; + }; + /** @description The workflow auth permission. */ + workflow_auth_strategy?: 'builder_choice' | 'end_user_only'; +} + +// https://api.slack.com/methods/admin.apps.requests.cancel +export type AdminAppsRequestsCancelArguments = RequestID & TeamOrEnterpriseID & TokenOverridable; + +// https://api.slack.com/methods/admin.apps.requests.list +export type AdminAppsRequestsListArguments = TeamOrEnterpriseID & Certified & TokenOverridable +& CursorPaginationEnabled; + +// https://api.slack.com/methods/admin.apps.restrict +export type AdminAppsRestrictArguments = AppOrRequestID & TeamOrEnterpriseID & TokenOverridable; + +// https://api.slack.com/methods/admin.apps.restricted.list +export type AdminAppsRestrictedListArguments = TeamOrEnterpriseID & Certified & TokenOverridable +& CursorPaginationEnabled; + +// https://api.slack.com/methods/admin.apps.uninstall +export type AdminAppsUninstallArguments = AppID & TeamOrEnterpriseID; diff --git a/packages/web-api/src/types/request/admin/auth.ts b/packages/web-api/src/types/request/admin/auth.ts new file mode 100644 index 000000000..6291c1e44 --- /dev/null +++ b/packages/web-api/src/types/request/admin/auth.ts @@ -0,0 +1,24 @@ +import type { CursorPaginationEnabled, TokenOverridable } from '../common'; + +interface EntityIDs { + /** @description Encoded IDs of the entities interacting with. */ + entity_ids: string[]; +} +interface EntityType { + /** @description The type of entity interacting with the policy. */ + entity_type: 'USER'; +} +interface PolicyName { + /** @description The name of the policy. */ + policy_name: 'email_password'; +} + +// https://api.slack.com/methods/admin.auth.policy.assignEntities +export interface AdminAuthPolicyAssignEntitiesArguments extends EntityIDs, EntityType, PolicyName, TokenOverridable {} + +// https://api.slack.com/methods/admin.auth.policy.getEntities +export interface AdminAuthPolicyGetEntitiesArguments extends Partial, PolicyName, TokenOverridable, + CursorPaginationEnabled {} + +// https://api.slack.com/methods/admin.auth.policy.removeEntities +export interface AdminAuthPolicyRemoveEntitiesArguments extends EntityIDs, EntityType, PolicyName, TokenOverridable {} diff --git a/packages/web-api/src/types/request/admin/barriers.ts b/packages/web-api/src/types/request/admin/barriers.ts new file mode 100644 index 000000000..6b4b21cd3 --- /dev/null +++ b/packages/web-api/src/types/request/admin/barriers.ts @@ -0,0 +1,28 @@ +import type { CursorPaginationEnabled, TokenOverridable } from '../common'; + +interface BarrierID { + /** @description The ID of the barrier. */ + barrier_id: string; +} + +// https://api.slack.com/methods/admin.barriers.create +export interface AdminBarriersCreateArguments extends TokenOverridable { + /** @description A list of {@link https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org IDP Groups} IDs ti associate with the barrier. */ + barriered_from_usergroup_ids: string[]; + /** @description The ID of the primary {@link https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org IDP Group}. */ + primary_usergroup_id: string; + /** + * @description What kind of interactions are blocked by this barrier? + * Currently you must provide all three: `im`, `mpim`, `call`. + */ + restricted_subjects: ['im', 'mpim', 'call']; +} + +// https://api.slack.com/methods/admin.barriers.delete +export interface AdminBarriersDeleteArguments extends BarrierID, TokenOverridable {} + +// https://api.slack.com/methods/admin.barriers.list +export interface AdminBarriersListArguments extends TokenOverridable, CursorPaginationEnabled { } + +// https://api.slack.com/methods/admin.barriers.update +export interface AdminBarriersUpdateArguments extends AdminBarriersCreateArguments, BarrierID {} diff --git a/packages/web-api/src/types/request/admin/conversations.ts b/packages/web-api/src/types/request/admin/conversations.ts new file mode 100644 index 000000000..40796e908 --- /dev/null +++ b/packages/web-api/src/types/request/admin/conversations.ts @@ -0,0 +1,203 @@ +import type { ChannelIDs, CursorPaginationEnabled, SortDir, TokenOverridable, UserIDs } from '../common'; + +interface ChannelID { // an identical interface exists in src/types/request/conversations.ts, but it is only for invites + /** @description Encoded channel ID. */ + channel_id: string; +} + +type ChannelType = 'private' | 'private_exclude' | 'archived' | 'exclude_archived' | 'private_exclude_archived' | 'multi_workspace' | 'org_wide' | 'external_shared_exclude' | 'external_shared' | 'external_shared_private' | 'external_shared_archived' | 'exclude_org_shared'; + +interface GroupID { + /** @description The {@link https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org IDP Group} ID. */ + group_id: string; +} + +interface TeamIDs { + /** @description A list of team IDs to filter by (must include at least one ID). */ + team_ids: [string, ...string[]]; +} + +// Interface to extend from specifically for the retrictAccess.* APIs, as the JSDoc is relevant only to these APIs +interface RestrictAccessTeamID { + /** + * @description The workspace where the channel exists. This argument is required for channels only tied to + * one workspace, and optional for channels that are shared across an organization. + */ + team_id?: string; +} + +// https://api.slack.com/methods/admin.conversations.archive +export interface AdminConversationsArchiveArguments extends ChannelID, TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.bulkArchive +export interface AdminConversationsBulkArchiveArguments extends ChannelIDs, TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.bulkDelete +export interface AdminConversationsBulkDeleteArguments extends ChannelIDs, TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.bulkMove +export interface AdminConversationsBulkMoveArguments extends ChannelIDs, TokenOverridable { + /** @description Target team ID to move channels to. */ + target_team_id: string; +} + +// https://api.slack.com/methods/admin.conversations.convertToPrivate +export interface AdminConversationsConvertToPrivateArguments extends ChannelID, TokenOverridable { + /** @description Name of private channel to create. Only respected when converting an MPIM. */ + name?: string; +} + +// https://api.slack.com/methods/admin.conversations.convertToPublic +export interface AdminConversationsConvertToPublicArguments extends ChannelID, TokenOverridable {} + +interface OrgWide { + /** @description When `true`, the channel will be available org-wide. */ + org_wide: true; + team_id?: never; +} +interface SpecificTeam { + /** + * @description When `false` (the default), the channel will be available to only + * the workspace specified by `team_id`. + */ + org_wide?: false; + /** + * @description The workspace to create the channel in. This argument is required unless you set `org_wide` to `true`. + */ + team_id: string; +} +// When creating a channel, it can either be org wide or team specific, but not both +type WorkspaceAccess = OrgWide | SpecificTeam; + +// https://api.slack.com/methods/admin.conversations.create +export type AdminConversationsCreateArguments = TokenOverridable & WorkspaceAccess & { + /** @description When `true`, creates a private channel instead of a public channel. */ + is_private: boolean; + /** @description Name of the public or private channel to create. */ + name: string; + /** @description Description of the public or private channel to create. */ + description?: string; +}; + +// https://api.slack.com/methods/admin.conversations.delete +export interface AdminConversationsDeleteArguments extends ChannelID, TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.disconnectShared +export interface AdminConversationsDisconnectSharedArguments extends ChannelID, TokenOverridable { + /** @description Team IDs getting removed from the channel, optional if there are only two teams in the channel. */ + leaving_team_ids?: string[]; +} + +// https://api.slack.com/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo +export interface AdminConversationsEKMListOriginalConnectedChannelInfoArguments + extends Partial, TokenOverridable, CursorPaginationEnabled { + /** @description A comma-separated list of channels to filter to. */ + channel_ids?: string[]; +} + +// https://api.slack.com/methods/admin.conversations.getConversationPrefs +export interface AdminConversationsGetConversationPrefsArguments extends ChannelID, TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.getCustomRetention +export interface AdminConversationsGetCustomRetentionArguments extends ChannelID, TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.getTeams +export interface AdminConversationsGetTeamsArguments + extends ChannelID, TokenOverridable, CursorPaginationEnabled {} + +// https://api.slack.com/methods/admin.conversations.invite +export interface AdminConversationsInviteArguments extends ChannelID, UserIDs, TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.lookup +export interface AdminConversationsLookupArguments + extends TeamIDs, TokenOverridable, CursorPaginationEnabled { + /** + * @description UNIX timestamp to filter by public channels where the most recent message + * was sent before this parameter. + */ + last_message_activity_before: number; + /** @description Filter by public channels with member count equal to or less than the specified number. */ + max_member_count?: number; +} + +// https://api.slack.com/methods/admin.conversations.removeCustomRetention +export interface AdminConversationsRemoveCustomRetentionArguments extends ChannelID, TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.rename +export interface AdminConversationsRenameArguments extends ChannelID, TokenOverridable { + /** @description The new name for the channel. */ + name: string; +} + +// https://api.slack.com/methods/admin.conversations.restrictAccess.addGroup +export interface AdminConversationsRestrictAccessAddGroupArguments extends ChannelID, GroupID, + RestrictAccessTeamID, TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.restrictAccess.listGroups +export interface AdminConversationsRestrictAccessListGroupsArguments extends ChannelID, RestrictAccessTeamID, + TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.restrictAccess.removeGroup +export interface AdminConversationsRestrictAccessRemoveGroupArguments extends ChannelID, GroupID, + RestrictAccessTeamID, TokenOverridable {} + +// https://api.slack.com/methods/admin.conversations.search +export interface AdminConversationsSearchArguments + extends SortDir, Partial, TokenOverridable, CursorPaginationEnabled { + /** @description Array of encoded team IDs, signifying the external orgs to search through. */ + connected_team_ids?: string[]; + /** @description Name of the channel to query by. */ + query?: string; + /** + * @description The type of channels to include or exclude in the search. For example `private` will search + * private channels, while `private_exclude` will exclude them. + * @see {@link https://api.slack.com/methods/admin.conversations.search#types Full list of channel types}. + */ + search_channel_types?: ChannelType[]; + /** + * @description Possible values are: + * - `relevant`: search ranking based on what we think is closest, + * - `name`: alphabetical, + * - `member_count`: number of users in the channel, + * - `created`: date channel was created. + * Defaults to `member_count`. + * You can optionally pair this with the `sort_dir` argument to change how it is sorted. + */ + sort?: 'relevant' | 'name' | 'member_count' | 'created'; + /** + * @description Only return the total count of channels. + * Omits channel data and allows access for admins without channel manager permissions. Defaults to `false`. + */ + total_count_only?: boolean; +} + +// https://api.slack.com/methods/admin.conversations.setConversationPrefs +export interface AdminConversationsSetConversationPrefsArguments extends ChannelID, TokenOverridable { + /** @description The prefs for this channel. */ + prefs: Record; +} + +// https://api.slack.com/methods/admin.conversations.setCustomRetention +export interface AdminConversationsSetCustomRetentionArguments extends ChannelID, TokenOverridable { + /** @description The message retention duration in days to set for this conversation. */ + duration_days: number; +} + +// https://api.slack.com/methods/admin.conversations.setTeams +export interface AdminConversationsSetTeamsArguments extends ChannelID, TokenOverridable { + /** @description Set to `true` if channel has to be converted to an org channel. Defaults to `false`. */ + org_channel?: boolean; + /** + * @description A list of workspaces to which the channel should be shared. + * Not required if the channel is being shared org-wide. + */ + target_team_ids?: string[]; + /** + * @description The workspace to which the channel belongs. + * Omit this argument if the channel is a cross-workspace shared channel. + */ + team_id?: string; +} + +// https://api.slack.com/methods/admin.conversations.unarchive +export interface AdminConversationsUnarchiveArguments extends ChannelID, TokenOverridable {} diff --git a/packages/web-api/src/types/request/admin/emoji.ts b/packages/web-api/src/types/request/admin/emoji.ts new file mode 100644 index 000000000..c2cecd873 --- /dev/null +++ b/packages/web-api/src/types/request/admin/emoji.ts @@ -0,0 +1,39 @@ +import type { CursorPaginationEnabled, TokenOverridable } from '../common'; + +interface Name { + /** + * @description The name of the emoji. Colons (:myemoji:) around the value are not required, + * although they may be included. + */ + name: string; +} + +// https://api.slack.com/methods/admin.emoji.add +export interface AdminEmojiAddArguments extends Name, TokenOverridable { + /** + * @description The URL of a file to use as an image for the emoji. + * Square images under 128KB and with transparent backgrounds work best. + */ + url: string; +} + +// https://api.slack.com/methods/admin.emoji.addAlias +export interface AdminEmojiAddAliasArguments extends Name, TokenOverridable { + /** + * @description Name of the emoji for which the alias is being made. + * Any wrapping whitespace or colons will be automatically trimmed. + */ + alias_for: string; +} + +// https://api.slack.com/methods/admin.emoji.list +export interface AdminEmojiListArguments extends TokenOverridable, CursorPaginationEnabled {} + +// https://api.slack.com/methods/admin.emoji.remove +export interface AdminEmojiRemoveArguments extends Name, TokenOverridable {} + +// https://api.slack.com/methods/admin.emoji.rename +export interface AdminEmojiRenameArguments extends Name, TokenOverridable { + /** @description The new name of the emoji. */ + new_name: string; +} diff --git a/packages/web-api/src/types/request/admin/functions.ts b/packages/web-api/src/types/request/admin/functions.ts new file mode 100644 index 000000000..95d09bf62 --- /dev/null +++ b/packages/web-api/src/types/request/admin/functions.ts @@ -0,0 +1,26 @@ +import type { CursorPaginationEnabled, TokenOverridable } from '../common'; + +// https://api.slack.com/methods/admin.functions.list +export interface AdminFunctionsListArguments extends TokenOverridable, CursorPaginationEnabled { + /** @description Array of app IDs to get functions for; max 50. */ + app_ids: string[]; + /** @description The team context to retrieve functions from. */ + team_id?: string; +} + +// https://api.slack.com/methods/admin.functions.permissions.lookup +export interface AdminFunctionsPermissionsLookupArguments + extends TokenOverridable { + /** @description An array of function IDs to get permissions for. */ + function_ids: [string, ...string[]]; +} + +// https://api.slack.com/methods/admin.functions.permissions.set +export interface AdminFunctionsPermissionsSetArguments extends TokenOverridable { + /** @description The function ID to set permissions for. */ + function_id: string; + /** @description The function visibility. */ + visibility: 'everyone' | 'app_collaborators' | 'named_entities' | 'no_one'; + /** @description List of user IDs to allow for `named_entities` visibility. */ + user_ids?: string[]; +} diff --git a/packages/web-api/src/types/request/admin/inviteRequests.ts b/packages/web-api/src/types/request/admin/inviteRequests.ts new file mode 100644 index 000000000..9ed4c5e86 --- /dev/null +++ b/packages/web-api/src/types/request/admin/inviteRequests.ts @@ -0,0 +1,26 @@ +import type { CursorPaginationEnabled, OptionalTeamAssignable, TokenOverridable } from '../common'; + +interface InviteRequestID { + /** @description ID of the request to invite. */ + invite_request_id: string; +} + +// https://api.slack.com/methods/admin.inviteRequests.approve +export interface AdminInviteRequestsApproveArguments extends InviteRequestID, Required, + TokenOverridable {} + +// https://api.slack.com/methods/admin.inviteRequests.approved.list +export interface AdminInviteRequestsApprovedListArguments extends Required, TokenOverridable, + CursorPaginationEnabled {} + +// https://api.slack.com/methods/admin.inviteRequests.denied.list +export interface AdminInviteRequestsDeniedListArguments extends Required, TokenOverridable, + CursorPaginationEnabled {} + +// https://api.slack.com/methods/admin.inviteRequests.deny +export interface AdminInviteRequestsDenyArguments extends InviteRequestID, Required, + TokenOverridable {} + +// https://api.slack.com/methods/admin.inviteRequests.list +export interface AdminInviteRequestsListArguments extends Required, TokenOverridable, + CursorPaginationEnabled {} diff --git a/packages/web-api/src/types/request/admin/roles.ts b/packages/web-api/src/types/request/admin/roles.ts new file mode 100644 index 000000000..5b53b7b57 --- /dev/null +++ b/packages/web-api/src/types/request/admin/roles.ts @@ -0,0 +1,33 @@ +import type { CursorPaginationEnabled, SortDir, TokenOverridable, UserIDs } from '../common'; + +interface EntityIDs { + /** + * @description List of the entity IDs for which roles will be assigned/listed/removed. + * These can be Org IDs (E12345), Team IDs (T12345) or Channel IDs (C12345). + */ + entity_ids: [string, ...string[]]; +} + +interface RoleID { + /** + * @description ID of the role to which users will be assigned/removed. + * @see {@link https://api.slack.com/methods/admin.roles.addAssignments#markdown Admin Roles under Usage info}. + */ + role_id: string; +} + +// https://api.slack.com/methods/admin.roles.addAssignments +export interface AdminRolesAddAssignmentsArguments extends EntityIDs, RoleID, UserIDs, TokenOverridable {} + +// https://api.slack.com/methods/admin.roles.listAssignments +export interface AdminRolesListAssignmentsArguments extends Partial, TokenOverridable, + CursorPaginationEnabled, SortDir { + /** + * @description Collection of role ids to scope results by. + * @see {@link https://api.slack.com/methods/admin.roles.addAssignments#markdown Admin Roles under Usage info}. + */ + role_ids?: string[]; +} + +// https://api.slack.com/methods/admin.roles.removeAssignments +export interface AdminRolesRemoveAssignmentsArguments extends EntityIDs, RoleID, UserIDs, TokenOverridable {} diff --git a/packages/web-api/src/types/request/admin/teams.ts b/packages/web-api/src/types/request/admin/teams.ts new file mode 100644 index 000000000..6cdd3b8b9 --- /dev/null +++ b/packages/web-api/src/types/request/admin/teams.ts @@ -0,0 +1,54 @@ +import type { ChannelIDs, CursorPaginationEnabled, TeamID, TokenOverridable } from '../common'; + +type TeamDiscoverability = 'open' | 'closed' | 'invite_only' | 'unlisted'; + +// https://api.slack.com/methods/admin.teams.admins.list +export interface AdminTeamsAdminsListArguments extends TeamID, TokenOverridable, CursorPaginationEnabled {} + +// https://api.slack.com/methods/admin.teams.create +export interface AdminTeamsCreateArguments extends TokenOverridable { + /** @description Team domain (for example, slacksoftballteam). Domains are limited to 21 characters. */ + team_domain: string; + /** @description Team name (for example, Slack Softball Team). */ + team_name: string; + /** @description Description for the team. */ + team_description?: string; + /** @description Who can join the team. */ + team_discoverability?: TeamDiscoverability; +} + +// https://api.slack.com/methods/admin.teams.list +export interface AdminTeamsListArguments extends TokenOverridable, CursorPaginationEnabled {} + +// https://api.slack.com/methods/admin.teams.owners.list +export interface AdminTeamsOwnersListArguments extends TeamID, TokenOverridable, CursorPaginationEnabled {} + +// https://api.slack.com/methods/admin.teams.settings.info +export interface AdminTeamsSettingsInfoArguments extends TeamID, TokenOverridable {} + +// https://api.slack.com/methods/admin.teams.settings.setDefaultChannels +export interface AdminTeamsSettingsSetDefaultChannelsArguments extends ChannelIDs, TeamID, TokenOverridable {} + +// https://api.slack.com/methods/admin.teams.settings.setDescription +export interface AdminTeamsSettingsSetDescriptionArguments extends TeamID, TokenOverridable { + /** @description The new description for the workspace. */ + description: string; +} + +// https://api.slack.com/methods/admin.teams.settings.setDiscoverability +export interface AdminTeamsSettingsSetDiscoverabilityArguments extends TeamID, TokenOverridable { + /** @description This workspace's discovery setting. */ + discoverability: TeamDiscoverability; +} + +// https://api.slack.com/methods/admin.teams.settings.setIcon +export interface AdminTeamsSettingsSetIconArguments extends TeamID, TokenOverridable { + /** @description Image URL for the icon. */ + image_url: string; +} + +// https://api.slack.com/methods/admin.teams.settings.setName +export interface AdminTeamsSettingsSetNameArguments extends TeamID, TokenOverridable { + /** @description The new name of the workspace. */ + name: string; +} diff --git a/packages/web-api/src/types/request/admin/usergroups.ts b/packages/web-api/src/types/request/admin/usergroups.ts new file mode 100644 index 000000000..b424dea54 --- /dev/null +++ b/packages/web-api/src/types/request/admin/usergroups.ts @@ -0,0 +1,38 @@ +import type { OptionalTeamAssignable, TokenOverridable } from '../common'; + +interface ChannelIDs { + /** @description One or more encoded channel IDs. */ + channel_ids: string | string[]; +} + +interface UsergroupID { + /** @description ID of the IDP group to list/manage channels for. */ + usergroup_id: string; +} + +// https://api.slack.com/methods/admin.usergroups.addChannels +export interface AdminUsergroupsAddChannelsArguments extends ChannelIDs, UsergroupID, OptionalTeamAssignable, + TokenOverridable {} + +// https://api.slack.com/methods/admin.usergroups.addTeams +export interface AdminUsergroupsAddTeamsArguments extends UsergroupID, TokenOverridable { + /** + * @description One or more encoded team (workspace) IDs. + * Each workspace MUST belong to the organization associated with the token. + */ + team_ids: string | string[]; + /** + * @description When `true`, this method automatically creates new workspace accounts for the IDP group members. + * Defaults to `false`. + */ + auto_provision?: boolean; +} + +// https://api.slack.com/methods/admin.usergroups.listChannels +export interface AdminUsergroupsListChannelsArguments extends UsergroupID, OptionalTeamAssignable, TokenOverridable { + /** @description Flag to include or exclude the count of members per channel. */ + include_num_members?: boolean; +} + +// https://api.slack.com/methods/admin.usergroups.removeChannels +export interface AdminUsergroupsRemoveChannelsArguments extends ChannelIDs, UsergroupID, TokenOverridable {} diff --git a/packages/web-api/src/types/request/admin/users.ts b/packages/web-api/src/types/request/admin/users.ts new file mode 100644 index 000000000..cc017f6dd --- /dev/null +++ b/packages/web-api/src/types/request/admin/users.ts @@ -0,0 +1,149 @@ +import type { ChannelIDs, CursorPaginationEnabled, OptionalTeamAssignable, TeamID, TokenOverridable, UserIDs } from '../common'; + +interface UserID { + /** @description The ID of the user. */ + user_id: string; +} + +interface IsRestricted { + /** @description Set to `true` if user should be added to the workspace as a guest. */ + is_restricted?: boolean; +} + +interface IsUltraRestricted { + /** @description Set to `true` if user should be added to the workspace as a guest. */ + is_ultra_restricted?: boolean; +} + +interface SessionExpirationTarget { + /** @description Only expire mobile sessions. Defaults to `false`. */ + mobile_only?: boolean; + /** @description Only expire web sessions. Defaults to `false`. */ + web_only?: boolean; +} + +interface TeamIDWithoutDeactivatedWorkspaces extends TeamID { + include_deactivated_user_workspaces?: false; +} +interface DeactivatedWorkspacesWithoutTeamID { + team_id?: never; + /** + * @description Only applies when using an org token and when no `team_id` is provided. If `true`, return workspaces + * for a user even if they may be deactivated on them. If `false`, return workspaces for a user only when user is + * active on them. Default is `false`. + */ + include_deactivated_user_workspaces?: true; +} +// `admin.users.list` accepts either a team_id, or include_deactivated_user_workspaces=true, but not both +type TeamIDOrDeactivatedWorkspaces = TeamIDWithoutDeactivatedWorkspaces | DeactivatedWorkspacesWithoutTeamID; + +interface BothTeamAndUserID extends TeamID, UserID {} +interface NeitherTeamNorUserID { + team_id?: never; + user_id?: never; +} +// `admin.users.session.list` accepts either BOTH team_id+user_id, or neither +type EitherTeamAndUserIDOrNeither = BothTeamAndUserID | NeitherTeamNorUserID; + +// https://api.slack.com/methods/admin.users.assign +export interface AdminUsersAssignArguments extends TeamID, UserID, Partial, IsRestricted, + IsUltraRestricted, TokenOverridable {} + +// https://api.slack.com/methods/admin.users.invite +export interface AdminUsersInviteArguments extends ChannelIDs, TeamID, IsRestricted, IsUltraRestricted, + TokenOverridable { + /** @description The email address of the person to invite. */ + email: string; + /** @description An optional message to send to the user in the invite email. */ + custom_message?: string; + /** + * @description Allow invited user to sign in via email and password. Only available for Enterprise Grid teams via + * admin invite. + */ + email_password_policy_enabled?: boolean; + /** + * @description Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a + * guest user and you want their account to expire on a certain date. + */ + guest_expiration_ts?: string; + /** @description Full name of the user. */ + real_name?: string; + /** + * @description Allow this invite to be resent in the future if a user has not signed up yet. + * Resending can only be done via the UI and has no expiration. Defaults to `false`. + */ + resend?: boolean; +} + +// https://api.slack.com/methods/admin.users.list +export type AdminUsersListArguments = TeamIDOrDeactivatedWorkspaces & TokenOverridable & CursorPaginationEnabled & { + /** + * @description If `true`, only active users will be returned. If `false`, only deactivated users will be returned. + * Default is `true`. + */ + is_active?: boolean; +}; + +// https://api.slack.com/methods/admin.users.remove +export interface AdminUsersRemoveArguments extends TeamID, UserID, TokenOverridable {} + +// https://api.slack.com/methods/admin.users.session.clearSettings +export interface AdminUsersSessionClearSettingsArguments extends UserIDs, TokenOverridable {} + +// https://api.slack.com/methods/admin.users.session.getSettings +export interface AdminUsersSessionGetSettingsArguments extends UserIDs, TokenOverridable {} + +// https://api.slack.com/methods/admin.users.session.invalidate +export interface AdminUsersSessionInvalidateArguments extends TeamID, TokenOverridable { + /** @description ID of the session to invalidate. */ + session_id: string; +} + +// https://api.slack.com/methods/admin.users.session.list +export type AdminUsersSessionListArguments = EitherTeamAndUserIDOrNeither & TokenOverridable & CursorPaginationEnabled; + +// https://api.slack.com/methods/admin.users.session.reset +export interface AdminUsersSessionResetArguments extends UserID, SessionExpirationTarget, TokenOverridable {} + +// https://api.slack.com/methods/admin.users.session.resetBulk +export interface AdminUsersSessionResetBulkArguments extends UserIDs, SessionExpirationTarget, TokenOverridable {} + +// https://api.slack.com/methods/admin.users.session.setSettings +export interface AdminUsersSessionSetSettingsArguments extends UserIDs, TokenOverridable { + /** @description Terminate the session when the client—either the desktop app or a browser window—is closed. */ + desktop_app_browser_quit?: boolean; + /** + * @description The session duration in seconds. The minimum value is 28800, which represents 8 hours; + * the max value is 315569520 or 10 years (that's a long Slack session). + */ + duration?: number; +} + +// https://api.slack.com/methods/admin.users.setAdmin +export interface AdminUsersSetAdminArguments extends TeamID, UserID, TokenOverridable {} + +// https://api.slack.com/methods/admin.users.setExpiration +export interface AdminUsersSetExpirationArguments extends UserID, TokenOverridable, OptionalTeamAssignable { + /** @description Epoch timestamp in seconds when guest account should be disabled. */ + expiration_ts: number; +} + +// https://api.slack.com/methods/admin.users.setOwner +export interface AdminUsersSetOwnerArguments extends TeamID, UserID, TokenOverridable {} + +// https://api.slack.com/methods/admin.users.setRegular +export interface AdminUsersSetRegularArguments extends TeamID, UserID, TokenOverridable {} + +// https://api.slack.com/methods/admin.users.unsupportedVersions.export +export interface AdminUsersUnsupportedVersionsExportArguments extends TokenOverridable { + /** + * @description Unix timestamp of the date of past or upcoming end of support cycles. + * If not provided will include all announced end of support cycles. Defaults to `0`. + */ + date_end_of_support?: number; + /** + * @description Unix timestamp of a date to start looking for user sessions. + * If not provided will start six months ago. + */ + date_sessions_started?: number; +} diff --git a/packages/web-api/src/types/request/admin/workflows.ts b/packages/web-api/src/types/request/admin/workflows.ts new file mode 100644 index 000000000..c7cabb9c4 --- /dev/null +++ b/packages/web-api/src/types/request/admin/workflows.ts @@ -0,0 +1,44 @@ +import type { AppID, CursorPaginationEnabled, SortDir, TokenOverridable } from '../common'; + +interface CollaboratorIDs { + /** @description Array of collaborators (encoded user IDs) - maximum of 50 items. */ + collaborator_ids: [string, ...string[]]; +} + +interface WorkflowIDs { + /** @description Array of workflow IDs - maximum of 50 items. */ + workflow_ids: [string, ...string[]]; +} + +// https://api.slack.com/methods/admin.workflows.collaborators.add +export interface AdminWorkflowsCollaboratorsAddArguments extends CollaboratorIDs, WorkflowIDs, TokenOverridable {} + +// https://api.slack.com/methods/admin.workflows.collaborators.remove +export interface AdminWorkflowsCollaboratorsRemoveArguments extends CollaboratorIDs, WorkflowIDs, TokenOverridable {} + +// https://api.slack.com/methods/admin.workflows.permissions.lookup +export interface AdminWorkflowsPermissionsLookupArguments extends WorkflowIDs, TokenOverridable { + /** + * @description Maximum number of triggers to fetch for each workflow when determining overall run permissions. + * Defaults to `100`. Maximum of `1000`. + */ + max_workflow_triggers?: number; +} + +// https://api.slack.com/methods/admin.workflows.search +export interface AdminWorkflowsSearchArguments extends Partial, Partial, SortDir, + TokenOverridable, CursorPaginationEnabled { + /** @description Only include workflows with no collaborators in the result; default is `false`. */ + no_collaborators?: boolean; + /** @description Number of trigger IDs to fetch for each workflow; default is `0`. */ + num_trigger_ids?: number; + /** @description A search query to filter for workflow name or description. */ + query?: string; + /** @description The field used to sort the returned workflows. Currently only `premium_runs` is supported. */ + sort?: 'premium_runs'; + /** @description Source of workflow creation, either from `code` or `workflow_builder`. */ + source?: 'code' | 'workflow_builder'; +} + +// https://api.slack.com/methods/admin.workflows.unpublish +export interface AdminWorkflowsUnpublishArguments extends WorkflowIDs, TokenOverridable {} diff --git a/packages/web-api/src/types/request/api.ts b/packages/web-api/src/types/request/api.ts new file mode 100644 index 000000000..709e2f211 --- /dev/null +++ b/packages/web-api/src/types/request/api.ts @@ -0,0 +1,5 @@ +// https://api.slack.com/methods/api.test +export interface APITestArguments { + /** @description Error response to return. */ + error?: string; +} diff --git a/packages/web-api/src/types/request/apps.ts b/packages/web-api/src/types/request/apps.ts new file mode 100644 index 000000000..2e8d80a55 --- /dev/null +++ b/packages/web-api/src/types/request/apps.ts @@ -0,0 +1,35 @@ +import type { AppID, CursorPaginationEnabled, TokenOverridable, OAuthCredentials } from './common'; +import type { Manifest } from './manifest'; + +// https://api.slack.com/methods/apps.connections.open +export interface AppsConnectionsOpenArguments { } + +// https://api.slack.com/methods/apps.event.authorizations.list +export interface AppsEventAuthorizationsListArguments + extends TokenOverridable, CursorPaginationEnabled { + event_context: string; +} + +// https://api.slack.com/methods/apps.manifest.create +export interface AppsManifestCreateArguments extends TokenOverridable { + manifest: Manifest; +} + +// https://api.slack.com/methods/apps.manifest.delete +export interface AppsManifestDeleteArguments extends AppID, TokenOverridable {} + +// https://api.slack.com/methods/apps.manifest.export +export interface AppsManifestExportArguments extends AppID, TokenOverridable {} + +// https://api.slack.com/methods/apps.manifest.update +export interface AppsManifestUpdateArguments extends AppID, TokenOverridable { + manifest: Manifest; +} + +// https://api.slack.com/methods/apps.manifest.validate +export interface AppsManifestValidateArguments extends Partial, TokenOverridable { + manifest: Manifest; +} + +// https://api.slack.com/methods/apps.uninstall +export interface AppsUninstallArguments extends Pick {} diff --git a/packages/web-api/src/types/request/auth.ts b/packages/web-api/src/types/request/auth.ts new file mode 100644 index 000000000..3da060665 --- /dev/null +++ b/packages/web-api/src/types/request/auth.ts @@ -0,0 +1,23 @@ +import type { CursorPaginationEnabled, TokenOverridable } from './common'; + +// https://api.slack.com/methods/auth.revoke +export interface AuthRevokeArguments extends TokenOverridable { + /** + * @description Setting this parameter to `true` triggers a testing mode where the specified token + * will not actually be revoked. + */ + test?: boolean; +} + +// https://api.slack.com/methods/auth.teams.list +export interface AuthTeamsListArguments extends TokenOverridable, CursorPaginationEnabled { + /** + * @description Whether to return icon paths for each workspace. + * An icon path represents a URI pointing to the image signifying the workspace. + * Defaults to `false`. + */ + include_icon?: boolean; +} + +// https://api.slack.com/methods/auth.test +export interface AuthTestArguments extends TokenOverridable { } diff --git a/packages/web-api/src/types/request/bookmarks.ts b/packages/web-api/src/types/request/bookmarks.ts new file mode 100644 index 000000000..d3a0ef984 --- /dev/null +++ b/packages/web-api/src/types/request/bookmarks.ts @@ -0,0 +1,35 @@ +import type { TokenOverridable } from './common'; + +interface Channel { + /** @description Channel containing bookmark. */ + channel_id: string; +} +interface ID { + bookmark_id: string; +} +interface BookmarkFields { + /** @description Title for the bookmark. */ + title: string; + /** @description Link to bookmark. */ + link: string; + /** @description Emoji tag to apply to the bookmark. */ + emoji?: string; +} + +// https://api.slack.com/methods/bookmarks.add +export interface BookmarksAddArguments extends Channel, BookmarkFields, TokenOverridable { + /** @description Type of the bookmark. Only `link` is supported at the moment. */ + type: 'link'; + /** @description ID of the entity being bookmarked. Only applies to message and file types. */ + entity_id?: string; + /** @description ID of this bookmark's parent. */ + parent_id?: string; +} +// https://api.slack.com/methods/bookmarks.edit +export interface BookmarksEditArguments extends Channel, ID, Partial, TokenOverridable {} + +// https://api.slack.com/methods/bookmarks.list +export interface BookmarksListArguments extends Channel, TokenOverridable {} + +// https://api.slack.com/methods/bookmarks.remove +export interface BookmarksRemoveArguments extends Channel, ID, TokenOverridable {} diff --git a/packages/web-api/src/types/request/bots.ts b/packages/web-api/src/types/request/bots.ts new file mode 100644 index 000000000..84f58240d --- /dev/null +++ b/packages/web-api/src/types/request/bots.ts @@ -0,0 +1,7 @@ +import type { OptionalTeamAssignable, TokenOverridable } from './common'; + +// https://api.slack.com/methods/bots.info +export interface BotsInfoArguments extends TokenOverridable, OptionalTeamAssignable { + /** @description Bot ID, which starts with 'B', to retrieve information about. */ + bot?: string; +} diff --git a/packages/web-api/src/types/request/calls.ts b/packages/web-api/src/types/request/calls.ts new file mode 100644 index 000000000..d388a8420 --- /dev/null +++ b/packages/web-api/src/types/request/calls.ts @@ -0,0 +1,63 @@ +import type { CallUser } from '@slack/types'; +import type { TokenOverridable } from './common'; + +interface ID { + /** @description `id` returned when registering the call using the `calls.add` method. */ + id: string; +} +interface Users { + /** + * @description The list of users to add/remove to/from the Call. + * @see {@link https://api.slack.com/apis/calls#users Using the Calls API: a note on Users}. + */ + users: CallUser[]; +} +interface CallDetails { + /** @description The URL required for a client to join the Call. */ + join_url: string; + /** + * @description When supplied, available Slack clients will attempt to directly launch the 3rd-party Call + * with this URL. + */ + desktop_app_join_url?: string; + /** @description The name of the Call. */ + title?: string; +} + +// https://api.slack.com/methods/calls.add +export interface CallsAddArguments extends Partial, CallDetails, TokenOverridable { + /** + * @description An ID supplied by the 3rd-party Call provider. It must be unique across all Calls from that service. + */ + external_unique_id: string; + /** + * @description ID of the user who created this Call. When this method is called with a user token, + * this field is optional and defaults to the authed user of the token. Otherwise, the field is required. + */ + created_by?: string; + /** @description Unix timestamp of the call start time. */ + date_start?: number; + /** + * @description An optional, human-readable ID supplied by the 3rd-party Call provider. + * If supplied, this ID will be displayed in the Call object. + */ + external_display_id?: string; +} + +// https://api.slack.com/methods/calls.end +export interface CallsEndArguments extends ID, TokenOverridable { + /** @description Call duration in seconds. */ + duration?: number; +} + +// https://api.slack.com/methods/calls.info +export interface CallsInfoArguments extends ID, TokenOverridable {} + +// https://api.slack.com/methods/calls.update +export interface CallsUpdateArguments extends ID, Partial, TokenOverridable {} + +// https://api.slack.com/methods/calls.participants.add +export interface CallsParticipantsAddArguments extends ID, Users, TokenOverridable {} + +// https://api.slack.com/methods/calls.participants.remove +export interface CallsParticipantsRemoveArguments extends ID, Users, TokenOverridable {} diff --git a/packages/web-api/src/types/request/chat.ts b/packages/web-api/src/types/request/chat.ts new file mode 100644 index 000000000..623e67b36 --- /dev/null +++ b/packages/web-api/src/types/request/chat.ts @@ -0,0 +1,227 @@ +import type { KnownBlock, Block, MessageAttachment, LinkUnfurls, MessageMetadata } from '@slack/types'; +import type { CursorPaginationEnabled, OptionalTeamAssignable, TimelinePaginationEnabled, TokenOverridable } from './common'; + +interface Channel { + /** @description Channel ID for the message. */ + channel: string; +} +interface ChannelAndTS extends Channel { + /** @description Timestamp of the message. */ + ts: string; +} +interface ChannelAndMessageTS extends Channel { + /** @description Timestamp of the message. */ + message_ts: string; +} +interface AsUser { + /** + * @description Pass `true` to act as the authed user with {@link https://api.slack.com/scopes/chat:write:user `chat:write:user` scope}. + * Bot users in this context are considered authed users. If unused or `false`, the message will be acted upon with + * {@link https://api.slack.com/scopes/chat:write:bot `chat:write:bot` scope}. + */ + as_user?: boolean; +} +interface LinkNames { + /** @description Find and link channel names and usernames. */ + link_names?: boolean; +} +interface Parse { + /** + * @description Change how messages are treated. Defaults to `none`. + * @see {@link https://api.slack.com/reference/surfaces/formatting#automatic-parsing Formatting: Automatic parsing}. + */ + parse?: 'full' | 'none'; +} +interface Text { + /** + * @description Text of the message. If used in conjunction with `blocks` or `attachments`, `text` will be used + * as fallback text for notifications only. + */ + text: string; +} +interface ChannelAndText extends Channel, Text {} +interface ChannelAndBlocks extends Channel, Partial { + /** + * @description An array of structured Blocks. + * @see {@link https://api.slack.com/reference/block-kit/blocks Blocks reference}. + */ + blocks: (KnownBlock | Block)[]; +} +interface ChannelAndAttachments extends Channel, Partial { + /** + * @description An array of structured attachments. + * @see {@link https://api.slack.com/messaging/composing/layouts#attachments Adding secondary attachments}. + */ + attachments: MessageAttachment[]; +} +// Models message-creation arguments, user must provide one of the following combinations: +// 1. channel and text +// 2. channel and blocks +// 3. channel and attachments +type MessageContents = ChannelAndText | ChannelAndBlocks | ChannelAndAttachments; +interface ThreadTS { + /** + * @description Provide another message's `ts` value to post this message in a thread. Avoid using a reply's `ts` + * value; use its parent's value instead. + */ + thread_ts: string; +} +interface WithinThreadReply extends Partial { + /** + * @description Used in conjunction with `thread_ts`, when set to `false` will make the reply only visibile within + * a thread. + */ + reply_broadcast?: false; +} +interface BroadcastedThreadReply extends ThreadTS { + /** @description Used in conjunction with `thread_ts`, when set to `true` will broadcast the reply to the channel. */ + reply_broadcast: true; +} +// For APIs supporting `reply_broadcast`, there are two options: either a broadcasted threaded reply, +// or not broadcasted. Broadcasted replies are necessarily threaded, so `thread_ts` becomes required. +type ReplyInThread = WithinThreadReply | BroadcastedThreadReply; + +interface Metadata { + /** @description Object representing message metadata, which will be made accessible to any user or app. */ + metadata?: MessageMetadata; +} +interface IconEmoji { + as_user?: false; + icon_url?: never; + /** + * @description Emoji to use as the icon for this message. Overrides `icon_url`. + * Can only be used with `as_user` set to `false`. + */ + icon_emoji?: string; +} +interface IconURL { + as_user?: false; + icon_emoji?: never; + /** + * @description URL to an image to use as the icon for this message. `icon_emoji` takes precendence over this field. + * Can only be used with `as_user` set to `false`. + */ + icon_url?: string; +} +// Can only specify message icon via predefined authorship using one of emoji or URL, but not both. +type Icon = IconEmoji | IconURL; +interface Username { + as_user?: false; + /** @description Set your bot's username. Can only be used with `as_user` set to `false`. */ + username?: string; +} +// This union keys on as_user: if it is undefined or false, then the Icon and Username types should be available +// and adhered to. Otherwise if true, then no icon or username fields should be available. +type Authorship = (Icon & Username) | { + /** + * @description Pass `true` to act as the authed user with {@link https://api.slack.com/scopes/chat:write:user `chat:write:user` scope}. + * Bot users in this context are considered authed users. If unused or `false`, the message will be acted upon with + * {@link https://api.slack.com/scopes/chat:write:bot `chat:write:bot` scope}. + */ + as_user: true; + icon_emoji?: never; + icon_url?: never; +}; +interface Unfurls { + /** @description Pass `true` to enable unfurling of primarily text-based content. */ + unfurl_links?: boolean; + /** @description Pass `false` to disable unfurling of media content. */ + unfurl_media?: boolean; +} + +// https://api.slack.com/methods/chat.delete +export interface ChatDeleteArguments extends ChannelAndTS, AsUser, TokenOverridable {} + +// https://api.slack.com/methods/chat.deleteScheduledMessage +export interface ChatDeleteScheduledMessageArguments extends Channel, AsUser, TokenOverridable { + /** @description The `scheduled_message_id` returned from call to {@link https://api.slack.com/methods/chat.scheduleMessage `chat.scheduleMessage`}. */ + scheduled_message_id: string; +} + +// https://api.slack.com/methods/chat.getPermalink +export interface ChatGetPermalinkArguments extends ChannelAndMessageTS, TokenOverridable {} + +// https://api.slack.com/methods/chat.meMessage +export interface ChatMeMessageArguments extends ChannelAndText, TokenOverridable {} + +// https://api.slack.com/methods/chat.postEphemeral +export type ChatPostEphemeralArguments = TokenOverridable & MessageContents & { + /** + * @description `id` of the user who will receive the ephemeral message. + * The user should be in the channel specified by the `channel` argument. + */ + user: string; +} & Authorship & Parse & LinkNames & Partial; + +// https://api.slack.com/methods/chat.postMessage +export type ChatPostMessageArguments = TokenOverridable & MessageContents & ReplyInThread & Authorship & Parse +& LinkNames & Metadata & Unfurls & { + /** @description Disable Slack markup parsing by setting to `false`. Enabled by default. */ + mrkdwn?: boolean; +}; + +// https://api.slack.com/methods/chat.scheduleMessage +export type ChatScheduleMessageArguments = TokenOverridable & MessageContents & { + /** @description Unix EPOCH timestamp of time in future to send the message. */ + post_at: string | number; +} & ReplyInThread & Parse & LinkNames & AsUser & Metadata & Unfurls; + +// https://api.slack.com/methods/chat.scheduledMessages.list +export interface ChatScheduledMessagesListArguments extends TokenOverridable, CursorPaginationEnabled, + OptionalTeamAssignable, Pick, Partial {} + +interface SourceAndUnfurlID { + /** + * @description The source of the link to unfurl. The source may either be `composer`, when the link is inside the + * message composer, or `conversations_history`, when the link has been posted to a conversation. + */ + source: 'composer' | 'conversations_history'; + /** + * @description The ID of the link to unfurl. Both `unfurl_id` and `source` must be provided together, or `channel` + * and `ts` must be provided together. + */ + unfurl_id: string; +} +type UnfurlTarget = ChannelAndTS | SourceAndUnfurlID; + +// https://api.slack.com/methods/chat.unfurl +export type ChatUnfurlArguments = { + /** + * @description URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl + * blocks or message attachments. + */ + unfurls: LinkUnfurls; +} & UnfurlTarget & TokenOverridable +& { + /** + * @description Provide a simply-formatted string to send as an ephemeral message to the user as invitation to + * authenticate further and enable full unfurling behavior. Provides two buttons, Not now or Never ask me again. + */ + user_auth_message?: string; + /** + * @description Set to `true` to indicate the user must install your Slack app to trigger unfurls for this domain. + * Defaults to `false`. + */ + user_auth_required?: boolean; + /** + * @description Send users to this custom URL where they will complete authentication in your app to fully trigger + * unfurling. Value should be properly URL-encoded. + */ + user_auth_url?: string; + /** + * @description Provide a JSON based array of structured blocks presented as URL-encoded string to send as an + * ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. + */ + user_auth_blocks?: (KnownBlock | Block)[]; +}; + +// https://api.slack.com/methods/chat.update +export type ChatUpdateArguments = MessageContents & { + /** @description Timestamp of the message to be updated. */ + ts: string; +} & TokenOverridable & AsUser & LinkNames & Metadata & Parse & { + /** @description Array of new file ids that will be sent with this message. */ + file_ids?: string[]; + /** @description Broadcast an existing thread reply to make it visible to everyone in the channel or conversation. */ + reply_broadcast?: boolean; +}; diff --git a/packages/web-api/src/types/request/common.ts b/packages/web-api/src/types/request/common.ts new file mode 100644 index 000000000..6ae527a59 --- /dev/null +++ b/packages/web-api/src/types/request/common.ts @@ -0,0 +1,138 @@ +// Reusable mixins or extensions that Method Arguments types can extend from + +// Cursor, timeline and traditional pagination extensions. +export interface CursorPaginationEnabled { + /** + * @description The maximum number of items to return. Fewer than the requested number of items may be returned, + * even if the end of the list hasn't been reached. Must be an integer with a max value of `999`. Default is `100`. + */ + limit?: number; + /** + * @description Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute + * returned by a previous request's `response_metadata`. + * Default value fetches the first "page" of the collection. + * @see {@link https://api.slack.com/docs/pagination pagination} for more detail. + */ + cursor?: string; +} + +export interface TimelinePaginationEnabled { + /** @description Only messages after this Unix timestamp will be included in results. */ + oldest?: string; + /** @description Only messages before this Unix timestamp will be included in results. */ + latest?: string; + /** + * @description Include messages with `oldest` or `latest` timestamps in results. + * Ignored unless either timestamp is specified. Defaults to `false`. + */ + inclusive?: boolean; +} + +export interface TraditionalPagingEnabled { + /** @description Number of items to return per page. Defaults to `20` */ + count?: number; + /** @description Page number of results to return. Defaults to `1`. */ + page?: number; +} + +/** + * Some API methods allow for overriding the auth token used with a method at runtime. + */ +export interface TokenOverridable { + /** @description Overridable authentication token bearing required scopes. */ + token?: string; +} + +/** + * Some API methods allow to receive the locale of the content. + */ +export interface LocaleAware { + /** @description Set this to `true` to receive the locale with the response. */ + include_locale?: boolean; +} + +/** + * Some API methods take a `team_id` - different interfaces here so that we can provide a different JSDoc. + */ + +export interface TeamID { + /** @description The encoded team ID. */ + team_id: string; +} + +export interface OptionalTeamAssignable { + /** @description If using an org token, `team_id` is required. */ + team_id?: string; +} + +// Some APIs (admin.teams.settings.setDefaultChannels, admin.conversations.*) require a minimum-1-item channel array + +export interface ChannelIDs { + /** @description An array of channel IDs (must include at least one ID). */ + channel_ids: [string, ...string[]]; +} + +// Same for user IDs + +export interface UserIDs { + /** @description List of encoded user IDs. */ + user_ids: [string, ...string[]]; +} + +export interface AppID { + /** @description The ID of the app. */ + app_id: string; +} + +/** + * Some API methods use arguments for specifying a message, file or file comment. + * E.g. `stars.*` and `reactions.*` + */ + +export interface MessageArgument { + /** @description Channel where the message was posted. */ + channel: string; + /** @description Timestamp of the message. */ + timestamp: string; +} + +export interface FileArgument { + /** @description Encoded file ID. */ + file: string; +} + +export interface FileCommentArgument { + /** @description Encoded file comment ID. */ + file_comment: string; +} + +// Some API methods offer search functionality whose sort order can be customized. +// E.g. `admin.conversations.search` and `search.*` +export interface SortDir { + /** @description Change sort direction to ascending (`asc`) or descending (`desc`). Defaults to `desc`. */ + sort_dir?: 'asc' | 'desc'; +} + +// Some API methods use arguments related to OAuth flows. +// E.g. `openid.*` and `oauth.*` + +export interface OAuthCredentials { + /** @description Issued when you created your application. */ + client_id: string; + /** @description Issued when you created your application. */ + client_secret: string; + /** @description The `code` parameter returned via the OAuth callback. */ + code?: string; + /** + * @description While optional, it is _required_ if your app passed it as a parameter to the OpenID/OAuth flow's + * first step and must match the originally submitted URI. + */ + redirect_uri?: string; +} + +export interface OAuthGrantRefresh { + /** @description The `grant_type` param as described in the OAuth spec. */ + grant_type?: 'authorization_code' | 'refresh_token'; + /** @description The `refresh_token` param as described in the OAuth spec. */ + refresh_token?: string; +} diff --git a/packages/web-api/src/types/request/conversations.ts b/packages/web-api/src/types/request/conversations.ts new file mode 100644 index 000000000..781d76b68 --- /dev/null +++ b/packages/web-api/src/types/request/conversations.ts @@ -0,0 +1,170 @@ +import type { CursorPaginationEnabled, LocaleAware, OptionalTeamAssignable, TimelinePaginationEnabled, TokenOverridable } from './common'; + +interface Channel { + /** @description ID of conversation. */ + channel: string; +} +interface ChannelID { + /** @description ID of the channel that you'd like to accept. Must provide either `invite_id` or `channel_id`. */ + channel_id: string; +} +interface Emails { + /** @description List of emails to receive this invite. Either `emails` or `user_ids` must be provided. */ + emails: string[]; + user_ids?: never; +} +interface IncludeAllMetadata { + /** @description Return all metadata associated with messages. Defaults to `false`. */ + include_all_metadata?: boolean; +} +interface InviteID { + /** @description ID of the invite. */ + invite_id: string; +} +interface IsPrivate { + /** @description Whether the channel should be private. */ + is_private?: boolean; +} +interface Message extends Channel { + /** @description Unique identifier of message. */ + ts: string; +} +interface TargetTeam { + /** @description The team or enterprise id of the other party involved in the invitation. */ + target_team?: string; +} +interface UserIDs { + /** List of user IDs to receive this invite. Either `emails` or `user_ids` must be provided. */ + user_ids: string[]; + emails?: never; +} +interface Users { + /** @description A comma separated list of user IDs. Up to 1000 users may be listed. */ + users: string; +} +// https://api.slack.com/methods/conversations.acceptSharedInvite +export type ConversationsAcceptSharedInviteArguments = TokenOverridable & OptionalTeamAssignable +& (ChannelID | InviteID) & IsPrivate & { + /** + * @description Name of the channel. If the channel does not exist already in your workspace, + * this name is the one that the channel will take. + */ + channel_name: string; + /** @description Whether you'd like to use your workspace's free trial to begin using Slack Connect. */ + free_trial_accepted?: boolean; +}; + +// https://api.slack.com/methods/conversations.approveSharedInvite +export interface ConversationsApproveSharedInviteArguments extends InviteID, TargetTeam, TokenOverridable {} + +// https://api.slack.com/methods/conversations.archive +export interface ConversationsArchiveArguments extends Channel, TokenOverridable {} + +// https://api.slack.com/methods/conversations.close +export interface ConversationsCloseArguments extends Channel, TokenOverridable {} + +// https://api.slack.com/methods/conversations.create +export interface ConversationsCreateArguments extends IsPrivate, TokenOverridable, OptionalTeamAssignable { + /** @description Name of the public or private channel to create. */ + name: string; +} + +// https://api.slack.com/methods/conversations.declineSharedInvite +export interface ConversationsDeclineSharedInviteArguments extends InviteID, TargetTeam, TokenOverridable {} + +// https://api.slack.com/methods/conversations.history +export interface ConversationsHistoryArguments extends Channel, IncludeAllMetadata, TokenOverridable, + CursorPaginationEnabled, TimelinePaginationEnabled {} + +// https://api.slack.com/methods/conversations.info +export interface ConversationsInfoArguments extends Channel, TokenOverridable, LocaleAware { + /** @description Set to `true` to include the member count for the specified conversation. Defaults to `false`. */ + include_num_members?: boolean; +} + +// https://api.slack.com/methods/conversations.invite +export interface ConversationsInviteArguments extends Channel, Users, TokenOverridable { + /** + * @description When set to `true` and multiple user IDs are provided, continue inviting the valid ones while + * disregarding invalid IDs. Defaults to `false`. + */ + force?: boolean; +} + +// https://api.slack.com/methods/conversations.inviteShared +export type ConversationsInviteSharedArguments = Channel & TokenOverridable & (Emails | UserIDs) & { + /** @description Whether invite is to an external limited member. Defaults to `true`. */ + external_limited?: boolean; +}; + +// https://api.slack.com/methods/conversations.join +export interface ConversationsJoinArguments extends Channel, TokenOverridable {} + +// https://api.slack.com/methods/conversations.kick +export interface ConversationsKickArguments extends Channel, TokenOverridable { + user: string; +} + +// https://api.slack.com/methods/conversations.leave +export interface ConversationsLeaveArguments extends Channel, TokenOverridable {} + +// https://api.slack.com/methods/conversations.list +export interface ConversationsListArguments extends TokenOverridable, CursorPaginationEnabled, OptionalTeamAssignable { + /** @description Set to `true` to exclude archived channels from the list. Defaults to `false`. */ + exclude_archived?: boolean; + /** + * @description Mix and match channel types by providing a comma-separated list of any combination of: + * `public_channel`, `private_channel`, `mpim` or `im`. Defaults to `public_channel`. + */ + types?: string; +} + +// https://api.slack.com/methods/conversations.listConnectInvites +export interface ConversationsListConnectInvitesArguments extends TokenOverridable, OptionalTeamAssignable { + /** @description Maximum number of invites to return. Defaults to `100`. */ + count?: number; + /** @description Set to `next_cursor` returned by previous call to list items in subsequent page. */ + cursor?: string; +} + +// https://api.slack.com/methods/conversations.mark +export interface ConversationsMarkArguments extends Message, TokenOverridable { } + +// https://api.slack.com/methods/conversations.members +export interface ConversationsMembersArguments extends Channel, TokenOverridable, CursorPaginationEnabled {} + +// https://api.slack.com/methods/conversations.open +export type ConversationsOpenArguments = (Channel | Users) & TokenOverridable & { + /** + * @description Do not create a direct message or multi-person direct message. + * This is used to see if there is an existing dm or mpdm. + */ + prevent_creation?: boolean; + /** @description Indicates you want the full IM channel definition in the response. */ + return_im?: boolean; +}; + +// https://api.slack.com/methods/conversations.rename +export interface ConversationsRenameArguments extends Channel, TokenOverridable { + /** @description New name for conversation. */ + name: string; +} + +// https://api.slack.com/methods/conversations.replies +export interface ConversationsRepliesArguments extends Message, IncludeAllMetadata, TokenOverridable, + CursorPaginationEnabled, TimelinePaginationEnabled {} + +// https://api.slack.com/methods/conversations.setPurpose +export interface ConversationsSetPurposeArguments extends Channel, TokenOverridable { + /** @description A new, specialer purpose. */ + purpose: string; +} + +// https://api.slack.com/methods/conversations.setTopic +export interface ConversationsSetTopicArguments extends Channel, TokenOverridable { + /** @description The new topic string. Does not support formatting or linkification. */ + topic: string; +} + +// https://api.slack.com/methods/conversations.unarchive +export interface ConversationsUnarchiveArguments extends Channel, TokenOverridable {} diff --git a/packages/web-api/src/types/request/dialog.ts b/packages/web-api/src/types/request/dialog.ts new file mode 100644 index 000000000..ec9e33f26 --- /dev/null +++ b/packages/web-api/src/types/request/dialog.ts @@ -0,0 +1,10 @@ +import type { Dialog } from '@slack/types'; +import type { TokenOverridable } from './common'; + +// https://api.slack.com/methods/dialog.open +export interface DialogOpenArguments extends TokenOverridable { + /** @description Exchange a trigger to post to the user. */ + trigger_id: string; + /** @description The dialog definition. */ + dialog: Dialog; +} diff --git a/packages/web-api/src/types/request/dnd.ts b/packages/web-api/src/types/request/dnd.ts new file mode 100644 index 000000000..81f66ebc9 --- /dev/null +++ b/packages/web-api/src/types/request/dnd.ts @@ -0,0 +1,21 @@ +import { OptionalTeamAssignable, TokenOverridable } from './common'; + +// https://api.slack.com/methods/dnd.endDnd +export interface DndEndDndArguments extends TokenOverridable { } +// https://api.slack.com/methods/dnd.endSnooze +export interface DndEndSnoozeArguments extends TokenOverridable { } +// https://api.slack.com/methods/dnd.info +export interface DndInfoArguments extends TokenOverridable, OptionalTeamAssignable { + /** @description User to fetch status for (defaults to authed user). */ + user?: string; +} +// https://api.slack.com/methods/dnd.setSnooze +export interface DndSetSnoozeArguments extends TokenOverridable { + /** @description Number of minutes, from now, to snooze until. */ + num_minutes: number; +} +// https://api.slack.com/methods/dnd.teamInfo +export interface DndTeamInfoArguments extends TokenOverridable, OptionalTeamAssignable { + /** @description Comma-separated list of users to fetch Do Not Disturb status for. */ + users: string; +} diff --git a/packages/web-api/src/types/request/emoji.ts b/packages/web-api/src/types/request/emoji.ts new file mode 100644 index 000000000..3f59549bd --- /dev/null +++ b/packages/web-api/src/types/request/emoji.ts @@ -0,0 +1,6 @@ +import { TokenOverridable } from './common'; +// https://api.slack.com/methods/emoji.list +export interface EmojiListArguments extends TokenOverridable { + /** @description Include a list of categories for Unicode emoji and the emoji in each category. */ + include_categories?: boolean; +} diff --git a/packages/web-api/src/types/request/files.ts b/packages/web-api/src/types/request/files.ts new file mode 100644 index 000000000..32c5b9009 --- /dev/null +++ b/packages/web-api/src/types/request/files.ts @@ -0,0 +1,197 @@ +import type { Stream } from 'node:stream'; +import type { CursorPaginationEnabled, OptionalTeamAssignable, TokenOverridable, TraditionalPagingEnabled } from './common'; +import type { FilesGetUploadURLExternalResponse } from '../response'; + +interface FileArgument { + /** @description Encoded file ID. */ + file: string; +} +interface ExternalIDArgument { + /** @description Creator defined GUID for the file. */ + external_id: string; +} +interface ChannelsArgument { + /** + * @description Comma-seperated list of channel IDs where the file will be shared. If not specified the file will + * be private. + */ + channels?: string; +} +interface FileType { + /** + * @description A file type identifier. + * @see {@link https://api.slack.com/types/file#file_types File types} for a complete list of supported file types. + */ + filetype?: string; +} +interface FileUploadComplete { + /** @description Encoded file ID. */ + id: string; + /** @description File title. */ + title?: string; +} + +interface FileChannelDestinationArgument { + /** @description Channel ID where the file will be shared. If not specified the file will be private. */ + channel_id?: string; + thread_ts?: never; +} +interface FileThreadDestinationArgument { + /** @description Channel ID where the file will be shared as a thread reply. */ + channel_id: string; + /** @description Provide another message's `ts` value to upload this file as a reply. */ + thread_ts: string; +} +// Some file APIs allow you to upload a file to a channel as its own message, or to a thread as a reply. +type FileDestinationArgument = FileChannelDestinationArgument | FileThreadDestinationArgument; +// Exact same as the above `FileDestinationArgument`, but with a `channels` property instead of `channel_id`. +interface FileChannelDestinationArgumentChannels extends ChannelsArgument { + thread_ts?: never; +} +interface FileThreadDestinationArgumentChannels extends Required { + /** @description Provide another message's `ts` value to upload this file as a reply. */ + thread_ts: string; +} +// Some file APIs allow you to upload a file to a channel as its own message, or to a thread as a reply. +type FileDestinationArgumentChannels = FileChannelDestinationArgumentChannels | FileThreadDestinationArgumentChannels; + +// https://api.slack.com/methods/files.completeUploadExternal +export type FilesCompleteUploadExternalArguments = FileDestinationArgument & TokenOverridable & { + /** @description Array of file IDs and their corresponding (optional) titles. */ + files: [FileUploadComplete, ...FileUploadComplete[]]; + /** @description The message text introducing the file in the specified channel. */ + initial_comment?: string; +}; + +// https://api.slack.com/methods/files.delete +export interface FilesDeleteArguments extends FileArgument, TokenOverridable {} + +// https://api.slack.com/methods/files.getUploadURLExternal +export interface FilesGetUploadURLExternalArguments extends TokenOverridable { + /** @description Name of the file being uploaded. */ + filename: string; + /** @description Size in bytes of the file being uploaded. */ + length: number; + /** @description Description of image for screen-reader. */ + alt_text?: string; + /** @description Syntax type of the snippet being uploaded. E.g. `python`. */ + snippet_type?: string; +} +// https://api.slack.com/methods/files.info +export interface FilesInfoArguments extends FileArgument, TokenOverridable, CursorPaginationEnabled, + TraditionalPagingEnabled {} +// https://api.slack.com/methods/files.list +export interface FilesListArguments extends TokenOverridable, TraditionalPagingEnabled, OptionalTeamAssignable { + /** @description Filter files appearing in a specific channel, indicated by its ID. */ + channel?: string; + /** + * @description Show truncated file info for files hidden due to being too old, and the team who owns the file + * being over the file limit. + */ + show_files_hidden_by_limit?: boolean; + /** @description Filter files created after this timestamp (inclusive). */ + ts_from?: string; + /** @description Filter files created before this timestamp (inclusive). */ + ts_to?: string; + /** + * @description Filter files by type. Pass multiple values for `types` argument by comma-seperating the values. + * The default value is `all`, which does not filter the list. + * Available types are `all`, `spaces`, `snippets`, `images`, `gdocs`, `zips` and `pdfs`. + */ + types?: string; + /** @description Filter files created by a single user. */ + user?: string; +} +// https://api.slack.com/methods/files.revokePublicURL +export interface FilesRevokePublicURLArguments extends FileArgument, TokenOverridable {} +// https://api.slack.com/methods/files.sharedPublicURL +export interface FilesSharedPublicURLArguments extends FileArgument, TokenOverridable {} + +export interface FileUploadStringContents { + /** @description File contents. If omitted, you must provide the `file` argument. */ + content: string; +} +export interface FileUploadBinaryContents { + /** + * @description File contents as a `Buffer` or `Stream`. + * If providing a `string`, this parameter will be interpreted as a _path_ to a file, which will be read from disk + * before uploading. If omitted, you must provide the `content` argument. + */ + file: Buffer | Stream | string; +} +// File upload contents can be provided using either `content` or `file` arguments - and one of these is required. +type FileUploadContents = FileUploadStringContents | FileUploadBinaryContents; + +type FileUpload = FileUploadContents & FileDestinationArgumentChannels & FileType & { + /** @description Name of the file. */ + filename?: string; + /** @description The message text introducing the file in specified channel(s). */ + initial_comment?: string; + /** @description File title. */ + title?: string; +}; +// https://api.slack.com/methods/files.upload +export type FilesUploadArguments = FileUpload & TokenOverridable; + +export type FileUploadV2 = FileUpload & { + /** @description Description of image for screen-reader. */ + alt_text?: string; + /** @description Channel ID where the file will be shared. If not specified the file will be private. */ + channel_id?: string; + /** @description Syntax type of the snippet being uploaded. E.g. `python`. */ + snippet_type?: string; +}; + +// https://slack.dev/node-slack-sdk/web-api#upload-a-file +export type FilesUploadV2Arguments = FileUploadV2 & TokenOverridable & { + file_uploads?: Omit[]; +}; + +// Helper type intended for internal use in filesUploadV2 client method +// Includes additional metadata required to complete a single file upload job +export type FileUploadV2Job = FileUploadV2 & +Pick & { + length?: number; + data?: Buffer; +}; + +// https://api.slack.com/methods/files.comments.delete +export interface FilesCommentsDeleteArguments extends FileArgument, TokenOverridable { + /** @description The ID of the comment to delete. */ + id: string; +} +interface SharedFile { + /** @description Title of the file being shared. */ + title: string; + /** @description URL of the remote file. */ + external_url: string; + /** @description Preview of the document. */ + preview_image?: Buffer | Stream; + /** + * @description A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery + * of the remote file. + */ + indexable_file_contents?: Buffer | Stream; +} + +// https://api.slack.com/methods/files.remote.add +export interface FilesRemoteAddArguments extends SharedFile, FileType, ExternalIDArgument, TokenOverridable {} +// Either the encoded file ID or the external ID must be used as an argument. +type FileOrExternalID = (FileArgument & { external_id?: never; }) | (ExternalIDArgument & { file?: never; }); +// https://api.slack.com/methods/files.remote.info +export type FilesRemoteInfoArguments = FileOrExternalID & TokenOverridable; +// https://api.slack.com/methods/files.remote.list +export interface FilesRemoteListArguments extends TokenOverridable, CursorPaginationEnabled { + /** @description Filter files appearing in a specific channel, indicated by its ID. */ + channel?: string; + /** @description Filter files created after this timestamp (inclusive). */ + ts_from?: string; + /** @description Filter files created before this timestamp (inclusive). */ + ts_to?: string; +} +// https://api.slack.com/methods/files.remote.remove +export type FilesRemoteRemoveArguments = FileOrExternalID & TokenOverridable; +// https://api.slack.com/methods/files.remote.share +export type FilesRemoteShareArguments = Required & FileOrExternalID & TokenOverridable; +// https://api.slack.com/methods/files.remote.update +export type FilesRemoteUpdateArguments = Partial & FileOrExternalID & FileType & TokenOverridable; diff --git a/packages/web-api/src/types/request/functions.ts b/packages/web-api/src/types/request/functions.ts new file mode 100644 index 000000000..b00aaf1bd --- /dev/null +++ b/packages/web-api/src/types/request/functions.ts @@ -0,0 +1,15 @@ +import type { TokenOverridable } from './common'; + +interface ExecutionID { + function_execution_id: string; +} + +// https://api.slack.com/methods/functions.completeError +export interface FunctionsCompleteErrorArguments extends ExecutionID, TokenOverridable { + error: string; +} + +// https://api.slack.com/methods/functions.completeSuccess +export interface FunctionsCompleteSuccessArguments extends ExecutionID, TokenOverridable { + outputs: Record; +} diff --git a/packages/web-api/src/types/request/manifest.ts b/packages/web-api/src/types/request/manifest.ts new file mode 100644 index 000000000..abae3f15e --- /dev/null +++ b/packages/web-api/src/types/request/manifest.ts @@ -0,0 +1,547 @@ +export interface Manifest extends Record { + /** @description A group of settings that describe the manifest. */ + _metadata?: ManifestMetadata; // eslint-disable-line @typescript-eslint/naming-convention + /** + * @description A group of settings that describe parts of an app's appearance within Slack. If you're distributing + * the app via the App Directory, read our {@link https://api.slack.com/start/distributing/guidelines#listing listing guidelines} to pick the best values for these settings. + */ + display_information: ManifestDisplayInformation; + /** @description A group of settings corresponding to the Features section of the app config pages. */ + features?: ManifestFeatures; + /** @description A group of settings describing OAuth configuration for the app. */ + oauth_config?: ManifestOAuthConfig; + /** @description A group of settings corresponding to the Settings section of the app config pages. */ + settings?: ManifestSettings; + /** @description A group of settings corresponding to Custom Functions bundled in your application. */ + functions?: Record; + // TODO: future additions: external_auth_providers, workflows +} + +interface ManifestMetadata { + /** + * @description An integer that specifies the major version of the manifest schema to target. + * Only `1` and `2` are supported. Defaults to `1`. + */ + major_version?: number; + /** @description An integer that specifies the minor version of the manifest schema to target. */ + minor_version?: number; +} + +interface ManifestDisplayInformation { + /** @description A string of the name of the app. Maximum length is 35 characters. */ + name: string; + /** + * @description A string with a short description of the app for display to users. Maximum length is 140 characters. + */ + description?: string; + /** @description A string with a longer version of the description of the app. Maximum length is 4000 characters. */ + long_description?: string; + /** + * @description A string containing a hex color value (including the hex sign) that specifies the background color + * used on hovercards that display information about your app. Can be 3-digit (`#000`) or 6-digit (`#000000`) hex + * values. Once an app has set a background color value, it cannot be removed, only updated. + */ + background_color?: string; +} + +interface ManifestFeatures { + /** + * @description A subgroup of settings that describe {@link https://api.slack.com/surfaces/app-home App Home} configuration. + * @see {@link https://api.slack.com/surfaces/app-home App Home}. + */ + app_home?: ManifestAppHome; + /** + * @description A subgroup of settings that describe {@link https://api.slack.com/legacy/enabling-bot-users bot user} configuration. + * @see {@link https://api.slack.com/legacy/enabling-bot-users Legacy bots}. + */ + bot_user?: ManifestBotUser; + /** + * @description An array of settings groups that describe {@link https://api.slack.com/interactivity/shortcuts shortcuts} + * configuration. A maximum of 10 shortcuts can be included in this array. + * @see {@link https://api.slack.com/interactivity/shortcuts Shortcuts}. + */ + shortcuts?: ManifestShortcut[]; + /** + * @description An array of settings groups that describe {@link https://api.slack.com/interactivity/slash-commands slash commands} + * configuration. A maximum of 50 slash commands can be included in this array. + * @see {@link https://api.slack.com/interactivity/slash-commands Slash Commands}. + */ + slash_commands?: ManifestSlashCommand[]; + /** + * @description An array of strings containing valid unfurl domains to register. A maximum of 5 unfurl domains can be + * included in this array. + * @see {@link https://api.slack.com/reference/messaging/link-unfurling#configuring_domains Link unfurling: configuring domains}. + */ + unfurl_domains?: string[]; +} + +interface ManifestAppHome { + /** + * @description A boolean that specifies whether or not the {@link https://api.slack.com/surfaces/app-home#home-tab Home tab} is enabled. + * @see {@link https://api.slack.com/surfaces/app-home#home-tab Home tab}. + */ + home_tab_enabled?: boolean; + /** + * @description A boolean that specifies whether or not the Messages tab in your App Home is enabled. + * @see {@link https://api.slack.com/surfaces/app-home#messages-tab Message tab}. + */ + messages_tab_enabled?: boolean; + /** + * @description A boolean that specifies whether or not the users can send messages to your app in the + * {@link https://api.slack.com/surfaces/app-home#messages-tab Messages tab} + * of your App Home. + * @see {@link https://api.slack.com/surfaces/app-home#messages-tab Messages tab}. + */ + messages_tab_read_only_enabled?: boolean; +} + +interface ManifestBotUser { + /** + * @description A string containing the display name of the bot user. Maximum length is 80 characters. + * Allowed characters: `a-z`, `0-9`, `-`, `_`, and `.`. + */ + display_name: string; + /** @description A boolean that specifies whether or not the bot user will always appear to be online. */ + always_online?: boolean; +} + +interface ManifestShortcut { + /** @description Specifies which {@link https://api.slack.com/interactivity/shortcuts#shortcut-types type of shortcut} is being described. */ + type: 'global' | 'message'; + /** @description A string containing the name of the shortcut. */ + name: string; + /** @description A string containing the callback_id of this shortcut. Maximum length is 255 characters. */ + callback_id: string; + /** @description A string containing a short description of this shortcut. Maximum length is 150 characters. */ + description: string; +} + +interface ManifestSlashCommand { + /** + * @description A string containing the actual slash command. Maximum length is 32 characters, and should include + * the leading `/` character. + */ + command: string; + /** + * @description A string containing a description of the slash command that will be displayed to users. + * Maximum length is 2000 characters. + */ + description: string; + /** + * @description A boolean that specifies whether or not channels, users, and links typed with + * the slash command should be escaped. Defaults to `false`. + */ + should_escape?: boolean; + /** + * @description A string containing the full `https` URL that acts as the + * {@link https://api.slack.com/interactivity/slash-commands#creating_commands slash command's request URL}. + */ + url?: string; // can be absent when enabling Socket Mode + /** @description A string a short usage hint about the slash command for users. Maximum length is 1000 characters. */ + usage_hint?: string; +} + +interface ManifestOAuthConfig { + /** + * @description An array of strings containing {@link https://api.slack.com/authentication/oauth-v2#asking OAuth redirect URLs}. + * A maximum of 1000 redirect URLs can be included in this array. + */ + redirect_urls?: string[]; + /** @description A subgroup of settings that describe {@link https://api.slack.com/scopes permission scopes} configuration. */ + scopes?: ManifestOAuthScopes; + token_management_enabled?: boolean; +} + +interface ManifestOAuthScopes { + /** + * @description An array of strings containing {@link https://api.slack.com/scopes?filter=granular_bot granular bot scopes} + * to request upon app installation. A maximum of 255 scopes can included in this array. + */ + bot?: BotScope[]; + /** + * @description An array of strings containing {@link https://api.slack.com/scopes?filter=user user scopes} + * to request upon app installation. A maximum of 255 scopes can included in this array. + */ + user?: UserScope[]; +} + +interface ManifestSettings { + /** + * @description An array of strings that contain IP addresses that conform to the + * {@link https://api.slack.com/authentication/best-practices#ip_allowlisting Allowed IP Ranges} feature. Maximum of 50 IP addresses. + */ + allowed_ip_address_ranges?: string[]; + /** @description A subgroup of settings that describe {@link https://api.slack.com/apis/connections/events-api Events API} configuration for the app. */ + event_subscriptions?: ManifestEventSubscriptions; + /** @description A subgroup of settings that describe {@link https://api.slack.com/messaging/webhooks Incoming Webhooks} configuration for the app. */ + incoming_webhooks?: ManifestIncomingWebhooks; + /** @description A subgroup of settings that describe {@link https://api.slack.com/interactivity interactivity} configuration for the app. */ + interactivity?: ManifestInteractivity; + /** @description A boolean that specifies whether or not {@link https://api.slack.com/enterprise/apps organization-wide deployment} is enabled. */ + org_deploy_enabled?: boolean; + /** @description A boolean that specifies whether or not {@link https://api.slack.com/apis/connections/socket Socket Mode} is enabled. */ + socket_mode_enabled?: boolean; + /** @description A boolean that specifies whether or not {@link https://api.slack.com/authentication/rotation token rotation} is enabled. */ + token_rotation_enabled?: boolean; + function_runtime?: string; +} + +interface ManifestEventSubscriptions { + /** + * @description An array of strings matching the event types you want to the app to subscribe to. + * A maximum of 100 event types can be used. + * @see {@link https://api.slack.com/events Event types}. + */ + bot_events?: ManifestEvent[]; + /** + * @description An array of strings matching the event types you want to the app to subscribe to on + * behalf of authorized users. A maximum of 100 event types can be used. + * @see {@link https://api.slack.com/events Event types}. + */ + user_events?: ManifestEvent[]; + /** + * @description A string containing the full `https` URL that acts as the + * {@link https://api.slack.com/apis/connections/events-api#request-urls Events API request URL}. + * If set, you'll need to manually verify the Request URL in the App Manifest section of App Management. + */ + request_url?: string; // can be absent when enabling Socket Mode +} + +interface ManifestIncomingWebhooks { + /** @description Whether to {@link https://api.slack.com/messaging/webhooks#enable_webhooks enable Incoming Webhooks} for your application or not. */ + incoming_webhooks_enabled?: boolean; +} + +interface ManifestInteractivity { + /** @description A boolean that specifies whether or not interactivity features are enabled. */ + is_enabled: boolean; + /** @description A string containing the full https URL that acts as the {@link https://api.slack.com/interactivity/handling#setup interactive Options Load URL}. */ + message_menu_options_url?: string; + /** @description A string containing the full https URL that acts as the {@link https://api.slack.com/interactivity/handling#setup interactive Request URL}. */ + request_url?: string; // can be absent when enabling Socket Mode +} + +interface ManifestFunction { + /** @description The name of your function. */ + title: string; + /** @description A description of your function. */ + description: string; + /** @description Input parameters that your function will accept. */ + input_parameters: ManifestParameters; + /** @description Output parameters that your function will produce. */ + output_parameters: ManifestParameters; +} + +interface ManifestParameters { + /** + * @description A map of property names to property definitions describing the parameter set. + * Maximum of 50 property names can be defined. + */ + properties: Record; + /** @description Array of strings matching the propert names defined in `properties`. */ + required?: string[]; +} + +export type ManifestParameterProperty = + | CommonManifestParameterProperty + | StringManifestParameterProperty + | NumberManifestParameterProperty; + +interface CommonManifestParameterProperty { + /** @description The type of the property. */ + type: string; + /** @description The description of the property. */ + description?: string; + /** @description The title of the property. */ + title?: string; + /** @description Property usage hint. */ + hint?: string; +} + +interface StringManifestParameterProperty extends CommonManifestParameterProperty { + /** @description The type of the property. For strings, this will always be `string`. */ + type: 'string'; + minLength?: number; + maxLength?: number; +} + +interface NumberManifestParameterProperty extends CommonManifestParameterProperty { + /** @description The type of the property. For numbers, this will always be `number`. */ + type: 'number'; + minimum?: number; + maximum?: number; +} + +// TODO: add more types that we support + +// https://api.slack.com/scopes?filter=granular_bot +// var scopes = [].slice.call(document.getElementsByClassName('apiReferenceFilterableList__listItemLink')) +// .map(e => '"' + e.innerText + '"').join(' | '); console.log("type BotScope = " + scopes + ";"); +type BotScope = + | 'app_mentions:read' + | 'bookmarks:read' + | 'bookmarks:write' + | 'calls:read' + | 'calls:write' + | 'channels:history' + | 'channels:join' + | 'channels:manage' + | 'channels:read' + | 'channels:write.invites' + | 'channels:write.topic' + | 'chat:write' + | 'chat:write.customize' + | 'chat:write.public' + | 'commands' + | 'conversations.connect:manage' + | 'conversations.connect:read' + | 'conversations.connect:write' + | 'datastore:read' + | 'datastore:write' + | 'dnd:read' + | 'emoji:read' + | 'files:read' + | 'files:write' + | 'groups:history' + | 'groups:read' + | 'groups:write' + | 'groups:write.invites' + | 'groups:write.topic' + | 'im:history' + | 'im:read' + | 'im:write' + | 'incoming-webhook' + | 'links.embed:write' + | 'links:read' + | 'links:write' + | 'metadata.message:read' + | 'mpim:history' + | 'mpim:read' + | 'mpim:write' + | 'mpim:write.invites' + | 'mpim:write.topic' + | 'none' + | 'pins:read' + | 'pins:write' + | 'reactions:read' + | 'reactions:write' + | 'reminders:read' + | 'reminders:write' + | 'remote_files:read' + | 'remote_files:share' + | 'remote_files:write' + | 'team.billing:read' + | 'team.preferences:read' + | 'team:read' + | 'tokens.basic' + | 'triggers:read' + | 'triggers:write' + | 'usergroups:read' + | 'usergroups:write' + | 'users.profile:read' + | 'users:read' + | 'users:read.email' + | 'users:write' + | 'workflow.steps:execute'; + +// https://api.slack.com/scopes?filter=user +// var scopes = [].slice.call(document.getElementsByClassName('apiReferenceFilterableList__listItemLink')) +// .map(e => ''' + e.innerText + ''').join(' | '); console.log('type UserScope = ' + scopes + ';'); +type UserScope = + | 'admin' + | 'admin.analytics:read' + | 'admin.app_activities:read' + | 'admin.apps:read' + | 'admin.apps:write' + | 'admin.barriers:read' + | 'admin.barriers:write' + | 'admin.conversations:read' + | 'admin.conversations:write' + | 'admin.invites:read' + | 'admin.invites:write' + | 'admin.roles:read' + | 'admin.roles:write' + | 'admin.teams:read' + | 'admin.teams:write' + | 'admin.usergroups:read' + | 'admin.usergroups:write' + | 'admin.users:read' + | 'admin.users:write' + | 'admin.workflows:read' + | 'admin.workflows:write' + | 'auditlogs:read' + | 'bookmarks:read' + | 'bookmarks:write' + | 'calls:read' + | 'calls:write' + | 'channels:history' + | 'channels:read' + | 'channels:write' + | 'channels:write.invites' + | 'channels:write.topic' + | 'chat:write' + | 'chat:write:bot' + | 'chat:write:user' + | 'commands' + | 'dnd:read' + | 'dnd:write' + | 'email' + | 'emoji:read' + | 'files:read' + | 'files:write' + | 'files:write:user' + | 'groups:history' + | 'groups:read' + | 'groups:write' + | 'groups:write.invites' + | 'groups:write.topic' + | 'identity.avatar' + | 'identity.basic' + | 'identity.email' + | 'identity.team' + | 'im:history' + | 'im:read' + | 'im:write' + | 'incoming-webhook' + | 'links.embed:write' + | 'links:read' + | 'links:write' + | 'mpim:history' + | 'mpim:read' + | 'mpim:write' + | 'mpim:write.invites' + | 'mpim:write.topic' + | 'openid' + | 'pins:read' + | 'pins:write' + | 'profile' + | 'reactions:read' + | 'reactions:write' + | 'reminders:read' + | 'reminders:write' + | 'remote_files:read' + | 'remote_files:share' + | 'search:read' + | 'stars:read' + | 'stars:write' + | 'team.billing:read' + | 'team.preferences:read' + | 'team:read' + | 'tokens.basic' + | 'usergroups:read' + | 'usergroups:write' + | 'users.profile:read' + | 'users.profile:write' + | 'users:read' + | 'users:read.email' + | 'users:write'; + +// https://api.slack.com/scopes?query=Configuration +// var scopes = [].slice.call(document.getElementsByClassName('apiReferenceFilterableList__listItemLink')) +// .map(e => ''' + e.innerText + ''').join(' | '); console.log('export type AnyConfigurationScope = ' + scopes + ';'); +export type AnyManifestConfigurationScope = + | 'app_configurations:read' + | 'app_configurations:write'; + +export type AppManifestLevelScopes = + | 'authorizations:read' + | 'connections:write'; + +// https://api.slack.com/events?filter=Events +// var events = [].slice.call(document.getElementsByClassName('apiReferenceFilterableList__listItemLink')) +// .map(e => '"' + e.innerText + '"').join(' | '); console.log("export type AnyMafifestEvent = " + events + ";"); +type ManifestEvent = + | 'app_home_opened' + | 'app_mention' + | 'app_rate_limited' + | 'app_requested' + | 'app_uninstalled' + | 'call_rejected' + | 'channel_archive' + | 'channel_created' + | 'channel_deleted' + | 'channel_history_changed' + | 'channel_id_changed' + | 'channel_left' + | 'channel_rename' + | 'channel_shared' + | 'channel_unarchive' + | 'channel_unshared' + | 'dnd_updated' + | 'dnd_updated_user' + | 'email_domain_changed' + | 'emoji_changed' + | 'file_change' + | 'file_comment_added' + | 'file_comment_deleted' + | 'file_comment_edited' + | 'file_created' + | 'file_deleted' + | 'file_public' + | 'file_shared' + | 'file_unshared' + | 'grid_migration_finished' + | 'grid_migration_started' + | 'group_archive' + | 'group_close' + | 'group_deleted' + | 'group_history_changed' + | 'group_left' + | 'group_open' + | 'group_rename' + | 'group_unarchive' + | 'im_close' + | 'im_created' + | 'im_history_changed' + | 'im_open' + | 'invite_requested' + | 'link_shared' + | 'member_joined_channel' + | 'member_left_channel' + | 'message' + | 'message.app_home' + | 'message.channels' + | 'message.groups' + | 'message.im' + | 'message.mpim' + | 'message_metadata_deleted' + | 'message_metadata_posted' + | 'message_metadata_updated' + | 'pin_added' + | 'pin_removed' + | 'reaction_added' + | 'reaction_removed' + | 'resources_added' + | 'resources_removed' + | 'scope_denied' + | 'scope_granted' + | 'shared_channel_invite_accepted' + | 'shared_channel_invite_approved' + | 'shared_channel_invite_declined' + | 'shared_channel_invite_received' + | 'star_added' + | 'star_removed' + | 'subteam_created' + | 'subteam_members_changed' + | 'subteam_self_added' + | 'subteam_self_removed' + | 'subteam_updated' + | 'team_access_granted' + | 'team_access_revoked' + | 'team_domain_change' + | 'team_join' + | 'team_rename' + | 'tokens_revoked' + | 'url_verification' + | 'user_change' + | 'user_huddle_changed' + | 'user_profile_changed' + | 'user_resource_denied' + | 'user_resource_granted' + | 'user_resource_removed' + | 'user_status_changed' + | 'workflow_deleted' + | 'workflow_published' + | 'workflow_step_deleted' + | 'workflow_step_execute' + | 'workflow_unpublished'; diff --git a/packages/web-api/src/types/request/migration.ts b/packages/web-api/src/types/request/migration.ts new file mode 100644 index 000000000..eafd40f42 --- /dev/null +++ b/packages/web-api/src/types/request/migration.ts @@ -0,0 +1,9 @@ +import type { OptionalTeamAssignable, TokenOverridable } from './common'; + +// https://api.slack.com/methods/migration.exchange +export interface MigrationExchangeArguments extends TokenOverridable, OptionalTeamAssignable { + /** @description A comma-separated list of user IDs, up to 400 per request. */ + users: string; + /** @description Specify `true` to convert `W` global user IDs to workspace-specific `U` IDs. Defaults to `false`. */ + to_old?: boolean; +} diff --git a/packages/web-api/src/types/request/oauth.ts b/packages/web-api/src/types/request/oauth.ts new file mode 100644 index 000000000..d5af94784 --- /dev/null +++ b/packages/web-api/src/types/request/oauth.ts @@ -0,0 +1,11 @@ +import type { OAuthCredentials, OAuthGrantRefresh } from './common'; + +// https://api.slack.com/methods/oauth.access +export interface OAuthAccessArguments extends OAuthCredentials { + /** @description Request the user to add your app only to a single channel. Only valid with a {@link https://api.slack.com/legacy-workspace-apps legacy workspace app}. Defaults to `false`. */ + single_channel?: boolean; +} +// https://api.slack.com/methods/oauth.v2.access +export interface OAuthV2AccessArguments extends OAuthCredentials, OAuthGrantRefresh {} +// https://api.slack.com/methods/oauth.v2.exchange +export interface OAuthV2ExchangeArguments extends Pick {} diff --git a/packages/web-api/src/types/request/openid.ts b/packages/web-api/src/types/request/openid.ts new file mode 100644 index 000000000..9415ffa7e --- /dev/null +++ b/packages/web-api/src/types/request/openid.ts @@ -0,0 +1,7 @@ +import type { OAuthCredentials, OAuthGrantRefresh } from './common'; + +// https://api.slack.com/methods/openid.connect.token +export interface OpenIDConnectTokenArguments extends OAuthCredentials, OAuthGrantRefresh {} +// https://api.slack.com/methods/openid.connect.userInfo +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface OpenIDConnectUserInfoArguments {} diff --git a/packages/web-api/src/types/request/pins.ts b/packages/web-api/src/types/request/pins.ts new file mode 100644 index 000000000..721667141 --- /dev/null +++ b/packages/web-api/src/types/request/pins.ts @@ -0,0 +1,11 @@ +import { MessageArgument, TokenOverridable } from './common'; + +// https://api.slack.com/methods/pins.add +export interface PinsAddArguments extends MessageArgument, TokenOverridable {} +// https://api.slack.com/methods/pins.list +export interface PinsListArguments extends TokenOverridable { + /** @description Channel to get pinned items for. */ + channel: string; +} +// https://api.slack.com/methods/pins.remove +export interface PinsRemoveArguments extends MessageArgument, TokenOverridable {} diff --git a/packages/web-api/src/types/request/reactions.ts b/packages/web-api/src/types/request/reactions.ts new file mode 100644 index 000000000..da2c21ea3 --- /dev/null +++ b/packages/web-api/src/types/request/reactions.ts @@ -0,0 +1,25 @@ +import { CursorPaginationEnabled, FileArgument, FileCommentArgument, MessageArgument, OptionalTeamAssignable, TokenOverridable, TraditionalPagingEnabled } from './common'; + +interface ReactionsFull { + /** @description If `true`, return the complete reaction list. */ + full?: boolean; +} +interface ReactionName { + /** @description Reaction (emoji) name. */ + name: string; +} +// https://api.slack.com/methods/reactions.add +export interface ReactionsAddArguments extends MessageArgument, TokenOverridable, ReactionName {} +// https://api.slack.com/methods/reactions.get +export type ReactionsGetArguments = ReactionsFull & TokenOverridable & +(MessageArgument | FileArgument | FileCommentArgument); + +// https://api.slack.com/methods/reactions.list +export interface ReactionsListArguments extends ReactionsFull, TokenOverridable, TraditionalPagingEnabled, + CursorPaginationEnabled, OptionalTeamAssignable { + /** @description Show reactions made by this user. Defaults to the authed user. */ + user?: string; +} +// https://api.slack.com/methods/reactions.remove +export type ReactionsRemoveArguments = TokenOverridable & ReactionName & +(MessageArgument | FileArgument | FileCommentArgument); diff --git a/packages/web-api/src/types/request/reminders.ts b/packages/web-api/src/types/request/reminders.ts new file mode 100644 index 000000000..db71a40c0 --- /dev/null +++ b/packages/web-api/src/types/request/reminders.ts @@ -0,0 +1,54 @@ +import { OptionalTeamAssignable, TokenOverridable } from './common'; + +interface ReminderRecurrenceDailyMonthlyYearly { + /** @description Specifies the repeating behavior of a reminder. */ + frequency: 'daily' | 'monthly' | 'yearly'; +} +type DaysOfTheWeek = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday'; +interface ReminderRecurrenceWeekly { + /** @description Specifies the repeating behavior of a reminder. */ + frequency: 'weekly'; + /** @description Specifies the day-of-the-week repeating behaviour when `frequency` is set to `weekly`. */ + weekdays: [DaysOfTheWeek, ...DaysOfTheWeek[]] +} +type ReminderRecurrence = ReminderRecurrenceWeekly | ReminderRecurrenceDailyMonthlyYearly; +// https://api.slack.com/methods/reminders.add +export interface RemindersAddArguments extends TokenOverridable, OptionalTeamAssignable { + /** @description The content of the reminder. */ + text: string; + /** + * @description When this reminder should happen, one of: + * - the Unix timestamp (up to five years from now), + * - the number of seconds until the reminder (if within 24 hours), or + * - a natural language description (Ex. "in 15 minutes," or "every Thursday"). + */ + time: string | number; + /** + * @description No longer supported - reminders cannot be set for other users. + * @deprecated + * @see {@link https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders#what Changes to `reminders.*` APIs announcement}. + */ + user?: string; + /** + * @description Specify the repeating behavior of a reminder. If you set the sub-property `frequency` to `weekly`, + * you must also set the `weekdays` array to specify which days of the week to recur on. + */ + recurrence?: ReminderRecurrence; +} +// https://api.slack.com/methods/reminders.complete +export interface RemindersCompleteArguments extends TokenOverridable, OptionalTeamAssignable { + /** @description The ID of the reminder to be marked as complete. */ + reminder: string; +} +// https://api.slack.com/methods/reminders.delete +export interface RemindersDeleteArguments extends TokenOverridable, OptionalTeamAssignable { + /** @description The ID of the reminder to delete. */ + reminder: string; +} +// https://api.slack.com/methods/reminders.info +export interface RemindersInfoArguments extends TokenOverridable, OptionalTeamAssignable { + /** @description The ID of the reminder to retrieve information about. */ + reminder: string; +} +// https://api.slack.com/methods/reminders.list +export interface RemindersListArguments extends TokenOverridable, OptionalTeamAssignable { } diff --git a/packages/web-api/src/types/request/rtm.ts b/packages/web-api/src/types/request/rtm.ts new file mode 100644 index 000000000..2cb243e7b --- /dev/null +++ b/packages/web-api/src/types/request/rtm.ts @@ -0,0 +1,29 @@ +import { LocaleAware, TokenOverridable } from './common'; + +// https://api.slack.com/methods/rtm.connect +export interface RTMConnectArguments extends TokenOverridable { + /** + * @description Batch presence deliveries via subscription. Enabling changes the shape of `presence_change` events. + * @see {@link https://api.slack.com/docs/presence-and-status#batching batch presence}. + */ + batch_presence_aware?: boolean; + /** + * @description Only deliver presence events when requested by subscription. + * @see {@link Only deliver presence events when requested by subscription. presence subscriptions}. + */ + presence_sub?: boolean; +} +// https://api.slack.com/methods/rtm.start +export interface RTMStartArguments extends RTMConnectArguments, LocaleAware { + /** @description Returns MPIMs to the client in the API response. */ + mpim_aware?: boolean; + /** + * @description Exclude latest timestamps for channels, groups, mpims, and ims. + * Automatically sets `no_unreads` to `true`. + */ + no_latest?: boolean; + /** @description Skip unread counts for each channel (improves performance). */ + no_unreads?: boolean; + /** @description Return timestamp only for latest message object of each channel (improves performance). */ + simple_latest?: boolean; +} diff --git a/packages/web-api/src/types/request/search.ts b/packages/web-api/src/types/request/search.ts new file mode 100644 index 000000000..e7264b845 --- /dev/null +++ b/packages/web-api/src/types/request/search.ts @@ -0,0 +1,23 @@ +import { OptionalTeamAssignable, SortDir, TokenOverridable, TraditionalPagingEnabled } from './common'; + +interface Searchable extends OptionalTeamAssignable, SortDir { + /** @description Search query. */ + query: string; + /** + * @description Set to `true` to enable query highlight markers. Defaults to `false`. + * @see {@link https://api.slack.com/methods/search.messages#markdown `search.messages` Usage info} for details. + */ + highlight?: boolean; + /** @description Return matches sorted by either `score` or `timestamp`. Defaults to `score`. */ + sort?: 'score' | 'timestamp'; +} + +// https://api.slack.com/methods/search.all +export interface SearchAllArguments extends TokenOverridable, TraditionalPagingEnabled, + Searchable { } +// https://api.slack.com/methods/search.files +export interface SearchFilesArguments extends TokenOverridable, TraditionalPagingEnabled, + Searchable { } +// https://api.slack.com/methods/search.messages +export interface SearchMessagesArguments extends TokenOverridable, TraditionalPagingEnabled, + Searchable { } diff --git a/packages/web-api/src/types/request/stars.ts b/packages/web-api/src/types/request/stars.ts new file mode 100644 index 000000000..6138b557b --- /dev/null +++ b/packages/web-api/src/types/request/stars.ts @@ -0,0 +1,13 @@ +import { CursorPaginationEnabled, FileCommentArgument, FileArgument, MessageArgument, OptionalTeamAssignable, TokenOverridable, TraditionalPagingEnabled } from './common'; + +/** @description When starring something, it can be starred _to_ a channel. */ +interface StarsChannelDestination { + /** @description Encoded channel ID the star belongs to. */ + channel: string; +} +// https://api.slack.com/methods/stars.add & https://api.slack.com/methods/stars.remove +export type StarsAddRemoveArguments = TokenOverridable & +(StarsChannelDestination | MessageArgument | FileArgument | FileCommentArgument); +// https://api.slack.com/methods/stars.list +export interface StarsListArguments extends TokenOverridable, TraditionalPagingEnabled, + CursorPaginationEnabled, OptionalTeamAssignable { } diff --git a/packages/web-api/src/types/request/team.ts b/packages/web-api/src/types/request/team.ts new file mode 100644 index 000000000..b2c9038cd --- /dev/null +++ b/packages/web-api/src/types/request/team.ts @@ -0,0 +1,46 @@ +import { AppID, OptionalTeamAssignable, TokenOverridable, CursorPaginationEnabled, TraditionalPagingEnabled } from './common'; + +// https://api.slack.com/methods/team.accessLogs +export interface TeamAccessLogsArguments extends TokenOverridable, CursorPaginationEnabled, + TraditionalPagingEnabled, OptionalTeamAssignable { + /** + * @description End of time range of logs to include in results (inclusive) as a UNIX timestamp in seconds. + * Default to now. + */ + before?: number; +} +// https://api.slack.com/methods/team.billableInfo +export interface TeamBillableInfoArguments extends TokenOverridable, CursorPaginationEnabled, OptionalTeamAssignable { + /** @description A user to retrieve the billable information for. Defaults to all users. */ + user?: string; +} +// https://api.slack.com/methods/team.billing.info +export interface TeamBillingInfoArguments extends TokenOverridable {} +// https://api.slack.com/methods/team.info +export interface TeamInfoArguments extends TokenOverridable { + /** + * @description Query by domain instead of team (only when `team` is null). This only works for domains in the same + * enterprise as the querying team token. + * This also expects the domain to belong to a team and not the enterprise itself. + */ + domain?: string; // available only for Enterprise Grid + /** @description Team to get info about; if omitted, will return information about the current team. */ + team?: string; +} +// https://api.slack.com/methods/team.integrationLogs +export interface TeamIntegrationLogsArguments extends Partial, TokenOverridable, + OptionalTeamAssignable, TraditionalPagingEnabled { + /** @description Filter logs with this change type. Defaults to all logs. */ + change_type?: 'added' | 'removed' | 'enabled' | 'disabled' | 'updated'; + /** @description Filter logs to this service. Defaults to all logs. */ + service_id?: string; + /** @description Filter logs generated by this user’s actions. Defaults to all logs. */ + user?: string; +} +// https://api.slack.com/methods/team.profile.get +export interface TeamProfileGetArguments extends TokenOverridable { + /** @description Filter by visibility. */ + visibility?: 'all' | 'visible' | 'hidden'; +} +// https://api.slack.com/methods/team.preferences.list +export interface TeamPreferencesListArguments extends TokenOverridable { } diff --git a/packages/web-api/src/types/request/tooling.ts b/packages/web-api/src/types/request/tooling.ts new file mode 100644 index 000000000..5b53e452e --- /dev/null +++ b/packages/web-api/src/types/request/tooling.ts @@ -0,0 +1,5 @@ +// https://api.slack.com/methods/tooling.tokens.rotate +export interface ToolingTokensRotateArguments { + /** @description The `xoxe` refresh token that was issued along with the old app configuration token. */ + refresh_token: string; +} diff --git a/packages/web-api/src/types/request/usergroups.ts b/packages/web-api/src/types/request/usergroups.ts new file mode 100644 index 000000000..3cbdb1234 --- /dev/null +++ b/packages/web-api/src/types/request/usergroups.ts @@ -0,0 +1,59 @@ +import { OptionalTeamAssignable, TokenOverridable } from './common'; + +interface UsergroupsIncludeCount { + /** @description Include the number of users in each User Group. */ + include_count?: boolean; +} + +// https://api.slack.com/methods/usergroups.create +export interface UsergroupsCreateArguments extends TokenOverridable, OptionalTeamAssignable, UsergroupsIncludeCount { + /** @description A name for the User Group. Must be unique among User Groups. */ + name: string; + /** @description A comma separated string of encoded channel IDs for which the User Group uses as a default. */ + channels?: string; + /** @description A short description of the User Group. */ + description?: string; + /** @description A mention handle. Must be unique among channels, users and User Groups. */ + handle?: string; +} +// https://api.slack.com/methods/usergroups.disable +export interface UsergroupsDisableArguments extends TokenOverridable, OptionalTeamAssignable, UsergroupsIncludeCount { + /** @description The encoded ID of the User Group to disable. */ + usergroup: string; +} +// https://api.slack.com/methods/usergroups.enable +export interface UsergroupsEnableArguments extends TokenOverridable, OptionalTeamAssignable, UsergroupsIncludeCount { + /** @description The encoded ID of the User Group to enable. */ + usergroup: string; +} +// https://api.slack.com/methods/usergroups.list +export interface UsergroupsListArguments extends TokenOverridable, OptionalTeamAssignable, UsergroupsIncludeCount { + /** @description Include disabled User Groups. */ + include_disabled?: boolean; + /** @description Include the list of users for each User Group. */ + include_users?: boolean; +} +// https://api.slack.com/methods/usergroups.update +export interface UsergroupsUpdateArguments extends TokenOverridable, OptionalTeamAssignable, + Partial { + /** @description The encoded ID of the User Group to update. */ + usergroup: string; +} +// https://api.slack.com/methods/usergroups.users.list +export interface UsergroupsUsersListArguments extends TokenOverridable, OptionalTeamAssignable { + /** @description The encoded ID of the User Group to list users for. */ + usergroup: string; + /** @description Allow results that involve disabled User Groups. */ + include_disabled?: boolean; +} +// https://api.slack.com/methods/usergroups.users.update +export interface UsergroupsUsersUpdateArguments extends TokenOverridable, OptionalTeamAssignable, + UsergroupsIncludeCount { + /** @description The encoded ID of the User Group to update users for. */ + usergroup: string; + /** + * @description A comma separated string of encoded user IDs that represent the entire list of users for + * the User Group. + */ + users: string; +} diff --git a/packages/web-api/src/types/request/users.ts b/packages/web-api/src/types/request/users.ts new file mode 100644 index 000000000..c13f74f91 --- /dev/null +++ b/packages/web-api/src/types/request/users.ts @@ -0,0 +1,88 @@ +import { Stream } from 'node:stream'; +import { TokenOverridable, CursorPaginationEnabled, OptionalTeamAssignable, LocaleAware } from './common'; + +// https://api.slack.com/methods/users.conversations +export interface UsersConversationsArguments extends TokenOverridable, CursorPaginationEnabled, OptionalTeamAssignable { + /** @description Set to `true` to exclude archived channels from the list. Default is `false`. */ + exclude_archived?: boolean; + /** + * @description Mix and match channel types by providing a comma-separated list of any combination of + * `public_channel`, `private_channel`, `mpim` and `im`. Defaults to `public_channel`. + */ + types?: string; + /** + * @description Browse conversations by a specific user ID's membership. + * Non-public channels are restricted to those where the calling user shares membership. + */ + user?: string; +} +// https://api.slack.com/methods/users.deletePhoto +export interface UsersDeletePhotoArguments extends TokenOverridable { } +// https://api.slack.com/methods/users.getPresence +export interface UsersGetPresenceArguments extends TokenOverridable { + /** @description User to get presence info on. Defaults to the authed user. */ + user?: string; +} +// https://api.slack.com/methods/users.identity +export interface UsersIdentityArguments extends TokenOverridable { } +// https://api.slack.com/methods/users.info +export interface UsersInfoArguments extends TokenOverridable, LocaleAware { + /** @description User to get info on. */ + user: string; +} +// https://api.slack.com/methods/users.list +export interface UsersListArguments extends TokenOverridable, CursorPaginationEnabled, + LocaleAware, OptionalTeamAssignable { } +// https://api.slack.com/methods/users.lookupByEmail +export interface UsersLookupByEmailArguments extends TokenOverridable { + /** @description An email address belonging to a user in the workspace */ + email: string; +} +// https://api.slack.com/methods/users.setPhoto +export interface UsersSetPhotoArguments extends TokenOverridable { + /** @description Image file contents. */ + image: Buffer | Stream; + /** @description Width/height of crop box (always square). */ + crop_w?: number; + /** @description X coordinate of top-left corner of crop box. */ + crop_x?: number; + /** @description Y coordinate of top-left corner of crop box. */ + crop_y?: number; +} +// https://api.slack.com/methods/users.setPresence +export interface UsersSetPresenceArguments extends TokenOverridable { + /** @description Either `auto` or `away`. */ + presence: 'auto' | 'away'; +} +// https://api.slack.com/methods/users.profile.get +export interface UsersProfileGetArguments extends TokenOverridable { + /** + * @description Include labels for each ID in custom profile fields. + * Using this parameter will heavily rate-limit your requests and is not recommended. Defaults to `false`. + */ + include_labels?: boolean; + /** @description User to retrieve profile info for. */ + user?: string; +} +// https://api.slack.com/methods/users.profile.set +export interface UsersProfileSetArguments extends TokenOverridable { + /** + * @description Sets profile fields using a single argument. + * Collection of key:value pairs presented. + * At most 50 fields may be set. Each field name is limited to 255 characters. + * @see {@link https://api.slack.com/methods/users.profile.set#profile-fields `users.profile.set` Profile fields usage info}. + */ + profile?: Record; + /** @description ID of user to change. This argument may only be specified by admins on paid teams. */ + user?: string; // must be an admin user and must be on a paid plan + /** + * @description Name of a single profile field to set. If both `name` and `profile` are set, `name` takes precedence. + * @see {@link https://api.slack.com/methods/users.profile.set#profile-fields `users.profile.set` Profile fields usage info}. + */ + name?: string; + /** + * @description Value to set for the profile field specified by `name`. Usable only if profile is not passed. + * @see {@link https://api.slack.com/methods/users.profile.set#profile-fields `users.profile.set` Profile fields usage info}. + */ + value?: string; +} diff --git a/packages/web-api/src/types/request/views.ts b/packages/web-api/src/types/request/views.ts new file mode 100644 index 000000000..186533e23 --- /dev/null +++ b/packages/web-api/src/types/request/views.ts @@ -0,0 +1,59 @@ +import { View } from '@slack/types'; +import { TokenOverridable } from './common'; + +interface BaseViewsArguments { + /** @description A {@link https://api.slack.com/reference/surfaces/views view payload}. */ + view: View; +} + +interface ViewTriggerId { + /** + * @description An access token originating from a user interaction in the Slack client. + * One of `trigger_id` or `interactivity_pointer` is required to interact with views. + */ + trigger_id: string; +} +interface ViewInteractivityPointer { + /** + * @description An access token originating from a user interaction in the Slack client. + * One of `trigger_id` or `interactivity_pointer` is required to interact with views. + */ + interactivity_pointer: string; +} + +// https://api.slack.com/methods/views.open +export type ViewsOpenArguments = BaseViewsArguments & TokenOverridable & (ViewTriggerId | ViewInteractivityPointer); + +// https://api.slack.com/methods/views.push +export type ViewsPushArguments = BaseViewsArguments & TokenOverridable & (ViewTriggerId | ViewInteractivityPointer); + +interface ViewHash { + /** + * @description A string that represents view state to protect against possible race conditions. + * @see {@link https://api.slack.com/surfaces/modals#handling_race_conditions Avoiding race conditions when using views}. + */ + hash?: string; +} + +// https://api.slack.com/methods/views.publish +export interface ViewsPublishArguments extends BaseViewsArguments, TokenOverridable, ViewHash { + /** @description ID of the user you want publish a view to. */ + user_id: string; +} + +interface ViewExternalId { + /** + * @description A unique identifier of the view set by the developer. Must be unique for all views on a team. + * Max length of 255 characters. Either `view_id` or `external_id` is required. + */ + external_id: string; +} +interface ViewViewId { + /** + * @description A unique identifier of the view to be updated. Either `view_id` or `external_id` is required. + */ + view_id: string; +} + +// https://api.slack.com/methods/views.update +export type ViewsUpdateArguments = BaseViewsArguments & TokenOverridable & (ViewExternalId | ViewViewId) & ViewHash; diff --git a/packages/web-api/src/types/request/workflows.ts b/packages/web-api/src/types/request/workflows.ts new file mode 100644 index 000000000..6fc387c7c --- /dev/null +++ b/packages/web-api/src/types/request/workflows.ts @@ -0,0 +1,39 @@ +import { TokenOverridable } from './common'; + +// TODO: breaking change: to be removed after Sep 12 2024 +// https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back + +// https://api.slack.com/methods/workflows.stepCompleted +export interface WorkflowsStepCompletedArguments extends TokenOverridable { + workflow_step_execute_id: string; + outputs?: Record; +} +// https://api.slack.com/methods/workflows.stepFailed +export interface WorkflowsStepFailedArguments extends TokenOverridable { + workflow_step_execute_id: string; + error: { + message: string; + }; +} +// https://api.slack.com/methods/workflows.updateStep +export interface WorkflowsUpdateStepArguments extends TokenOverridable { + workflow_step_edit_id: string; + step_image_url?: string; + step_name?: string; + inputs?: { + [name: string]: { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any; + skip_variable_replacement?: boolean; + variables?: { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + }; + }, + }; + outputs?: { + type: string; + name: string; + label: string; + }[]; +} diff --git a/packages/web-api/src/response/AdminAnalyticsGetFileResponse.ts b/packages/web-api/src/types/response/AdminAnalyticsGetFileResponse.ts similarity index 75% rename from packages/web-api/src/response/AdminAnalyticsGetFileResponse.ts rename to packages/web-api/src/types/response/AdminAnalyticsGetFileResponse.ts index f5a1a9d1f..45bdc77f1 100644 --- a/packages/web-api/src/response/AdminAnalyticsGetFileResponse.ts +++ b/packages/web-api/src/types/response/AdminAnalyticsGetFileResponse.ts @@ -1,16 +1,8 @@ -/* 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. // -// // -///////////////////////////////////////////////////////////////////////////////////////// +/* eslint-disable no-multi-spaces,max-len */ +import { WebAPICallResult } from '../../WebClient'; -import { WebAPICallResult } from '../WebClient'; export type AdminAnalyticsGetFileResponse = WebAPICallResult & { - file_data?: Array[]; + file_data?: (AdminAnalyticsMemberDetails | AdminAnalyticsPublicChannelDetails | AdminAnalyticsPublicChannelMetadataDetails)[]; error?: string; needed?: string; ok?: boolean; @@ -24,6 +16,7 @@ export interface ResponseMetadata { export interface AdminAnalyticsMemberDetails { enterprise_id: string; + team_id: string; date: string; user_id: string; email_address: string; diff --git a/packages/web-api/src/response/AdminAppsActivitiesListResponse.ts b/packages/web-api/src/types/response/AdminAppsActivitiesListResponse.ts similarity index 97% rename from packages/web-api/src/response/AdminAppsActivitiesListResponse.ts rename to packages/web-api/src/types/response/AdminAppsActivitiesListResponse.ts index 21ee1ddeb..7a1f08579 100644 --- a/packages/web-api/src/response/AdminAppsActivitiesListResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsActivitiesListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsActivitiesListResponse = WebAPICallResult & { activities?: Activity[]; error?: string; diff --git a/packages/web-api/src/response/AdminAppsApproveResponse.ts b/packages/web-api/src/types/response/AdminAppsApproveResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminAppsApproveResponse.ts rename to packages/web-api/src/types/response/AdminAppsApproveResponse.ts index 1dfa667cb..0cf8c7d11 100644 --- a/packages/web-api/src/response/AdminAppsApproveResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsApproveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsApproveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminAppsApprovedListResponse.ts b/packages/web-api/src/types/response/AdminAppsApprovedListResponse.ts similarity index 97% rename from packages/web-api/src/response/AdminAppsApprovedListResponse.ts rename to packages/web-api/src/types/response/AdminAppsApprovedListResponse.ts index eda0f2cd4..a55adddff 100644 --- a/packages/web-api/src/response/AdminAppsApprovedListResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsApprovedListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsApprovedListResponse = WebAPICallResult & { approved_apps?: ApprovedApp[]; error?: string; diff --git a/packages/web-api/src/response/AdminAppsClearResolutionResponse.ts b/packages/web-api/src/types/response/AdminAppsClearResolutionResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminAppsClearResolutionResponse.ts rename to packages/web-api/src/types/response/AdminAppsClearResolutionResponse.ts index 3b61c2e93..8b93a3442 100644 --- a/packages/web-api/src/response/AdminAppsClearResolutionResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsClearResolutionResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsClearResolutionResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminAppsConfigLookupResponse.ts b/packages/web-api/src/types/response/AdminAppsConfigLookupResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminAppsConfigLookupResponse.ts rename to packages/web-api/src/types/response/AdminAppsConfigLookupResponse.ts index 5598a7bc4..7f7ff871a 100644 --- a/packages/web-api/src/response/AdminAppsConfigLookupResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsConfigLookupResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsConfigLookupResponse = WebAPICallResult & { configs?: Config[]; error?: string; diff --git a/packages/web-api/src/response/AdminAppsConfigSetResponse.ts b/packages/web-api/src/types/response/AdminAppsConfigSetResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminAppsConfigSetResponse.ts rename to packages/web-api/src/types/response/AdminAppsConfigSetResponse.ts index 699d1b02b..e6644768b 100644 --- a/packages/web-api/src/response/AdminAppsConfigSetResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsConfigSetResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsConfigSetResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminAppsRequestsCancelResponse.ts b/packages/web-api/src/types/response/AdminAppsRequestsCancelResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminAppsRequestsCancelResponse.ts rename to packages/web-api/src/types/response/AdminAppsRequestsCancelResponse.ts index 8a79bde52..482f4a7a5 100644 --- a/packages/web-api/src/response/AdminAppsRequestsCancelResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsRequestsCancelResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsRequestsCancelResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminAppsRequestsListResponse.ts b/packages/web-api/src/types/response/AdminAppsRequestsListResponse.ts similarity index 97% rename from packages/web-api/src/response/AdminAppsRequestsListResponse.ts rename to packages/web-api/src/types/response/AdminAppsRequestsListResponse.ts index a9b46e40f..a6789f520 100644 --- a/packages/web-api/src/response/AdminAppsRequestsListResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsRequestsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsRequestsListResponse = WebAPICallResult & { app_requests?: AppRequest[]; error?: string; diff --git a/packages/web-api/src/response/AdminAppsRestrictResponse.ts b/packages/web-api/src/types/response/AdminAppsRestrictResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminAppsRestrictResponse.ts rename to packages/web-api/src/types/response/AdminAppsRestrictResponse.ts index c8641fe3e..421941cd3 100644 --- a/packages/web-api/src/response/AdminAppsRestrictResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsRestrictResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsRestrictResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminAppsRestrictedListResponse.ts b/packages/web-api/src/types/response/AdminAppsRestrictedListResponse.ts similarity index 97% rename from packages/web-api/src/response/AdminAppsRestrictedListResponse.ts rename to packages/web-api/src/types/response/AdminAppsRestrictedListResponse.ts index 65bb454df..da9cbe5e3 100644 --- a/packages/web-api/src/response/AdminAppsRestrictedListResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsRestrictedListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsRestrictedListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminAppsUninstallResponse.ts b/packages/web-api/src/types/response/AdminAppsUninstallResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminAppsUninstallResponse.ts rename to packages/web-api/src/types/response/AdminAppsUninstallResponse.ts index 9d3c17779..1d255b306 100644 --- a/packages/web-api/src/response/AdminAppsUninstallResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsUninstallResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAppsUninstallResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminAuthPolicyAssignEntitiesResponse.ts b/packages/web-api/src/types/response/AdminAuthPolicyAssignEntitiesResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminAuthPolicyAssignEntitiesResponse.ts rename to packages/web-api/src/types/response/AdminAuthPolicyAssignEntitiesResponse.ts index d43f9dd10..cc060ee19 100644 --- a/packages/web-api/src/response/AdminAuthPolicyAssignEntitiesResponse.ts +++ b/packages/web-api/src/types/response/AdminAuthPolicyAssignEntitiesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAuthPolicyAssignEntitiesResponse = WebAPICallResult & { entity_total_count?: number; error?: string; diff --git a/packages/web-api/src/response/AdminAuthPolicyGetEntitiesResponse.ts b/packages/web-api/src/types/response/AdminAuthPolicyGetEntitiesResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminAuthPolicyGetEntitiesResponse.ts rename to packages/web-api/src/types/response/AdminAuthPolicyGetEntitiesResponse.ts index cdbd16175..38379751b 100644 --- a/packages/web-api/src/response/AdminAuthPolicyGetEntitiesResponse.ts +++ b/packages/web-api/src/types/response/AdminAuthPolicyGetEntitiesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAuthPolicyGetEntitiesResponse = WebAPICallResult & { entities?: Entity[]; entity_total_count?: number; diff --git a/packages/web-api/src/response/AdminAuthPolicyRemoveEntitiesResponse.ts b/packages/web-api/src/types/response/AdminAuthPolicyRemoveEntitiesResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminAuthPolicyRemoveEntitiesResponse.ts rename to packages/web-api/src/types/response/AdminAuthPolicyRemoveEntitiesResponse.ts index baa60b6c1..0ffb418c1 100644 --- a/packages/web-api/src/response/AdminAuthPolicyRemoveEntitiesResponse.ts +++ b/packages/web-api/src/types/response/AdminAuthPolicyRemoveEntitiesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminAuthPolicyRemoveEntitiesResponse = WebAPICallResult & { entity_total_count?: number; error?: string; diff --git a/packages/web-api/src/response/AdminBarriersCreateResponse.ts b/packages/web-api/src/types/response/AdminBarriersCreateResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminBarriersCreateResponse.ts rename to packages/web-api/src/types/response/AdminBarriersCreateResponse.ts index 81f263492..9d89f1870 100644 --- a/packages/web-api/src/response/AdminBarriersCreateResponse.ts +++ b/packages/web-api/src/types/response/AdminBarriersCreateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminBarriersCreateResponse = WebAPICallResult & { barrier?: Barrier; error?: string; diff --git a/packages/web-api/src/response/AdminBarriersDeleteResponse.ts b/packages/web-api/src/types/response/AdminBarriersDeleteResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminBarriersDeleteResponse.ts rename to packages/web-api/src/types/response/AdminBarriersDeleteResponse.ts index f45d25d56..43f889e0a 100644 --- a/packages/web-api/src/response/AdminBarriersDeleteResponse.ts +++ b/packages/web-api/src/types/response/AdminBarriersDeleteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminBarriersDeleteResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminBarriersListResponse.ts b/packages/web-api/src/types/response/AdminBarriersListResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminBarriersListResponse.ts rename to packages/web-api/src/types/response/AdminBarriersListResponse.ts index ad1150d93..c6b22ef97 100644 --- a/packages/web-api/src/response/AdminBarriersListResponse.ts +++ b/packages/web-api/src/types/response/AdminBarriersListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminBarriersListResponse = WebAPICallResult & { barriers?: Barrier[]; error?: string; diff --git a/packages/web-api/src/response/AdminBarriersUpdateResponse.ts b/packages/web-api/src/types/response/AdminBarriersUpdateResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminBarriersUpdateResponse.ts rename to packages/web-api/src/types/response/AdminBarriersUpdateResponse.ts index 8d0bd460c..2a78ebd1a 100644 --- a/packages/web-api/src/response/AdminBarriersUpdateResponse.ts +++ b/packages/web-api/src/types/response/AdminBarriersUpdateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminBarriersUpdateResponse = WebAPICallResult & { barrier?: Barrier; error?: string; diff --git a/packages/web-api/src/response/AdminConversationsArchiveResponse.ts b/packages/web-api/src/types/response/AdminConversationsArchiveResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsArchiveResponse.ts rename to packages/web-api/src/types/response/AdminConversationsArchiveResponse.ts index 5f3245166..28894add2 100644 --- a/packages/web-api/src/response/AdminConversationsArchiveResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsArchiveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsArchiveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsBulkArchiveResponse.ts b/packages/web-api/src/types/response/AdminConversationsBulkArchiveResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsBulkArchiveResponse.ts rename to packages/web-api/src/types/response/AdminConversationsBulkArchiveResponse.ts index b9c6cc5ea..c8e892450 100644 --- a/packages/web-api/src/response/AdminConversationsBulkArchiveResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsBulkArchiveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsBulkArchiveResponse = WebAPICallResult & { bulk_action_id?: string; error?: string; diff --git a/packages/web-api/src/response/AdminConversationsBulkDeleteResponse.ts b/packages/web-api/src/types/response/AdminConversationsBulkDeleteResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsBulkDeleteResponse.ts rename to packages/web-api/src/types/response/AdminConversationsBulkDeleteResponse.ts index 4b56d7d9a..4adf68ece 100644 --- a/packages/web-api/src/response/AdminConversationsBulkDeleteResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsBulkDeleteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsBulkDeleteResponse = WebAPICallResult & { bulk_action_id?: string; error?: string; diff --git a/packages/web-api/src/response/AdminConversationsBulkMoveResponse.ts b/packages/web-api/src/types/response/AdminConversationsBulkMoveResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsBulkMoveResponse.ts rename to packages/web-api/src/types/response/AdminConversationsBulkMoveResponse.ts index ad48728f9..2be45b703 100644 --- a/packages/web-api/src/response/AdminConversationsBulkMoveResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsBulkMoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsBulkMoveResponse = WebAPICallResult & { bulk_action_id?: string; error?: string; diff --git a/packages/web-api/src/response/AdminConversationsConvertToPrivateResponse.ts b/packages/web-api/src/types/response/AdminConversationsConvertToPrivateResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsConvertToPrivateResponse.ts rename to packages/web-api/src/types/response/AdminConversationsConvertToPrivateResponse.ts index 0daf955f0..28085a659 100644 --- a/packages/web-api/src/response/AdminConversationsConvertToPrivateResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsConvertToPrivateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsConvertToPrivateResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsConvertToPublicResponse.ts b/packages/web-api/src/types/response/AdminConversationsConvertToPublicResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsConvertToPublicResponse.ts rename to packages/web-api/src/types/response/AdminConversationsConvertToPublicResponse.ts index b3719eb1b..9a7b9523f 100644 --- a/packages/web-api/src/response/AdminConversationsConvertToPublicResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsConvertToPublicResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsConvertToPublicResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsCreateResponse.ts b/packages/web-api/src/types/response/AdminConversationsCreateResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsCreateResponse.ts rename to packages/web-api/src/types/response/AdminConversationsCreateResponse.ts index 523820f35..fdaa5141d 100644 --- a/packages/web-api/src/response/AdminConversationsCreateResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsCreateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsCreateResponse = WebAPICallResult & { channel_id?: string; error?: string; diff --git a/packages/web-api/src/response/AdminConversationsDeleteResponse.ts b/packages/web-api/src/types/response/AdminConversationsDeleteResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsDeleteResponse.ts rename to packages/web-api/src/types/response/AdminConversationsDeleteResponse.ts index 85413b007..0f5d58e67 100644 --- a/packages/web-api/src/response/AdminConversationsDeleteResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsDeleteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsDeleteResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsDisconnectSharedResponse.ts b/packages/web-api/src/types/response/AdminConversationsDisconnectSharedResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsDisconnectSharedResponse.ts rename to packages/web-api/src/types/response/AdminConversationsDisconnectSharedResponse.ts index a9bca7b2c..9315d6bff 100644 --- a/packages/web-api/src/response/AdminConversationsDisconnectSharedResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsDisconnectSharedResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsDisconnectSharedResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts b/packages/web-api/src/types/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts rename to packages/web-api/src/types/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts index d2bf68c8d..0155f5cb0 100644 --- a/packages/web-api/src/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsEkmListOriginalConnectedChannelInfoResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsGetConversationPrefsResponse.ts b/packages/web-api/src/types/response/AdminConversationsGetConversationPrefsResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsGetConversationPrefsResponse.ts rename to packages/web-api/src/types/response/AdminConversationsGetConversationPrefsResponse.ts index 89596ab1c..53ccdd209 100644 --- a/packages/web-api/src/response/AdminConversationsGetConversationPrefsResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsGetConversationPrefsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsGetConversationPrefsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsGetCustomRetentionResponse.ts b/packages/web-api/src/types/response/AdminConversationsGetCustomRetentionResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsGetCustomRetentionResponse.ts rename to packages/web-api/src/types/response/AdminConversationsGetCustomRetentionResponse.ts index 658fd098e..88ca02175 100644 --- a/packages/web-api/src/response/AdminConversationsGetCustomRetentionResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsGetCustomRetentionResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsGetCustomRetentionResponse = WebAPICallResult & { duration_days?: number; error?: string; diff --git a/packages/web-api/src/response/AdminConversationsGetTeamsResponse.ts b/packages/web-api/src/types/response/AdminConversationsGetTeamsResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsGetTeamsResponse.ts rename to packages/web-api/src/types/response/AdminConversationsGetTeamsResponse.ts index 2e2c0e1d2..514a6714f 100644 --- a/packages/web-api/src/response/AdminConversationsGetTeamsResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsGetTeamsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsGetTeamsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsInviteResponse.ts b/packages/web-api/src/types/response/AdminConversationsInviteResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsInviteResponse.ts rename to packages/web-api/src/types/response/AdminConversationsInviteResponse.ts index 9120de636..b9c41cca3 100644 --- a/packages/web-api/src/response/AdminConversationsInviteResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsInviteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsInviteResponse = WebAPICallResult & { error?: string; failed_user_ids?: FailedUserids; diff --git a/packages/web-api/src/response/AdminConversationsLookupResponse.ts b/packages/web-api/src/types/response/AdminConversationsLookupResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsLookupResponse.ts rename to packages/web-api/src/types/response/AdminConversationsLookupResponse.ts index 1f8f856d2..b005c8a1c 100644 --- a/packages/web-api/src/response/AdminConversationsLookupResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsLookupResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsLookupResponse = WebAPICallResult & { channel_ids?: string[]; error?: string; diff --git a/packages/web-api/src/response/AdminConversationsRemoveCustomRetentionResponse.ts b/packages/web-api/src/types/response/AdminConversationsRemoveCustomRetentionResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsRemoveCustomRetentionResponse.ts rename to packages/web-api/src/types/response/AdminConversationsRemoveCustomRetentionResponse.ts index 8ae943165..061c1982c 100644 --- a/packages/web-api/src/response/AdminConversationsRemoveCustomRetentionResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsRemoveCustomRetentionResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsRemoveCustomRetentionResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsRenameResponse.ts b/packages/web-api/src/types/response/AdminConversationsRenameResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsRenameResponse.ts rename to packages/web-api/src/types/response/AdminConversationsRenameResponse.ts index f9ea33e15..96a112652 100644 --- a/packages/web-api/src/response/AdminConversationsRenameResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsRenameResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsRenameResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsRestrictAccessAddGroupResponse.ts b/packages/web-api/src/types/response/AdminConversationsRestrictAccessAddGroupResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsRestrictAccessAddGroupResponse.ts rename to packages/web-api/src/types/response/AdminConversationsRestrictAccessAddGroupResponse.ts index 50e347e5f..84ee9d5aa 100644 --- a/packages/web-api/src/response/AdminConversationsRestrictAccessAddGroupResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsRestrictAccessAddGroupResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsRestrictAccessAddGroupResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsRestrictAccessListGroupsResponse.ts b/packages/web-api/src/types/response/AdminConversationsRestrictAccessListGroupsResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsRestrictAccessListGroupsResponse.ts rename to packages/web-api/src/types/response/AdminConversationsRestrictAccessListGroupsResponse.ts index 19a66370e..3c329d2e6 100644 --- a/packages/web-api/src/response/AdminConversationsRestrictAccessListGroupsResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsRestrictAccessListGroupsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsRestrictAccessListGroupsResponse = WebAPICallResult & { error?: string; group_ids?: string[]; diff --git a/packages/web-api/src/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts b/packages/web-api/src/types/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts rename to packages/web-api/src/types/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts index a6af9fc0c..b4037cd20 100644 --- a/packages/web-api/src/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsRestrictAccessRemoveGroupResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsSearchResponse.ts b/packages/web-api/src/types/response/AdminConversationsSearchResponse.ts similarity index 98% rename from packages/web-api/src/response/AdminConversationsSearchResponse.ts rename to packages/web-api/src/types/response/AdminConversationsSearchResponse.ts index c3cd9d254..490485f33 100644 --- a/packages/web-api/src/response/AdminConversationsSearchResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsSearchResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsSearchResponse = WebAPICallResult & { conversations?: Conversation[]; error?: string; diff --git a/packages/web-api/src/response/AdminConversationsSetConversationPrefsResponse.ts b/packages/web-api/src/types/response/AdminConversationsSetConversationPrefsResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsSetConversationPrefsResponse.ts rename to packages/web-api/src/types/response/AdminConversationsSetConversationPrefsResponse.ts index cc0a0ccac..b766006c3 100644 --- a/packages/web-api/src/response/AdminConversationsSetConversationPrefsResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsSetConversationPrefsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsSetConversationPrefsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsSetCustomRetentionResponse.ts b/packages/web-api/src/types/response/AdminConversationsSetCustomRetentionResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsSetCustomRetentionResponse.ts rename to packages/web-api/src/types/response/AdminConversationsSetCustomRetentionResponse.ts index c1dca9823..386770bea 100644 --- a/packages/web-api/src/response/AdminConversationsSetCustomRetentionResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsSetCustomRetentionResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsSetCustomRetentionResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsSetTeamsResponse.ts b/packages/web-api/src/types/response/AdminConversationsSetTeamsResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsSetTeamsResponse.ts rename to packages/web-api/src/types/response/AdminConversationsSetTeamsResponse.ts index 18ba8b188..14d142362 100644 --- a/packages/web-api/src/response/AdminConversationsSetTeamsResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsSetTeamsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsSetTeamsResponse = WebAPICallResult & { channel?: string; error?: string; diff --git a/packages/web-api/src/response/AdminConversationsUnarchiveResponse.ts b/packages/web-api/src/types/response/AdminConversationsUnarchiveResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminConversationsUnarchiveResponse.ts rename to packages/web-api/src/types/response/AdminConversationsUnarchiveResponse.ts index d09e5822e..ec47e149c 100644 --- a/packages/web-api/src/response/AdminConversationsUnarchiveResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsUnarchiveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsUnarchiveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsWhitelistAddResponse.ts b/packages/web-api/src/types/response/AdminConversationsWhitelistAddResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsWhitelistAddResponse.ts rename to packages/web-api/src/types/response/AdminConversationsWhitelistAddResponse.ts index d61b9870d..3dd0d1f9a 100644 --- a/packages/web-api/src/response/AdminConversationsWhitelistAddResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsWhitelistAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsWhitelistAddResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts b/packages/web-api/src/types/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts rename to packages/web-api/src/types/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts index 5bff9ba7a..6178e38e6 100644 --- a/packages/web-api/src/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsWhitelistListGroupsLinkedToChannelResponse = WebAPICallResult & { error?: string; group_ids?: string[]; diff --git a/packages/web-api/src/response/AdminConversationsWhitelistRemoveResponse.ts b/packages/web-api/src/types/response/AdminConversationsWhitelistRemoveResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminConversationsWhitelistRemoveResponse.ts rename to packages/web-api/src/types/response/AdminConversationsWhitelistRemoveResponse.ts index 6c0a6b285..58d02add2 100644 --- a/packages/web-api/src/response/AdminConversationsWhitelistRemoveResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsWhitelistRemoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminConversationsWhitelistRemoveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminEmojiAddAliasResponse.ts b/packages/web-api/src/types/response/AdminEmojiAddAliasResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminEmojiAddAliasResponse.ts rename to packages/web-api/src/types/response/AdminEmojiAddAliasResponse.ts index 860840cc6..c9c4e73d9 100644 --- a/packages/web-api/src/response/AdminEmojiAddAliasResponse.ts +++ b/packages/web-api/src/types/response/AdminEmojiAddAliasResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminEmojiAddAliasResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminEmojiAddResponse.ts b/packages/web-api/src/types/response/AdminEmojiAddResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminEmojiAddResponse.ts rename to packages/web-api/src/types/response/AdminEmojiAddResponse.ts index 9f521c3f0..b78e3118b 100644 --- a/packages/web-api/src/response/AdminEmojiAddResponse.ts +++ b/packages/web-api/src/types/response/AdminEmojiAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminEmojiAddResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminEmojiListResponse.ts b/packages/web-api/src/types/response/AdminEmojiListResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminEmojiListResponse.ts rename to packages/web-api/src/types/response/AdminEmojiListResponse.ts index 244603910..d6cae5fe1 100644 --- a/packages/web-api/src/response/AdminEmojiListResponse.ts +++ b/packages/web-api/src/types/response/AdminEmojiListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminEmojiListResponse = WebAPICallResult & { emoji?: { [key: string]: Emoji }; error?: string; diff --git a/packages/web-api/src/response/AdminEmojiRemoveResponse.ts b/packages/web-api/src/types/response/AdminEmojiRemoveResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminEmojiRemoveResponse.ts rename to packages/web-api/src/types/response/AdminEmojiRemoveResponse.ts index ed5ea1a26..550948e3f 100644 --- a/packages/web-api/src/response/AdminEmojiRemoveResponse.ts +++ b/packages/web-api/src/types/response/AdminEmojiRemoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminEmojiRemoveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminEmojiRenameResponse.ts b/packages/web-api/src/types/response/AdminEmojiRenameResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminEmojiRenameResponse.ts rename to packages/web-api/src/types/response/AdminEmojiRenameResponse.ts index 9d389e245..a296a2577 100644 --- a/packages/web-api/src/response/AdminEmojiRenameResponse.ts +++ b/packages/web-api/src/types/response/AdminEmojiRenameResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminEmojiRenameResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminFunctionsListResponse.ts b/packages/web-api/src/types/response/AdminFunctionsListResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminFunctionsListResponse.ts rename to packages/web-api/src/types/response/AdminFunctionsListResponse.ts index 13dfcd56d..4817f3cca 100644 --- a/packages/web-api/src/response/AdminFunctionsListResponse.ts +++ b/packages/web-api/src/types/response/AdminFunctionsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminFunctionsListResponse = WebAPICallResult & { error?: string; functions?: Function[]; diff --git a/packages/web-api/src/response/AdminFunctionsPermissionsLookupResponse.ts b/packages/web-api/src/types/response/AdminFunctionsPermissionsLookupResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminFunctionsPermissionsLookupResponse.ts rename to packages/web-api/src/types/response/AdminFunctionsPermissionsLookupResponse.ts index 2b4a557c5..e28455e47 100644 --- a/packages/web-api/src/response/AdminFunctionsPermissionsLookupResponse.ts +++ b/packages/web-api/src/types/response/AdminFunctionsPermissionsLookupResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminFunctionsPermissionsLookupResponse = WebAPICallResult & { error?: string; errors?: Errors; diff --git a/packages/web-api/src/response/AdminFunctionsPermissionsSetResponse.ts b/packages/web-api/src/types/response/AdminFunctionsPermissionsSetResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminFunctionsPermissionsSetResponse.ts rename to packages/web-api/src/types/response/AdminFunctionsPermissionsSetResponse.ts index 981bbee91..0e7ed2c80 100644 --- a/packages/web-api/src/response/AdminFunctionsPermissionsSetResponse.ts +++ b/packages/web-api/src/types/response/AdminFunctionsPermissionsSetResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminFunctionsPermissionsSetResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminInviteRequestsApproveResponse.ts b/packages/web-api/src/types/response/AdminInviteRequestsApproveResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminInviteRequestsApproveResponse.ts rename to packages/web-api/src/types/response/AdminInviteRequestsApproveResponse.ts index f44d12410..2052e0f0c 100644 --- a/packages/web-api/src/response/AdminInviteRequestsApproveResponse.ts +++ b/packages/web-api/src/types/response/AdminInviteRequestsApproveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminInviteRequestsApproveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminInviteRequestsApprovedListResponse.ts b/packages/web-api/src/types/response/AdminInviteRequestsApprovedListResponse.ts similarity index 97% rename from packages/web-api/src/response/AdminInviteRequestsApprovedListResponse.ts rename to packages/web-api/src/types/response/AdminInviteRequestsApprovedListResponse.ts index 6b24c14be..888bef004 100644 --- a/packages/web-api/src/response/AdminInviteRequestsApprovedListResponse.ts +++ b/packages/web-api/src/types/response/AdminInviteRequestsApprovedListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminInviteRequestsApprovedListResponse = WebAPICallResult & { approved_requests?: ApprovedRequest[]; error?: string; diff --git a/packages/web-api/src/response/AdminInviteRequestsDeniedListResponse.ts b/packages/web-api/src/types/response/AdminInviteRequestsDeniedListResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminInviteRequestsDeniedListResponse.ts rename to packages/web-api/src/types/response/AdminInviteRequestsDeniedListResponse.ts index b6c69e024..585d5bf07 100644 --- a/packages/web-api/src/response/AdminInviteRequestsDeniedListResponse.ts +++ b/packages/web-api/src/types/response/AdminInviteRequestsDeniedListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminInviteRequestsDeniedListResponse = WebAPICallResult & { denied_requests?: DeniedRequest[]; error?: string; diff --git a/packages/web-api/src/response/AdminInviteRequestsDenyResponse.ts b/packages/web-api/src/types/response/AdminInviteRequestsDenyResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminInviteRequestsDenyResponse.ts rename to packages/web-api/src/types/response/AdminInviteRequestsDenyResponse.ts index 836e8021e..5a99fdc89 100644 --- a/packages/web-api/src/response/AdminInviteRequestsDenyResponse.ts +++ b/packages/web-api/src/types/response/AdminInviteRequestsDenyResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminInviteRequestsDenyResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminInviteRequestsListResponse.ts b/packages/web-api/src/types/response/AdminInviteRequestsListResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminInviteRequestsListResponse.ts rename to packages/web-api/src/types/response/AdminInviteRequestsListResponse.ts index 5c85d6c22..065d692b4 100644 --- a/packages/web-api/src/response/AdminInviteRequestsListResponse.ts +++ b/packages/web-api/src/types/response/AdminInviteRequestsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminInviteRequestsListResponse = WebAPICallResult & { error?: string; invite_requests?: InviteRequest[]; diff --git a/packages/web-api/src/response/AdminRolesAddAssignmentsResponse.ts b/packages/web-api/src/types/response/AdminRolesAddAssignmentsResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminRolesAddAssignmentsResponse.ts rename to packages/web-api/src/types/response/AdminRolesAddAssignmentsResponse.ts index a18d7382c..a4ce1d0b2 100644 --- a/packages/web-api/src/response/AdminRolesAddAssignmentsResponse.ts +++ b/packages/web-api/src/types/response/AdminRolesAddAssignmentsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminRolesAddAssignmentsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminRolesListAssignmentsResponse.ts b/packages/web-api/src/types/response/AdminRolesListAssignmentsResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminRolesListAssignmentsResponse.ts rename to packages/web-api/src/types/response/AdminRolesListAssignmentsResponse.ts index 60c67a925..995cac37a 100644 --- a/packages/web-api/src/response/AdminRolesListAssignmentsResponse.ts +++ b/packages/web-api/src/types/response/AdminRolesListAssignmentsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminRolesListAssignmentsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminRolesRemoveAssignmentsResponse.ts b/packages/web-api/src/types/response/AdminRolesRemoveAssignmentsResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminRolesRemoveAssignmentsResponse.ts rename to packages/web-api/src/types/response/AdminRolesRemoveAssignmentsResponse.ts index 4178988e6..34fdfe08f 100644 --- a/packages/web-api/src/response/AdminRolesRemoveAssignmentsResponse.ts +++ b/packages/web-api/src/types/response/AdminRolesRemoveAssignmentsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminRolesRemoveAssignmentsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminTeamsAdminsListResponse.ts b/packages/web-api/src/types/response/AdminTeamsAdminsListResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminTeamsAdminsListResponse.ts rename to packages/web-api/src/types/response/AdminTeamsAdminsListResponse.ts index 089b56cd3..32eb6e58c 100644 --- a/packages/web-api/src/response/AdminTeamsAdminsListResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsAdminsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminTeamsAdminsListResponse = WebAPICallResult & { admin_ids?: string[]; error?: string; diff --git a/packages/web-api/src/response/AdminTeamsCreateResponse.ts b/packages/web-api/src/types/response/AdminTeamsCreateResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminTeamsCreateResponse.ts rename to packages/web-api/src/types/response/AdminTeamsCreateResponse.ts index 1bbdc66f6..e72883553 100644 --- a/packages/web-api/src/response/AdminTeamsCreateResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsCreateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminTeamsCreateResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminTeamsListResponse.ts b/packages/web-api/src/types/response/AdminTeamsListResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminTeamsListResponse.ts rename to packages/web-api/src/types/response/AdminTeamsListResponse.ts index 4df5ccc3f..be065d101 100644 --- a/packages/web-api/src/response/AdminTeamsListResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminTeamsListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminTeamsOwnersListResponse.ts b/packages/web-api/src/types/response/AdminTeamsOwnersListResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminTeamsOwnersListResponse.ts rename to packages/web-api/src/types/response/AdminTeamsOwnersListResponse.ts index 1ae0ec2a2..3290fe2ea 100644 --- a/packages/web-api/src/response/AdminTeamsOwnersListResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsOwnersListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminTeamsOwnersListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminTeamsSettingsInfoResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsInfoResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminTeamsSettingsInfoResponse.ts rename to packages/web-api/src/types/response/AdminTeamsSettingsInfoResponse.ts index 18e0fcbfb..ceca46eba 100644 --- a/packages/web-api/src/response/AdminTeamsSettingsInfoResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsInfoResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts rename to packages/web-api/src/types/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts index c77e03725..2890c8709 100644 --- a/packages/web-api/src/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsSetDefaultChannelsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminTeamsSettingsSetDescriptionResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsSetDescriptionResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminTeamsSettingsSetDescriptionResponse.ts rename to packages/web-api/src/types/response/AdminTeamsSettingsSetDescriptionResponse.ts index 29e787c13..141c2337a 100644 --- a/packages/web-api/src/response/AdminTeamsSettingsSetDescriptionResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsSetDescriptionResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsSetDescriptionResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts rename to packages/web-api/src/types/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts index bb0d54400..fbdb00319 100644 --- a/packages/web-api/src/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsSetDiscoverabilityResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminTeamsSettingsSetIconResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsSetIconResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminTeamsSettingsSetIconResponse.ts rename to packages/web-api/src/types/response/AdminTeamsSettingsSetIconResponse.ts index 3e73ca3f6..c0f258d14 100644 --- a/packages/web-api/src/response/AdminTeamsSettingsSetIconResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsSetIconResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsSetIconResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminTeamsSettingsSetNameResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsSetNameResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminTeamsSettingsSetNameResponse.ts rename to packages/web-api/src/types/response/AdminTeamsSettingsSetNameResponse.ts index e3f8aaed8..9a11beda4 100644 --- a/packages/web-api/src/response/AdminTeamsSettingsSetNameResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsSetNameResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsSetNameResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsergroupsAddChannelsResponse.ts b/packages/web-api/src/types/response/AdminUsergroupsAddChannelsResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsergroupsAddChannelsResponse.ts rename to packages/web-api/src/types/response/AdminUsergroupsAddChannelsResponse.ts index f3dcc7600..02547b181 100644 --- a/packages/web-api/src/response/AdminUsergroupsAddChannelsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsergroupsAddChannelsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsergroupsAddChannelsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsergroupsAddTeamsResponse.ts b/packages/web-api/src/types/response/AdminUsergroupsAddTeamsResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsergroupsAddTeamsResponse.ts rename to packages/web-api/src/types/response/AdminUsergroupsAddTeamsResponse.ts index d27ffa4d9..8c41a2b08 100644 --- a/packages/web-api/src/response/AdminUsergroupsAddTeamsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsergroupsAddTeamsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsergroupsAddTeamsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsergroupsListChannelsResponse.ts b/packages/web-api/src/types/response/AdminUsergroupsListChannelsResponse.ts similarity index 97% rename from packages/web-api/src/response/AdminUsergroupsListChannelsResponse.ts rename to packages/web-api/src/types/response/AdminUsergroupsListChannelsResponse.ts index afec01399..34cdabb1e 100644 --- a/packages/web-api/src/response/AdminUsergroupsListChannelsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsergroupsListChannelsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsergroupsListChannelsResponse = WebAPICallResult & { channels?: Channel[]; error?: string; diff --git a/packages/web-api/src/response/AdminUsergroupsRemoveChannelsResponse.ts b/packages/web-api/src/types/response/AdminUsergroupsRemoveChannelsResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsergroupsRemoveChannelsResponse.ts rename to packages/web-api/src/types/response/AdminUsergroupsRemoveChannelsResponse.ts index b01e4fb6b..b7f30080c 100644 --- a/packages/web-api/src/response/AdminUsergroupsRemoveChannelsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsergroupsRemoveChannelsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsergroupsRemoveChannelsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersAssignResponse.ts b/packages/web-api/src/types/response/AdminUsersAssignResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersAssignResponse.ts rename to packages/web-api/src/types/response/AdminUsersAssignResponse.ts index d9b31063d..58c1ba8ed 100644 --- a/packages/web-api/src/response/AdminUsersAssignResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersAssignResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersAssignResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersInviteResponse.ts b/packages/web-api/src/types/response/AdminUsersInviteResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminUsersInviteResponse.ts rename to packages/web-api/src/types/response/AdminUsersInviteResponse.ts index 4ffabc5e1..12390cd45 100644 --- a/packages/web-api/src/response/AdminUsersInviteResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersInviteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersInviteResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersListResponse.ts b/packages/web-api/src/types/response/AdminUsersListResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminUsersListResponse.ts rename to packages/web-api/src/types/response/AdminUsersListResponse.ts index 50d4983b0..ae951592b 100644 --- a/packages/web-api/src/response/AdminUsersListResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersRemoveResponse.ts b/packages/web-api/src/types/response/AdminUsersRemoveResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersRemoveResponse.ts rename to packages/web-api/src/types/response/AdminUsersRemoveResponse.ts index 609343492..b7d10c31b 100644 --- a/packages/web-api/src/response/AdminUsersRemoveResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersRemoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersRemoveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersSessionClearSettingsResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionClearSettingsResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersSessionClearSettingsResponse.ts rename to packages/web-api/src/types/response/AdminUsersSessionClearSettingsResponse.ts index 0a73982d3..87e20c7d1 100644 --- a/packages/web-api/src/response/AdminUsersSessionClearSettingsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionClearSettingsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionClearSettingsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersSessionGetSettingsResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionGetSettingsResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminUsersSessionGetSettingsResponse.ts rename to packages/web-api/src/types/response/AdminUsersSessionGetSettingsResponse.ts index 3eaffcc23..5d45bfd6f 100644 --- a/packages/web-api/src/response/AdminUsersSessionGetSettingsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionGetSettingsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionGetSettingsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersSessionInvalidateResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionInvalidateResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminUsersSessionInvalidateResponse.ts rename to packages/web-api/src/types/response/AdminUsersSessionInvalidateResponse.ts index c5415f6cf..1f192f9c7 100644 --- a/packages/web-api/src/response/AdminUsersSessionInvalidateResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionInvalidateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionInvalidateResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersSessionListResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionListResponse.ts similarity index 96% rename from packages/web-api/src/response/AdminUsersSessionListResponse.ts rename to packages/web-api/src/types/response/AdminUsersSessionListResponse.ts index 0aef7512a..22b7c9e52 100644 --- a/packages/web-api/src/response/AdminUsersSessionListResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionListResponse = WebAPICallResult & { active_sessions?: ActiveSession[]; error?: string; diff --git a/packages/web-api/src/response/AdminUsersSessionResetBulkResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionResetBulkResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersSessionResetBulkResponse.ts rename to packages/web-api/src/types/response/AdminUsersSessionResetBulkResponse.ts index 6ee4392db..92fb5b17b 100644 --- a/packages/web-api/src/response/AdminUsersSessionResetBulkResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionResetBulkResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionResetBulkResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersSessionResetResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionResetResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersSessionResetResponse.ts rename to packages/web-api/src/types/response/AdminUsersSessionResetResponse.ts index b70ac590d..5226cf9ff 100644 --- a/packages/web-api/src/response/AdminUsersSessionResetResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionResetResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionResetResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersSessionSetSettingsResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionSetSettingsResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersSessionSetSettingsResponse.ts rename to packages/web-api/src/types/response/AdminUsersSessionSetSettingsResponse.ts index 1439313a0..b07a8f7f7 100644 --- a/packages/web-api/src/response/AdminUsersSessionSetSettingsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionSetSettingsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionSetSettingsResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersSetAdminResponse.ts b/packages/web-api/src/types/response/AdminUsersSetAdminResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersSetAdminResponse.ts rename to packages/web-api/src/types/response/AdminUsersSetAdminResponse.ts index 010ad3ca6..7ee8f342a 100644 --- a/packages/web-api/src/response/AdminUsersSetAdminResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSetAdminResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSetAdminResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersSetExpirationResponse.ts b/packages/web-api/src/types/response/AdminUsersSetExpirationResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersSetExpirationResponse.ts rename to packages/web-api/src/types/response/AdminUsersSetExpirationResponse.ts index 616de852c..c5ef87cf1 100644 --- a/packages/web-api/src/response/AdminUsersSetExpirationResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSetExpirationResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSetExpirationResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersSetOwnerResponse.ts b/packages/web-api/src/types/response/AdminUsersSetOwnerResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersSetOwnerResponse.ts rename to packages/web-api/src/types/response/AdminUsersSetOwnerResponse.ts index 0064d265b..9654efc70 100644 --- a/packages/web-api/src/response/AdminUsersSetOwnerResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSetOwnerResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSetOwnerResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersSetRegularResponse.ts b/packages/web-api/src/types/response/AdminUsersSetRegularResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersSetRegularResponse.ts rename to packages/web-api/src/types/response/AdminUsersSetRegularResponse.ts index 4f5171469..27dc5601b 100644 --- a/packages/web-api/src/response/AdminUsersSetRegularResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSetRegularResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersSetRegularResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminUsersUnsupportedVersionsExportResponse.ts b/packages/web-api/src/types/response/AdminUsersUnsupportedVersionsExportResponse.ts similarity index 94% rename from packages/web-api/src/response/AdminUsersUnsupportedVersionsExportResponse.ts rename to packages/web-api/src/types/response/AdminUsersUnsupportedVersionsExportResponse.ts index 4f3bd0fac..ea679d0f1 100644 --- a/packages/web-api/src/response/AdminUsersUnsupportedVersionsExportResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersUnsupportedVersionsExportResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminUsersUnsupportedVersionsExportResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminWorkflowsCollaboratorsAddResponse.ts b/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsAddResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminWorkflowsCollaboratorsAddResponse.ts rename to packages/web-api/src/types/response/AdminWorkflowsCollaboratorsAddResponse.ts index 1a8d92d4b..a3359544e 100644 --- a/packages/web-api/src/response/AdminWorkflowsCollaboratorsAddResponse.ts +++ b/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminWorkflowsCollaboratorsAddResponse = WebAPICallResult & { error?: string; errors?: Error[]; diff --git a/packages/web-api/src/response/AdminWorkflowsCollaboratorsRemoveResponse.ts b/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsRemoveResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminWorkflowsCollaboratorsRemoveResponse.ts rename to packages/web-api/src/types/response/AdminWorkflowsCollaboratorsRemoveResponse.ts index 2cd20e618..41f9a586f 100644 --- a/packages/web-api/src/response/AdminWorkflowsCollaboratorsRemoveResponse.ts +++ b/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsRemoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminWorkflowsCollaboratorsRemoveResponse = WebAPICallResult & { error?: string; errors?: Error[]; diff --git a/packages/web-api/src/response/AdminWorkflowsPermissionsLookupResponse.ts b/packages/web-api/src/types/response/AdminWorkflowsPermissionsLookupResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminWorkflowsPermissionsLookupResponse.ts rename to packages/web-api/src/types/response/AdminWorkflowsPermissionsLookupResponse.ts index 5a538fbf8..eea08db2a 100644 --- a/packages/web-api/src/response/AdminWorkflowsPermissionsLookupResponse.ts +++ b/packages/web-api/src/types/response/AdminWorkflowsPermissionsLookupResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminWorkflowsPermissionsLookupResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminWorkflowsSearchResponse.ts b/packages/web-api/src/types/response/AdminWorkflowsSearchResponse.ts similarity index 97% rename from packages/web-api/src/response/AdminWorkflowsSearchResponse.ts rename to packages/web-api/src/types/response/AdminWorkflowsSearchResponse.ts index b9c829ad0..6d27875be 100644 --- a/packages/web-api/src/response/AdminWorkflowsSearchResponse.ts +++ b/packages/web-api/src/types/response/AdminWorkflowsSearchResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminWorkflowsSearchResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AdminWorkflowsUnpublishResponse.ts b/packages/web-api/src/types/response/AdminWorkflowsUnpublishResponse.ts similarity index 95% rename from packages/web-api/src/response/AdminWorkflowsUnpublishResponse.ts rename to packages/web-api/src/types/response/AdminWorkflowsUnpublishResponse.ts index 38c817141..2996ff6aa 100644 --- a/packages/web-api/src/response/AdminWorkflowsUnpublishResponse.ts +++ b/packages/web-api/src/types/response/AdminWorkflowsUnpublishResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AdminWorkflowsUnpublishResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ApiTestResponse.ts b/packages/web-api/src/types/response/ApiTestResponse.ts similarity index 94% rename from packages/web-api/src/response/ApiTestResponse.ts rename to packages/web-api/src/types/response/ApiTestResponse.ts index 46c759c3a..5bbd5cc3b 100644 --- a/packages/web-api/src/response/ApiTestResponse.ts +++ b/packages/web-api/src/types/response/ApiTestResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ApiTestResponse = WebAPICallResult & { args?: Args; error?: string; diff --git a/packages/web-api/src/response/AppsConnectionsOpenResponse.ts b/packages/web-api/src/types/response/AppsConnectionsOpenResponse.ts similarity index 94% rename from packages/web-api/src/response/AppsConnectionsOpenResponse.ts rename to packages/web-api/src/types/response/AppsConnectionsOpenResponse.ts index 72f1dfd32..e567c94f4 100644 --- a/packages/web-api/src/response/AppsConnectionsOpenResponse.ts +++ b/packages/web-api/src/types/response/AppsConnectionsOpenResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsConnectionsOpenResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AppsEventAuthorizationsListResponse.ts b/packages/web-api/src/types/response/AppsEventAuthorizationsListResponse.ts similarity index 95% rename from packages/web-api/src/response/AppsEventAuthorizationsListResponse.ts rename to packages/web-api/src/types/response/AppsEventAuthorizationsListResponse.ts index 5489ad0a4..ad4c09b62 100644 --- a/packages/web-api/src/response/AppsEventAuthorizationsListResponse.ts +++ b/packages/web-api/src/types/response/AppsEventAuthorizationsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsEventAuthorizationsListResponse = WebAPICallResult & { authorizations?: Authorization[]; error?: string; diff --git a/packages/web-api/src/response/AppsManifestCreateResponse.ts b/packages/web-api/src/types/response/AppsManifestCreateResponse.ts similarity index 96% rename from packages/web-api/src/response/AppsManifestCreateResponse.ts rename to packages/web-api/src/types/response/AppsManifestCreateResponse.ts index 98f60070f..d5e681ce6 100644 --- a/packages/web-api/src/response/AppsManifestCreateResponse.ts +++ b/packages/web-api/src/types/response/AppsManifestCreateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsManifestCreateResponse = WebAPICallResult & { app_id?: string; credentials?: Credentials; diff --git a/packages/web-api/src/response/AppsManifestDeleteResponse.ts b/packages/web-api/src/types/response/AppsManifestDeleteResponse.ts similarity index 94% rename from packages/web-api/src/response/AppsManifestDeleteResponse.ts rename to packages/web-api/src/types/response/AppsManifestDeleteResponse.ts index 36aa5c73d..d6cd553d2 100644 --- a/packages/web-api/src/response/AppsManifestDeleteResponse.ts +++ b/packages/web-api/src/types/response/AppsManifestDeleteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsManifestDeleteResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AppsManifestExportResponse.ts b/packages/web-api/src/types/response/AppsManifestExportResponse.ts similarity index 98% rename from packages/web-api/src/response/AppsManifestExportResponse.ts rename to packages/web-api/src/types/response/AppsManifestExportResponse.ts index bfee78b49..7792c8606 100644 --- a/packages/web-api/src/response/AppsManifestExportResponse.ts +++ b/packages/web-api/src/types/response/AppsManifestExportResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsManifestExportResponse = WebAPICallResult & { error?: string; manifest?: Manifest; diff --git a/packages/web-api/src/response/AppsManifestUpdateResponse.ts b/packages/web-api/src/types/response/AppsManifestUpdateResponse.ts similarity index 95% rename from packages/web-api/src/response/AppsManifestUpdateResponse.ts rename to packages/web-api/src/types/response/AppsManifestUpdateResponse.ts index 7b0498454..14134a688 100644 --- a/packages/web-api/src/response/AppsManifestUpdateResponse.ts +++ b/packages/web-api/src/types/response/AppsManifestUpdateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsManifestUpdateResponse = WebAPICallResult & { app_id?: string; error?: string; diff --git a/packages/web-api/src/response/AppsManifestValidateResponse.ts b/packages/web-api/src/types/response/AppsManifestValidateResponse.ts similarity index 95% rename from packages/web-api/src/response/AppsManifestValidateResponse.ts rename to packages/web-api/src/types/response/AppsManifestValidateResponse.ts index 287c19e46..7b8c1ab00 100644 --- a/packages/web-api/src/response/AppsManifestValidateResponse.ts +++ b/packages/web-api/src/types/response/AppsManifestValidateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsManifestValidateResponse = WebAPICallResult & { error?: string; errors?: Error[]; diff --git a/packages/web-api/src/response/AppsPermissionsInfoResponse.ts b/packages/web-api/src/types/response/AppsPermissionsInfoResponse.ts similarity index 94% rename from packages/web-api/src/response/AppsPermissionsInfoResponse.ts rename to packages/web-api/src/types/response/AppsPermissionsInfoResponse.ts index 20233b18e..079f3b018 100644 --- a/packages/web-api/src/response/AppsPermissionsInfoResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsInfoResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AppsPermissionsRequestResponse.ts b/packages/web-api/src/types/response/AppsPermissionsRequestResponse.ts similarity index 94% rename from packages/web-api/src/response/AppsPermissionsRequestResponse.ts rename to packages/web-api/src/types/response/AppsPermissionsRequestResponse.ts index 5c49656f9..d64493413 100644 --- a/packages/web-api/src/response/AppsPermissionsRequestResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsRequestResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsRequestResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AppsPermissionsResourcesListResponse.ts b/packages/web-api/src/types/response/AppsPermissionsResourcesListResponse.ts similarity index 94% rename from packages/web-api/src/response/AppsPermissionsResourcesListResponse.ts rename to packages/web-api/src/types/response/AppsPermissionsResourcesListResponse.ts index 23174fd15..2f4f0e8f4 100644 --- a/packages/web-api/src/response/AppsPermissionsResourcesListResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsResourcesListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsResourcesListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AppsPermissionsScopesListResponse.ts b/packages/web-api/src/types/response/AppsPermissionsScopesListResponse.ts similarity index 94% rename from packages/web-api/src/response/AppsPermissionsScopesListResponse.ts rename to packages/web-api/src/types/response/AppsPermissionsScopesListResponse.ts index daa9efcae..11eeffc7f 100644 --- a/packages/web-api/src/response/AppsPermissionsScopesListResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsScopesListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsScopesListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AppsPermissionsUsersListResponse.ts b/packages/web-api/src/types/response/AppsPermissionsUsersListResponse.ts similarity index 94% rename from packages/web-api/src/response/AppsPermissionsUsersListResponse.ts rename to packages/web-api/src/types/response/AppsPermissionsUsersListResponse.ts index f9d0c9e9b..d675351a3 100644 --- a/packages/web-api/src/response/AppsPermissionsUsersListResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsUsersListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsUsersListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AppsPermissionsUsersRequestResponse.ts b/packages/web-api/src/types/response/AppsPermissionsUsersRequestResponse.ts similarity index 94% rename from packages/web-api/src/response/AppsPermissionsUsersRequestResponse.ts rename to packages/web-api/src/types/response/AppsPermissionsUsersRequestResponse.ts index 9ce0e5783..f231ad950 100644 --- a/packages/web-api/src/response/AppsPermissionsUsersRequestResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsUsersRequestResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsUsersRequestResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AppsUninstallResponse.ts b/packages/web-api/src/types/response/AppsUninstallResponse.ts similarity index 95% rename from packages/web-api/src/response/AppsUninstallResponse.ts rename to packages/web-api/src/types/response/AppsUninstallResponse.ts index 8cb22c2cc..956647391 100644 --- a/packages/web-api/src/response/AppsUninstallResponse.ts +++ b/packages/web-api/src/types/response/AppsUninstallResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AppsUninstallResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AuthRevokeResponse.ts b/packages/web-api/src/types/response/AuthRevokeResponse.ts similarity index 94% rename from packages/web-api/src/response/AuthRevokeResponse.ts rename to packages/web-api/src/types/response/AuthRevokeResponse.ts index 1c87610f9..110808738 100644 --- a/packages/web-api/src/response/AuthRevokeResponse.ts +++ b/packages/web-api/src/types/response/AuthRevokeResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AuthRevokeResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AuthTeamsListResponse.ts b/packages/web-api/src/types/response/AuthTeamsListResponse.ts similarity index 96% rename from packages/web-api/src/response/AuthTeamsListResponse.ts rename to packages/web-api/src/types/response/AuthTeamsListResponse.ts index c957f4c60..b6a16aaed 100644 --- a/packages/web-api/src/response/AuthTeamsListResponse.ts +++ b/packages/web-api/src/types/response/AuthTeamsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AuthTeamsListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/AuthTestResponse.ts b/packages/web-api/src/types/response/AuthTestResponse.ts similarity index 96% rename from packages/web-api/src/response/AuthTestResponse.ts rename to packages/web-api/src/types/response/AuthTestResponse.ts index c50744e6d..9b158029e 100644 --- a/packages/web-api/src/response/AuthTestResponse.ts +++ b/packages/web-api/src/types/response/AuthTestResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type AuthTestResponse = WebAPICallResult & { app_id?: string; app_name?: string; diff --git a/packages/web-api/src/response/BookmarksAddResponse.ts b/packages/web-api/src/types/response/BookmarksAddResponse.ts similarity index 96% rename from packages/web-api/src/response/BookmarksAddResponse.ts rename to packages/web-api/src/types/response/BookmarksAddResponse.ts index e2fd9cd9e..d458b051b 100644 --- a/packages/web-api/src/response/BookmarksAddResponse.ts +++ b/packages/web-api/src/types/response/BookmarksAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type BookmarksAddResponse = WebAPICallResult & { bookmark?: Bookmark; error?: string; diff --git a/packages/web-api/src/response/BookmarksEditResponse.ts b/packages/web-api/src/types/response/BookmarksEditResponse.ts similarity index 96% rename from packages/web-api/src/response/BookmarksEditResponse.ts rename to packages/web-api/src/types/response/BookmarksEditResponse.ts index 7166da474..1cd98060c 100644 --- a/packages/web-api/src/response/BookmarksEditResponse.ts +++ b/packages/web-api/src/types/response/BookmarksEditResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type BookmarksEditResponse = WebAPICallResult & { bookmark?: Bookmark; error?: string; diff --git a/packages/web-api/src/response/BookmarksListResponse.ts b/packages/web-api/src/types/response/BookmarksListResponse.ts similarity index 96% rename from packages/web-api/src/response/BookmarksListResponse.ts rename to packages/web-api/src/types/response/BookmarksListResponse.ts index 8fd91eb6a..6fb4f5ce4 100644 --- a/packages/web-api/src/response/BookmarksListResponse.ts +++ b/packages/web-api/src/types/response/BookmarksListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type BookmarksListResponse = WebAPICallResult & { bookmarks?: Bookmark[]; error?: string; diff --git a/packages/web-api/src/response/BookmarksRemoveResponse.ts b/packages/web-api/src/types/response/BookmarksRemoveResponse.ts similarity index 95% rename from packages/web-api/src/response/BookmarksRemoveResponse.ts rename to packages/web-api/src/types/response/BookmarksRemoveResponse.ts index 2076e3be5..01236f5cb 100644 --- a/packages/web-api/src/response/BookmarksRemoveResponse.ts +++ b/packages/web-api/src/types/response/BookmarksRemoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type BookmarksRemoveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/BotsInfoResponse.ts b/packages/web-api/src/types/response/BotsInfoResponse.ts similarity index 95% rename from packages/web-api/src/response/BotsInfoResponse.ts rename to packages/web-api/src/types/response/BotsInfoResponse.ts index 7d4f6e499..10665fc9c 100644 --- a/packages/web-api/src/response/BotsInfoResponse.ts +++ b/packages/web-api/src/types/response/BotsInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type BotsInfoResponse = WebAPICallResult & { bot?: Bot; error?: string; diff --git a/packages/web-api/src/response/CallsAddResponse.ts b/packages/web-api/src/types/response/CallsAddResponse.ts similarity index 96% rename from packages/web-api/src/response/CallsAddResponse.ts rename to packages/web-api/src/types/response/CallsAddResponse.ts index 3984349ae..f88470755 100644 --- a/packages/web-api/src/response/CallsAddResponse.ts +++ b/packages/web-api/src/types/response/CallsAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type CallsAddResponse = WebAPICallResult & { call?: Call; error?: string; diff --git a/packages/web-api/src/response/CallsEndResponse.ts b/packages/web-api/src/types/response/CallsEndResponse.ts similarity index 96% rename from packages/web-api/src/response/CallsEndResponse.ts rename to packages/web-api/src/types/response/CallsEndResponse.ts index 44004267b..a4c946dd6 100644 --- a/packages/web-api/src/response/CallsEndResponse.ts +++ b/packages/web-api/src/types/response/CallsEndResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type CallsEndResponse = WebAPICallResult & { call?: Call; error?: string; diff --git a/packages/web-api/src/response/CallsInfoResponse.ts b/packages/web-api/src/types/response/CallsInfoResponse.ts similarity index 96% rename from packages/web-api/src/response/CallsInfoResponse.ts rename to packages/web-api/src/types/response/CallsInfoResponse.ts index 5c535607c..5d816165f 100644 --- a/packages/web-api/src/response/CallsInfoResponse.ts +++ b/packages/web-api/src/types/response/CallsInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type CallsInfoResponse = WebAPICallResult & { call?: Call; error?: string; diff --git a/packages/web-api/src/response/CallsParticipantsAddResponse.ts b/packages/web-api/src/types/response/CallsParticipantsAddResponse.ts similarity index 96% rename from packages/web-api/src/response/CallsParticipantsAddResponse.ts rename to packages/web-api/src/types/response/CallsParticipantsAddResponse.ts index c62900f4c..8ffda7357 100644 --- a/packages/web-api/src/response/CallsParticipantsAddResponse.ts +++ b/packages/web-api/src/types/response/CallsParticipantsAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type CallsParticipantsAddResponse = WebAPICallResult & { call?: Call; error?: string; diff --git a/packages/web-api/src/response/CallsParticipantsRemoveResponse.ts b/packages/web-api/src/types/response/CallsParticipantsRemoveResponse.ts similarity index 96% rename from packages/web-api/src/response/CallsParticipantsRemoveResponse.ts rename to packages/web-api/src/types/response/CallsParticipantsRemoveResponse.ts index 203014423..098130763 100644 --- a/packages/web-api/src/response/CallsParticipantsRemoveResponse.ts +++ b/packages/web-api/src/types/response/CallsParticipantsRemoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type CallsParticipantsRemoveResponse = WebAPICallResult & { call?: Call; error?: string; diff --git a/packages/web-api/src/response/CallsUpdateResponse.ts b/packages/web-api/src/types/response/CallsUpdateResponse.ts similarity index 96% rename from packages/web-api/src/response/CallsUpdateResponse.ts rename to packages/web-api/src/types/response/CallsUpdateResponse.ts index bd0206d65..3d09eaa61 100644 --- a/packages/web-api/src/response/CallsUpdateResponse.ts +++ b/packages/web-api/src/types/response/CallsUpdateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type CallsUpdateResponse = WebAPICallResult & { call?: Call; error?: string; diff --git a/packages/web-api/src/response/ChannelsArchiveResponse.ts b/packages/web-api/src/types/response/ChannelsArchiveResponse.ts similarity index 94% rename from packages/web-api/src/response/ChannelsArchiveResponse.ts rename to packages/web-api/src/types/response/ChannelsArchiveResponse.ts index 9c9bb92b7..e80e0ad1e 100644 --- a/packages/web-api/src/response/ChannelsArchiveResponse.ts +++ b/packages/web-api/src/types/response/ChannelsArchiveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsArchiveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ChannelsCreateResponse.ts b/packages/web-api/src/types/response/ChannelsCreateResponse.ts similarity index 97% rename from packages/web-api/src/response/ChannelsCreateResponse.ts rename to packages/web-api/src/types/response/ChannelsCreateResponse.ts index d71f2584f..6a146cb00 100644 --- a/packages/web-api/src/response/ChannelsCreateResponse.ts +++ b/packages/web-api/src/types/response/ChannelsCreateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsCreateResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ChannelsHistoryResponse.ts b/packages/web-api/src/types/response/ChannelsHistoryResponse.ts similarity index 99% rename from packages/web-api/src/response/ChannelsHistoryResponse.ts rename to packages/web-api/src/types/response/ChannelsHistoryResponse.ts index 47d8677ca..85b73447d 100644 --- a/packages/web-api/src/response/ChannelsHistoryResponse.ts +++ b/packages/web-api/src/types/response/ChannelsHistoryResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsHistoryResponse = WebAPICallResult & { channel_actions_count?: number; channel_actions_ts?: number; diff --git a/packages/web-api/src/response/ChannelsInfoResponse.ts b/packages/web-api/src/types/response/ChannelsInfoResponse.ts similarity index 99% rename from packages/web-api/src/response/ChannelsInfoResponse.ts rename to packages/web-api/src/types/response/ChannelsInfoResponse.ts index 133250df4..729e24720 100644 --- a/packages/web-api/src/response/ChannelsInfoResponse.ts +++ b/packages/web-api/src/types/response/ChannelsInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsInfoResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ChannelsInviteResponse.ts b/packages/web-api/src/types/response/ChannelsInviteResponse.ts similarity index 97% rename from packages/web-api/src/response/ChannelsInviteResponse.ts rename to packages/web-api/src/types/response/ChannelsInviteResponse.ts index 86b54c781..8068e085b 100644 --- a/packages/web-api/src/response/ChannelsInviteResponse.ts +++ b/packages/web-api/src/types/response/ChannelsInviteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsInviteResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ChannelsJoinResponse.ts b/packages/web-api/src/types/response/ChannelsJoinResponse.ts similarity index 97% rename from packages/web-api/src/response/ChannelsJoinResponse.ts rename to packages/web-api/src/types/response/ChannelsJoinResponse.ts index a63617446..f9aaac9b3 100644 --- a/packages/web-api/src/response/ChannelsJoinResponse.ts +++ b/packages/web-api/src/types/response/ChannelsJoinResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsJoinResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ChannelsKickResponse.ts b/packages/web-api/src/types/response/ChannelsKickResponse.ts similarity index 94% rename from packages/web-api/src/response/ChannelsKickResponse.ts rename to packages/web-api/src/types/response/ChannelsKickResponse.ts index bd70952e9..6acfb07f5 100644 --- a/packages/web-api/src/response/ChannelsKickResponse.ts +++ b/packages/web-api/src/types/response/ChannelsKickResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsKickResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ChannelsLeaveResponse.ts b/packages/web-api/src/types/response/ChannelsLeaveResponse.ts similarity index 94% rename from packages/web-api/src/response/ChannelsLeaveResponse.ts rename to packages/web-api/src/types/response/ChannelsLeaveResponse.ts index 45e1611d6..905bacdae 100644 --- a/packages/web-api/src/response/ChannelsLeaveResponse.ts +++ b/packages/web-api/src/types/response/ChannelsLeaveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsLeaveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ChannelsListResponse.ts b/packages/web-api/src/types/response/ChannelsListResponse.ts similarity index 97% rename from packages/web-api/src/response/ChannelsListResponse.ts rename to packages/web-api/src/types/response/ChannelsListResponse.ts index fdd170961..a61766760 100644 --- a/packages/web-api/src/response/ChannelsListResponse.ts +++ b/packages/web-api/src/types/response/ChannelsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsListResponse = WebAPICallResult & { channels?: Channel[]; error?: string; diff --git a/packages/web-api/src/response/ChannelsMarkResponse.ts b/packages/web-api/src/types/response/ChannelsMarkResponse.ts similarity index 94% rename from packages/web-api/src/response/ChannelsMarkResponse.ts rename to packages/web-api/src/types/response/ChannelsMarkResponse.ts index bbf9c8ba5..336d09521 100644 --- a/packages/web-api/src/response/ChannelsMarkResponse.ts +++ b/packages/web-api/src/types/response/ChannelsMarkResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsMarkResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ChannelsRenameResponse.ts b/packages/web-api/src/types/response/ChannelsRenameResponse.ts similarity index 96% rename from packages/web-api/src/response/ChannelsRenameResponse.ts rename to packages/web-api/src/types/response/ChannelsRenameResponse.ts index 1986ec9e5..dbaed13de 100644 --- a/packages/web-api/src/response/ChannelsRenameResponse.ts +++ b/packages/web-api/src/types/response/ChannelsRenameResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsRenameResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ChannelsRepliesResponse.ts b/packages/web-api/src/types/response/ChannelsRepliesResponse.ts similarity index 97% rename from packages/web-api/src/response/ChannelsRepliesResponse.ts rename to packages/web-api/src/types/response/ChannelsRepliesResponse.ts index 324e61eac..722ef4482 100644 --- a/packages/web-api/src/response/ChannelsRepliesResponse.ts +++ b/packages/web-api/src/types/response/ChannelsRepliesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsRepliesResponse = WebAPICallResult & { error?: string; has_more?: boolean; diff --git a/packages/web-api/src/response/ChannelsSetPurposeResponse.ts b/packages/web-api/src/types/response/ChannelsSetPurposeResponse.ts similarity index 94% rename from packages/web-api/src/response/ChannelsSetPurposeResponse.ts rename to packages/web-api/src/types/response/ChannelsSetPurposeResponse.ts index f726e6dbb..6a37e607e 100644 --- a/packages/web-api/src/response/ChannelsSetPurposeResponse.ts +++ b/packages/web-api/src/types/response/ChannelsSetPurposeResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsSetPurposeResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ChannelsSetTopicResponse.ts b/packages/web-api/src/types/response/ChannelsSetTopicResponse.ts similarity index 94% rename from packages/web-api/src/response/ChannelsSetTopicResponse.ts rename to packages/web-api/src/types/response/ChannelsSetTopicResponse.ts index 9c3665b3b..8507ae8ce 100644 --- a/packages/web-api/src/response/ChannelsSetTopicResponse.ts +++ b/packages/web-api/src/types/response/ChannelsSetTopicResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsSetTopicResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ChannelsUnarchiveResponse.ts b/packages/web-api/src/types/response/ChannelsUnarchiveResponse.ts similarity index 94% rename from packages/web-api/src/response/ChannelsUnarchiveResponse.ts rename to packages/web-api/src/types/response/ChannelsUnarchiveResponse.ts index 12726c6d4..78324f681 100644 --- a/packages/web-api/src/response/ChannelsUnarchiveResponse.ts +++ b/packages/web-api/src/types/response/ChannelsUnarchiveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChannelsUnarchiveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ChatDeleteResponse.ts b/packages/web-api/src/types/response/ChatDeleteResponse.ts similarity index 94% rename from packages/web-api/src/response/ChatDeleteResponse.ts rename to packages/web-api/src/types/response/ChatDeleteResponse.ts index 1b763e31d..e48ff26bd 100644 --- a/packages/web-api/src/response/ChatDeleteResponse.ts +++ b/packages/web-api/src/types/response/ChatDeleteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChatDeleteResponse = WebAPICallResult & { channel?: string; error?: string; diff --git a/packages/web-api/src/response/ChatDeleteScheduledMessageResponse.ts b/packages/web-api/src/types/response/ChatDeleteScheduledMessageResponse.ts similarity index 94% rename from packages/web-api/src/response/ChatDeleteScheduledMessageResponse.ts rename to packages/web-api/src/types/response/ChatDeleteScheduledMessageResponse.ts index 6ed14437e..17e061de0 100644 --- a/packages/web-api/src/response/ChatDeleteScheduledMessageResponse.ts +++ b/packages/web-api/src/types/response/ChatDeleteScheduledMessageResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChatDeleteScheduledMessageResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ChatGetPermalinkResponse.ts b/packages/web-api/src/types/response/ChatGetPermalinkResponse.ts similarity index 94% rename from packages/web-api/src/response/ChatGetPermalinkResponse.ts rename to packages/web-api/src/types/response/ChatGetPermalinkResponse.ts index ceed1cdfa..0a89af143 100644 --- a/packages/web-api/src/response/ChatGetPermalinkResponse.ts +++ b/packages/web-api/src/types/response/ChatGetPermalinkResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChatGetPermalinkResponse = WebAPICallResult & { channel?: string; error?: string; diff --git a/packages/web-api/src/response/ChatMeMessageResponse.ts b/packages/web-api/src/types/response/ChatMeMessageResponse.ts similarity index 94% rename from packages/web-api/src/response/ChatMeMessageResponse.ts rename to packages/web-api/src/types/response/ChatMeMessageResponse.ts index c24462617..7e742b5dc 100644 --- a/packages/web-api/src/response/ChatMeMessageResponse.ts +++ b/packages/web-api/src/types/response/ChatMeMessageResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChatMeMessageResponse = WebAPICallResult & { channel?: string; error?: string; diff --git a/packages/web-api/src/response/ChatPostEphemeralResponse.ts b/packages/web-api/src/types/response/ChatPostEphemeralResponse.ts similarity index 94% rename from packages/web-api/src/response/ChatPostEphemeralResponse.ts rename to packages/web-api/src/types/response/ChatPostEphemeralResponse.ts index 93f48bcb3..03d41b14a 100644 --- a/packages/web-api/src/response/ChatPostEphemeralResponse.ts +++ b/packages/web-api/src/types/response/ChatPostEphemeralResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChatPostEphemeralResponse = WebAPICallResult & { error?: string; message_ts?: string; diff --git a/packages/web-api/src/response/ChatPostMessageResponse.ts b/packages/web-api/src/types/response/ChatPostMessageResponse.ts similarity index 99% rename from packages/web-api/src/response/ChatPostMessageResponse.ts rename to packages/web-api/src/types/response/ChatPostMessageResponse.ts index 491fe6e50..e9651e4c0 100644 --- a/packages/web-api/src/response/ChatPostMessageResponse.ts +++ b/packages/web-api/src/types/response/ChatPostMessageResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChatPostMessageResponse = WebAPICallResult & { channel?: string; deprecated_argument?: string; diff --git a/packages/web-api/src/response/ChatScheduleMessageResponse.ts b/packages/web-api/src/types/response/ChatScheduleMessageResponse.ts similarity index 99% rename from packages/web-api/src/response/ChatScheduleMessageResponse.ts rename to packages/web-api/src/types/response/ChatScheduleMessageResponse.ts index 3879b7de0..bcdfa530d 100644 --- a/packages/web-api/src/response/ChatScheduleMessageResponse.ts +++ b/packages/web-api/src/types/response/ChatScheduleMessageResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChatScheduleMessageResponse = WebAPICallResult & { channel?: string; error?: string; diff --git a/packages/web-api/src/response/ChatScheduledMessagesListResponse.ts b/packages/web-api/src/types/response/ChatScheduledMessagesListResponse.ts similarity index 96% rename from packages/web-api/src/response/ChatScheduledMessagesListResponse.ts rename to packages/web-api/src/types/response/ChatScheduledMessagesListResponse.ts index f85c27247..6fe95f0a5 100644 --- a/packages/web-api/src/response/ChatScheduledMessagesListResponse.ts +++ b/packages/web-api/src/types/response/ChatScheduledMessagesListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChatScheduledMessagesListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ChatUnfurlResponse.ts b/packages/web-api/src/types/response/ChatUnfurlResponse.ts similarity index 94% rename from packages/web-api/src/response/ChatUnfurlResponse.ts rename to packages/web-api/src/types/response/ChatUnfurlResponse.ts index 3567b6f0a..d2d21f9ed 100644 --- a/packages/web-api/src/response/ChatUnfurlResponse.ts +++ b/packages/web-api/src/types/response/ChatUnfurlResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChatUnfurlResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ChatUpdateResponse.ts b/packages/web-api/src/types/response/ChatUpdateResponse.ts similarity index 99% rename from packages/web-api/src/response/ChatUpdateResponse.ts rename to packages/web-api/src/types/response/ChatUpdateResponse.ts index 9c816c3e4..d685ed58d 100644 --- a/packages/web-api/src/response/ChatUpdateResponse.ts +++ b/packages/web-api/src/types/response/ChatUpdateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ChatUpdateResponse = WebAPICallResult & { channel?: string; error?: string; diff --git a/packages/web-api/src/response/ConversationsAcceptSharedInviteResponse.ts b/packages/web-api/src/types/response/ConversationsAcceptSharedInviteResponse.ts similarity index 95% rename from packages/web-api/src/response/ConversationsAcceptSharedInviteResponse.ts rename to packages/web-api/src/types/response/ConversationsAcceptSharedInviteResponse.ts index 9b6b1f300..64436cb53 100644 --- a/packages/web-api/src/response/ConversationsAcceptSharedInviteResponse.ts +++ b/packages/web-api/src/types/response/ConversationsAcceptSharedInviteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsAcceptSharedInviteResponse = WebAPICallResult & { can_open_scdm?: boolean; channel_id?: string; diff --git a/packages/web-api/src/response/ConversationsApproveSharedInviteResponse.ts b/packages/web-api/src/types/response/ConversationsApproveSharedInviteResponse.ts similarity index 94% rename from packages/web-api/src/response/ConversationsApproveSharedInviteResponse.ts rename to packages/web-api/src/types/response/ConversationsApproveSharedInviteResponse.ts index 05a5cb61e..ad52f553f 100644 --- a/packages/web-api/src/response/ConversationsApproveSharedInviteResponse.ts +++ b/packages/web-api/src/types/response/ConversationsApproveSharedInviteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsApproveSharedInviteResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ConversationsArchiveResponse.ts b/packages/web-api/src/types/response/ConversationsArchiveResponse.ts similarity index 94% rename from packages/web-api/src/response/ConversationsArchiveResponse.ts rename to packages/web-api/src/types/response/ConversationsArchiveResponse.ts index d8447886c..c2ff760c5 100644 --- a/packages/web-api/src/response/ConversationsArchiveResponse.ts +++ b/packages/web-api/src/types/response/ConversationsArchiveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsArchiveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ConversationsCloseResponse.ts b/packages/web-api/src/types/response/ConversationsCloseResponse.ts similarity index 94% rename from packages/web-api/src/response/ConversationsCloseResponse.ts rename to packages/web-api/src/types/response/ConversationsCloseResponse.ts index 234bf153e..12da711b3 100644 --- a/packages/web-api/src/response/ConversationsCloseResponse.ts +++ b/packages/web-api/src/types/response/ConversationsCloseResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsCloseResponse = WebAPICallResult & { already_closed?: boolean; error?: string; diff --git a/packages/web-api/src/response/ConversationsCreateResponse.ts b/packages/web-api/src/types/response/ConversationsCreateResponse.ts similarity index 97% rename from packages/web-api/src/response/ConversationsCreateResponse.ts rename to packages/web-api/src/types/response/ConversationsCreateResponse.ts index 187d95954..0141f32a6 100644 --- a/packages/web-api/src/response/ConversationsCreateResponse.ts +++ b/packages/web-api/src/types/response/ConversationsCreateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsCreateResponse = WebAPICallResult & { channel?: Channel; detail?: string; diff --git a/packages/web-api/src/response/ConversationsDeclineSharedInviteResponse.ts b/packages/web-api/src/types/response/ConversationsDeclineSharedInviteResponse.ts similarity index 94% rename from packages/web-api/src/response/ConversationsDeclineSharedInviteResponse.ts rename to packages/web-api/src/types/response/ConversationsDeclineSharedInviteResponse.ts index 9b6085d7d..424f9ce71 100644 --- a/packages/web-api/src/response/ConversationsDeclineSharedInviteResponse.ts +++ b/packages/web-api/src/types/response/ConversationsDeclineSharedInviteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsDeclineSharedInviteResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ConversationsHistoryResponse.ts b/packages/web-api/src/types/response/ConversationsHistoryResponse.ts similarity index 99% rename from packages/web-api/src/response/ConversationsHistoryResponse.ts rename to packages/web-api/src/types/response/ConversationsHistoryResponse.ts index fa3330470..cb7a47f46 100644 --- a/packages/web-api/src/response/ConversationsHistoryResponse.ts +++ b/packages/web-api/src/types/response/ConversationsHistoryResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsHistoryResponse = WebAPICallResult & { channel_actions_count?: number; channel_actions_ts?: number; diff --git a/packages/web-api/src/response/ConversationsInfoResponse.ts b/packages/web-api/src/types/response/ConversationsInfoResponse.ts similarity index 98% rename from packages/web-api/src/response/ConversationsInfoResponse.ts rename to packages/web-api/src/types/response/ConversationsInfoResponse.ts index a621e3d58..3b8950cfa 100644 --- a/packages/web-api/src/response/ConversationsInfoResponse.ts +++ b/packages/web-api/src/types/response/ConversationsInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsInfoResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ConversationsInviteResponse.ts b/packages/web-api/src/types/response/ConversationsInviteResponse.ts similarity index 97% rename from packages/web-api/src/response/ConversationsInviteResponse.ts rename to packages/web-api/src/types/response/ConversationsInviteResponse.ts index d2a8865ff..e7c4325f5 100644 --- a/packages/web-api/src/response/ConversationsInviteResponse.ts +++ b/packages/web-api/src/types/response/ConversationsInviteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsInviteResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ConversationsInviteSharedResponse.ts b/packages/web-api/src/types/response/ConversationsInviteSharedResponse.ts similarity index 95% rename from packages/web-api/src/response/ConversationsInviteSharedResponse.ts rename to packages/web-api/src/types/response/ConversationsInviteSharedResponse.ts index 4cc39df66..1e089be05 100644 --- a/packages/web-api/src/response/ConversationsInviteSharedResponse.ts +++ b/packages/web-api/src/types/response/ConversationsInviteSharedResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsInviteSharedResponse = WebAPICallResult & { conf_code?: string; error?: string; diff --git a/packages/web-api/src/response/ConversationsJoinResponse.ts b/packages/web-api/src/types/response/ConversationsJoinResponse.ts similarity index 98% rename from packages/web-api/src/response/ConversationsJoinResponse.ts rename to packages/web-api/src/types/response/ConversationsJoinResponse.ts index 07575f2cc..bbe501f1f 100644 --- a/packages/web-api/src/response/ConversationsJoinResponse.ts +++ b/packages/web-api/src/types/response/ConversationsJoinResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsJoinResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ConversationsKickResponse.ts b/packages/web-api/src/types/response/ConversationsKickResponse.ts similarity index 94% rename from packages/web-api/src/response/ConversationsKickResponse.ts rename to packages/web-api/src/types/response/ConversationsKickResponse.ts index f106dac7b..4986d8916 100644 --- a/packages/web-api/src/response/ConversationsKickResponse.ts +++ b/packages/web-api/src/types/response/ConversationsKickResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsKickResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ConversationsLeaveResponse.ts b/packages/web-api/src/types/response/ConversationsLeaveResponse.ts similarity index 94% rename from packages/web-api/src/response/ConversationsLeaveResponse.ts rename to packages/web-api/src/types/response/ConversationsLeaveResponse.ts index aeea0998e..5d97618b1 100644 --- a/packages/web-api/src/response/ConversationsLeaveResponse.ts +++ b/packages/web-api/src/types/response/ConversationsLeaveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsLeaveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ConversationsListConnectInvitesResponse.ts b/packages/web-api/src/types/response/ConversationsListConnectInvitesResponse.ts similarity index 98% rename from packages/web-api/src/response/ConversationsListConnectInvitesResponse.ts rename to packages/web-api/src/types/response/ConversationsListConnectInvitesResponse.ts index c0dcdb509..f4590ae07 100644 --- a/packages/web-api/src/response/ConversationsListConnectInvitesResponse.ts +++ b/packages/web-api/src/types/response/ConversationsListConnectInvitesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsListConnectInvitesResponse = WebAPICallResult & { arg?: string; error?: string; diff --git a/packages/web-api/src/response/ConversationsListResponse.ts b/packages/web-api/src/types/response/ConversationsListResponse.ts similarity index 98% rename from packages/web-api/src/response/ConversationsListResponse.ts rename to packages/web-api/src/types/response/ConversationsListResponse.ts index 6d8922d51..d9a29af21 100644 --- a/packages/web-api/src/response/ConversationsListResponse.ts +++ b/packages/web-api/src/types/response/ConversationsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsListResponse = WebAPICallResult & { channels?: Channel[]; error?: string; diff --git a/packages/web-api/src/response/ConversationsMarkResponse.ts b/packages/web-api/src/types/response/ConversationsMarkResponse.ts similarity index 94% rename from packages/web-api/src/response/ConversationsMarkResponse.ts rename to packages/web-api/src/types/response/ConversationsMarkResponse.ts index c5c6cd1cc..9fbffa74d 100644 --- a/packages/web-api/src/response/ConversationsMarkResponse.ts +++ b/packages/web-api/src/types/response/ConversationsMarkResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsMarkResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ConversationsMembersResponse.ts b/packages/web-api/src/types/response/ConversationsMembersResponse.ts similarity index 95% rename from packages/web-api/src/response/ConversationsMembersResponse.ts rename to packages/web-api/src/types/response/ConversationsMembersResponse.ts index 0875c232d..b39ebfdc3 100644 --- a/packages/web-api/src/response/ConversationsMembersResponse.ts +++ b/packages/web-api/src/types/response/ConversationsMembersResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsMembersResponse = WebAPICallResult & { error?: string; members?: string[]; diff --git a/packages/web-api/src/response/ConversationsOpenResponse.ts b/packages/web-api/src/types/response/ConversationsOpenResponse.ts similarity index 99% rename from packages/web-api/src/response/ConversationsOpenResponse.ts rename to packages/web-api/src/types/response/ConversationsOpenResponse.ts index 48cc35b23..dc0e76340 100644 --- a/packages/web-api/src/response/ConversationsOpenResponse.ts +++ b/packages/web-api/src/types/response/ConversationsOpenResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsOpenResponse = WebAPICallResult & { already_open?: boolean; channel?: Channel; diff --git a/packages/web-api/src/response/ConversationsRenameResponse.ts b/packages/web-api/src/types/response/ConversationsRenameResponse.ts similarity index 97% rename from packages/web-api/src/response/ConversationsRenameResponse.ts rename to packages/web-api/src/types/response/ConversationsRenameResponse.ts index e9780b616..246146bce 100644 --- a/packages/web-api/src/response/ConversationsRenameResponse.ts +++ b/packages/web-api/src/types/response/ConversationsRenameResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsRenameResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ConversationsRepliesResponse.ts b/packages/web-api/src/types/response/ConversationsRepliesResponse.ts similarity index 99% rename from packages/web-api/src/response/ConversationsRepliesResponse.ts rename to packages/web-api/src/types/response/ConversationsRepliesResponse.ts index dc7f13fe5..d40fd98d5 100644 --- a/packages/web-api/src/response/ConversationsRepliesResponse.ts +++ b/packages/web-api/src/types/response/ConversationsRepliesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsRepliesResponse = WebAPICallResult & { error?: string; has_more?: boolean; diff --git a/packages/web-api/src/response/ConversationsSetPurposeResponse.ts b/packages/web-api/src/types/response/ConversationsSetPurposeResponse.ts similarity index 97% rename from packages/web-api/src/response/ConversationsSetPurposeResponse.ts rename to packages/web-api/src/types/response/ConversationsSetPurposeResponse.ts index 9a76a8d8b..2ea93449e 100644 --- a/packages/web-api/src/response/ConversationsSetPurposeResponse.ts +++ b/packages/web-api/src/types/response/ConversationsSetPurposeResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsSetPurposeResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ConversationsSetTopicResponse.ts b/packages/web-api/src/types/response/ConversationsSetTopicResponse.ts similarity index 97% rename from packages/web-api/src/response/ConversationsSetTopicResponse.ts rename to packages/web-api/src/types/response/ConversationsSetTopicResponse.ts index 2c7b7f7b8..e663b00bf 100644 --- a/packages/web-api/src/response/ConversationsSetTopicResponse.ts +++ b/packages/web-api/src/types/response/ConversationsSetTopicResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsSetTopicResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/ConversationsUnarchiveResponse.ts b/packages/web-api/src/types/response/ConversationsUnarchiveResponse.ts similarity index 94% rename from packages/web-api/src/response/ConversationsUnarchiveResponse.ts rename to packages/web-api/src/types/response/ConversationsUnarchiveResponse.ts index 71bb24aff..5b5365f29 100644 --- a/packages/web-api/src/response/ConversationsUnarchiveResponse.ts +++ b/packages/web-api/src/types/response/ConversationsUnarchiveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ConversationsUnarchiveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/DialogOpenResponse.ts b/packages/web-api/src/types/response/DialogOpenResponse.ts similarity index 95% rename from packages/web-api/src/response/DialogOpenResponse.ts rename to packages/web-api/src/types/response/DialogOpenResponse.ts index 7c2f9ac0f..9be2b79e7 100644 --- a/packages/web-api/src/response/DialogOpenResponse.ts +++ b/packages/web-api/src/types/response/DialogOpenResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type DialogOpenResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/DndEndDndResponse.ts b/packages/web-api/src/types/response/DndEndDndResponse.ts similarity index 94% rename from packages/web-api/src/response/DndEndDndResponse.ts rename to packages/web-api/src/types/response/DndEndDndResponse.ts index a3e904f6a..756d5b758 100644 --- a/packages/web-api/src/response/DndEndDndResponse.ts +++ b/packages/web-api/src/types/response/DndEndDndResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type DndEndDndResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/DndEndSnoozeResponse.ts b/packages/web-api/src/types/response/DndEndSnoozeResponse.ts similarity index 95% rename from packages/web-api/src/response/DndEndSnoozeResponse.ts rename to packages/web-api/src/types/response/DndEndSnoozeResponse.ts index 7b8c97026..83e21ba98 100644 --- a/packages/web-api/src/response/DndEndSnoozeResponse.ts +++ b/packages/web-api/src/types/response/DndEndSnoozeResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type DndEndSnoozeResponse = WebAPICallResult & { dnd_enabled?: boolean; error?: string; diff --git a/packages/web-api/src/response/DndInfoResponse.ts b/packages/web-api/src/types/response/DndInfoResponse.ts similarity index 95% rename from packages/web-api/src/response/DndInfoResponse.ts rename to packages/web-api/src/types/response/DndInfoResponse.ts index e2deaa4fa..b2887439b 100644 --- a/packages/web-api/src/response/DndInfoResponse.ts +++ b/packages/web-api/src/types/response/DndInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type DndInfoResponse = WebAPICallResult & { dnd_enabled?: boolean; error?: string; diff --git a/packages/web-api/src/response/DndSetSnoozeResponse.ts b/packages/web-api/src/types/response/DndSetSnoozeResponse.ts similarity index 95% rename from packages/web-api/src/response/DndSetSnoozeResponse.ts rename to packages/web-api/src/types/response/DndSetSnoozeResponse.ts index 5aaf2f641..9a443a16b 100644 --- a/packages/web-api/src/response/DndSetSnoozeResponse.ts +++ b/packages/web-api/src/types/response/DndSetSnoozeResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type DndSetSnoozeResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/DndTeamInfoResponse.ts b/packages/web-api/src/types/response/DndTeamInfoResponse.ts similarity index 95% rename from packages/web-api/src/response/DndTeamInfoResponse.ts rename to packages/web-api/src/types/response/DndTeamInfoResponse.ts index ac115a079..371e77c28 100644 --- a/packages/web-api/src/response/DndTeamInfoResponse.ts +++ b/packages/web-api/src/types/response/DndTeamInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type DndTeamInfoResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/EmojiListResponse.ts b/packages/web-api/src/types/response/EmojiListResponse.ts similarity index 95% rename from packages/web-api/src/response/EmojiListResponse.ts rename to packages/web-api/src/types/response/EmojiListResponse.ts index 95ba5726f..ce29e4cd7 100644 --- a/packages/web-api/src/response/EmojiListResponse.ts +++ b/packages/web-api/src/types/response/EmojiListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type EmojiListResponse = WebAPICallResult & { cache_ts?: string; categories?: Category[]; diff --git a/packages/web-api/src/response/FilesCommentsAddResponse.ts b/packages/web-api/src/types/response/FilesCommentsAddResponse.ts similarity index 94% rename from packages/web-api/src/response/FilesCommentsAddResponse.ts rename to packages/web-api/src/types/response/FilesCommentsAddResponse.ts index 7080c7ad6..90e5f36e2 100644 --- a/packages/web-api/src/response/FilesCommentsAddResponse.ts +++ b/packages/web-api/src/types/response/FilesCommentsAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesCommentsAddResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/FilesCommentsDeleteResponse.ts b/packages/web-api/src/types/response/FilesCommentsDeleteResponse.ts similarity index 94% rename from packages/web-api/src/response/FilesCommentsDeleteResponse.ts rename to packages/web-api/src/types/response/FilesCommentsDeleteResponse.ts index 2ce420585..55ae084f4 100644 --- a/packages/web-api/src/response/FilesCommentsDeleteResponse.ts +++ b/packages/web-api/src/types/response/FilesCommentsDeleteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesCommentsDeleteResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/FilesCommentsEditResponse.ts b/packages/web-api/src/types/response/FilesCommentsEditResponse.ts similarity index 95% rename from packages/web-api/src/response/FilesCommentsEditResponse.ts rename to packages/web-api/src/types/response/FilesCommentsEditResponse.ts index 2c65ffa86..3ae49de2d 100644 --- a/packages/web-api/src/response/FilesCommentsEditResponse.ts +++ b/packages/web-api/src/types/response/FilesCommentsEditResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesCommentsEditResponse = WebAPICallResult & { comment?: Comment; error?: string; diff --git a/packages/web-api/src/response/FilesCompleteUploadExternalResponse.ts b/packages/web-api/src/types/response/FilesCompleteUploadExternalResponse.ts similarity index 98% rename from packages/web-api/src/response/FilesCompleteUploadExternalResponse.ts rename to packages/web-api/src/types/response/FilesCompleteUploadExternalResponse.ts index 316db36a3..28ff9f3e5 100644 --- a/packages/web-api/src/response/FilesCompleteUploadExternalResponse.ts +++ b/packages/web-api/src/types/response/FilesCompleteUploadExternalResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesCompleteUploadExternalResponse = WebAPICallResult & { error?: string; files?: File[]; diff --git a/packages/web-api/src/response/FilesDeleteResponse.ts b/packages/web-api/src/types/response/FilesDeleteResponse.ts similarity index 94% rename from packages/web-api/src/response/FilesDeleteResponse.ts rename to packages/web-api/src/types/response/FilesDeleteResponse.ts index c6dafce66..ba164803c 100644 --- a/packages/web-api/src/response/FilesDeleteResponse.ts +++ b/packages/web-api/src/types/response/FilesDeleteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesDeleteResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/FilesGetUploadURLExternalResponse.ts b/packages/web-api/src/types/response/FilesGetUploadURLExternalResponse.ts similarity index 95% rename from packages/web-api/src/response/FilesGetUploadURLExternalResponse.ts rename to packages/web-api/src/types/response/FilesGetUploadURLExternalResponse.ts index 42580ed10..3fbed9a36 100644 --- a/packages/web-api/src/response/FilesGetUploadURLExternalResponse.ts +++ b/packages/web-api/src/types/response/FilesGetUploadURLExternalResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesGetUploadURLExternalResponse = WebAPICallResult & { error?: string; file_id?: string; diff --git a/packages/web-api/src/response/FilesInfoResponse.ts b/packages/web-api/src/types/response/FilesInfoResponse.ts similarity index 99% rename from packages/web-api/src/response/FilesInfoResponse.ts rename to packages/web-api/src/types/response/FilesInfoResponse.ts index 468bc5560..704d4b480 100644 --- a/packages/web-api/src/response/FilesInfoResponse.ts +++ b/packages/web-api/src/types/response/FilesInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesInfoResponse = WebAPICallResult & { comments?: Comment[]; content?: string; diff --git a/packages/web-api/src/response/FilesListResponse.ts b/packages/web-api/src/types/response/FilesListResponse.ts similarity index 99% rename from packages/web-api/src/response/FilesListResponse.ts rename to packages/web-api/src/types/response/FilesListResponse.ts index da5065346..1f6d48ead 100644 --- a/packages/web-api/src/response/FilesListResponse.ts +++ b/packages/web-api/src/types/response/FilesListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesListResponse = WebAPICallResult & { error?: string; files?: FileElement[]; diff --git a/packages/web-api/src/response/FilesRemoteAddResponse.ts b/packages/web-api/src/types/response/FilesRemoteAddResponse.ts similarity index 99% rename from packages/web-api/src/response/FilesRemoteAddResponse.ts rename to packages/web-api/src/types/response/FilesRemoteAddResponse.ts index 77ffe2c92..f42db8498 100644 --- a/packages/web-api/src/response/FilesRemoteAddResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesRemoteAddResponse = WebAPICallResult & { error?: string; file?: File; diff --git a/packages/web-api/src/response/FilesRemoteInfoResponse.ts b/packages/web-api/src/types/response/FilesRemoteInfoResponse.ts similarity index 99% rename from packages/web-api/src/response/FilesRemoteInfoResponse.ts rename to packages/web-api/src/types/response/FilesRemoteInfoResponse.ts index f9b0aefb5..209d61f5d 100644 --- a/packages/web-api/src/response/FilesRemoteInfoResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesRemoteInfoResponse = WebAPICallResult & { error?: string; file?: File; diff --git a/packages/web-api/src/response/FilesRemoteListResponse.ts b/packages/web-api/src/types/response/FilesRemoteListResponse.ts similarity index 99% rename from packages/web-api/src/response/FilesRemoteListResponse.ts rename to packages/web-api/src/types/response/FilesRemoteListResponse.ts index bcd48a48f..c1fb94911 100644 --- a/packages/web-api/src/response/FilesRemoteListResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesRemoteListResponse = WebAPICallResult & { error?: string; files?: FileElement[]; diff --git a/packages/web-api/src/response/FilesRemoteRemoveResponse.ts b/packages/web-api/src/types/response/FilesRemoteRemoveResponse.ts similarity index 94% rename from packages/web-api/src/response/FilesRemoteRemoveResponse.ts rename to packages/web-api/src/types/response/FilesRemoteRemoveResponse.ts index eeca52c23..aeb98392a 100644 --- a/packages/web-api/src/response/FilesRemoteRemoveResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteRemoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesRemoteRemoveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/FilesRemoteShareResponse.ts b/packages/web-api/src/types/response/FilesRemoteShareResponse.ts similarity index 99% rename from packages/web-api/src/response/FilesRemoteShareResponse.ts rename to packages/web-api/src/types/response/FilesRemoteShareResponse.ts index b3cbb60d2..b855cf5bb 100644 --- a/packages/web-api/src/response/FilesRemoteShareResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteShareResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesRemoteShareResponse = WebAPICallResult & { error?: string; file?: File; diff --git a/packages/web-api/src/response/FilesRemoteUpdateResponse.ts b/packages/web-api/src/types/response/FilesRemoteUpdateResponse.ts similarity index 99% rename from packages/web-api/src/response/FilesRemoteUpdateResponse.ts rename to packages/web-api/src/types/response/FilesRemoteUpdateResponse.ts index 453a490af..441e3b5dc 100644 --- a/packages/web-api/src/response/FilesRemoteUpdateResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteUpdateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesRemoteUpdateResponse = WebAPICallResult & { error?: string; file?: File; diff --git a/packages/web-api/src/response/FilesRevokePublicURLResponse.ts b/packages/web-api/src/types/response/FilesRevokePublicURLResponse.ts similarity index 99% rename from packages/web-api/src/response/FilesRevokePublicURLResponse.ts rename to packages/web-api/src/types/response/FilesRevokePublicURLResponse.ts index 79ad43204..e9f999296 100644 --- a/packages/web-api/src/response/FilesRevokePublicURLResponse.ts +++ b/packages/web-api/src/types/response/FilesRevokePublicURLResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesRevokePublicURLResponse = WebAPICallResult & { error?: string; file?: File; diff --git a/packages/web-api/src/response/FilesSharedPublicURLResponse.ts b/packages/web-api/src/types/response/FilesSharedPublicURLResponse.ts similarity index 99% rename from packages/web-api/src/response/FilesSharedPublicURLResponse.ts rename to packages/web-api/src/types/response/FilesSharedPublicURLResponse.ts index 32d5f14aa..81f93035b 100644 --- a/packages/web-api/src/response/FilesSharedPublicURLResponse.ts +++ b/packages/web-api/src/types/response/FilesSharedPublicURLResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesSharedPublicURLResponse = WebAPICallResult & { error?: string; file?: File; diff --git a/packages/web-api/src/response/FilesUploadResponse.ts b/packages/web-api/src/types/response/FilesUploadResponse.ts similarity index 99% rename from packages/web-api/src/response/FilesUploadResponse.ts rename to packages/web-api/src/types/response/FilesUploadResponse.ts index 71047cb65..2b0dab0d9 100644 --- a/packages/web-api/src/response/FilesUploadResponse.ts +++ b/packages/web-api/src/types/response/FilesUploadResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FilesUploadResponse = WebAPICallResult & { error?: string; file?: File; diff --git a/packages/web-api/src/response/FunctionsCompleteErrorResponse.ts b/packages/web-api/src/types/response/FunctionsCompleteErrorResponse.ts similarity index 94% rename from packages/web-api/src/response/FunctionsCompleteErrorResponse.ts rename to packages/web-api/src/types/response/FunctionsCompleteErrorResponse.ts index 0cf44f406..0450f7591 100644 --- a/packages/web-api/src/response/FunctionsCompleteErrorResponse.ts +++ b/packages/web-api/src/types/response/FunctionsCompleteErrorResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FunctionsCompleteErrorResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/FunctionsCompleteSuccessResponse.ts b/packages/web-api/src/types/response/FunctionsCompleteSuccessResponse.ts similarity index 94% rename from packages/web-api/src/response/FunctionsCompleteSuccessResponse.ts rename to packages/web-api/src/types/response/FunctionsCompleteSuccessResponse.ts index e81792d51..d40df2d79 100644 --- a/packages/web-api/src/response/FunctionsCompleteSuccessResponse.ts +++ b/packages/web-api/src/types/response/FunctionsCompleteSuccessResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type FunctionsCompleteSuccessResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/GroupsArchiveResponse.ts b/packages/web-api/src/types/response/GroupsArchiveResponse.ts similarity index 95% rename from packages/web-api/src/response/GroupsArchiveResponse.ts rename to packages/web-api/src/types/response/GroupsArchiveResponse.ts index d121bd2a8..2f9ac2523 100644 --- a/packages/web-api/src/response/GroupsArchiveResponse.ts +++ b/packages/web-api/src/types/response/GroupsArchiveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsArchiveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/GroupsCloseResponse.ts b/packages/web-api/src/types/response/GroupsCloseResponse.ts similarity index 94% rename from packages/web-api/src/response/GroupsCloseResponse.ts rename to packages/web-api/src/types/response/GroupsCloseResponse.ts index 1a4e611e0..fd2a67783 100644 --- a/packages/web-api/src/response/GroupsCloseResponse.ts +++ b/packages/web-api/src/types/response/GroupsCloseResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsCloseResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/GroupsCreateChildResponse.ts b/packages/web-api/src/types/response/GroupsCreateChildResponse.ts similarity index 97% rename from packages/web-api/src/response/GroupsCreateChildResponse.ts rename to packages/web-api/src/types/response/GroupsCreateChildResponse.ts index f1091f280..1a5419b87 100644 --- a/packages/web-api/src/response/GroupsCreateChildResponse.ts +++ b/packages/web-api/src/types/response/GroupsCreateChildResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsCreateChildResponse = WebAPICallResult & { error?: string; group?: Group; diff --git a/packages/web-api/src/response/GroupsCreateResponse.ts b/packages/web-api/src/types/response/GroupsCreateResponse.ts similarity index 97% rename from packages/web-api/src/response/GroupsCreateResponse.ts rename to packages/web-api/src/types/response/GroupsCreateResponse.ts index 7edd86fcf..951d4e090 100644 --- a/packages/web-api/src/response/GroupsCreateResponse.ts +++ b/packages/web-api/src/types/response/GroupsCreateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsCreateResponse = WebAPICallResult & { error?: string; group?: Group; diff --git a/packages/web-api/src/response/GroupsHistoryResponse.ts b/packages/web-api/src/types/response/GroupsHistoryResponse.ts similarity index 96% rename from packages/web-api/src/response/GroupsHistoryResponse.ts rename to packages/web-api/src/types/response/GroupsHistoryResponse.ts index 0e12a8161..b5da7cded 100644 --- a/packages/web-api/src/response/GroupsHistoryResponse.ts +++ b/packages/web-api/src/types/response/GroupsHistoryResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsHistoryResponse = WebAPICallResult & { channel_actions_count?: number; error?: string; diff --git a/packages/web-api/src/response/GroupsInfoResponse.ts b/packages/web-api/src/types/response/GroupsInfoResponse.ts similarity index 97% rename from packages/web-api/src/response/GroupsInfoResponse.ts rename to packages/web-api/src/types/response/GroupsInfoResponse.ts index 75e2828a5..d42003b94 100644 --- a/packages/web-api/src/response/GroupsInfoResponse.ts +++ b/packages/web-api/src/types/response/GroupsInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsInfoResponse = WebAPICallResult & { error?: string; group?: Group; diff --git a/packages/web-api/src/response/GroupsInviteResponse.ts b/packages/web-api/src/types/response/GroupsInviteResponse.ts similarity index 97% rename from packages/web-api/src/response/GroupsInviteResponse.ts rename to packages/web-api/src/types/response/GroupsInviteResponse.ts index e88ff9af5..e6a478ce3 100644 --- a/packages/web-api/src/response/GroupsInviteResponse.ts +++ b/packages/web-api/src/types/response/GroupsInviteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsInviteResponse = WebAPICallResult & { error?: string; group?: Group; diff --git a/packages/web-api/src/response/GroupsKickResponse.ts b/packages/web-api/src/types/response/GroupsKickResponse.ts similarity index 95% rename from packages/web-api/src/response/GroupsKickResponse.ts rename to packages/web-api/src/types/response/GroupsKickResponse.ts index 06a9e045e..59a0cfed9 100644 --- a/packages/web-api/src/response/GroupsKickResponse.ts +++ b/packages/web-api/src/types/response/GroupsKickResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsKickResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/GroupsLeaveResponse.ts b/packages/web-api/src/types/response/GroupsLeaveResponse.ts similarity index 95% rename from packages/web-api/src/response/GroupsLeaveResponse.ts rename to packages/web-api/src/types/response/GroupsLeaveResponse.ts index b006b1bfa..f1998fbb0 100644 --- a/packages/web-api/src/response/GroupsLeaveResponse.ts +++ b/packages/web-api/src/types/response/GroupsLeaveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsLeaveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/GroupsListResponse.ts b/packages/web-api/src/types/response/GroupsListResponse.ts similarity index 96% rename from packages/web-api/src/response/GroupsListResponse.ts rename to packages/web-api/src/types/response/GroupsListResponse.ts index c62442e9f..d3d214859 100644 --- a/packages/web-api/src/response/GroupsListResponse.ts +++ b/packages/web-api/src/types/response/GroupsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsListResponse = WebAPICallResult & { error?: string; groups?: Group[]; diff --git a/packages/web-api/src/response/GroupsMarkResponse.ts b/packages/web-api/src/types/response/GroupsMarkResponse.ts similarity index 95% rename from packages/web-api/src/response/GroupsMarkResponse.ts rename to packages/web-api/src/types/response/GroupsMarkResponse.ts index c3b6045bf..19f007a29 100644 --- a/packages/web-api/src/response/GroupsMarkResponse.ts +++ b/packages/web-api/src/types/response/GroupsMarkResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsMarkResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/GroupsOpenResponse.ts b/packages/web-api/src/types/response/GroupsOpenResponse.ts similarity index 95% rename from packages/web-api/src/response/GroupsOpenResponse.ts rename to packages/web-api/src/types/response/GroupsOpenResponse.ts index e25c4ae53..54b4da2e2 100644 --- a/packages/web-api/src/response/GroupsOpenResponse.ts +++ b/packages/web-api/src/types/response/GroupsOpenResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsOpenResponse = WebAPICallResult & { already_open?: boolean; error?: string; diff --git a/packages/web-api/src/response/GroupsRenameResponse.ts b/packages/web-api/src/types/response/GroupsRenameResponse.ts similarity index 96% rename from packages/web-api/src/response/GroupsRenameResponse.ts rename to packages/web-api/src/types/response/GroupsRenameResponse.ts index f052a8437..d67f3caac 100644 --- a/packages/web-api/src/response/GroupsRenameResponse.ts +++ b/packages/web-api/src/types/response/GroupsRenameResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsRenameResponse = WebAPICallResult & { channel?: Channel; error?: string; diff --git a/packages/web-api/src/response/GroupsRepliesResponse.ts b/packages/web-api/src/types/response/GroupsRepliesResponse.ts similarity index 97% rename from packages/web-api/src/response/GroupsRepliesResponse.ts rename to packages/web-api/src/types/response/GroupsRepliesResponse.ts index 59c2f37cc..0fac5fe26 100644 --- a/packages/web-api/src/response/GroupsRepliesResponse.ts +++ b/packages/web-api/src/types/response/GroupsRepliesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsRepliesResponse = WebAPICallResult & { error?: string; has_more?: boolean; diff --git a/packages/web-api/src/response/GroupsSetPurposeResponse.ts b/packages/web-api/src/types/response/GroupsSetPurposeResponse.ts similarity index 95% rename from packages/web-api/src/response/GroupsSetPurposeResponse.ts rename to packages/web-api/src/types/response/GroupsSetPurposeResponse.ts index fdb13929f..38bcf314b 100644 --- a/packages/web-api/src/response/GroupsSetPurposeResponse.ts +++ b/packages/web-api/src/types/response/GroupsSetPurposeResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsSetPurposeResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/GroupsSetTopicResponse.ts b/packages/web-api/src/types/response/GroupsSetTopicResponse.ts similarity index 95% rename from packages/web-api/src/response/GroupsSetTopicResponse.ts rename to packages/web-api/src/types/response/GroupsSetTopicResponse.ts index 1323602e7..140813303 100644 --- a/packages/web-api/src/response/GroupsSetTopicResponse.ts +++ b/packages/web-api/src/types/response/GroupsSetTopicResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsSetTopicResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/GroupsUnarchiveResponse.ts b/packages/web-api/src/types/response/GroupsUnarchiveResponse.ts similarity index 95% rename from packages/web-api/src/response/GroupsUnarchiveResponse.ts rename to packages/web-api/src/types/response/GroupsUnarchiveResponse.ts index 440863bb2..54e8a37bb 100644 --- a/packages/web-api/src/response/GroupsUnarchiveResponse.ts +++ b/packages/web-api/src/types/response/GroupsUnarchiveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type GroupsUnarchiveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ImCloseResponse.ts b/packages/web-api/src/types/response/ImCloseResponse.ts similarity index 95% rename from packages/web-api/src/response/ImCloseResponse.ts rename to packages/web-api/src/types/response/ImCloseResponse.ts index ba8719517..0bfaa6c31 100644 --- a/packages/web-api/src/response/ImCloseResponse.ts +++ b/packages/web-api/src/types/response/ImCloseResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ImCloseResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ImHistoryResponse.ts b/packages/web-api/src/types/response/ImHistoryResponse.ts similarity index 98% rename from packages/web-api/src/response/ImHistoryResponse.ts rename to packages/web-api/src/types/response/ImHistoryResponse.ts index 93ff17b50..d73f3e1e9 100644 --- a/packages/web-api/src/response/ImHistoryResponse.ts +++ b/packages/web-api/src/types/response/ImHistoryResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ImHistoryResponse = WebAPICallResult & { channel_actions_count?: number; error?: string; diff --git a/packages/web-api/src/response/ImListResponse.ts b/packages/web-api/src/types/response/ImListResponse.ts similarity index 96% rename from packages/web-api/src/response/ImListResponse.ts rename to packages/web-api/src/types/response/ImListResponse.ts index f6ee5cd51..c6912478c 100644 --- a/packages/web-api/src/response/ImListResponse.ts +++ b/packages/web-api/src/types/response/ImListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ImListResponse = WebAPICallResult & { error?: string; ims?: Im[]; diff --git a/packages/web-api/src/response/ImMarkResponse.ts b/packages/web-api/src/types/response/ImMarkResponse.ts similarity index 95% rename from packages/web-api/src/response/ImMarkResponse.ts rename to packages/web-api/src/types/response/ImMarkResponse.ts index 8e7f8605f..b15449395 100644 --- a/packages/web-api/src/response/ImMarkResponse.ts +++ b/packages/web-api/src/types/response/ImMarkResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ImMarkResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ImOpenResponse.ts b/packages/web-api/src/types/response/ImOpenResponse.ts similarity index 95% rename from packages/web-api/src/response/ImOpenResponse.ts rename to packages/web-api/src/types/response/ImOpenResponse.ts index 04ed62df1..44e81db63 100644 --- a/packages/web-api/src/response/ImOpenResponse.ts +++ b/packages/web-api/src/types/response/ImOpenResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ImOpenResponse = WebAPICallResult & { already_open?: boolean; channel?: Channel; diff --git a/packages/web-api/src/response/ImRepliesResponse.ts b/packages/web-api/src/types/response/ImRepliesResponse.ts similarity index 97% rename from packages/web-api/src/response/ImRepliesResponse.ts rename to packages/web-api/src/types/response/ImRepliesResponse.ts index 84b616830..6f2b6b452 100644 --- a/packages/web-api/src/response/ImRepliesResponse.ts +++ b/packages/web-api/src/types/response/ImRepliesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ImRepliesResponse = WebAPICallResult & { error?: string; has_more?: boolean; diff --git a/packages/web-api/src/response/MigrationExchangeResponse.ts b/packages/web-api/src/types/response/MigrationExchangeResponse.ts similarity index 95% rename from packages/web-api/src/response/MigrationExchangeResponse.ts rename to packages/web-api/src/types/response/MigrationExchangeResponse.ts index 46956816c..4fcf80670 100644 --- a/packages/web-api/src/response/MigrationExchangeResponse.ts +++ b/packages/web-api/src/types/response/MigrationExchangeResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type MigrationExchangeResponse = WebAPICallResult & { enterprise_id?: string; error?: string; diff --git a/packages/web-api/src/response/MpimCloseResponse.ts b/packages/web-api/src/types/response/MpimCloseResponse.ts similarity index 95% rename from packages/web-api/src/response/MpimCloseResponse.ts rename to packages/web-api/src/types/response/MpimCloseResponse.ts index 45816feb3..13f3fe6f7 100644 --- a/packages/web-api/src/response/MpimCloseResponse.ts +++ b/packages/web-api/src/types/response/MpimCloseResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type MpimCloseResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/MpimHistoryResponse.ts b/packages/web-api/src/types/response/MpimHistoryResponse.ts similarity index 97% rename from packages/web-api/src/response/MpimHistoryResponse.ts rename to packages/web-api/src/types/response/MpimHistoryResponse.ts index 24805a463..fdd2939c1 100644 --- a/packages/web-api/src/response/MpimHistoryResponse.ts +++ b/packages/web-api/src/types/response/MpimHistoryResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type MpimHistoryResponse = WebAPICallResult & { channel_actions_count?: number; error?: string; diff --git a/packages/web-api/src/response/MpimListResponse.ts b/packages/web-api/src/types/response/MpimListResponse.ts similarity index 96% rename from packages/web-api/src/response/MpimListResponse.ts rename to packages/web-api/src/types/response/MpimListResponse.ts index a46256bca..f06658cf4 100644 --- a/packages/web-api/src/response/MpimListResponse.ts +++ b/packages/web-api/src/types/response/MpimListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type MpimListResponse = WebAPICallResult & { error?: string; groups?: Group[]; diff --git a/packages/web-api/src/response/MpimMarkResponse.ts b/packages/web-api/src/types/response/MpimMarkResponse.ts similarity index 95% rename from packages/web-api/src/response/MpimMarkResponse.ts rename to packages/web-api/src/types/response/MpimMarkResponse.ts index 8af92659b..ecf8be00d 100644 --- a/packages/web-api/src/response/MpimMarkResponse.ts +++ b/packages/web-api/src/types/response/MpimMarkResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type MpimMarkResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/MpimOpenResponse.ts b/packages/web-api/src/types/response/MpimOpenResponse.ts similarity index 97% rename from packages/web-api/src/response/MpimOpenResponse.ts rename to packages/web-api/src/types/response/MpimOpenResponse.ts index b11f740e3..656a4e2e4 100644 --- a/packages/web-api/src/response/MpimOpenResponse.ts +++ b/packages/web-api/src/types/response/MpimOpenResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type MpimOpenResponse = WebAPICallResult & { error?: string; group?: Group; diff --git a/packages/web-api/src/response/MpimRepliesResponse.ts b/packages/web-api/src/types/response/MpimRepliesResponse.ts similarity index 97% rename from packages/web-api/src/response/MpimRepliesResponse.ts rename to packages/web-api/src/types/response/MpimRepliesResponse.ts index 8efb111c4..b559652ad 100644 --- a/packages/web-api/src/response/MpimRepliesResponse.ts +++ b/packages/web-api/src/types/response/MpimRepliesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type MpimRepliesResponse = WebAPICallResult & { error?: string; has_more?: boolean; diff --git a/packages/web-api/src/response/OauthAccessResponse.ts b/packages/web-api/src/types/response/OauthAccessResponse.ts similarity index 97% rename from packages/web-api/src/response/OauthAccessResponse.ts rename to packages/web-api/src/types/response/OauthAccessResponse.ts index 3cede3d77..6b3c99ef9 100644 --- a/packages/web-api/src/response/OauthAccessResponse.ts +++ b/packages/web-api/src/types/response/OauthAccessResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type OauthAccessResponse = WebAPICallResult & { access_token?: string; authorizing_user?: User; diff --git a/packages/web-api/src/response/OauthTokenResponse.ts b/packages/web-api/src/types/response/OauthTokenResponse.ts similarity index 94% rename from packages/web-api/src/response/OauthTokenResponse.ts rename to packages/web-api/src/types/response/OauthTokenResponse.ts index b5f6d5f7d..a3a5008f2 100644 --- a/packages/web-api/src/response/OauthTokenResponse.ts +++ b/packages/web-api/src/types/response/OauthTokenResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type OauthTokenResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/OauthV2AccessResponse.ts b/packages/web-api/src/types/response/OauthV2AccessResponse.ts similarity index 97% rename from packages/web-api/src/response/OauthV2AccessResponse.ts rename to packages/web-api/src/types/response/OauthV2AccessResponse.ts index da13ee7e1..de5aa2def 100644 --- a/packages/web-api/src/response/OauthV2AccessResponse.ts +++ b/packages/web-api/src/types/response/OauthV2AccessResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type OauthV2AccessResponse = WebAPICallResult & { access_token?: string; app_id?: string; diff --git a/packages/web-api/src/response/OauthV2ExchangeResponse.ts b/packages/web-api/src/types/response/OauthV2ExchangeResponse.ts similarity index 97% rename from packages/web-api/src/response/OauthV2ExchangeResponse.ts rename to packages/web-api/src/types/response/OauthV2ExchangeResponse.ts index b793ce79c..96427a037 100644 --- a/packages/web-api/src/response/OauthV2ExchangeResponse.ts +++ b/packages/web-api/src/types/response/OauthV2ExchangeResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type OauthV2ExchangeResponse = WebAPICallResult & { access_token?: string; app_id?: string; diff --git a/packages/web-api/src/response/OpenIDConnectTokenResponse.ts b/packages/web-api/src/types/response/OpenIDConnectTokenResponse.ts similarity index 95% rename from packages/web-api/src/response/OpenIDConnectTokenResponse.ts rename to packages/web-api/src/types/response/OpenIDConnectTokenResponse.ts index ada974bbc..b97e54e63 100644 --- a/packages/web-api/src/response/OpenIDConnectTokenResponse.ts +++ b/packages/web-api/src/types/response/OpenIDConnectTokenResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type OpenIDConnectTokenResponse = WebAPICallResult & { access_token?: string; error?: string; diff --git a/packages/web-api/src/response/OpenIDConnectUserInfoResponse.ts b/packages/web-api/src/types/response/OpenIDConnectUserInfoResponse.ts similarity index 98% rename from packages/web-api/src/response/OpenIDConnectUserInfoResponse.ts rename to packages/web-api/src/types/response/OpenIDConnectUserInfoResponse.ts index 1f3a9fc37..414e785dc 100644 --- a/packages/web-api/src/response/OpenIDConnectUserInfoResponse.ts +++ b/packages/web-api/src/types/response/OpenIDConnectUserInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type OpenIDConnectUserInfoResponse = WebAPICallResult & { date_email_verified?: number; email?: string; diff --git a/packages/web-api/src/response/PinsAddResponse.ts b/packages/web-api/src/types/response/PinsAddResponse.ts similarity index 94% rename from packages/web-api/src/response/PinsAddResponse.ts rename to packages/web-api/src/types/response/PinsAddResponse.ts index 06dfbf889..6fe280939 100644 --- a/packages/web-api/src/response/PinsAddResponse.ts +++ b/packages/web-api/src/types/response/PinsAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type PinsAddResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/PinsListResponse.ts b/packages/web-api/src/types/response/PinsListResponse.ts similarity index 99% rename from packages/web-api/src/response/PinsListResponse.ts rename to packages/web-api/src/types/response/PinsListResponse.ts index 1cb28b34e..52a657978 100644 --- a/packages/web-api/src/response/PinsListResponse.ts +++ b/packages/web-api/src/types/response/PinsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type PinsListResponse = WebAPICallResult & { error?: string; items?: Item[]; diff --git a/packages/web-api/src/response/PinsRemoveResponse.ts b/packages/web-api/src/types/response/PinsRemoveResponse.ts similarity index 94% rename from packages/web-api/src/response/PinsRemoveResponse.ts rename to packages/web-api/src/types/response/PinsRemoveResponse.ts index 8299805f7..c589322ba 100644 --- a/packages/web-api/src/response/PinsRemoveResponse.ts +++ b/packages/web-api/src/types/response/PinsRemoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type PinsRemoveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ReactionsAddResponse.ts b/packages/web-api/src/types/response/ReactionsAddResponse.ts similarity index 94% rename from packages/web-api/src/response/ReactionsAddResponse.ts rename to packages/web-api/src/types/response/ReactionsAddResponse.ts index 952146261..a7411a9a5 100644 --- a/packages/web-api/src/response/ReactionsAddResponse.ts +++ b/packages/web-api/src/types/response/ReactionsAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ReactionsAddResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ReactionsGetResponse.ts b/packages/web-api/src/types/response/ReactionsGetResponse.ts similarity index 99% rename from packages/web-api/src/response/ReactionsGetResponse.ts rename to packages/web-api/src/types/response/ReactionsGetResponse.ts index 28ae8343b..6375c3c02 100644 --- a/packages/web-api/src/response/ReactionsGetResponse.ts +++ b/packages/web-api/src/types/response/ReactionsGetResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ReactionsGetResponse = WebAPICallResult & { channel?: string; error?: string; diff --git a/packages/web-api/src/response/ReactionsListResponse.ts b/packages/web-api/src/types/response/ReactionsListResponse.ts similarity index 99% rename from packages/web-api/src/response/ReactionsListResponse.ts rename to packages/web-api/src/types/response/ReactionsListResponse.ts index e62fb413f..acff10b44 100644 --- a/packages/web-api/src/response/ReactionsListResponse.ts +++ b/packages/web-api/src/types/response/ReactionsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ReactionsListResponse = WebAPICallResult & { error?: string; items?: Item[]; diff --git a/packages/web-api/src/response/ReactionsRemoveResponse.ts b/packages/web-api/src/types/response/ReactionsRemoveResponse.ts similarity index 94% rename from packages/web-api/src/response/ReactionsRemoveResponse.ts rename to packages/web-api/src/types/response/ReactionsRemoveResponse.ts index 6b1730343..652bbf180 100644 --- a/packages/web-api/src/response/ReactionsRemoveResponse.ts +++ b/packages/web-api/src/types/response/ReactionsRemoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ReactionsRemoveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/RemindersAddResponse.ts b/packages/web-api/src/types/response/RemindersAddResponse.ts similarity index 96% rename from packages/web-api/src/response/RemindersAddResponse.ts rename to packages/web-api/src/types/response/RemindersAddResponse.ts index 9d621b79d..9586daa97 100644 --- a/packages/web-api/src/response/RemindersAddResponse.ts +++ b/packages/web-api/src/types/response/RemindersAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type RemindersAddResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/RemindersCompleteResponse.ts b/packages/web-api/src/types/response/RemindersCompleteResponse.ts similarity index 94% rename from packages/web-api/src/response/RemindersCompleteResponse.ts rename to packages/web-api/src/types/response/RemindersCompleteResponse.ts index 619c16057..db6007716 100644 --- a/packages/web-api/src/response/RemindersCompleteResponse.ts +++ b/packages/web-api/src/types/response/RemindersCompleteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type RemindersCompleteResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/RemindersDeleteResponse.ts b/packages/web-api/src/types/response/RemindersDeleteResponse.ts similarity index 94% rename from packages/web-api/src/response/RemindersDeleteResponse.ts rename to packages/web-api/src/types/response/RemindersDeleteResponse.ts index b630b913c..1e729bceb 100644 --- a/packages/web-api/src/response/RemindersDeleteResponse.ts +++ b/packages/web-api/src/types/response/RemindersDeleteResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type RemindersDeleteResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/RemindersInfoResponse.ts b/packages/web-api/src/types/response/RemindersInfoResponse.ts similarity index 95% rename from packages/web-api/src/response/RemindersInfoResponse.ts rename to packages/web-api/src/types/response/RemindersInfoResponse.ts index 1542badb2..4ca914103 100644 --- a/packages/web-api/src/response/RemindersInfoResponse.ts +++ b/packages/web-api/src/types/response/RemindersInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type RemindersInfoResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/RemindersListResponse.ts b/packages/web-api/src/types/response/RemindersListResponse.ts similarity index 96% rename from packages/web-api/src/response/RemindersListResponse.ts rename to packages/web-api/src/types/response/RemindersListResponse.ts index 3ce7ebbe3..8820c1570 100644 --- a/packages/web-api/src/response/RemindersListResponse.ts +++ b/packages/web-api/src/types/response/RemindersListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type RemindersListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/RtmConnectResponse.ts b/packages/web-api/src/types/response/RtmConnectResponse.ts similarity index 95% rename from packages/web-api/src/response/RtmConnectResponse.ts rename to packages/web-api/src/types/response/RtmConnectResponse.ts index 9f3cdd38f..a2e037bb3 100644 --- a/packages/web-api/src/response/RtmConnectResponse.ts +++ b/packages/web-api/src/types/response/RtmConnectResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type RtmConnectResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/RtmStartResponse.ts b/packages/web-api/src/types/response/RtmStartResponse.ts similarity index 99% rename from packages/web-api/src/response/RtmStartResponse.ts rename to packages/web-api/src/types/response/RtmStartResponse.ts index c95acfd7c..b66fc6632 100644 --- a/packages/web-api/src/response/RtmStartResponse.ts +++ b/packages/web-api/src/types/response/RtmStartResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type RtmStartResponse = WebAPICallResult & { accept_tos_url?: string; bots?: Bot[]; diff --git a/packages/web-api/src/response/SearchAllResponse.ts b/packages/web-api/src/types/response/SearchAllResponse.ts similarity index 99% rename from packages/web-api/src/response/SearchAllResponse.ts rename to packages/web-api/src/types/response/SearchAllResponse.ts index 1d7ab00b6..1fa7f7092 100644 --- a/packages/web-api/src/response/SearchAllResponse.ts +++ b/packages/web-api/src/types/response/SearchAllResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type SearchAllResponse = WebAPICallResult & { error?: string; files?: Files; diff --git a/packages/web-api/src/response/SearchFilesResponse.ts b/packages/web-api/src/types/response/SearchFilesResponse.ts similarity index 99% rename from packages/web-api/src/response/SearchFilesResponse.ts rename to packages/web-api/src/types/response/SearchFilesResponse.ts index d9392d2ae..8e54c78ee 100644 --- a/packages/web-api/src/response/SearchFilesResponse.ts +++ b/packages/web-api/src/types/response/SearchFilesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type SearchFilesResponse = WebAPICallResult & { error?: string; files?: Files; diff --git a/packages/web-api/src/response/SearchMessagesResponse.ts b/packages/web-api/src/types/response/SearchMessagesResponse.ts similarity index 99% rename from packages/web-api/src/response/SearchMessagesResponse.ts rename to packages/web-api/src/types/response/SearchMessagesResponse.ts index 4cf90e7b1..48921ca1b 100644 --- a/packages/web-api/src/response/SearchMessagesResponse.ts +++ b/packages/web-api/src/types/response/SearchMessagesResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type SearchMessagesResponse = WebAPICallResult & { error?: string; messages?: Messages; diff --git a/packages/web-api/src/response/StarsAddResponse.ts b/packages/web-api/src/types/response/StarsAddResponse.ts similarity index 94% rename from packages/web-api/src/response/StarsAddResponse.ts rename to packages/web-api/src/types/response/StarsAddResponse.ts index f36d2071e..44712411b 100644 --- a/packages/web-api/src/response/StarsAddResponse.ts +++ b/packages/web-api/src/types/response/StarsAddResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type StarsAddResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/StarsListResponse.ts b/packages/web-api/src/types/response/StarsListResponse.ts similarity index 99% rename from packages/web-api/src/response/StarsListResponse.ts rename to packages/web-api/src/types/response/StarsListResponse.ts index 309e38828..8d466a9a0 100644 --- a/packages/web-api/src/response/StarsListResponse.ts +++ b/packages/web-api/src/types/response/StarsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type StarsListResponse = WebAPICallResult & { error?: string; items?: Item[]; diff --git a/packages/web-api/src/response/StarsRemoveResponse.ts b/packages/web-api/src/types/response/StarsRemoveResponse.ts similarity index 94% rename from packages/web-api/src/response/StarsRemoveResponse.ts rename to packages/web-api/src/types/response/StarsRemoveResponse.ts index 0d35c152b..d22d82a0d 100644 --- a/packages/web-api/src/response/StarsRemoveResponse.ts +++ b/packages/web-api/src/types/response/StarsRemoveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type StarsRemoveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/TeamAccessLogsResponse.ts b/packages/web-api/src/types/response/TeamAccessLogsResponse.ts similarity index 96% rename from packages/web-api/src/response/TeamAccessLogsResponse.ts rename to packages/web-api/src/types/response/TeamAccessLogsResponse.ts index 0422307c6..7312ef0d1 100644 --- a/packages/web-api/src/response/TeamAccessLogsResponse.ts +++ b/packages/web-api/src/types/response/TeamAccessLogsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type TeamAccessLogsResponse = WebAPICallResult & { error?: string; logins?: Login[]; diff --git a/packages/web-api/src/response/TeamBillableInfoResponse.ts b/packages/web-api/src/types/response/TeamBillableInfoResponse.ts similarity index 95% rename from packages/web-api/src/response/TeamBillableInfoResponse.ts rename to packages/web-api/src/types/response/TeamBillableInfoResponse.ts index 505571f7e..30c6fb668 100644 --- a/packages/web-api/src/response/TeamBillableInfoResponse.ts +++ b/packages/web-api/src/types/response/TeamBillableInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type TeamBillableInfoResponse = WebAPICallResult & { billable_info?: { [key: string]: BillableInfo }; error?: string; diff --git a/packages/web-api/src/response/TeamBillingInfoResponse.ts b/packages/web-api/src/types/response/TeamBillingInfoResponse.ts similarity index 94% rename from packages/web-api/src/response/TeamBillingInfoResponse.ts rename to packages/web-api/src/types/response/TeamBillingInfoResponse.ts index 92b31019f..55262c442 100644 --- a/packages/web-api/src/response/TeamBillingInfoResponse.ts +++ b/packages/web-api/src/types/response/TeamBillingInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type TeamBillingInfoResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/TeamInfoResponse.ts b/packages/web-api/src/types/response/TeamInfoResponse.ts similarity index 96% rename from packages/web-api/src/response/TeamInfoResponse.ts rename to packages/web-api/src/types/response/TeamInfoResponse.ts index f3ab153bf..5712ab9a9 100644 --- a/packages/web-api/src/response/TeamInfoResponse.ts +++ b/packages/web-api/src/types/response/TeamInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type TeamInfoResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/TeamIntegrationLogsResponse.ts b/packages/web-api/src/types/response/TeamIntegrationLogsResponse.ts similarity index 96% rename from packages/web-api/src/response/TeamIntegrationLogsResponse.ts rename to packages/web-api/src/types/response/TeamIntegrationLogsResponse.ts index 2ec8879a5..f5cf5ffb3 100644 --- a/packages/web-api/src/response/TeamIntegrationLogsResponse.ts +++ b/packages/web-api/src/types/response/TeamIntegrationLogsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type TeamIntegrationLogsResponse = WebAPICallResult & { error?: string; logs?: Log[]; diff --git a/packages/web-api/src/response/TeamPreferencesListResponse.ts b/packages/web-api/src/types/response/TeamPreferencesListResponse.ts similarity index 95% rename from packages/web-api/src/response/TeamPreferencesListResponse.ts rename to packages/web-api/src/types/response/TeamPreferencesListResponse.ts index 818ccbbe4..064b55782 100644 --- a/packages/web-api/src/response/TeamPreferencesListResponse.ts +++ b/packages/web-api/src/types/response/TeamPreferencesListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type TeamPreferencesListResponse = WebAPICallResult & { allow_message_deletion?: boolean; disable_file_uploads?: string; diff --git a/packages/web-api/src/response/TeamProfileGetResponse.ts b/packages/web-api/src/types/response/TeamProfileGetResponse.ts similarity index 97% rename from packages/web-api/src/response/TeamProfileGetResponse.ts rename to packages/web-api/src/types/response/TeamProfileGetResponse.ts index a7887b127..f61d615df 100644 --- a/packages/web-api/src/response/TeamProfileGetResponse.ts +++ b/packages/web-api/src/types/response/TeamProfileGetResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type TeamProfileGetResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ToolingTokensRotateResponse.ts b/packages/web-api/src/types/response/ToolingTokensRotateResponse.ts similarity index 95% rename from packages/web-api/src/response/ToolingTokensRotateResponse.ts rename to packages/web-api/src/types/response/ToolingTokensRotateResponse.ts index 093f088d5..94e5b79a1 100644 --- a/packages/web-api/src/response/ToolingTokensRotateResponse.ts +++ b/packages/web-api/src/types/response/ToolingTokensRotateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ToolingTokensRotateResponse = WebAPICallResult & { error?: string; exp?: number; diff --git a/packages/web-api/src/response/UsergroupsCreateResponse.ts b/packages/web-api/src/types/response/UsergroupsCreateResponse.ts similarity index 96% rename from packages/web-api/src/response/UsergroupsCreateResponse.ts rename to packages/web-api/src/types/response/UsergroupsCreateResponse.ts index c1ffb1952..3f77cf8a5 100644 --- a/packages/web-api/src/response/UsergroupsCreateResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsCreateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsergroupsCreateResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsergroupsDisableResponse.ts b/packages/web-api/src/types/response/UsergroupsDisableResponse.ts similarity index 96% rename from packages/web-api/src/response/UsergroupsDisableResponse.ts rename to packages/web-api/src/types/response/UsergroupsDisableResponse.ts index b9947caed..29c7a2e09 100644 --- a/packages/web-api/src/response/UsergroupsDisableResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsDisableResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsergroupsDisableResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsergroupsEnableResponse.ts b/packages/web-api/src/types/response/UsergroupsEnableResponse.ts similarity index 96% rename from packages/web-api/src/response/UsergroupsEnableResponse.ts rename to packages/web-api/src/types/response/UsergroupsEnableResponse.ts index 26fdf25be..9ebabcac4 100644 --- a/packages/web-api/src/response/UsergroupsEnableResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsEnableResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsergroupsEnableResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsergroupsListResponse.ts b/packages/web-api/src/types/response/UsergroupsListResponse.ts similarity index 96% rename from packages/web-api/src/response/UsergroupsListResponse.ts rename to packages/web-api/src/types/response/UsergroupsListResponse.ts index 93d2a4026..ed962117f 100644 --- a/packages/web-api/src/response/UsergroupsListResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsergroupsListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsergroupsUpdateResponse.ts b/packages/web-api/src/types/response/UsergroupsUpdateResponse.ts similarity index 96% rename from packages/web-api/src/response/UsergroupsUpdateResponse.ts rename to packages/web-api/src/types/response/UsergroupsUpdateResponse.ts index 780c85c91..cfa03043d 100644 --- a/packages/web-api/src/response/UsergroupsUpdateResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsUpdateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsergroupsUpdateResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsergroupsUsersListResponse.ts b/packages/web-api/src/types/response/UsergroupsUsersListResponse.ts similarity index 94% rename from packages/web-api/src/response/UsergroupsUsersListResponse.ts rename to packages/web-api/src/types/response/UsergroupsUsersListResponse.ts index 2b066dfd4..33a66d2f7 100644 --- a/packages/web-api/src/response/UsergroupsUsersListResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsUsersListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsergroupsUsersListResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsergroupsUsersUpdateResponse.ts b/packages/web-api/src/types/response/UsergroupsUsersUpdateResponse.ts similarity index 96% rename from packages/web-api/src/response/UsergroupsUsersUpdateResponse.ts rename to packages/web-api/src/types/response/UsergroupsUsersUpdateResponse.ts index 18a3667fe..33899c869 100644 --- a/packages/web-api/src/response/UsergroupsUsersUpdateResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsUsersUpdateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsergroupsUsersUpdateResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsersConversationsResponse.ts b/packages/web-api/src/types/response/UsersConversationsResponse.ts similarity index 98% rename from packages/web-api/src/response/UsersConversationsResponse.ts rename to packages/web-api/src/types/response/UsersConversationsResponse.ts index 6d61c3547..6138ce755 100644 --- a/packages/web-api/src/response/UsersConversationsResponse.ts +++ b/packages/web-api/src/types/response/UsersConversationsResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersConversationsResponse = WebAPICallResult & { channels?: Channel[]; error?: string; diff --git a/packages/web-api/src/response/UsersDeletePhotoResponse.ts b/packages/web-api/src/types/response/UsersDeletePhotoResponse.ts similarity index 94% rename from packages/web-api/src/response/UsersDeletePhotoResponse.ts rename to packages/web-api/src/types/response/UsersDeletePhotoResponse.ts index df7038771..3917e1297 100644 --- a/packages/web-api/src/response/UsersDeletePhotoResponse.ts +++ b/packages/web-api/src/types/response/UsersDeletePhotoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersDeletePhotoResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsersGetPresenceResponse.ts b/packages/web-api/src/types/response/UsersGetPresenceResponse.ts similarity index 95% rename from packages/web-api/src/response/UsersGetPresenceResponse.ts rename to packages/web-api/src/types/response/UsersGetPresenceResponse.ts index dddb6933b..cd675caeb 100644 --- a/packages/web-api/src/response/UsersGetPresenceResponse.ts +++ b/packages/web-api/src/types/response/UsersGetPresenceResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersGetPresenceResponse = WebAPICallResult & { auto_away?: boolean; connection_count?: number; diff --git a/packages/web-api/src/response/UsersIdentityResponse.ts b/packages/web-api/src/types/response/UsersIdentityResponse.ts similarity index 95% rename from packages/web-api/src/response/UsersIdentityResponse.ts rename to packages/web-api/src/types/response/UsersIdentityResponse.ts index f8f0a1d15..d8c54e65e 100644 --- a/packages/web-api/src/response/UsersIdentityResponse.ts +++ b/packages/web-api/src/types/response/UsersIdentityResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersIdentityResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsersInfoResponse.ts b/packages/web-api/src/types/response/UsersInfoResponse.ts similarity index 98% rename from packages/web-api/src/response/UsersInfoResponse.ts rename to packages/web-api/src/types/response/UsersInfoResponse.ts index 1a4db7382..6ddd53c88 100644 --- a/packages/web-api/src/response/UsersInfoResponse.ts +++ b/packages/web-api/src/types/response/UsersInfoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersInfoResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsersListResponse.ts b/packages/web-api/src/types/response/UsersListResponse.ts similarity index 98% rename from packages/web-api/src/response/UsersListResponse.ts rename to packages/web-api/src/types/response/UsersListResponse.ts index caa05c953..12ffc4907 100644 --- a/packages/web-api/src/response/UsersListResponse.ts +++ b/packages/web-api/src/types/response/UsersListResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersListResponse = WebAPICallResult & { arg?: string; cache_ts?: number; diff --git a/packages/web-api/src/response/UsersLookupByEmailResponse.ts b/packages/web-api/src/types/response/UsersLookupByEmailResponse.ts similarity index 98% rename from packages/web-api/src/response/UsersLookupByEmailResponse.ts rename to packages/web-api/src/types/response/UsersLookupByEmailResponse.ts index 2012a4078..9f036eb34 100644 --- a/packages/web-api/src/response/UsersLookupByEmailResponse.ts +++ b/packages/web-api/src/types/response/UsersLookupByEmailResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersLookupByEmailResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsersProfileGetResponse.ts b/packages/web-api/src/types/response/UsersProfileGetResponse.ts similarity index 97% rename from packages/web-api/src/response/UsersProfileGetResponse.ts rename to packages/web-api/src/types/response/UsersProfileGetResponse.ts index 68dbf37a2..51e1f88e6 100644 --- a/packages/web-api/src/response/UsersProfileGetResponse.ts +++ b/packages/web-api/src/types/response/UsersProfileGetResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersProfileGetResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsersProfileSetResponse.ts b/packages/web-api/src/types/response/UsersProfileSetResponse.ts similarity index 97% rename from packages/web-api/src/response/UsersProfileSetResponse.ts rename to packages/web-api/src/types/response/UsersProfileSetResponse.ts index 27b4ae481..df307449e 100644 --- a/packages/web-api/src/response/UsersProfileSetResponse.ts +++ b/packages/web-api/src/types/response/UsersProfileSetResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersProfileSetResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsersSetActiveResponse.ts b/packages/web-api/src/types/response/UsersSetActiveResponse.ts similarity index 94% rename from packages/web-api/src/response/UsersSetActiveResponse.ts rename to packages/web-api/src/types/response/UsersSetActiveResponse.ts index 2ffae86dc..19d0e8a2a 100644 --- a/packages/web-api/src/response/UsersSetActiveResponse.ts +++ b/packages/web-api/src/types/response/UsersSetActiveResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersSetActiveResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsersSetPhotoResponse.ts b/packages/web-api/src/types/response/UsersSetPhotoResponse.ts similarity index 95% rename from packages/web-api/src/response/UsersSetPhotoResponse.ts rename to packages/web-api/src/types/response/UsersSetPhotoResponse.ts index 1a4fb6a25..87d31637e 100644 --- a/packages/web-api/src/response/UsersSetPhotoResponse.ts +++ b/packages/web-api/src/types/response/UsersSetPhotoResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersSetPhotoResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/UsersSetPresenceResponse.ts b/packages/web-api/src/types/response/UsersSetPresenceResponse.ts similarity index 94% rename from packages/web-api/src/response/UsersSetPresenceResponse.ts rename to packages/web-api/src/types/response/UsersSetPresenceResponse.ts index cac5e5b8b..011735983 100644 --- a/packages/web-api/src/response/UsersSetPresenceResponse.ts +++ b/packages/web-api/src/types/response/UsersSetPresenceResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type UsersSetPresenceResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ViewsOpenResponse.ts b/packages/web-api/src/types/response/ViewsOpenResponse.ts similarity index 99% rename from packages/web-api/src/response/ViewsOpenResponse.ts rename to packages/web-api/src/types/response/ViewsOpenResponse.ts index 13a8a292b..112da3b50 100644 --- a/packages/web-api/src/response/ViewsOpenResponse.ts +++ b/packages/web-api/src/types/response/ViewsOpenResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ViewsOpenResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ViewsPublishResponse.ts b/packages/web-api/src/types/response/ViewsPublishResponse.ts similarity index 99% rename from packages/web-api/src/response/ViewsPublishResponse.ts rename to packages/web-api/src/types/response/ViewsPublishResponse.ts index 4dee3d3b8..19f501ed8 100644 --- a/packages/web-api/src/response/ViewsPublishResponse.ts +++ b/packages/web-api/src/types/response/ViewsPublishResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ViewsPublishResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ViewsPushResponse.ts b/packages/web-api/src/types/response/ViewsPushResponse.ts similarity index 99% rename from packages/web-api/src/response/ViewsPushResponse.ts rename to packages/web-api/src/types/response/ViewsPushResponse.ts index 282d12211..76ebaaac2 100644 --- a/packages/web-api/src/response/ViewsPushResponse.ts +++ b/packages/web-api/src/types/response/ViewsPushResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ViewsPushResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/ViewsUpdateResponse.ts b/packages/web-api/src/types/response/ViewsUpdateResponse.ts similarity index 99% rename from packages/web-api/src/response/ViewsUpdateResponse.ts rename to packages/web-api/src/types/response/ViewsUpdateResponse.ts index bd7bebc46..bf52086b1 100644 --- a/packages/web-api/src/response/ViewsUpdateResponse.ts +++ b/packages/web-api/src/types/response/ViewsUpdateResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type ViewsUpdateResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/WorkflowsStepCompletedResponse.ts b/packages/web-api/src/types/response/WorkflowsStepCompletedResponse.ts similarity index 94% rename from packages/web-api/src/response/WorkflowsStepCompletedResponse.ts rename to packages/web-api/src/types/response/WorkflowsStepCompletedResponse.ts index 1ae417c9a..13e34f298 100644 --- a/packages/web-api/src/response/WorkflowsStepCompletedResponse.ts +++ b/packages/web-api/src/types/response/WorkflowsStepCompletedResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type WorkflowsStepCompletedResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/WorkflowsStepFailedResponse.ts b/packages/web-api/src/types/response/WorkflowsStepFailedResponse.ts similarity index 94% rename from packages/web-api/src/response/WorkflowsStepFailedResponse.ts rename to packages/web-api/src/types/response/WorkflowsStepFailedResponse.ts index 15483fee7..8c000ea37 100644 --- a/packages/web-api/src/response/WorkflowsStepFailedResponse.ts +++ b/packages/web-api/src/types/response/WorkflowsStepFailedResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type WorkflowsStepFailedResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/WorkflowsUpdateStepResponse.ts b/packages/web-api/src/types/response/WorkflowsUpdateStepResponse.ts similarity index 94% rename from packages/web-api/src/response/WorkflowsUpdateStepResponse.ts rename to packages/web-api/src/types/response/WorkflowsUpdateStepResponse.ts index 7ca0e335d..7f04e0980 100644 --- a/packages/web-api/src/response/WorkflowsUpdateStepResponse.ts +++ b/packages/web-api/src/types/response/WorkflowsUpdateStepResponse.ts @@ -8,7 +8,7 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../WebClient'; +import { WebAPICallResult } from '../../WebClient'; export type WorkflowsUpdateStepResponse = WebAPICallResult & { error?: string; needed?: string; diff --git a/packages/web-api/src/response/index.ts b/packages/web-api/src/types/response/index.ts similarity index 100% rename from packages/web-api/src/response/index.ts rename to packages/web-api/src/types/response/index.ts diff --git a/packages/web-api/test/types/methods/admin.analytics.test-d.ts b/packages/web-api/test/types/methods/admin.analytics.test-d.ts new file mode 100644 index 000000000..629fad9e0 --- /dev/null +++ b/packages/web-api/test/types/methods/admin.analytics.test-d.ts @@ -0,0 +1,45 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.analytics.getFile +// -- sad path +expectError(web.admin.analytics.getFile()); // lacking argument +expectError(web.admin.analytics.getFile({})); // empty argument +expectError(web.admin.analytics.getFile({ + type: 'member', // missing date +})); +expectError(web.admin.analytics.getFile({ + date: '2023-11-01', // missing type +})); +expectError(web.admin.analytics.getFile({ + type: 'public_channel', // missing date or metadata_only=true +})); +expectError(web.admin.analytics.getFile({ + type: 'public_channel', + metadata_only: false, // w/ type=public_channel and no date, metadata_only must be true +})); +expectError(web.admin.analytics.getFile({ + type: 'public_channel', + date: '2023-11-01', + metadata_only: true, // w/ type=public_channel and date specified, metadata_only must be falsy +})); +// -- happy path +expectAssignable>([{ + type: 'member', + date: '2023-11-01', +}]); +expectAssignable>([{ + type: 'public_channel', + date: '2023-11-01', +}]); +expectAssignable>([{ + type: 'public_channel', + date: '2023-11-01', + metadata_only: false, +}]); +expectAssignable>([{ + type: 'public_channel', + metadata_only: true, +}]); diff --git a/packages/web-api/test/types/methods/admin.apps.test-d.ts b/packages/web-api/test/types/methods/admin.apps.test-d.ts new file mode 100644 index 000000000..989834cab --- /dev/null +++ b/packages/web-api/test/types/methods/admin.apps.test-d.ts @@ -0,0 +1,244 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.apps.activities.list +// -- sad path +expectError(web.admin.apps.activities.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// admin.apps.approve +// -- sad path +expectError(web.admin.apps.approve()); // lacking argument +expectError(web.admin.apps.approve({})); // empty argument +expectError(web.admin.apps.approve({ + app_id: 'A1234', // missing team or enterprise id +})); +expectError(web.admin.apps.approve({ + request_id: 'R1234', // missing team or enterprise id +})); +expectError(web.admin.apps.approve({ + team_id: 'T1234', // missing request or app id +})); +expectError(web.admin.apps.approve({ + enterprise_id: 'E1234', // missing request or app id +})); +expectError(web.admin.apps.approve({ + app_id: 'A1234', + request_id: 'R1234', // missing team or enterprise id, and cant specify both app and request id +})); +expectError(web.admin.apps.approve({ + enterprise_id: 'E1234', + team_id: 'T1234', // missing request or app id, and canot specify both enterprise and team id +})); +// -- happy path +expectAssignable>([{ + app_id: 'A1234', + team_id: 'T1234', +}]); +expectAssignable>([{ + app_id: 'A1234', + enterprise_id: 'T1234', +}]); +expectAssignable>([{ + request_id: 'R1234', + team_id: 'T1234', +}]); +expectAssignable>([{ + request_id: 'R1234', + enterprise_id: 'T1234', +}]); + +// admin.apps.approved.list +// -- sad path +expectError(web.admin.apps.approved.list()); // lacking argument +expectError(web.admin.apps.approved.list({ + enterprise_id: 'E1234', + team_id: 'T1234', // cannot specify both enterprise and team id +})); +// -- happy path +expectAssignable>([{}]); // all args optional +expectAssignable>([{ + team_id: 'T1234', // can optionally specify team id +}]); +expectAssignable>([{ + enterprise_id: 'T1234', // can optionally specify enterprise id +}]); + +// admin.apps.clearResolution +// -- sad path +expectError(web.admin.apps.clearResolution()); // lacking argument +expectError(web.admin.apps.clearResolution({})); // empty argument +expectError(web.admin.apps.clearResolution({ + app_id: 'A1234', // missing team or enterprise id +})); +expectError(web.admin.apps.clearResolution({ + enterprise_id: 'E1234', // missing app_id +})); +expectError(web.admin.apps.clearResolution({ + team_id: 'T1234', // missing app_id +})); +expectError(web.admin.apps.clearResolution({ + app_id: 'A1234', + enterprise_id: 'E1234', + team_id: 'T1234', // cannot specify both enterprise and team id +})); +// -- happy path +expectAssignable>([{ + app_id: 'A1234', + team_id: 'T1234', +}]); +expectAssignable>([{ + app_id: 'A1234', + enterprise_id: 'E1234', +}]); + +// admin.apps.config.lookup +// -- sad path +expectError(web.admin.apps.config.lookup()); // lacking argument +expectError(web.admin.apps.config.lookup({})); // empty argument +// -- happy path +expectAssignable>([{ + app_ids: ['A1234'], +}]); + +// admin.apps.config.set +// -- sad path +expectError(web.admin.apps.config.set()); // lacking argument +expectError(web.admin.apps.config.set({})); // empty argument +// -- happy path +expectAssignable>([{ + app_id: 'A1234', +}]); + +// admin.apps.requests.cancel +// -- sad path +expectError(web.admin.apps.requests.cancel()); // lacking argument +expectError(web.admin.apps.requests.cancel({})); // empty argument +expectError(web.admin.apps.requests.cancel({ + request_id: 'A1234', // missing team or enterprise id +})); +expectError(web.admin.apps.requests.cancel({ + enterprise_id: 'E1234', // missing request_id +})); +expectError(web.admin.apps.requests.cancel({ + team_id: 'T1234', // missing request_id +})); +expectError(web.admin.apps.requests.cancel({ + request_id: 'A1234', + enterprise_id: 'E1234', + team_id: 'T1234', // cannot specify both enterprise and team id +})); +// -- happy path +expectAssignable>([{ + request_id: 'A1234', + team_id: 'T1234', +}]); +expectAssignable>([{ + request_id: 'A1234', + enterprise_id: 'E1234', +}]); + +// admin.apps.requests.list +// -- sad path +expectError(web.admin.apps.requests.list()); // lacking argument +expectError(web.admin.apps.requests.list({})); // empty argument +expectError(web.admin.apps.requests.list({ + enterprise_id: 'E1234', + team_id: 'T1234', // cannot specify both enterprise and team id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', +}]); +expectAssignable>([{ + enterprise_id: 'E1234', +}]); + +// admin.apps.restrict +// -- sad path +expectError(web.admin.apps.restrict()); // lacking argument +expectError(web.admin.apps.restrict({})); // empty argument +expectError(web.admin.apps.restrict({ + app_id: 'A1234', // missing team or enterprise id +})); +expectError(web.admin.apps.restrict({ + request_id: 'R1234', // missing team or enterprise id +})); +expectError(web.admin.apps.restrict({ + team_id: 'T1234', // missing request or app id +})); +expectError(web.admin.apps.restrict({ + enterprise_id: 'E1234', // missing request or app id +})); +expectError(web.admin.apps.restrict({ + app_id: 'A1234', + request_id: 'R1234', // missing team or enterprise id, and cant specify both app and request id +})); +expectError(web.admin.apps.restrict({ + enterprise_id: 'E1234', + team_id: 'T1234', // missing request or app id, and canot specify both enterprise and team id +})); +// -- happy path +expectAssignable>([{ + app_id: 'A1234', + team_id: 'T1234', +}]); +expectAssignable>([{ + app_id: 'A1234', + enterprise_id: 'T1234', +}]); +expectAssignable>([{ + request_id: 'R1234', + team_id: 'T1234', +}]); +expectAssignable>([{ + request_id: 'R1234', + enterprise_id: 'T1234', +}]); + +// admin.apps.restricted.list +// -- sad path +expectError(web.admin.apps.restricted.list()); // lacking argument +expectError(web.admin.apps.restricted.list({})); // empty argument +expectError(web.admin.apps.restricted.list({ + enterprise_id: 'E1234', + team_id: 'T1234', // cannot specify both enterprise and team id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', +}]); +expectAssignable>([{ + enterprise_id: 'E1234', +}]); + +// admin.apps.uninstall +// -- sad path +expectError(web.admin.apps.uninstall()); // lacking argument +expectError(web.admin.apps.uninstall({})); // empty argument +expectError(web.admin.apps.uninstall({ + app_id: 'A1234', // missing team or enterprise id +})); +expectError(web.admin.apps.uninstall({ + enterprise_id: 'E1234', // missing app_id +})); +expectError(web.admin.apps.uninstall({ + team_id: 'T1234', // missing app_id +})); +expectError(web.admin.apps.uninstall({ + app_id: 'A1234', + enterprise_id: 'E1234', + team_id: 'T1234', // cannot specify both enterprise and team id +})); +// -- happy path +expectAssignable>([{ + app_id: 'A1234', + team_id: 'T1234', +}]); +expectAssignable>([{ + app_id: 'A1234', + enterprise_id: 'E1234', +}]); diff --git a/packages/web-api/test/types/methods/admin.auth.test-d.ts b/packages/web-api/test/types/methods/admin.auth.test-d.ts new file mode 100644 index 000000000..a85075965 --- /dev/null +++ b/packages/web-api/test/types/methods/admin.auth.test-d.ts @@ -0,0 +1,77 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.auth.policy.assignEntities +// -- sad path +expectError(web.admin.auth.policy.assignEntities()); // lacking argument +expectError(web.admin.auth.policy.assignEntities({})); // empty argument +expectError(web.admin.auth.policy.assignEntities({ + entity_ids: ['U1234'], // missing entity_type and policy_name +})); +expectError(web.admin.auth.policy.assignEntities({ + entity_type: 'USER', // missing entity_ids and policy_name +})); +expectError(web.admin.auth.policy.assignEntities({ + policy_name: 'email_password', // missing entity_ids and entity_type +})); +expectError(web.admin.auth.policy.assignEntities({ + entity_ids: ['U1234'], // missing policy_name + entity_type: 'USER', +})); +expectError(web.admin.auth.policy.assignEntities({ + entity_ids: ['U1234'], // missing entity_type + policy_name: 'email_password', +})); +expectError(web.admin.auth.policy.assignEntities({ + entity_type: 'USER', // missing entity_ids + policy_name: 'email_password', +})); +// -- happy path +expectAssignable>([{ + policy_name: 'email_password', + entity_type: 'USER', + entity_ids: ['U1234'], +}]); + +// admin.auth.policy.getEntities +// -- sad path +expectError(web.admin.auth.policy.getEntities()); // lacking argument +expectError(web.admin.auth.policy.getEntities({})); // empty argument +// -- happy path +expectAssignable>([{ + policy_name: 'email_password', +}]); + +// admin.auth.policy.removeEntities +// -- sad path +expectError(web.admin.auth.policy.removeEntities()); // lacking argument +expectError(web.admin.auth.policy.removeEntities({})); // empty argument +expectError(web.admin.auth.policy.removeEntities({ + entity_ids: ['U1234'], // missing entity_type and policy_name +})); +expectError(web.admin.auth.policy.removeEntities({ + entity_type: 'USER', // missing entity_ids and policy_name +})); +expectError(web.admin.auth.policy.removeEntities({ + policy_name: 'email_password', // missing entity_ids and entity_type +})); +expectError(web.admin.auth.policy.removeEntities({ + entity_ids: ['U1234'], // missing policy_name + entity_type: 'USER', +})); +expectError(web.admin.auth.policy.removeEntities({ + entity_ids: ['U1234'], // missing entity_type + policy_name: 'email_password', +})); +expectError(web.admin.auth.policy.removeEntities({ + entity_type: 'USER', // missing entity_ids + policy_name: 'email_password', +})); +// -- happy path +expectAssignable>([{ + policy_name: 'email_password', + entity_type: 'USER', + entity_ids: ['U1234'], +}]); diff --git a/packages/web-api/test/types/methods/admin.barriers.test-d.ts b/packages/web-api/test/types/methods/admin.barriers.test-d.ts new file mode 100644 index 000000000..9cfe78077 --- /dev/null +++ b/packages/web-api/test/types/methods/admin.barriers.test-d.ts @@ -0,0 +1,130 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.barriers.create +// -- sad path +expectError(web.admin.barriers.create()); // lacking argument +expectError(web.admin.barriers.create({})); // empty argument +expectError(web.admin.barriers.create({ + barriered_from_usergroup_ids: [], // missing primary_usergroup_id and restricted_subjects +})); +expectError(web.admin.barriers.create({ + primary_usergroup_id: '1234', // missing barriered_from_usergroup_ids and restricted_subjets +})); +expectError(web.admin.barriers.create({ + restricted_subjects: ['im', 'mpim', 'call'], // missing barriered_from_usergroup_ids and primary_usergroup_id +})); +expectError(web.admin.barriers.create({ + barriered_from_usergroup_ids: [], // missing restricted_subjects + primary_usergroup_id: '1234', +})); +expectError(web.admin.barriers.create({ + barriered_from_usergroup_ids: [], // missing primary_usergroup_id + restricted_subjects: ['im', 'mpim', 'call'], +})); +expectError(web.admin.barriers.create({ + primary_usergroup_id: '1234', // missing barriered_from_usergroup_ids + restricted_subjects: ['im', 'mpim', 'call'], +})); +expectError(web.admin.barriers.create({ + barriered_from_usergroup_ids: [], + primary_usergroup_id: '1234', + restricted_subjects: ['im', 'mpim'], // must provide all three of im, mpim and call +})); +// -- happy path +expectAssignable>([{ + barriered_from_usergroup_ids: [], + primary_usergroup_id: '1234', + restricted_subjects: ['im', 'mpim', 'call'], +}]); + +// admin.barriers.delete +// -- sad path +expectError(web.admin.barriers.delete()); // lacking argument +expectError(web.admin.barriers.delete({})); // empty argument +// -- happy path +expectAssignable>([{ + barrier_id: 'B1234', +}]); + +// admin.barriers.list +// -- sad path +expectError(web.admin.barriers.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// admin.barriers.update +// -- sad path +expectError(web.admin.barriers.update()); // lacking argument +expectError(web.admin.barriers.update({})); // empty argument +expectError(web.admin.barriers.update({ + barriered_from_usergroup_ids: [], // missing primary_usergroup_id and restricted_subjects and barrier_id +})); +expectError(web.admin.barriers.update({ + primary_usergroup_id: '1234', // missing barriered_from_usergroup_ids and restricted_subjets and barrier_id +})); +expectError(web.admin.barriers.update({ + restricted_subjects: ['im', 'mpim', 'call'], // missing barriered_from_usergroup_ids and primary_usergroup_id and barrier_id +})); +expectError(web.admin.barriers.update({ + barrier_id: 'B1234', // missing barriered_from_usergroup_ids, primary_usergroup_id and restricted_subjects +})); +expectError(web.admin.barriers.update({ + barriered_from_usergroup_ids: [], // missing restricted_subjects and barrier_id + primary_usergroup_id: '1234', +})); +expectError(web.admin.barriers.update({ + barriered_from_usergroup_ids: [], // missing primary_usergroup_id and barrier_id + restricted_subjects: ['im', 'mpim', 'call'], +})); +expectError(web.admin.barriers.update({ + barriered_from_usergroup_ids: [], // missing primary_usergroup_id and restructed_subjects + barrier_id: 'B1234', +})); +expectError(web.admin.barriers.update({ + primary_usergroup_id: '1234', // missing barriered_from_usergroup_ids and barrier_id + restricted_subjects: ['im', 'mpim', 'call'], +})); +expectError(web.admin.barriers.update({ + primary_usergroup_id: '1234', // missing barriered_from_usergroup_ids and restricted_subjects + barrier_id: 'B1234', +})); +expectError(web.admin.barriers.update({ + restricted_subjects: ['im', 'mpim', 'call'], + barrier_id: 'B1234', // missing barriered_from_usergroup_ids and primary_usergroup_id +})); +expectError(web.admin.barriers.update({ + barriered_from_usergroup_ids: [], + primary_usergroup_id: '1234', + restricted_subjects: ['im', 'mpim', 'call'], // missing barrier_id +})); +expectError(web.admin.barriers.update({ + barriered_from_usergroup_ids: [], + primary_usergroup_id: '1234', + barrier_id: 'B1234', // missing restricted_subjects +})); +expectError(web.admin.barriers.update({ + primary_usergroup_id: '1234', + barrier_id: 'B1234', + restricted_subjects: ['im', 'mpim', 'call'], // missing barriered_from_usergroup_ids +})); +expectError(web.admin.barriers.update({ + barriered_from_usergroup_ids: [], + barrier_id: 'B1234', + restricted_subjects: ['im', 'mpim', 'call'], // missing primary_usergroup_id +})); +expectError(web.admin.barriers.update({ + barrier_id: 'B1234', + barriered_from_usergroup_ids: [], + primary_usergroup_id: '1234', + restricted_subjects: ['im', 'mpim'], // must provide all three of im, mpim and call +})); +// -- happy path +expectAssignable>([{ + barrier_id: 'B1234', + barriered_from_usergroup_ids: [], + primary_usergroup_id: '1234', + restricted_subjects: ['im', 'mpim', 'call'], +}]); diff --git a/packages/web-api/test/types/methods/admin.conversations.test-d.ts b/packages/web-api/test/types/methods/admin.conversations.test-d.ts new file mode 100644 index 000000000..eb1c517e2 --- /dev/null +++ b/packages/web-api/test/types/methods/admin.conversations.test-d.ts @@ -0,0 +1,343 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.conversations.archive +// -- sad path +expectError(web.admin.conversations.archive()); // lacking argument +expectError(web.admin.conversations.archive({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.bulkArchive +// -- sad path +expectError(web.admin.conversations.bulkArchive()); // lacking argument +expectError(web.admin.conversations.bulkArchive({})); // empty argument +expectError(web.admin.conversations.bulkArchive({ + channel_ids: [], // must include at least one element +})); +// -- happy path +expectAssignable>([{ + channel_ids: ['C1234'], +}]); + +// admin.conversations.bulkDelete +// -- sad path +expectError(web.admin.conversations.bulkDelete()); // lacking argument +expectError(web.admin.conversations.bulkDelete({})); // empty argument +expectError(web.admin.conversations.bulkDelete({ + channel_ids: [], // must include at least one element +})); +// -- happy path +expectAssignable>([{ + channel_ids: ['C1234'], +}]); + +// admin.conversations.bulkMove +// -- sad path +expectError(web.admin.conversations.bulkMove()); // lacking argument +expectError(web.admin.conversations.bulkMove({})); // empty argument +expectError(web.admin.conversations.bulkMove({ + channel_ids: ['C1234'], // missing target_team_id +})); +expectError(web.admin.conversations.bulkMove({ + target_team_id: 'T1234', // missing channel_ids +})); +expectError(web.admin.conversations.bulkMove({ + target_team_id: 'T1234', + channel_ids: [], // must include at least one element +})); +// -- happy path +expectAssignable>([{ + target_team_id: 'T1234', + channel_ids: ['C1234'], +}]); + +// admin.conversations.convertToPrivate +// -- sad path +expectError(web.admin.conversations.convertToPrivate()); // lacking argument +expectError(web.admin.conversations.convertToPrivate({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.convertToPublic +// -- sad path +expectError(web.admin.conversations.convertToPublic()); // lacking argument +expectError(web.admin.conversations.convertToPublic({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.create +// -- sad path +expectError(web.admin.conversations.create()); // lacking argument +expectError(web.admin.conversations.create({})); // empty argument +expectError(web.admin.conversations.create({ + is_private: true, // missing name and either teamid or orgwide +})); +expectError(web.admin.conversations.create({ + name: 'test', // missing is_private and either teamid or orgwide +})); +expectError(web.admin.conversations.create({ + org_wide: true, // missing is_private and name +})); +expectError(web.admin.conversations.create({ + team_id: 'T1234', // missing is_private and name +})); +expectError(web.admin.conversations.create({ + is_private: true, // missing either teamid or orgwide + name: 'test', +})); +expectError(web.admin.conversations.create({ + is_private: true, // missing name + org_wide: true, +})); +expectError(web.admin.conversations.create({ + is_private: true, // missing name + team_id: 'T1234', +})); +expectError(web.admin.conversations.create({ + name: 'test', + org_wide: true, // missing is_private +})); +expectError(web.admin.conversations.create({ + name: 'test', + team_id: 'T1234', // missing is_private +})); +expectError(web.admin.conversations.create({ + is_private: true, + name: 'test', + org_wide: true, + team_id: 'T1234', // cannot specify org_wide=true and a team id +})); +// -- happy path +expectAssignable>([{ + is_private: false, + name: 'test', + org_wide: true, +}]); +expectAssignable>([{ + is_private: false, + name: 'test', + org_wide: false, + team_id: 'T1234', +}]); +expectAssignable>([{ + is_private: false, + name: 'test', + team_id: 'T1234', +}]); + +// admin.conversations.delete +// -- sad path +expectError(web.admin.conversations.delete()); // lacking argument +expectError(web.admin.conversations.delete({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.disconnectShared +// -- sad path +expectError(web.admin.conversations.disconnectShared()); // lacking argument +expectError(web.admin.conversations.disconnectShared({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.ekm.listOriginalConnectedChannelInfo +// -- sad path +expectError(web.admin.conversations.ekm.listOriginalConnectedChannelInfo()); // lacking argument +// -- happy path +expectAssignable>([{ +}]); // all optional args + +// admin.conversations.getConversationPrefs +// -- sad path +expectError(web.admin.conversations.getConversationPrefs()); // lacking argument +expectError(web.admin.conversations.getConversationPrefs({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.getCustomRetention +// -- sad path +expectError(web.admin.conversations.getCustomRetention()); // lacking argument +expectError(web.admin.conversations.getCustomRetention({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.getTeams +// -- sad path +expectError(web.admin.conversations.getTeams()); // lacking argument +expectError(web.admin.conversations.getTeams({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.invite +// -- sad path +expectError(web.admin.conversations.invite()); // lacking argument +expectError(web.admin.conversations.invite({})); // empty argument +expectError(web.admin.conversations.invite({ + channel_id: 'C1234', // missing user_ids +})); +expectError(web.admin.conversations.invite({ + channel_id: 'C1234', + user_ids: [], // empty user_ids +})); +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', + user_ids: ['U1234'], +}]); + +// admin.conversations.lookup +// -- sad path +expectError(web.admin.conversations.lookup()); // lacking argument +expectError(web.admin.conversations.lookup({})); // empty argument +expectError(web.admin.conversations.lookup({ + team_ids: [], // missing last_message_activity_before +})); +expectError(web.admin.conversations.lookup({ + last_message_activity_before: 1969, // missing team_ids +})); +// -- happy path +expectAssignable>([{ + team_ids: ['T1234'], + last_message_activity_before: 10, +}]); + +// admin.conversations.removeCustomRetention +// -- sad path +expectError(web.admin.conversations.removeCustomRetention()); // lacking argument +expectError(web.admin.conversations.removeCustomRetention({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.rename +// -- sad path +expectError(web.admin.conversations.rename()); // lacking argument +expectError(web.admin.conversations.rename({})); // empty argument +expectError(web.admin.conversations.rename({ + channel_id: 'C1234', // missing name +})); +expectError(web.admin.conversations.rename({ + name: 'C1234', // missing channel_id +})); +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', + name: 'heyho', +}]); + +// admin.conversations.restrictAccess.addGroup +// -- sad path +expectError(web.admin.conversations.restrictAccess.addGroup()); // lacking argument +expectError(web.admin.conversations.restrictAccess.addGroup({})); // empty argument +expectError(web.admin.conversations.restrictAccess.addGroup({ + channel_id: 'C1234', // missing group_id +})); +expectError(web.admin.conversations.restrictAccess.addGroup({ + group_id: 'G1234', // missing channel_id +})); +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', + group_id: 'G1234', +}]); + +// admin.conversations.restrictAccess.listGroups +// -- sad path +expectError(web.admin.conversations.restrictAccess.listGroups()); // lacking argument +expectError(web.admin.conversations.restrictAccess.listGroups({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.restrictAccess.removeGroup +// -- sad path +expectError(web.admin.conversations.restrictAccess.removeGroup()); // lacking argument +expectError(web.admin.conversations.restrictAccess.removeGroup({})); // empty argument +expectError(web.admin.conversations.restrictAccess.removeGroup({ + channel_id: 'C1234', // missing group_id +})); +expectError(web.admin.conversations.restrictAccess.removeGroup({ + group_id: 'G1234', // missing channel_id +})); +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', + group_id: 'G1234', +}]); + +// admin.conversations.search +// -- sad path +expectError(web.admin.conversations.search()); // lacking argument +// -- happy path +expectAssignable>([{ +}]); // all optional args + +// admin.conversations.setConversationPrefs +// -- sad path +expectError(web.admin.conversations.setConversationPrefs()); // lacking argument +expectError(web.admin.conversations.setConversationPrefs({})); // empty argument +expectError(web.admin.conversations.setConversationPrefs({ + channel_id: 'C1234', // missing prefs +})); +expectError(web.admin.conversations.setConversationPrefs({ + prefs: {}, // missing channel_id +})); +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', + prefs: {}, +}]); + +// admin.conversations.setCustomRetention +// -- sad path +expectError(web.admin.conversations.setCustomRetention()); // lacking argument +expectError(web.admin.conversations.setCustomRetention({})); // empty argument +expectError(web.admin.conversations.setCustomRetention({ + channel_id: 'C1234', // missing duration_days +})); +expectError(web.admin.conversations.setCustomRetention({ + duration_days: 420, // missing channel_id +})); +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', + duration_days: 69, +}]); + +// admin.conversations.setTeams +// -- sad path +expectError(web.admin.conversations.setTeams()); // lacking argument +expectError(web.admin.conversations.setTeams({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// admin.conversations.unarchive +// -- sad path +expectError(web.admin.conversations.unarchive()); // lacking argument +expectError(web.admin.conversations.unarchive({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); diff --git a/packages/web-api/test/types/methods/admin.emoji.test-d.ts b/packages/web-api/test/types/methods/admin.emoji.test-d.ts new file mode 100644 index 000000000..b04a7c3f9 --- /dev/null +++ b/packages/web-api/test/types/methods/admin.emoji.test-d.ts @@ -0,0 +1,67 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.emoji.add +// -- sad path +expectError(web.admin.emoji.add()); // lacking argument +expectError(web.admin.emoji.add({})); // empty argument +expectError(web.admin.emoji.add({ + name: 'facepalm', // missing url +})); +expectError(web.admin.emoji.add({ + url: 'facepalm', // missing name +})); +// -- happy path +expectAssignable>([{ + name: 'facepalm', + url: 'http://example.com', +}]); + +// admin.emoji.addAlias +// -- sad path +expectError(web.admin.emoji.addAlias()); // lacking argument +expectError(web.admin.emoji.addAlias({})); // empty argument +expectError(web.admin.emoji.addAlias({ + name: 'facepalm', // missing alias_for +})); +expectError(web.admin.emoji.addAlias({ + alias_for: 'facepalm', // missing name +})); +// -- happy path +expectAssignable>([{ + name: 'facepalm', + alias_for: 'fp', +}]); + +// admin.emoji.list +// -- sad path +expectError(web.admin.emoji.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// admin.emoji.remove +// -- sad path +expectError(web.admin.emoji.remove()); // lacking argument +expectError(web.admin.emoji.remove({})); // empty argument +// -- happy path +expectAssignable>([{ + name: 'facepalm', +}]); + +// admin.emoji.rename +// -- sad path +expectError(web.admin.emoji.rename()); // lacking argument +expectError(web.admin.emoji.rename({})); // empty argument +expectError(web.admin.emoji.rename({ + name: 'facepalm', // missing new_name +})); +expectError(web.admin.emoji.rename({ + new_name: 'facepalm', // missing name +})); +// -- happy path +expectAssignable>([{ + name: 'facepalm', + new_name: 'fp', +}]); diff --git a/packages/web-api/test/types/methods/admin.functions.test-d.ts b/packages/web-api/test/types/methods/admin.functions.test-d.ts new file mode 100644 index 000000000..b2067ea7f --- /dev/null +++ b/packages/web-api/test/types/methods/admin.functions.test-d.ts @@ -0,0 +1,41 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.functions.list +// -- sad path +expectError(web.admin.functions.list()); // lacking argument +expectError(web.admin.functions.list({})); // empty argument +// -- happy path +expectAssignable>([{ + app_ids: [], +}]); + +// admin.functions.permissions.lookup +// -- sad path +expectError(web.admin.functions.permissions.lookup()); // lacking argument +expectError(web.admin.functions.permissions.lookup({})); // empty argument +expectError(web.admin.functions.permissions.lookup({ + function_ids: [], // must provide at least 1 +})); +// -- happy path +expectAssignable>([{ + function_ids: ['F1234'], +}]); + +// admin.functions.permissions.set +// -- sad path +expectError(web.admin.functions.permissions.set()); // lacking argument +expectError(web.admin.functions.permissions.set({})); // empty argument +expectError(web.admin.functions.permissions.set({ + function_id: 'F1234', // missing visibility +})); +expectError(web.admin.functions.permissions.set({ + visibility: 'named_entities', // missing function_id +})); +// -- happy path +expectAssignable>([{ + function_id: 'F1234', + visibility: 'named_entities', +}]); diff --git a/packages/web-api/test/types/methods/admin.inviteRequests.test-d.ts b/packages/web-api/test/types/methods/admin.inviteRequests.test-d.ts new file mode 100644 index 000000000..29a25a097 --- /dev/null +++ b/packages/web-api/test/types/methods/admin.inviteRequests.test-d.ts @@ -0,0 +1,63 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.inviteRequests.approve +// -- sad path +expectError(web.admin.inviteRequests.approve()); // lacking argument +expectError(web.admin.inviteRequests.approve({})); // empty argument +expectError(web.admin.inviteRequests.approve({ + invite_request_id: 'I1234', // missing team_id +})); +expectError(web.admin.inviteRequests.approve({ + team_id: 'T1234', // missing invite_request_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + invite_request_id: 'I1234', +}]); + +// admin.inviteRequests.approved.list +// -- sad path +expectError(web.admin.inviteRequests.approved.list()); // lacking argument +expectError(web.admin.inviteRequests.approved.list({})); // empty argument +// -- happy path +expectAssignable>([{ + team_id: 'T1234', +}]); + +// admin.inviteRequests.denied.list +// -- sad path +expectError(web.admin.inviteRequests.denied.list()); // lacking argument +expectError(web.admin.inviteRequests.denied.list({})); // empty argument +// -- happy path +expectAssignable>([{ + team_id: 'T1234', +}]); + +// admin.inviteRequests.deny +// -- sad path +expectError(web.admin.inviteRequests.deny()); // lacking argument +expectError(web.admin.inviteRequests.deny({})); // empty argument +expectError(web.admin.inviteRequests.deny({ + invite_request_id: 'I1234', // missing team_id +})); +expectError(web.admin.inviteRequests.deny({ + team_id: 'T1234', // missing invite_request_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + invite_request_id: 'I1234', +}]); + +// admin.inviteRequests.list +// -- sad path +expectError(web.admin.inviteRequests.list()); // lacking argument +expectError(web.admin.inviteRequests.list({})); // empty argument +// -- happy path +expectAssignable>([{ + team_id: 'T1234', +}]); diff --git a/packages/web-api/test/types/methods/admin.roles.test-d.ts b/packages/web-api/test/types/methods/admin.roles.test-d.ts new file mode 100644 index 000000000..6e670b2c7 --- /dev/null +++ b/packages/web-api/test/types/methods/admin.roles.test-d.ts @@ -0,0 +1,94 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.roles.addAssignments +// -- sad path +expectError(web.admin.roles.addAssignments()); // lacking argument +expectError(web.admin.roles.addAssignments({})); // empty argument +expectError(web.admin.roles.addAssignments({ + entity_ids: ['E1234'], // missing role_id, user_ids +})); +expectError(web.admin.roles.addAssignments({ + role_id: 'Rl0A', // missing entity_ids, user_ids +})); +expectError(web.admin.roles.addAssignments({ + user_ids: ['U1234'], // missing entity_ids, role_id +})); +expectError(web.admin.roles.addAssignments({ + entity_ids: ['E1234'], // missing user_ids + role_id: 'Rl0A', +})); +expectError(web.admin.roles.addAssignments({ + entity_ids: ['E1234'], // missing role_id + user_ids: ['U1234'], +})); +expectError(web.admin.roles.addAssignments({ + role_id: 'Rl0A', // missing entity_ids + user_ids: ['U1234'], +})); +expectError(web.admin.roles.addAssignments({ + entity_ids: [], // need at least 1 item + role_id: 'Rl0A', + user_ids: ['U1234'], +})); +expectError(web.admin.roles.addAssignments({ + entity_ids: ['C1234'], + role_id: 'Rl0A', + user_ids: [], // need at least 1 item, +})); +// -- happy path +expectAssignable>([{ + entity_ids: ['C1234'], + role_id: 'Rl0A', + user_ids: ['U1234'], +}]); + +// admin.roles.listAssignments +// -- sad path +expectError(web.admin.roles.listAssignments()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional + +// admin.roles.removeAssignments +// -- sad path +expectError(web.admin.roles.removeAssignments()); // lacking argument +expectError(web.admin.roles.removeAssignments({})); // empty argument +expectError(web.admin.roles.removeAssignments({ + entity_ids: ['E1234'], // missing role_id, user_ids +})); +expectError(web.admin.roles.removeAssignments({ + role_id: 'Rl0A', // missing entity_ids, user_ids +})); +expectError(web.admin.roles.removeAssignments({ + user_ids: ['U1234'], // missing entity_ids, role_id +})); +expectError(web.admin.roles.removeAssignments({ + entity_ids: ['E1234'], // missing user_ids + role_id: 'Rl0A', +})); +expectError(web.admin.roles.removeAssignments({ + entity_ids: ['E1234'], // missing role_id + user_ids: ['U1234'], +})); +expectError(web.admin.roles.removeAssignments({ + role_id: 'Rl0A', // missing entity_ids + user_ids: ['U1234'], +})); +expectError(web.admin.roles.removeAssignments({ + entity_ids: [], // need at least 1 item + role_id: 'Rl0A', + user_ids: ['U1234'], +})); +expectError(web.admin.roles.removeAssignments({ + entity_ids: ['C1234'], + role_id: 'Rl0A', + user_ids: [], // need at least 1 item, +})); +// -- happy path +expectAssignable>([{ + entity_ids: ['C1234'], + role_id: 'Rl0A', + user_ids: ['U1234'], +}]); diff --git a/packages/web-api/test/types/methods/admin.teams.test-d.ts b/packages/web-api/test/types/methods/admin.teams.test-d.ts new file mode 100644 index 000000000..7c037bb5e --- /dev/null +++ b/packages/web-api/test/types/methods/admin.teams.test-d.ts @@ -0,0 +1,137 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.teams.admins.list +// -- sad path +expectError(web.admin.teams.admins.list()); // lacking argument +expectError(web.admin.teams.admins.list({})); // empty argument +// -- happy path +expectAssignable>([{ + team_id: 'T1234', +}]); + +// admin.teams.create +// -- sad path +expectError(web.admin.teams.create()); // lacking argument +expectError(web.admin.teams.create({})); // empty argument +expectError(web.admin.teams.create({ + team_name: 'Jokers', // missing team_domain +})); +expectError(web.admin.teams.create({ + team_domain: 'jokers', // missing team_name +})); +// -- happy path +expectAssignable>([{ + team_domain: 'jokers', + team_name: 'Jokers', +}]); + +// admin.teams.list +// -- sad path +expectError(web.admin.teams.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional + +// admin.teams.owners.list +// -- sad path +expectError(web.admin.teams.owners.list()); // lacking argument +expectError(web.admin.teams.owners.list({})); // empty argument +// -- happy path +expectAssignable>([{ + team_id: 'T1234', +}]); + +// admin.teams.settings.info +// -- sad path +expectError(web.admin.teams.settings.info()); // lacking argument +expectError(web.admin.teams.settings.info({})); // empty argument +// -- happy path +expectAssignable>([{ + team_id: 'T1234', +}]); + +// admin.teams.settings.setDefaultChannels +// -- sad path +expectError(web.admin.teams.settings.setDefaultChannels()); // lacking argument +expectError(web.admin.teams.settings.setDefaultChannels({})); // empty argument +expectError(web.admin.teams.settings.setDefaultChannels({ + team_id: 'T1234', // missing channel_ids +})); +expectError(web.admin.teams.settings.setDefaultChannels({ + channel_ids: ['C1234'], // missing team_id +})); +expectError(web.admin.teams.settings.setDefaultChannels({ + team_id: 'T1234', + channel_ids: [], // must include at least 1 channel +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + channel_ids: ['C1234'], +}]); + +// admin.teams.settings.setDescription +// -- sad path +expectError(web.admin.teams.settings.setDescription()); // lacking argument +expectError(web.admin.teams.settings.setDescription({})); // empty argument +expectError(web.admin.teams.settings.setDescription({ + team_id: 'T1234', // missing description +})); +expectError(web.admin.teams.settings.setDescription({ + description: 'hey ho', // missing team_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + description: 'existential dread', +}]); + +// admin.teams.settings.setDiscoverability +// -- sad path +expectError(web.admin.teams.settings.setDiscoverability()); // lacking argument +expectError(web.admin.teams.settings.setDiscoverability({})); // empty argument +expectError(web.admin.teams.settings.setDiscoverability({ + team_id: 'T1234', // missing discoverability +})); +expectError(web.admin.teams.settings.setDiscoverability({ + discoverability: 'open', // missing team_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + discoverability: 'closed', +}]); + +// admin.teams.settings.setIcon +// -- sad path +expectError(web.admin.teams.settings.setIcon()); // lacking argument +expectError(web.admin.teams.settings.setIcon({})); // empty argument +expectError(web.admin.teams.settings.setIcon({ + team_id: 'T1234', // missing image_url +})); +expectError(web.admin.teams.settings.setIcon({ + image_url: 'example.com', // missing team_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + image_url: 'example.com', +}]); + +// admin.teams.settings.setName +// -- sad path +expectError(web.admin.teams.settings.setName()); // lacking argument +expectError(web.admin.teams.settings.setName({})); // empty argument +expectError(web.admin.teams.settings.setName({ + team_id: 'T1234', // missing name +})); +expectError(web.admin.teams.settings.setName({ + name: 'SlackHQ', // missing team_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + name: 'SlackHQ', +}]); diff --git a/packages/web-api/test/types/methods/admin.usergroups.test-d.ts b/packages/web-api/test/types/methods/admin.usergroups.test-d.ts new file mode 100644 index 000000000..2b12d49d7 --- /dev/null +++ b/packages/web-api/test/types/methods/admin.usergroups.test-d.ts @@ -0,0 +1,73 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.usergroups.addChannels +// -- sad path +expectError(web.admin.usergroups.addChannels()); // lacking argument +expectError(web.admin.usergroups.addChannels({})); // lacking argument +expectError(web.admin.usergroups.addChannels({ + channel_ids: 'C1234', // missing usergroup_id +})); +expectError(web.admin.usergroups.addChannels({ + usergroup_id: 'S1234', // missing channel_ids +})); +// -- happy path +expectAssignable>([{ + channel_ids: 'C1234', // can accept a string + usergroup_id: 'S1234', +}]); +expectAssignable>([{ + channel_ids: ['C1234', 'C2345'], // can accept an array + usergroup_id: 'S1234', +}]); + +// admin.usergroups.addTeams +// -- sad path +expectError(web.admin.usergroups.addTeams()); // lacking argument +expectError(web.admin.usergroups.addTeams({})); // lacking argument +expectError(web.admin.usergroups.addTeams({ + team_ids: 'T1234', // missing usergroup_id +})); +expectError(web.admin.usergroups.addTeams({ + usergroup_id: 'S1234', // missing team_ids +})); +// -- happy path +expectAssignable>([{ + team_ids: 'T1234', // can accept a string + usergroup_id: 'S1234', +}]); +expectAssignable>([{ + team_ids: ['T1234', 'T2345'], // can accept an array + usergroup_id: 'S1234', +}]); + +// admin.usergroups.listChannels +// -- sad path +expectError(web.admin.usergroups.listChannels()); // lacking argument +expectError(web.admin.usergroups.listChannels({})); // lacking argument +// -- happy path +expectAssignable>([{ + usergroup_id: 'S1234', +}]); + +// admin.usergroups.removeChannels +// -- sad path +expectError(web.admin.usergroups.removeChannels()); // lacking argument +expectError(web.admin.usergroups.removeChannels({})); // lacking argument +expectError(web.admin.usergroups.removeChannels({ + channel_ids: 'C1234', // missing usergroup_id +})); +expectError(web.admin.usergroups.removeChannels({ + usergroup_id: 'S1234', // missing channel_ids +})); +// -- happy path +expectAssignable>([{ + channel_ids: 'C1234', // can accept a string + usergroup_id: 'S1234', +}]); +expectAssignable>([{ + channel_ids: ['C1234', 'C2345'], // can accept an array + usergroup_id: 'S1234', +}]); diff --git a/packages/web-api/test/types/methods/admin.users.test-d.ts b/packages/web-api/test/types/methods/admin.users.test-d.ts new file mode 100644 index 000000000..5c1ef1b43 --- /dev/null +++ b/packages/web-api/test/types/methods/admin.users.test-d.ts @@ -0,0 +1,264 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.users.assign +// -- sad path +expectError(web.admin.users.assign()); // lacking argument +expectError(web.admin.users.assign({})); // empty argument +expectError(web.admin.users.assign({ + team_id: 'T1234', // missing user_id +})); +expectError(web.admin.users.assign({ + user_id: 'U1234', // missing team_id +})); +expectError(web.admin.users.assign({ + user_id: 'U1234', + team_id: 'T1234', + channel_ids: [], // requires at least 1 channel +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + user_id: 'U1234', +}]); + +// admin.users.invite +// -- sad path +expectError(web.admin.users.invite()); // lacking argument +expectError(web.admin.users.invite({})); // empty argument +expectError(web.admin.users.invite({ + team_id: 'T1234', // missing channel_ids, email +})); +expectError(web.admin.users.invite({ + channel_ids: ['C1234'], // missing team_id, email +})); +expectError(web.admin.users.invite({ + email: 'me@you.com', // missing channel_ids, team_id +})); +expectError(web.admin.users.invite({ + email: 'me@you.com', + team_id: 'T1234', // missing channel_ids +})); +expectError(web.admin.users.invite({ + email: 'me@you.com', + channel_ids: ['C1234'], // missing team_id +})); +expectError(web.admin.users.invite({ + team_id: 'T1234', + channel_ids: ['C1234'], // missing email +})); +expectError(web.admin.users.invite({ + team_id: 'T1234', + channel_ids: [], // requires at least 1 channel +})); +expectError(web.admin.users.invite({ + email: 'me@you.com', + team_id: 'T1234', + channel_ids: [], // required at least 1 channel +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + email: 'me@you.com', + channel_ids: ['C1234'], +}]); + +// admin.users.list +// -- sad path +expectError(web.admin.users.list()); // lacking argument +expectError(web.admin.users.list({ + team_id: 'T1234', + include_deactivated_user_workspaces: true, // cannot set both team_id and include_deactivated=true +})); +expectError(web.admin.users.list({ + user_id: 'U1234', // missing team_id +})); +// -- happy path +expectAssignable>([{}]); // all optional args is ok +expectAssignable>([{ + team_id: 'T1234', + include_deactivated_user_workspaces: false, // team_id and include_deactivated=false is ok +}]); +expectAssignable>([{ + team_id: 'T1234', // team_id and undefined include_deactivated is ok +}]); +expectAssignable>([{ + include_deactivated_user_workspaces: true, // team_id and=undefined and include_deactivated is ok +}]); + +// admin.users.remove +// -- sad path +expectError(web.admin.users.remove()); // lacking argument +expectError(web.admin.users.remove({})); // empty argument +expectError(web.admin.users.remove({ + team_id: 'T1234', // missing user_id +})); +expectError(web.admin.users.remove({ + user_id: 'U1234', // missing team_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + user_id: 'U1234', +}]); + +// admin.users.session.clearSettings +// -- sad path +expectError(web.admin.users.session.clearSettings()); // lacking argument +expectError(web.admin.users.session.clearSettings({})); // empty argument +expectError(web.admin.users.session.clearSettings({ + user_ids: [], +})); // must provide at least one user_id +// -- happy path +expectAssignable>([{ + user_ids: ['U1234'], +}]); + +// admin.users.session.getSettings +// -- sad path +expectError(web.admin.users.session.getSettings()); // lacking argument +expectError(web.admin.users.session.getSettings({})); // empty argument +expectError(web.admin.users.session.getSettings({ + user_ids: [], +})); // must provide at least one user_id +// -- happy path +expectAssignable>([{ + user_ids: ['U1234'], +}]); + +// admin.users.session.invalidate +// -- sad path +expectError(web.admin.users.session.invalidate()); // lacking argument +expectError(web.admin.users.session.invalidate({})); // empty argument +expectError(web.admin.users.session.invalidate({ + team_id: 'T1234', // missing session_id +})); +expectError(web.admin.users.session.invalidate({ + session_id: '1234', // missing team_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + session_id: '1234', +}]); + +// admin.users.session.list +// -- sad path +expectError(web.admin.users.session.list()); // lacking argument +expectError(web.admin.users.session.list({ + team_id: 'T1234', // if team_id is provided, must also provide user_id +})); +expectError(web.admin.users.session.list({ + user_id: 'T1234', // if user_id is provided, must also provide team_id +})); +// -- happy path +expectAssignable>([{}]); // all optional args is OK +expectAssignable>([{ + team_id: 'T1234', + user_id: 'U1234', // also providing both team and user id - but has to be both +}]); + +// admin.users.session.reset +// -- sad path +expectError(web.admin.users.session.reset()); // lacking argument +expectError(web.admin.users.session.reset({})); // empty argument +// -- happy path +expectAssignable>([{ + user_id: 'U1234', +}]); + +// admin.users.session.resetBulk +// -- sad path +expectError(web.admin.users.session.resetBulk()); // lacking argument +expectError(web.admin.users.session.resetBulk({})); // empty argument +expectError(web.admin.users.session.resetBulk({ + user_ids: [], +})); // must provide at least one user_id +// -- happy path +expectAssignable>([{ + user_ids: ['U1234'], +}]); + +// admin.users.session.setSettings +// -- sad path +expectError(web.admin.users.session.setSettings()); // lacking argument +expectError(web.admin.users.session.setSettings({})); // empty argument +expectError(web.admin.users.session.setSettings({ + user_ids: [], +})); // must provide at least one user_id +// -- happy path +expectAssignable>([{ + user_ids: ['U1234'], +}]); + +// admin.users.session.setAdmin +// -- sad path +expectError(web.admin.users.setAdmin()); // lacking argument +expectError(web.admin.users.setAdmin({})); // empty argument +expectError(web.admin.users.setAdmin({ + team_id: 'T1234', // missing user_id +})); +expectError(web.admin.users.setAdmin({ + user_id: 'T1234', // missing team_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + user_id: 'U1234', +}]); + +// admin.users.session.setExpiration +// -- sad path +expectError(web.admin.users.setExpiration()); // lacking argument +expectError(web.admin.users.setExpiration({})); // empty argument +expectError(web.admin.users.setExpiration({ + expiration_ts: 1234, // missing user_id +})); +expectError(web.admin.users.setExpiration({ + user_id: 'T1234', // missing expiration_ts +})); +// -- happy path +expectAssignable>([{ + user_id: 'U1234', + expiration_ts: 1234, +}]); + +// admin.users.session.setOwner +// -- sad path +expectError(web.admin.users.setOwner()); // lacking argument +expectError(web.admin.users.setOwner({})); // empty argument +expectError(web.admin.users.setOwner({ + team_id: 'T1234', // missing user_id +})); +expectError(web.admin.users.setOwner({ + user_id: 'T1234', // missing team_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + user_id: 'U1234', +}]); + +// admin.users.session.setRegular +// -- sad path +expectError(web.admin.users.setRegular()); // lacking argument +expectError(web.admin.users.setRegular({})); // empty argument +expectError(web.admin.users.setRegular({ + team_id: 'T1234', // missing user_id +})); +expectError(web.admin.users.setRegular({ + user_id: 'T1234', // missing team_id +})); +// -- happy path +expectAssignable>([{ + team_id: 'T1234', + user_id: 'U1234', +}]); + +// admin.users.session.unsupportedVersions.export +// -- sad path +expectError(web.admin.users.unsupportedVersions.export()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args OK diff --git a/packages/web-api/test/types/methods/admin.workflows.test-d.ts b/packages/web-api/test/types/methods/admin.workflows.test-d.ts new file mode 100644 index 000000000..1947d925e --- /dev/null +++ b/packages/web-api/test/types/methods/admin.workflows.test-d.ts @@ -0,0 +1,84 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// admin.workflows.collaborators.add +// -- sad path +expectError(web.admin.workflows.collaborators.add()); // lacking argument +expectError(web.admin.workflows.collaborators.add({})); // empty argument +expectError(web.admin.workflows.collaborators.add({ + collaborator_ids: ['U1234'], // missing workflow_ids +})); +expectError(web.admin.workflows.collaborators.add({ + workflow_ids: ['Wf1234'], // missing user_ids +})); +expectError(web.admin.workflows.collaborators.add({ + collaborator_ids: ['U1234'], + workflow_ids: [], // must provide at least 1 id +})); +expectError(web.admin.workflows.collaborators.add({ + workflow_ids: ['Wf1234'], + collaborator_ids: [], // must provide at least 1 id +})); +// -- happy path +expectAssignable>([{ + collaborator_ids: ['U1234'], + workflow_ids: ['Wf1234'], +}]); + +// admin.workflows.collaborators.remove +// -- sad path +expectError(web.admin.workflows.collaborators.remove()); // lacking argument +expectError(web.admin.workflows.collaborators.remove({})); // empty argument +expectError(web.admin.workflows.collaborators.remove({ + collaborator_ids: ['U1234'], // missing workflow_ids +})); +expectError(web.admin.workflows.collaborators.remove({ + workflow_ids: ['Wf1234'], // missing user_ids +})); +expectError(web.admin.workflows.collaborators.remove({ + collaborator_ids: ['U1234'], + workflow_ids: [], // must provide at least 1 id +})); +expectError(web.admin.workflows.collaborators.remove({ + workflow_ids: ['Wf1234'], + collaborator_ids: [], // must provide at least 1 id +})); +// -- happy path +expectAssignable>([{ + collaborator_ids: ['U1234'], + workflow_ids: ['Wf1234'], +}]); + +// admin.workflows.permissions.lookup +// -- sad path +expectError(web.admin.workflows.permissions.lookup()); // lacking argument +expectError(web.admin.workflows.permissions.lookup({})); // empty argument +expectError(web.admin.workflows.permissions.lookup({ + workflow_ids: [], // must provide at least 1 id +})); +// -- happy path +expectAssignable>([{ + workflow_ids: ['Wf1234'], +}]); + +// admin.workflows.search +// -- sad path +expectError(web.admin.workflows.search()); // lacking argument +expectError(web.admin.workflows.search({ + collaborator_ids: [], // must provide at least 1 ID +})); +// -- happy path +expectAssignable>([{}]); // all optional args OK + +// admin.workflows.unpublish +// -- sad path +expectError(web.admin.workflows.unpublish()); // lacking argument +expectError(web.admin.workflows.unpublish({ + workflow_ids: [], // must provide at least 1 ID +})); +// -- happy path +expectAssignable>([{ + workflow_ids: ['Wf1234'], +}]); diff --git a/packages/web-api/test/types/methods/api.test-d.ts b/packages/web-api/test/types/methods/api.test-d.ts new file mode 100644 index 000000000..87aa8a0ac --- /dev/null +++ b/packages/web-api/test/types/methods/api.test-d.ts @@ -0,0 +1,10 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// api.test +// -- sad path +expectError(web.api.test()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args diff --git a/packages/web-api/test/types/methods/apps.test-d.ts b/packages/web-api/test/types/methods/apps.test-d.ts new file mode 100644 index 000000000..d97492041 --- /dev/null +++ b/packages/web-api/test/types/methods/apps.test-d.ts @@ -0,0 +1,103 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// apps.connections.open +// -- sad path +expectError(web.apps.connections.open()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// apps.event.authorizations.list +// -- sad path +expectError(web.apps.event.authorizations.list()); // lacking argument +expectError(web.apps.event.authorizations.list({})); // empty argument +// -- happy path +expectAssignable>([{ + event_context: '12345', +}]); + +// apps.manifest.create +// -- sad path +expectError(web.apps.manifest.create()); // lacking argument +expectError(web.apps.manifest.create({})); // empty argument +// -- happy path +expectAssignable>([{ + manifest: { + display_information: { + name: 'Bare Minimum', + }, + }, +}]); + +// apps.manifest.delete +// -- sad path +expectError(web.apps.manifest.delete()); // lacking argument +expectError(web.apps.manifest.delete({})); // empty argument +// -- happy path +expectAssignable>([{ + app_id: 'A1234', +}]); + +// apps.manifest.export +// -- sad path +expectError(web.apps.manifest.export()); // lacking argument +expectError(web.apps.manifest.export({})); // empty argument +// -- happy path +expectAssignable>([{ + app_id: 'A1234', +}]); + +// apps.manifest.update +// -- sad path +expectError(web.apps.manifest.update()); // lacking argument +expectError(web.apps.manifest.update({})); // empty argument +expectError(web.apps.manifest.update({ + app_id: 'A1234', // missing manifest +})); +expectError(web.apps.manifest.update({ + manifest: { // missing app_id + display_information: { + name: 'Bare Minimum', + }, + }, +})); +// -- happy path +expectAssignable>([{ + app_id: 'A1234', + manifest: { + display_information: { + name: 'Bare Minimum', + }, + }, +}]); + +// apps.manifest.validate +// -- sad path +expectError(web.apps.manifest.validate()); // lacking argument +expectError(web.apps.manifest.validate({})); // empty argument +// -- happy path +expectAssignable>([{ + manifest: { + display_information: { + name: 'Bare Minimum', + }, + }, +}]); + +// apps.uninstall +// -- sad path +expectError(web.apps.uninstall()); // lacking argument +expectError(web.apps.uninstall({})); // empty argument +expectError(web.apps.uninstall({ + client_id: '1234.56', // missing client_secret +})); +expectError(web.apps.uninstall({ + client_secret: '1234.56', // missing client_id +})); +// -- happy path +expectAssignable>([{ + client_id: '1234.56', + client_secret: 'ABC123', +}]); diff --git a/packages/web-api/test/types/methods/auth.test-d.ts b/packages/web-api/test/types/methods/auth.test-d.ts new file mode 100644 index 000000000..68d817a92 --- /dev/null +++ b/packages/web-api/test/types/methods/auth.test-d.ts @@ -0,0 +1,22 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// auth.revoke +// -- sad path +expectError(web.auth.revoke()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// auth.teams.list +// -- sad path +expectError(web.auth.teams.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// auth.test +// -- sad path +expectError(web.auth.test()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args diff --git a/packages/web-api/test/types/methods/bookmarks.test-d.ts b/packages/web-api/test/types/methods/bookmarks.test-d.ts new file mode 100644 index 000000000..86474f108 --- /dev/null +++ b/packages/web-api/test/types/methods/bookmarks.test-d.ts @@ -0,0 +1,123 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// bookmarks.add +// -- sad path +expectError(web.bookmarks.add()); // lacking argument +expectError(web.bookmarks.add({})); // empty argument +expectError(web.bookmarks.add({ + channel_id: 'C1234', // missing title, link, type +})); +expectError(web.bookmarks.add({ + type: 'link', + channel_id: 'C1234', // missing title, link +})); +expectError(web.bookmarks.add({ + title: 'link', + channel_id: 'C1234', // missing type, link +})); +expectError(web.bookmarks.add({ + link: 'url.com', + channel_id: 'C1234', // missing type, channel_id +})); +expectError(web.bookmarks.add({ + type: 'link', + channel_id: 'C1234', // missing link + title: 'test', +})); +expectError(web.bookmarks.add({ + link: 'link', + channel_id: 'C1234', // missing type + title: 'test', +})); +expectError(web.bookmarks.add({ + link: 'link', + channel_id: 'C1234', // missing title + type: 'link', +})); +expectError(web.bookmarks.add({ + type: 'link', // missing channel_id, link, title +})); +expectError(web.bookmarks.add({ + type: 'link', // missing channel_id, link + title: 'test', +})); +expectError(web.bookmarks.add({ + type: 'link', // missing channel_id, title + link: 'url', +})); +expectError(web.bookmarks.add({ + link: 'link', + title: 'test', // missing channel_id + type: 'link', +})); +expectError(web.bookmarks.add({ + title: 'test', // missing channel_id, link, type +})); +expectError(web.bookmarks.add({ + title: 'test', // missing channel_id, type + link: 'test.com', +})); +expectError(web.bookmarks.add({ + channel_id: 'C1234', + title: 'test', // missing link + type: 'link', +})); +expectError(web.bookmarks.add({ + link: 'test', // missing channel_id, title, type +})); +expectError(web.bookmarks.add({ + link: 'link', + title: 'test', // missing channel + type: 'link', +})); +// -- happy path +expectAssignable>([{ + type: 'link', + title: 'test', + channel_id: 'C1234', + link: 'example.com', +}]); + +// bookmarks.edit +// -- sad path +expectError(web.bookmarks.edit()); // lacking argument +expectError(web.bookmarks.edit({})); // empty argument +expectError(web.bookmarks.edit({ + channel_id: 'C1234', // missing bookmark_id +})); +expectError(web.bookmarks.edit({ + bookmark_id: 'B1234', // missing channel_id +})); +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', + bookmark_id: 'B1234', +}]); + +// bookmarks.list +// -- sad path +expectError(web.bookmarks.list()); // lacking argument +expectError(web.bookmarks.list({})); // empty argument +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', +}]); + +// bookmarks.remove +// -- sad path +expectError(web.bookmarks.remove()); // lacking argument +expectError(web.bookmarks.remove({})); // empty argument +expectError(web.bookmarks.remove({ + channel_id: 'C1234', // missing bookmark_id +})); +expectError(web.bookmarks.remove({ + bookmark_id: 'B1234', // missing channel_id +})); +// -- happy path +expectAssignable>([{ + channel_id: 'C1234', + bookmark_id: 'B1234', +}]); diff --git a/packages/web-api/test/types/methods/bots.test-d.ts b/packages/web-api/test/types/methods/bots.test-d.ts new file mode 100644 index 000000000..99ab5f04f --- /dev/null +++ b/packages/web-api/test/types/methods/bots.test-d.ts @@ -0,0 +1,10 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// bots.info +// -- sad path +expectError(web.bots.info()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args diff --git a/packages/web-api/test/types/methods/calls.test-d.ts b/packages/web-api/test/types/methods/calls.test-d.ts new file mode 100644 index 000000000..438ba293d --- /dev/null +++ b/packages/web-api/test/types/methods/calls.test-d.ts @@ -0,0 +1,79 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// calls.add +// -- sad path +expectError(web.calls.add()); // lacking argument +expectError(web.calls.add({})); // empty argument +expectError(web.calls.add({ + external_unique_id: '1234.566', // missing join_url +})); +expectError(web.calls.add({ + join_url: '1234.566', // missing external_unique_id +})); +// -- happy path +expectAssignable>([{ + external_unique_id: '1234.566', + join_url: '1234.566', +}]); + +// calls.end +// -- sad path +expectError(web.calls.end()); // lacking argument +expectError(web.calls.end({})); // empty argument +// -- happy path +expectAssignable>([{ + id: 'R1234', +}]); + +// calls.info +// -- sad path +expectError(web.calls.info()); // lacking argument +expectError(web.calls.info({})); // empty argument +// -- happy path +expectAssignable>([{ + id: 'R1234', +}]); + +// calls.update +// -- sad path +expectError(web.calls.update()); // lacking argument +expectError(web.calls.update({})); // empty argument +// -- happy path +expectAssignable>([{ + id: 'R1234', +}]); + +// calls.participants.add +// -- sad path +expectError(web.calls.participants.add()); // lacking argument +expectError(web.calls.participants.add({})); // empty argument +expectError(web.calls.participants.add({ + id: 'R1234', // missing users +})); +expectError(web.calls.participants.add({ + users: [], // missing id +})); +// -- happy path +expectAssignable>([{ + id: 'R1234', + users: [], +}]); + +// calls.participants.remove +// -- sad path +expectError(web.calls.participants.remove()); // lacking argument +expectError(web.calls.participants.remove({})); // empty argument +expectError(web.calls.participants.remove({ + id: 'R1234', // missing users +})); +expectError(web.calls.participants.remove({ + users: [], // missing id +})); +// -- happy path +expectAssignable>([{ + id: 'R1234', + users: [], +}]); diff --git a/packages/web-api/test/types/methods/chat.test-d.ts b/packages/web-api/test/types/methods/chat.test-d.ts new file mode 100644 index 000000000..b30f0e676 --- /dev/null +++ b/packages/web-api/test/types/methods/chat.test-d.ts @@ -0,0 +1,500 @@ +import { expectError, expectAssignable } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// chat.delete +// -- sad path +expectError(web.chat.delete()); // lacking argument +expectError(web.chat.delete({})); // empty argument +expectError(web.chat.delete({ + channel: 'C1234', // missing ts +})); +expectError(web.chat.delete({ + ts: '1234.56', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + ts: '1234.56', +}]); + +// chat.deleteScheduledMessage +// -- sad path +expectError(web.chat.deleteScheduledMessage()); // lacking argument +expectError(web.chat.deleteScheduledMessage({})); // empty argument +expectError(web.chat.deleteScheduledMessage({ + channel: 'C1234', // missing scheduled_message_id +})); +expectError(web.chat.deleteScheduledMessage({ + scheduled_message_id: 'Q1234', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + scheduled_message_id: 'Q1234', +}]); + +// chat.getPermalink +// -- sad path +expectError(web.chat.getPermalink()); // lacking argument +expectError(web.chat.getPermalink({})); // empty argument +expectError(web.chat.getPermalink({ + channel: 'C1234', // missing message_ts +})); +expectError(web.chat.getPermalink({ + message_ts: '1234.56', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + message_ts: '1234.56', +}]); + +// chat.meMessage +// -- sad path +expectError(web.chat.meMessage()); // lacking argument +expectError(web.chat.meMessage({})); // empty argument +expectError(web.chat.meMessage({ + channel: 'C1234', // missing text +})); +expectError(web.chat.meMessage({ + text: '1234.56', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + text: '1234.56', +}]); + +// chat.postEphemeral +// -- sad path +expectError(web.chat.postEphemeral()); // lacking argument +expectError(web.chat.postEphemeral({})); // empty argument +expectError(web.chat.postEphemeral({ + channel: 'C1234', // missing text/attachments/blocks and user +})); +expectError(web.chat.postEphemeral({ + channel: 'C1234', // missing text/attachments/blocks + user: 'U1234', +})); +expectError(web.chat.postEphemeral({ + channel: 'C1234', // missing user + text: 'U1234', +})); +expectError(web.chat.postEphemeral({ + user: 'U1234', // missing channel + text: 'U1234', +})); +expectError(web.chat.postEphemeral({ + channel: 'C1234', // missing user + blocks: [], +})); +expectError(web.chat.postEphemeral({ + user: 'U1234', // missing channel + blocks: [], +})); +expectError(web.chat.postEphemeral({ + channel: 'C1234', // missing user + attachments: [], +})); +expectError(web.chat.postEphemeral({ + user: 'U1234', // missing channel + attachments: [], +})); +expectError(web.chat.postEphemeral({ + channel: 'C123', + user: 'U1234', + attachments: [], + icon_url: 'someurl.png', + icon_emoji: 'smile', // cannot use both icon_url and icon_emoji +})); +expectError(web.chat.postEphemeral({ + channel: 'C123', + user: 'U1234', + attachments: [], + icon_url: 'someurl.png', + as_user: true, // cannot set both as_user=true and icon_url +})); +expectError(web.chat.postEphemeral({ + channel: 'C123', + user: 'U1234', + attachments: [], + icon_emoji: 'smile', + as_user: true, // cannot set both as_user=true and icon_emoji +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', + text: '1234.56', +}]); +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', + blocks: [], +}]); +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', + blocks: [], + text: 'fallback', +}]); +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', + attachments: [], +}]); +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', + attachments: [], + text: 'fallback', +}]); +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', + attachments: [], + as_user: true, // can pass as_user=true if no icon or username fields set +}]); +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', + attachments: [], + icon_emoji: 'smile', // icon can be set on its own... +}]); +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', + attachments: [], + icon_emoji: 'smile', + as_user: false, // ... or with as_user=false +}]); +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', + attachments: [], + icon_url: 'someurl.png', // icon can be set on its own... +}]); +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', + attachments: [], + icon_emoji: 'someurl.png', + as_user: false, // ... or with as_user=false +}]); + +// chat.postMessage +// -- sad path +expectError(web.chat.postMessage()); // lacking argument +expectError(web.chat.postMessage({})); // empty argument +expectError(web.chat.postMessage({ + channel: 'C1234', // missing text/attachments/blocks +})); +expectError(web.chat.postMessage({ + text: 'U1234', // missing channel +})); +expectError(web.chat.postMessage({ + blocks: [], // missing channel +})); +expectError(web.chat.postMessage({ + attachments: [], // missing channel +})); +expectError(web.chat.postMessage({ + channel: 'C123', + attachments: [], + icon_url: 'someurl.png', + icon_emoji: 'smile', // cannot use both icon_url and icon_emoji +})); +expectError(web.chat.postMessage({ + channel: 'C123', + attachments: [], + icon_url: 'someurl.png', + as_user: true, // cannot set both as_user=true and icon_url +})); +expectError(web.chat.postMessage({ + channel: 'C123', + attachments: [], + icon_emoji: 'smile', + as_user: true, // cannot set both as_user=true and icon_emoji +})); +expectError(web.chat.postMessage({ + channel: 'C123', + attachments: [], + reply_broadcast: true, // cannot reply_broadcast=true without setting thread_ts +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + text: '1234.56', +}]); +expectAssignable>([{ + channel: 'C1234', + blocks: [], +}]); +expectAssignable>([{ + channel: 'C1234', + blocks: [], + text: 'fallback', +}]); +expectAssignable>([{ + channel: 'C1234', + attachments: [], +}]); +expectAssignable>([{ + channel: 'C1234', + attachments: [], + text: 'fallback', +}]); +expectAssignable>([{ + channel: 'C1234', + attachments: [], + as_user: true, // can pass as_user=true if no icon or username fields set +}]); +expectAssignable>([{ + channel: 'C1234', + attachments: [], + icon_emoji: 'smile', // icon can be set on its own... +}]); +expectAssignable>([{ + channel: 'C1234', + attachments: [], + icon_emoji: 'smile', + as_user: false, // ... or with as_user=false +}]); +expectAssignable>([{ + channel: 'C1234', + attachments: [], + icon_url: 'someurl.png', // icon can be set on its own... +}]); +expectAssignable>([{ + channel: 'C1234', + attachments: [], + icon_emoji: 'someurl.png', + as_user: false, // ... or with as_user=false +}]); +expectAssignable>([{ + channel: 'C1234', + text: 'hello', + thread_ts: '1234.56', // can send a threaded message +}]); +expectAssignable>([{ + channel: 'C1234', + text: 'hello', + thread_ts: '1234.56', + reply_broadcast: true, // can send a threaded message and broadcast it, too +}]); + +// chat.scheduleMessage +// -- sad path +expectError(web.chat.scheduleMessage()); // lacking argument +expectError(web.chat.scheduleMessage({})); // empty argument +expectError(web.chat.scheduleMessage({ + channel: 'C1234', // missing text/attachments/blocks and post_at +})); +expectError(web.chat.scheduleMessage({ + channel: 'C1234', // missing text/attachments/blocks + post_at: 'U1234', +})); +expectError(web.chat.scheduleMessage({ + channel: 'C1234', // missing post_at + text: 'U1234', +})); +expectError(web.chat.scheduleMessage({ + post_at: 'U1234', // missing channel + text: 'U1234', +})); +expectError(web.chat.scheduleMessage({ + channel: 'C1234', // missing post_at + blocks: [], +})); +expectError(web.chat.scheduleMessage({ + post_at: 'U1234', // missing channel + blocks: [], +})); +expectError(web.chat.scheduleMessage({ + channel: 'C1234', // missing post_at + attachments: [], +})); +expectError(web.chat.scheduleMessage({ + post_at: 'U1234', // missing channel + attachments: [], +})); +expectError(web.chat.scheduleMessage({ + post_at: 17000000000, + channel: 'C123', + attachments: [], + reply_broadcast: true, // cannot reply_broadcast=true without setting thread_ts +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + post_at: 'U1234', + text: '1234.56', +}]); +expectAssignable>([{ + channel: 'C1234', + post_at: 'U1234', + blocks: [], +}]); +expectAssignable>([{ + channel: 'C1234', + post_at: 'U1234', + blocks: [], + text: 'fallback', +}]); +expectAssignable>([{ + channel: 'C1234', + post_at: 'U1234', + attachments: [], +}]); +expectAssignable>([{ + channel: 'C1234', + post_at: 'U1234', + attachments: [], + text: 'fallback', +}]); +expectAssignable>([{ + channel: 'C1234', + text: 'hello', + post_at: 180000000, + thread_ts: '1234.56', // can send a threaded message +}]); +expectAssignable>([{ + channel: 'C1234', + text: 'hello', + thread_ts: '1234.56', + post_at: 19000000, + reply_broadcast: true, // can send a threaded message and broadcast it, too +}]); + +// chat.scheduledMessages.list +// -- sad path +expectError(web.chat.scheduledMessages.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// chat.unfurl +// -- sad path +expectError(web.chat.unfurl()); // lacking argument +expectError(web.chat.unfurl({})); // empty argument +expectError(web.chat.unfurl({ + channel: 'C1234', // missing ts and unfurls +})); +expectError(web.chat.unfurl({ + channel: 'C1234', // missing unfurls + ts: '1234.56', +})); +expectError(web.chat.unfurl({ + ts: '1234.56', + unfurls: {}, +})); +expectError(web.chat.unfurl({ + channel: 'C1234', + unfurls: {}, +})); +expectError(web.chat.unfurl({ + source: 'composer', // missing unfurl_id and unfurls +})); +expectError(web.chat.unfurl({ + source: 'composer', // missing unfurls + unfurl_id: '1234', +})); +expectError(web.chat.unfurl({ + unfurl_id: '1234.56', + unfurls: {}, +})); +expectError(web.chat.unfurl({ + source: 'conversations_history', + unfurls: {}, +})); +// -- happy path +expectAssignable>([{ + unfurls: {}, + source: 'conversations_history', + unfurl_id: '12345', +}]); +expectAssignable>([{ + unfurls: {}, + channel: 'C1234', + ts: '1234.56', +}]); + +// chat.update +// -- sad path +expectError(web.chat.update()); // lacking argument +expectError(web.chat.update({})); // empty argument +expectError(web.chat.update({ + channel: 'C1234', // missing text/attachments/blocks and ts +})); +expectError(web.chat.update({ + channel: 'C1234', // missing text/attachments/blocks + ts: '1234.56', +})); +expectError(web.chat.update({ + text: 'U1234', // missing channel and ts +})); +expectError(web.chat.update({ + text: 'U1234', // missing channel + ts: '1234.56', +})); +expectError(web.chat.update({ + text: 'U1234', // missing ts + channel: 'C1234', +})); +expectError(web.chat.update({ + blocks: [], // missing channel and ts +})); +expectError(web.chat.update({ + blocks: [], // missing channel + ts: '1234.56', +})); +expectError(web.chat.update({ + blocks: [], // missing ts + channel: 'C1234', +})); +expectError(web.chat.update({ + attachments: [], // missing channel and ts +})); +expectError(web.chat.update({ + attachments: [], // missing channel + ts: '1234.56', +})); +expectError(web.chat.update({ + attachments: [], // missing ts + channel: 'C1234', +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + ts: '1234.56', + text: '1234.56', +}]); +expectAssignable>([{ + channel: 'C1234', + ts: '1234.56', + blocks: [], +}]); +expectAssignable>([{ + channel: 'C1234', + ts: '1234.56', + blocks: [], + text: 'fallback', +}]); +expectAssignable>([{ + channel: 'C1234', + ts: '1234.56', + attachments: [], +}]); +expectAssignable>([{ + channel: 'C1234', + ts: '1234.56', + attachments: [], + text: 'fallback', +}]); +expectAssignable>([{ + channel: 'C1234', + ts: '1234.56', + text: 'hello', + reply_broadcast: true, // can broadcast a threaded msg +}]); diff --git a/packages/web-api/test/types/methods/conversations.test-d.ts b/packages/web-api/test/types/methods/conversations.test-d.ts new file mode 100644 index 000000000..e2d142530 --- /dev/null +++ b/packages/web-api/test/types/methods/conversations.test-d.ts @@ -0,0 +1,290 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// conversations.acceptSharedInvite +// -- sad path +expectError(web.conversations.acceptSharedInvite()); // lacking argument +expectError(web.conversations.acceptSharedInvite({})); // empty argument +expectError(web.conversations.acceptSharedInvite({ + channel_name: 'puppies-r-us', // missing invite_id or channel_id +})); +expectError(web.conversations.acceptSharedInvite({ + channel_id: 'C1234', // missing channel_name +})); +expectError(web.conversations.acceptSharedInvite({ + invite_id: 'I1234', // missing channel_name +})); +// -- happy path +expectAssignable>([{ + channel_name: 'puppies-r-us', + invite_id: 'I1234', +}]); +expectAssignable>([{ + channel_name: 'puppies-r-us', + channel_id: 'C1234', +}]); + +// conversations.approveSharedInvite +// -- sad path +expectError(web.conversations.approveSharedInvite()); // lacking argument +expectError(web.conversations.approveSharedInvite({})); // empty argument +// -- happy path +expectAssignable>([{ + invite_id: 'I1234', +}]); + +// conversations.archive +// -- sad path +expectError(web.conversations.archive()); // lacking argument +expectError(web.conversations.archive({})); // empty argument +// -- happy path +expectAssignable>([{ + channel: 'C1234', +}]); + +// conversations.close +// -- sad path +expectError(web.conversations.close()); // lacking argument +expectError(web.conversations.close({})); // empty argument +// -- happy path +expectAssignable>([{ + channel: 'C1234', +}]); + +// conversations.create +// -- sad path +expectError(web.conversations.create()); // lacking argument +expectError(web.conversations.create({})); // empty argument +// -- happy path +expectAssignable>([{ + name: 'grunge-fans', +}]); + +// conversations.declineSharedInvite +// -- sad path +expectError(web.conversations.declineSharedInvite()); // lacking argument +expectError(web.conversations.declineSharedInvite({})); // empty argument +// -- happy path +expectAssignable>([{ + invite_id: 'I1234', +}]); + +// conversations.history +// -- sad path +expectError(web.conversations.history()); // lacking argument +expectError(web.conversations.history({})); // empty argument +// -- happy path +expectAssignable>([{ + channel: 'C1234', +}]); + +// conversations.info +// -- sad path +expectError(web.conversations.info()); // lacking argument +expectError(web.conversations.info({})); // empty argument +// -- happy path +expectAssignable>([{ + channel: 'C1234', +}]); + +// conversations.invite +// -- sad path +expectError(web.conversations.invite()); // lacking argument +expectError(web.conversations.invite({})); // empty argument +expectError(web.conversations.invite({ + channel: 'C1234', // missing users +})); +expectError(web.conversations.invite({ + users: 'U1234', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + users: 'U1234', +}]); + +// conversations.inviteShared +// -- sad path +expectError(web.conversations.inviteShared()); // lacking argument +expectError(web.conversations.inviteShared({})); // empty argument +expectError(web.conversations.inviteShared({ + channel: 'C1234', // missing emails or user_ids +})); +expectError(web.conversations.inviteShared({ + user_ids: ['U1234'], // missing channel +})); +expectError(web.conversations.inviteShared({ + emails: ['ceo@salesforce.com'], // missing channel +})); +expectError(web.conversations.inviteShared({ + channel: 'C1234', + emails: ['ceo@salesforce.com'], + user_ids: ['U1234'], // either emails or user_ids, but not both +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + user_ids: ['U1234'], +}]); +expectAssignable>([{ + channel: 'C1234', + emails: ['ceo@salesforce.com'], +}]); + +// conversations.join +// -- sad path +expectError(web.conversations.join()); // lacking argument +expectError(web.conversations.join({})); // empty argument +// -- happy path +expectAssignable>([{ + channel: 'C1234', +}]); + +// conversations.kick +// -- sad path +expectError(web.conversations.kick()); // lacking argument +expectError(web.conversations.kick({})); // empty argument +expectError(web.conversations.kick({ + channel: 'C1234', // missing user +})); +expectError(web.conversations.kick({ + user: 'U1234', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + user: 'U1234', +}]); + +// conversations.leave +// -- sad path +expectError(web.conversations.leave()); // lacking argument +expectError(web.conversations.leave({})); // empty argument +// -- happy path +expectAssignable>([{ + channel: 'C1234', +}]); + +// conversations.list +// -- sad path +expectError(web.conversations.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// conversations.listConnectInvites +// -- sad path +expectError(web.conversations.listConnectInvites()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// conversations.mark +// -- sad path +expectError(web.conversations.mark()); // lacking argument +expectError(web.conversations.mark({})); // empty argument +expectError(web.conversations.mark({ + channel: 'C1234', // missing ts +})); +expectError(web.conversations.mark({ + ts: '12345.67', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + ts: '12345.67', +}]); + +// conversations.members +// -- sad path +expectError(web.conversations.members()); // lacking argument +expectError(web.conversations.members({})); // empty argument +// -- happy path +expectAssignable>([{ + channel: 'C1234', +}]); + +// conversations.open +// -- sad path +expectError(web.conversations.open()); // lacking argument +expectError(web.conversations.open({})); // empty argument +// -- happy path +expectAssignable>([{ + channel: 'C1234', +}]); +expectAssignable>([{ + users: 'U1234,U2345', +}]); + +// conversations.rename +// -- sad path +expectError(web.conversations.rename()); // lacking argument +expectError(web.conversations.rename({})); // empty argument +expectError(web.conversations.rename({ + channel: 'C1234', // missing name +})); +expectError(web.conversations.rename({ + name: 'batman-fans', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + name: 'batman-fans', +}]); + +// conversations.replies +// -- sad path +expectError(web.conversations.replies()); // lacking argument +expectError(web.conversations.replies({})); // empty argument +expectError(web.conversations.replies({ + channel: 'C1234', // missing ts +})); +expectError(web.conversations.replies({ + ts: '12345.67', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + ts: '12345.67', +}]); + +// conversations.setPurpose +// -- sad path +expectError(web.conversations.setPurpose()); // lacking argument +expectError(web.conversations.setPurpose({})); // empty argument +expectError(web.conversations.setPurpose({ + channel: 'C1234', // missing purpose +})); +expectError(web.conversations.setPurpose({ + purpose: 'Feed the world', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + purpose: 'Feed the world', +}]); + +// conversations.setTopic +// -- sad path +expectError(web.conversations.setTopic()); // lacking argument +expectError(web.conversations.setTopic({})); // empty argument +expectError(web.conversations.setTopic({ + channel: 'C1234', // missing topic +})); +expectError(web.conversations.setTopic({ + topic: 'Eat and be merry', // missing channel +})); +// -- happy path +expectAssignable>([{ + channel: 'C1234', + topic: 'Eat and be merry', +}]); + +// conversations.unarchive +// -- sad path +expectError(web.conversations.unarchive()); // lacking argument +expectError(web.conversations.unarchive({})); // empty argument +// -- happy path +expectAssignable>([{ + channel: 'C1234', +}]); diff --git a/packages/web-api/test/types/methods/dialog.test-d.ts b/packages/web-api/test/types/methods/dialog.test-d.ts new file mode 100644 index 000000000..2c9aaf457 --- /dev/null +++ b/packages/web-api/test/types/methods/dialog.test-d.ts @@ -0,0 +1,26 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +const dialog = { + title: 'Test', + callback_id: 'test', + elements: [], +}; + +// dialog.open +// -- sad path +expectError(web.dialog.open()); // lacking argument +expectError(web.dialog.open({})); // empty argument +expectError(web.dialog.open({ + trigger_id: '1234.566', // missing `dialog` +})); +expectError(web.dialog.open({ + dialog, // missing `trigger_id` +})); +// -- happy path +expectAssignable>([{ + trigger_id: '1234.56', + dialog, +}]); diff --git a/packages/web-api/test/types/methods/dnd.test-d.ts b/packages/web-api/test/types/methods/dnd.test-d.ts new file mode 100644 index 000000000..a7244d258 --- /dev/null +++ b/packages/web-api/test/types/methods/dnd.test-d.ts @@ -0,0 +1,40 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// dnd.endDnd +// -- sad path +expectError(web.dnd.endDnd()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// dnd.endSnooze +// -- sad path +expectError(web.dnd.endSnooze()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// dnd.info +// -- sad path +expectError(web.dnd.info()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// dnd.setSnooze +// -- sad path +expectError(web.dnd.setSnooze()); // lacking argument +expectError(web.dnd.setSnooze({})); // empty argument +// -- happy path +expectAssignable>([{ + num_minutes: 1, +}]); + +// dnd.teamInfo +// -- sad path +expectError(web.dnd.teamInfo()); // lacking argument +expectError(web.dnd.teamInfo({})); // empty argument +// -- happy path +expectAssignable>([{ + users: 'U1234', +}]); diff --git a/packages/web-api/test/types/methods/emoji.test-d.ts b/packages/web-api/test/types/methods/emoji.test-d.ts new file mode 100644 index 000000000..11b603657 --- /dev/null +++ b/packages/web-api/test/types/methods/emoji.test-d.ts @@ -0,0 +1,10 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// emoji.list +// -- sad path +expectError(web.emoji.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args diff --git a/packages/web-api/test/types/methods/files.test-d.ts b/packages/web-api/test/types/methods/files.test-d.ts new file mode 100644 index 000000000..1e6675663 --- /dev/null +++ b/packages/web-api/test/types/methods/files.test-d.ts @@ -0,0 +1,223 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// Reusable files.* API partial argument objects for these tests +const file = { id: 'F1234', title: 'Choose Boring Technology' }; + +// files.completeUploadExternal +// -- sad path +expectError(web.files.completeUploadExternal()); // lacking argument +expectError(web.files.completeUploadExternal({})); // empty argument +expectError(web.files.completeUploadExternal({ + files: [file], + thread_ts: '1234.567', // has thread_ts but no channel +})); +expectError(web.files.completeUploadExternal({ + files: [], // must specify at least one file +})); +// -- happy path +expectAssignable>([{ + files: [file], // must specify at least one file + // not shared to any destination, so it is a 'private' file +}]); +expectAssignable>([{ + files: [file], + channel_id: 'C1234', // share to a channel +}]); +expectAssignable>([{ + files: [file], + channel_id: 'C1234', + thread_ts: '1234.567', // share to a thread +}]); + +// files.delete +// -- sad path +expectError(web.files.delete()); // lacking argument +expectError(web.files.delete({})); // empty argument +// -- happy path +expectAssignable>([{ + file: 'F123', // must specify a file +}]); + +// files.getUploadURLExternal +// -- sad path +expectError(web.files.getUploadURLExternal()); // lacking argument +expectError(web.files.getUploadURLExternal({})); // empty argument +expectError(web.files.getUploadURLExternal({ filename: 'hi' })); // missing `length` +expectError(web.files.getUploadURLExternal({ length: 42 })); // missing `filename` +// -- happy path +expectAssignable>([{ + filename: 'batman', + length: 420, +}]); + +// files.info +// -- sad path +expectError(web.files.info()); // lacking argument +expectError(web.files.info({})); // empty argument +// -- happy path +expectAssignable>([{ + file: 'F123', // must specify a file +}]); + +// files.list +// -- sad path +expectError(web.files.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // able to call it with empty argument + +// files.revokePublicURL +// -- sad path +expectError(web.files.revokePublicURL()); // lacking argument +expectError(web.files.revokePublicURL({})); // empty argument +// -- happy path +expectAssignable>([{ + file: 'F123', // must specify a file +}]); + +// files.sharedPublicURL +// -- sad path +expectError(web.files.sharedPublicURL()); // lacking argument +expectError(web.files.sharedPublicURL({})); // empty argument +// -- happy path +expectAssignable>([{ + file: 'F123', // must specify a file +}]); + +// files.upload +// -- sad path +expectError(web.files.upload()); // lacking argument +expectError(web.files.upload({})); // empty argument +expectError(web.files.upload({ file: 'test.png', thread_ts: '123.456' })); // if providing thread_ts, must provide channels +// -- happy path +expectAssignable>([{ + file: 'test.png', // must specify either a file... +}]); +expectAssignable>([{ + content: 'text', // or file contents +}]); +expectAssignable>([{ + channels: 'C1234', // optionally share to one or more channels + content: 'text', +}]); +expectAssignable>([{ + channels: 'C1234', // or even to a specific thread + content: 'text', +}]); + +// files.uploadV2 +// -- sad path +expectError(web.files.uploadV2()); // lacking argument +expectError(web.files.uploadV2({})); // empty argument +expectError(web.files.uploadV2({ file: 'test.png', thread_ts: '123.456' })); // if providing thread_ts, must provide channels +// -- happy path +expectAssignable>([{ + file: 'test.png', // must specify either a file... +}]); +expectAssignable>([{ + content: 'text', // or file contents... +}]); +expectAssignable>([{ + channels: 'C1234', // optionally share to one or more channels + content: 'text', +}]); +expectAssignable>([{ + channels: 'C1234', + thread_ts: '12345.67', // or even to a specific thread + content: 'text', +}]); + +// files.comments.delete +// -- sad path +expectError(web.files.comments.delete()); // lacking argument +expectError(web.files.comments.delete({})); // empty argument +expectError(web.files.comments.delete({ file: 'F123' })); // missing comment ID +expectError(web.files.comments.delete({ id: 'Fc123' })); // missing file ID +// -- happy path +expectAssignable>([{ + file: 'F1234', + id: 'Fc1234', +}]); + +// files.remote.add +// -- sad path +expectError(web.files.remote.add()); // lacking argument +expectError(web.files.remote.add({})); // empty argument +expectError(web.files.remote.add({ external_id: '1234' })); // missing url and title +expectError(web.files.remote.add({ external_url: 'https://example.com' })); // missing id and title +expectError(web.files.remote.add({ title: 'my document' })); // missing id and url +expectError(web.files.remote.add({ external_id: '1234', external_url: 'https://example.com' })); // missing title +expectError(web.files.remote.add({ external_id: '1234', title: 'this is a test' })); // missing url +expectError(web.files.remote.add({ external_url: '1234', title: 'this is a test' })); // missing id +// -- happy path +expectAssignable>([{ + external_id: '1234', + external_url: 'https://example.com', + title: 'my document', +}]); + +// files.remote.info +// -- sad path +expectError(web.files.remote.info()); // lacking argument +expectError(web.files.remote.info({})); // empty argument +expectError(web.files.remote.info({ external_id: '1234', file: 'F1234' })); // either external ID, or file ID, but not both +// -- happy path +expectAssignable>([{ + external_id: '1234', +}]); +expectAssignable>([{ + file: 'F1234', +}]); + +// files.remote.list +// -- sad path +expectError(web.files.remote.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // able to call it with empty argument + +// files.remote.remove +// -- sad path +expectError(web.files.remote.remove()); // lacking argument +expectError(web.files.remote.remove({})); // empty argument +expectError(web.files.remote.remove({ external_id: '1234', file: 'F1234' })); // either external ID, or file ID, but not both +// -- happy path +expectAssignable>([{ + external_id: '1234', +}]); +expectAssignable>([{ + file: 'F1234', +}]); + +// files.remote.share +// -- sad path +expectError(web.files.remote.share()); // lacking argument +expectError(web.files.remote.share({})); // empty argument +expectError(web.files.remote.share({ external_id: '1234', file: 'F1234' })); // either external ID, or file ID, but not both +expectError(web.files.remote.share({ channels: 'C1234' })); // missing one of external ID or file ID +// -- happy path +expectAssignable>([{ + channels: 'C123', + external_id: '1234', +}]); +expectAssignable>([{ + channels: 'C123', + file: 'F1234', +}]); + +// files.remote.update +// -- sad path +expectError(web.files.remote.update()); // lacking argument +expectError(web.files.remote.update({})); // empty argument +expectError(web.files.remote.update({ external_id: '1234', file: 'F1234' })); // either external ID, or file ID, but not both +expectError(web.files.remote.update({ title: 'Fear and Loathing in Las Vegas' })); // missing one of external ID or file ID +// -- happy path +expectAssignable>([{ + external_id: '1234', + title: 'Moby Dick', +}]); +expectAssignable>([{ + file: 'F1234', + external_url: 'https://someurl.com', +}]); diff --git a/packages/web-api/test/types/methods/functions.test-d.ts b/packages/web-api/test/types/methods/functions.test-d.ts new file mode 100644 index 000000000..20e8814bf --- /dev/null +++ b/packages/web-api/test/types/methods/functions.test-d.ts @@ -0,0 +1,36 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// functions.completeError +// -- sad path +expectError(web.functions.completeError()); // lacking argument +expectError(web.functions.completeError({})); // empty argument +expectError(web.functions.completeError({ + function_execution_id: 'Fx1234', // missing error +})); +expectError(web.functions.completeError({ + error: 'boomsies', // missing function_execution_id +})); +// -- happy path +expectAssignable>([{ + function_execution_id: 'Fx1234', + error: 'oh noes', +}]); + +// functions.completeSuccess +// -- sad path +expectError(web.functions.completeSuccess()); // lacking argument +expectError(web.functions.completeSuccess({})); // empty argument +expectError(web.functions.completeSuccess({ + function_execution_id: 'Fx1234', // missing output +})); +expectError(web.functions.completeSuccess({ + outputs: {}, // missing function_execution_id +})); +// -- happy path +expectAssignable>([{ + function_execution_id: 'Fx1234', + outputs: {}, +}]); diff --git a/packages/web-api/test/types/methods/migration.test-d.ts b/packages/web-api/test/types/methods/migration.test-d.ts new file mode 100644 index 000000000..420eaba04 --- /dev/null +++ b/packages/web-api/test/types/methods/migration.test-d.ts @@ -0,0 +1,13 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// migration.exchange +// -- sad path +expectError(web.migration.exchange()); // lacking argument +expectError(web.migration.exchange({})); // empty argument +// -- happy path +expectAssignable>([{ + users: 'U1234', +}]); diff --git a/packages/web-api/test/types/methods/oauth.test-d.ts b/packages/web-api/test/types/methods/oauth.test-d.ts new file mode 100644 index 000000000..1e1ec23b8 --- /dev/null +++ b/packages/web-api/test/types/methods/oauth.test-d.ts @@ -0,0 +1,52 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// Reusable openid.* API partial argument objects for these tests +const creds = { client_id: 'C1234', client_secret: '1234.567' }; + +// oauth.access +// -- sad path +expectError(web.oauth.access()); // lacking argument +expectError(web.oauth.access({})); // empty argument +expectError(web.oauth.access({ + client_id: 'C1234', // missing client_secret +})); +expectError(web.oauth.access({ + client_secret: '1234.567', // missing `client_id` +})); +// -- happy path +expectAssignable>([{ + ...creds, +}]); + +// oauth.v2.access +// -- sad path +expectError(web.oauth.v2.access()); // lacking argument +expectError(web.oauth.v2.access({})); // empty argument +expectError(web.oauth.v2.access({ + client_id: 'C1234', // missing client_secret +})); +expectError(web.oauth.v2.access({ + client_secret: '1234.567', // missing `client_id` +})); +// -- happy path +expectAssignable>([{ + ...creds, +}]); + +// oauth.v2.exchange +// -- sad path +expectError(web.oauth.v2.exchange()); // lacking argument +expectError(web.oauth.v2.exchange({})); // empty argument +expectError(web.oauth.v2.exchange({ + client_id: 'C1234', // missing client_secret +})); +expectError(web.oauth.v2.exchange({ + client_secret: '1234.567', // missing `client_id` +})); +// -- happy path +expectAssignable>([{ + ...creds, +}]); diff --git a/packages/web-api/test/types/methods/openid.test-d.ts b/packages/web-api/test/types/methods/openid.test-d.ts new file mode 100644 index 000000000..2e1f748aa --- /dev/null +++ b/packages/web-api/test/types/methods/openid.test-d.ts @@ -0,0 +1,28 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// Reusable openid.* API partial argument objects for these tests +const creds = { client_id: 'C1234', client_secret: '1234.567' }; + +// openid.connect.token +// -- sad path +expectError(web.openid.connect.token()); // lacking argument +expectError(web.openid.connect.token({})); // empty argument +expectError(web.openid.connect.token({ + client_id: 'C1234', // missing client_secret +})); +expectError(web.openid.connect.token({ + client_secret: '1234.567', // missing `client_id` +})); +// -- happy path +expectAssignable>([{ + ...creds, +}]); + +// openid.connect.userInfo +// -- sad path +expectError(web.openid.connect.userInfo()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args diff --git a/packages/web-api/test/types/methods/pins.test-d.ts b/packages/web-api/test/types/methods/pins.test-d.ts new file mode 100644 index 000000000..3173134b1 --- /dev/null +++ b/packages/web-api/test/types/methods/pins.test-d.ts @@ -0,0 +1,46 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// Reusable pins.* API partial argument objects for these tests +const message = { channel: 'C1234', timestamp: '1234.567' }; + +// pins.add +// -- sad path +expectError(web.pins.add()); // lacking argument +expectError(web.pins.add({})); // empty argument +expectError(web.pins.add({ + channel: 'C1234', // missing timestamp +})); +expectError(web.pins.add({ + timestamp: '1234.567', // missing `channel` +})); +// -- happy path +expectAssignable>([{ + ...message, +}]); + +// pins.list +// -- sad path +expectError(web.pins.list()); // lacking argument +expectError(web.pins.list({})); // empty argument +// -- happy path +expectAssignable>([{ + channel: message.channel, +}]); + +// pins.remove +// -- sad path +expectError(web.pins.remove()); // lacking argument +expectError(web.pins.remove({})); // empty argument +expectError(web.pins.remove({ + channel: 'C1234', // missing timestamp +})); +expectError(web.pins.remove({ + timestamp: '1234.567', // missing `channel` +})); +// -- happy path +expectAssignable>([{ + ...message, +}]); diff --git a/packages/web-api/test/types/methods/reactions.test-d.ts b/packages/web-api/test/types/methods/reactions.test-d.ts new file mode 100644 index 000000000..1251d3540 --- /dev/null +++ b/packages/web-api/test/types/methods/reactions.test-d.ts @@ -0,0 +1,96 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// Reusable reactions.* API partial argument objects for these tests +const message = { channel: 'C1234', timestamp: '1234.567' }; + +// reactions.add +// -- sad path +expectError(web.reactions.add()); // lacking argument +expectError(web.reactions.add({})); // empty argument +expectError(web.reactions.add({ + ...message, // missing `name` +})); +expectError(web.reactions.add({ + name: 'smile', // missing `channel` and `timestamp` +})); +expectError(web.reactions.add({ + name: 'smile', // missing `timestamp` + channel: 'C1234', +})); +expectError(web.reactions.add({ + name: 'smile', // missing `channel` + timestamp: '1234.567', +})); +// -- happy path +expectAssignable>([{ + ...message, + name: 'smile', +}]); + +// reactions.get +// -- sad path +expectError(web.reactions.get()); // lacking argument +expectError(web.reactions.get({})); // empty argument +expectError(web.reactions.get({ + channel: 'C1234', // missing timestamp +})); +expectError(web.reactions.get({ + timestamp: '1234.567', // missing channel +})); +// -- happy path +expectAssignable>([{ + ...message, // get reactions for a message +}]); +expectAssignable>([{ + file: 'F1234', // or a file +}]); +expectAssignable>([{ + file_comment: 'Fc1234', // or a file comment +}]); + +// reactions.list +// -- sad path +expectError(web.reactions.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args + +// reactions.remove +// -- sad path +expectError(web.reactions.remove()); // lacking argument +expectError(web.reactions.remove({})); // empty argument +expectError(web.reactions.remove({ + ...message, // missing `name` +})); +expectError(web.reactions.remove({ + name: 'smile', // missing `channel` and `timestamp`, or `file`, or `file_comment` +})); +expectError(web.reactions.remove({ + name: 'smile', // missing `timestamp` + channel: 'C1234', +})); +expectError(web.reactions.remove({ + name: 'smile', // missing `channel` + timestamp: '1234.567', +})); +expectError(web.reactions.remove({ + file: 'F1234', // missing name +})); +expectError(web.reactions.remove({ + file_comment: 'Fc1234', // missing name +})); +// -- happy path +expectAssignable>([{ + ...message, + name: 'smile', // remove a reaction from a message +}]); +expectAssignable>([{ + file: 'F1234', + name: 'smile', // remove a reaction from a file +}]); +expectAssignable>([{ + file_comment: 'Fc1234', + name: 'smile', // remove a reaction from a file comment +}]); diff --git a/packages/web-api/test/types/methods/reminders.test-d.ts b/packages/web-api/test/types/methods/reminders.test-d.ts new file mode 100644 index 000000000..a193a4e4e --- /dev/null +++ b/packages/web-api/test/types/methods/reminders.test-d.ts @@ -0,0 +1,79 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// reminders.add +// -- sad path +expectError(web.reminders.add()); // lacking argument +expectError(web.reminders.add({})); // empty argument +expectError(web.reminders.add({ text: 'take out the garbage' })); // missing time +expectError(web.reminders.add({ time: 'mondays at 6pm' })); // missing text +expectError(web.reminders.add({ + time: '6pm', + text: 'take out the garbage', + recurrence: { + frequency: 'weekly', // missing weekdays property + }, +})); +expectError(web.reminders.add({ + time: '6pm', + text: 'take out the garbage', + recurrence: { + frequency: 'weekly', // missing weekdays property + weekdays: [], // must provide at least one weekday if frequency=weekly + }, +})); +// -- happy path +expectAssignable>([{ + text: 'floss your teeth', + time: 'every damn day', +}]); // must provide at a minimum time and text +expectAssignable>([{ + text: 'take out the garbage', + time: '6pm', // must provide at a minimum time and text + recurrence: { + frequency: 'weekly', + weekdays: ['monday'], // and weekly recurrence needs at least one weekday + }, +}]); +expectAssignable>([{ + text: 'call mom for her birthday', + time: 'April 8th', // must provide at a minimum time and text + recurrence: { + frequency: 'yearly', + }, +}]); + +// reminders.complete +// -- sad path +expectError(web.reminders.complete()); // lacking argument +expectError(web.reminders.complete({})); // empty argument +// -- happy path +expectAssignable>([{ + reminder: 'R1234', // needs the reminder ID +}]); + +// reminders.delete +// -- sad path +expectError(web.reminders.delete()); // lacking argument +expectError(web.reminders.delete({})); // empty argument +// -- happy path +expectAssignable>([{ + reminder: 'R1234', // needs the reminder ID +}]); + +// reminders.info +// -- sad path +expectError(web.reminders.info()); // lacking argument +expectError(web.reminders.info({})); // empty argument +// -- happy path +expectAssignable>([{ + reminder: 'R1234', // needs the reminder ID +}]); + +// reminders.list +// -- sad path +expectError(web.reminders.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional args diff --git a/packages/web-api/test/types/methods/rtm.test-d.ts b/packages/web-api/test/types/methods/rtm.test-d.ts new file mode 100644 index 000000000..1aa91a7ce --- /dev/null +++ b/packages/web-api/test/types/methods/rtm.test-d.ts @@ -0,0 +1,16 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// rtm.connect +// -- sad path +expectError(web.rtm.connect()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional arguments + +// rtm.start +// -- sad path +expectError(web.rtm.start()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional arguments diff --git a/packages/web-api/test/types/methods/search.test-d.ts b/packages/web-api/test/types/methods/search.test-d.ts new file mode 100644 index 000000000..c675690b1 --- /dev/null +++ b/packages/web-api/test/types/methods/search.test-d.ts @@ -0,0 +1,31 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// search.all +// -- sad path +expectError(web.search.all()); // lacking argument +expectError(web.search.all({})); // empty argument +// -- happy path +expectAssignable>([{ + query: '1234', // must specify query +}]); + +// search.files +// -- sad path +expectError(web.search.files()); // lacking argument +expectError(web.search.files({})); // empty argument +// -- happy path +expectAssignable>([{ + query: '1234', // must specify query +}]); + +// search.messages +// -- sad path +expectError(web.search.messages()); // lacking argument +expectError(web.search.messages({})); // empty argument +// -- happy path +expectAssignable>([{ + query: '1234', // must specify query +}]); diff --git a/packages/web-api/test/types/methods/team.test-d.ts b/packages/web-api/test/types/methods/team.test-d.ts new file mode 100644 index 000000000..d332fb684 --- /dev/null +++ b/packages/web-api/test/types/methods/team.test-d.ts @@ -0,0 +1,40 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// team.accessLogs +// -- sad path +expectError(web.team.accessLogs()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional arguments + +// team.billableInfo +// -- sad path +expectError(web.team.billableInfo()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional arguments + +// team.billing.info +// -- sad path +expectError(web.team.billing.info()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional arguments + +// team.integrationLogs +// -- sad path +expectError(web.team.integrationLogs()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional arguments + +// team.profile.get +// -- sad path +expectError(web.team.profile.get()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional arguments + +// team.preferences.list +// -- sad path +expectError(web.team.preferences.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional arguments diff --git a/packages/web-api/test/types/methods/tooling.test-d.ts b/packages/web-api/test/types/methods/tooling.test-d.ts new file mode 100644 index 000000000..3eb7b9770 --- /dev/null +++ b/packages/web-api/test/types/methods/tooling.test-d.ts @@ -0,0 +1,13 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// tooling.tokens.rotate +// -- sad path +expectError(web.tooling.tokens.rotate()); // lacking argument +expectError(web.tooling.tokens.rotate({})); // empty argument +// -- happy path +expectAssignable>([{ + refresh_token: '1234', // must specify refresh_token +}]); diff --git a/packages/web-api/test/types/methods/usergroups.test-d.ts b/packages/web-api/test/types/methods/usergroups.test-d.ts new file mode 100644 index 000000000..fd1746873 --- /dev/null +++ b/packages/web-api/test/types/methods/usergroups.test-d.ts @@ -0,0 +1,67 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// usergroups.create +// -- sad path +expectError(web.usergroups.create()); // lacking argument +expectError(web.usergroups.create({})); // empty argument +// -- happy path +expectAssignable>([{ + name: 'knights who say ni', // must specify name +}]); + +// usergroups.disable +// -- sad path +expectError(web.usergroups.disable()); // lacking argument +expectError(web.usergroups.disable({})); // empty argument +// -- happy path +expectAssignable>([{ + usergroup: 'Sg1234', // must specify usergroup +}]); + +// usergroups.enable +// -- sad path +expectError(web.usergroups.enable()); // lacking argument +expectError(web.usergroups.enable({})); // empty argument +// -- happy path +expectAssignable>([{ + usergroup: 'Sg1234', // must specify usergroup +}]); + +// usergroups.list +// -- sad path +expectError(web.usergroups.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all optional properties + +// usergroups.update +// -- sad path +expectError(web.usergroups.update()); // lacking argument +expectError(web.usergroups.update({})); // empty argument +// -- happy path +expectAssignable>([{ + usergroup: 'Sg1234', // must specify usergroup +}]); + +// usergroups.users.list +// -- sad path +expectError(web.usergroups.users.list()); // lacking argument +expectError(web.usergroups.users.list({})); // empty argument +// -- happy path +expectAssignable>([{ + usergroup: 'Sg1234', // must specify usergroup +}]); + +// usergroups.users.update +// -- sad path +expectError(web.usergroups.users.update()); // lacking argument +expectError(web.usergroups.users.update({})); // empty argument +expectError(web.usergroups.users.update({ usergroup: 'Sg1234' })); // missing users +expectError(web.usergroups.users.update({ users: 'U1,U2,U3' })); // missing usergroups +// -- happy path +expectAssignable>([{ + usergroup: 'Sg1234', + users: 'U1,U2,U3', // must specify usergroup and users +}]); diff --git a/packages/web-api/test/types/methods/users.test-d.ts b/packages/web-api/test/types/methods/users.test-d.ts new file mode 100644 index 000000000..9a1b9a26d --- /dev/null +++ b/packages/web-api/test/types/methods/users.test-d.ts @@ -0,0 +1,82 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// users.conversations +// -- sad path +expectError(web.users.conversations()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all args are optional + +// users.deletePhoto +// -- sad path +expectError(web.users.deletePhoto()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all args are optional + +// users.getPresence +// -- sad path +expectError(web.users.getPresence()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all args are optional + +// users.identity +// -- sad path +expectError(web.users.identity()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all args are optional + +// users.info +// -- sad path +expectError(web.users.info()); // lacking argument +expectError(web.users.info({})); // empty argument +// -- happy path +expectAssignable>([{ + user: 'U1234', // must specify a user +}]); + +// users.list +// -- sad path +expectError(web.users.list()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all args are optional + +// users.lookupByEmail +// -- sad path +expectError(web.users.lookupByEmail()); // lacking argument +expectError(web.users.lookupByEmail({})); // empty argument +// -- happy path +expectAssignable>([{ + email: 'ceo@slack.com', // must specify an email +}]); + +// users.setPhoto +// -- sad path +expectError(web.users.setPhoto()); // lacking argument +expectError(web.users.setPhoto({})); // empty argument +// -- happy path +expectAssignable>([{ + image: Buffer.from([1]), // must specify an image +}]); + +// users.setPresence +// -- sad path +expectError(web.users.setPresence()); // lacking argument +expectError(web.users.setPresence({})); // empty argument +// -- happy path +expectAssignable>([{ + presence: 'auto', // must specify presence +}]); + +// users.profile.get +// -- sad path +expectError(web.users.profile.get()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all args are optional + +// users.profile.set +// -- sad path +expectError(web.users.profile.set()); // lacking argument +// -- happy path +expectAssignable>([{}]); // all args are optional diff --git a/packages/web-api/test/types/methods/views.test-d.ts b/packages/web-api/test/types/methods/views.test-d.ts new file mode 100644 index 000000000..a0411ba30 --- /dev/null +++ b/packages/web-api/test/types/methods/views.test-d.ts @@ -0,0 +1,122 @@ +import { expectAssignable, expectError } from 'tsd'; +import { WebClient } from '../../../src/WebClient'; + +const web = new WebClient('TOKEN'); + +// views.open +// -- sad path +expectError(web.views.open()); // lacking argument +expectError(web.views.open({})); // empty argument +expectError(web.views.open({ // missing interactivity_pointer or trigger_id + view: { + type: 'home', + blocks: [], + }, +})); +expectError(web.views.open({ // missing view + interactivity_pointer: '1234', +})); +expectError(web.views.open({ // missing view + trigger_id: '1234', +})); +// -- happy path +expectAssignable>([{ + view: { + type: 'home', + blocks: [], + }, + interactivity_pointer: '1234', // provide a view and interactivity pointer, or.. +}]); +expectAssignable>([{ + view: { + type: 'home', + blocks: [], + }, + trigger_id: '1234', // .. a trigger_id +}]); + +// views.push +// -- sad path +expectError(web.views.push()); // lacking argument +expectError(web.views.push({})); // empty argument +expectError(web.views.push({ // missing interactivity_pointer or trigger_id + view: { + type: 'home', + blocks: [], + }, +})); +expectError(web.views.push({ // missing view + interactivity_pointer: '1234', +})); +expectError(web.views.push({ // missing view + trigger_id: '1234', +})); +// -- happy path +expectAssignable>([{ + view: { + type: 'home', + blocks: [], + }, + interactivity_pointer: '1234', // provide a view and interactivity pointer, or.. +}]); +expectAssignable>([{ + view: { + type: 'home', + blocks: [], + }, + trigger_id: '1234', // .. a trigger_id +}]); + +// views.publish +// -- sad path +expectError(web.views.publish()); // lacking argument +expectError(web.views.publish({})); // empty argument +expectError(web.views.publish({ // missing user_id + view: { + type: 'home', + blocks: [], + }, +})); +expectError(web.views.publish({ // missing view + user_id: 'U1234', +})); +// -- happy path +expectAssignable>([{ + view: { + type: 'home', + blocks: [], + }, + user_id: 'U1234', // provide a view and user_id +}]); + +// views.update +// -- sad path +expectError(web.views.update()); // lacking argument +expectError(web.views.update({})); // empty argument +expectError(web.views.update({ // missing external_id or view_id + view: { + type: 'home', + blocks: [], + }, +})); +expectError(web.views.update({ // missing view + external_id: '1234', +})); +expectError(web.views.update({ // missing view + view_id: '1234', +})); +// -- happy path +expectAssignable>([{ + view: { + type: 'home', + blocks: [], + }, + external_id: '1234', // provide a view and view_id, or.. +}]); +expectAssignable>([{ + view: { + type: 'home', + blocks: [], + }, + view_id: '1234', // .. a view_id +}]); diff --git a/packages/web-api/test/types/webclient-named-method-types.test-d.ts b/packages/web-api/test/types/webclient-named-method-types.test-d.ts deleted file mode 100644 index 82ad31533..000000000 --- a/packages/web-api/test/types/webclient-named-method-types.test-d.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { expectType, expectError } from 'tsd'; -import { WebClient, WebAPICallResult } from '../../'; -import { ChatPostMessageResponse } from '../../src/response/ChatPostMessageResponse'; -import { ChatPostEphemeralResponse } from '../../src/response/ChatPostEphemeralResponse'; -// import { ChatScheduleMessageResponse } from '../../src/response/ChatScheduleMessageResponse'; -// import { ChatUpdateResponse } from '../../src/response/ChatUpdateResponse'; - -const web = new WebClient('TOKEN'); - -const chatPostMesssageResult: ChatPostMessageResponse = { ok: true }; -const result: WebAPICallResult = chatPostMesssageResult; -expectType(result); - -// TODO: Parameter type Promise is not identical to argument type Promise -// // calling a method directly with arbitrary arguments should work -// expectType>(web.chat.postMessage({ -// channel: 'CHANNEL', -// text: 'TEXT', -// key: 'VALUE', -// })); -// expectType>(web.chat.postMessage({ -// channel: 'CHANNEL', -// blocks: [ -// { -// type: 'section', -// text: { -// type: 'mrkdwn', -// text: -// 'text', -// }, -// }, -// ], -// key: 'VALUE', -// })); - -// calling a method directly with under-specified arguments should not work -expectError(web.chat.postMessage({ - text: 'TEXT', -})); - -// assigning an object with a specific type that includes arbitrary arguments should not work -// TODO: can typescript even reliably do that? ^ -// expectError(web.chat.postMessage({ -// text: 'TEXT', -// channel: 'CHANNEL', -// key: 'VALUE', -// })); - -// expectType>(web.chat.postMessage({ -// channel: 'C111', -// blocks: [], -// // no text should be accepted -// })); -// expectType>(web.chat.update({ -// channel: 'C111', -// ts: '111.222', -// blocks: [], -// // no text should be accepted -// })); - -// expectType>(web.chat.scheduleMessage({ -// channel: 'C111', -// post_at: '11111', -// blocks: [], -// // no text should be accepted -// })); -// expectType>(web.chat.scheduleMessage({ -// channel: 'C111', -// post_at: '1621497568', -// text: 'Hi there!', -// blocks: [], -// })); -// expectType>(web.chat.scheduleMessage({ -// channel: 'C111', -// post_at: 1621497568, -// text: 'Hi there!', -// blocks: [], -// })); - -expectType>(web.chat.postEphemeral({ - channel: 'C111', - user: 'U111', - blocks: [], - // no text should be accepted -})); -expectType>(web.chat.postEphemeral({ - channel: 'C111', - user: 'U111', - text: 'Hi there!', - blocks: [], -})); diff --git a/packages/web-api/test/types/webclient-no-token.test-d.ts b/packages/web-api/test/types/webclient-no-token.test-d.ts index e692d6684..fc96355e9 100644 --- a/packages/web-api/test/types/webclient-no-token.test-d.ts +++ b/packages/web-api/test/types/webclient-no-token.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd'; -import { WebClient } from '../../'; -import { OauthAccessResponse } from '../../src/response/OauthAccessResponse'; +import { WebClient } from '../..'; +import { OauthAccessResponse } from '../../src/types/response/OauthAccessResponse'; const web = new WebClient(); diff --git a/scripts/code_generator.rb b/scripts/code_generator.rb index 5e6edb3aa..647f77de8 100644 --- a/scripts/code_generator.rb +++ b/scripts/code_generator.rb @@ -5,7 +5,7 @@ require 'open3' -index_file = __dir__ + '/../packages/web-api/src/response/index.ts' +index_file = __dir__ + '/../packages/web-api/src/types/response/index.ts' File.truncate(index_file, 0) class TsWriter @@ -29,7 +29,7 @@ def write(root_class_name, json_path, typedef_filepath, input_json) Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr| stdin.write(input_json) stdin.close() - source = "/* eslint-disable */\n#{NOTICE}\nimport { WebAPICallResult } from '../WebClient';\n" + stdout.read + source = "/* eslint-disable */\n#{NOTICE}\nimport { WebAPICallResult } from '../../WebClient';\n" + stdout.read source.gsub!( "export interface #{root_class_name} {", "export type #{root_class_name} = WebAPICallResult & {" @@ -90,7 +90,7 @@ def append_multiple_classes_to_index(classes, class_file_name, index_file) end root_class_name << 'Response' - typedef_filepath = __dir__ + "/../packages/web-api/src/response/#{root_class_name}.ts" + typedef_filepath = __dir__ + "/../packages/web-api/src/types/response/#{root_class_name}.ts" input_json = json_file.read ts_writer.write(root_class_name, json_path, typedef_filepath, input_json) ts_writer.append_to_index(root_class_name, index_file)