From e1eeac9f0b115bd6d816892c852c70b9c1a7283f Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Thu, 5 Sep 2024 12:30:12 +0000 Subject: [PATCH] chore: remove eslint, use biome instead (#2006) --- .github/workflows/ci-build.yml | 2 - biome.json | 32 + lint-configs/.eslintignore | 1 - lint-configs/.eslintrc.js | 337 -- lint-configs/tsconfig.eslint.json | 21 - package.json | 7 - packages/cli-hooks/.eslintignore | 1 - packages/cli-hooks/.eslintrc.cjs | 188 - packages/cli-hooks/biome.json | 4 + packages/cli-hooks/jsconfig.json | 9 +- packages/cli-hooks/package.json | 14 +- packages/cli-hooks/src/check-update.js | 31 +- packages/cli-hooks/src/check-update.spec.js | 28 +- packages/cli-hooks/src/doctor.js | 6 +- packages/cli-hooks/src/doctor.spec.js | 2 +- packages/cli-hooks/src/get-hooks.js | 10 +- packages/cli-hooks/src/get-hooks.spec.js | 2 +- packages/cli-hooks/src/get-manifest.js | 6 +- packages/cli-hooks/src/get-manifest.spec.js | 8 +- packages/cli-hooks/src/protocols.js | 17 +- packages/cli-hooks/src/protocols.spec.js | 19 +- packages/cli-hooks/src/start.js | 10 +- packages/cli-hooks/src/start.spec.js | 18 +- packages/cli-test/.eslintignore | 1 - packages/cli-test/.eslintrc.js | 15 - packages/cli-test/biome.json | 4 + packages/cli-test/package.json | 18 +- packages/cli-test/src/cli/cli-process.spec.ts | 2 +- packages/cli-test/src/cli/cli-process.ts | 6 +- .../cli-test/src/cli/commands/app.spec.ts | 2 +- .../cli-test/src/cli/commands/auth.spec.ts | 2 +- packages/cli-test/src/cli/commands/auth.ts | 47 +- .../src/cli/commands/collaborator.spec.ts | 2 +- .../cli-test/src/cli/commands/collaborator.ts | 4 +- .../cli-test/src/cli/commands/create.spec.ts | 2 +- packages/cli-test/src/cli/commands/create.ts | 4 +- .../cli-test/src/cli/commands/env.spec.ts | 2 +- packages/cli-test/src/cli/commands/env.ts | 6 +- .../src/cli/commands/external-auth.spec.ts | 2 +- .../src/cli/commands/external-auth.ts | 17 +- .../src/cli/commands/function.spec.ts | 2 +- .../cli-test/src/cli/commands/function.ts | 8 +- .../src/cli/commands/manifest.spec.ts | 2 +- .../cli-test/src/cli/commands/manifest.ts | 18 +- .../src/cli/commands/platform.spec.ts | 6 +- .../cli-test/src/cli/commands/platform.ts | 95 +- .../cli-test/src/cli/commands/trigger.spec.ts | 17 +- packages/cli-test/src/cli/commands/trigger.ts | 28 +- packages/cli-test/src/cli/index.spec.ts | 2 +- packages/cli-test/src/cli/index.ts | 14 +- packages/cli-test/src/cli/shell.spec.ts | 34 +- packages/cli-test/src/cli/shell.ts | 66 +- packages/cli-test/src/types/shell.ts | 2 +- packages/cli-test/src/utils/logger.ts | 9 +- packages/cli-test/src/utils/test.ts | 6 +- packages/cli-test/tsconfig.eslint.json | 1 - packages/cli-test/tsconfig.json | 2 +- packages/client/.eslintignore | 1 - packages/client/.eslintrc.js | 1 - packages/client/tsconfig.eslint.json | 1 - packages/events-api/.eslintignore | 1 - packages/events-api/.eslintrc.js | 1 - packages/events-api/tsconfig.eslint.json | 1 - packages/interactive-messages/.eslintignore | 1 - packages/interactive-messages/.eslintrc.js | 1 - .../interactive-messages/tsconfig.eslint.json | 1 - packages/logger/.eslintignore | 1 - packages/logger/.eslintrc.js | 1 - packages/logger/.mocharc.json | 2 +- packages/logger/.vscode/launch.json | 38 +- packages/logger/.vscode/settings.json | 2 +- packages/logger/api-extractor.json | 34 - packages/logger/biome.json | 4 + packages/logger/package.json | 25 +- packages/logger/src/index.spec.js | 12 +- packages/logger/src/index.ts | 20 +- packages/logger/tsconfig.eslint.json | 1 - packages/logger/tsconfig.json | 11 +- packages/oauth/.eslintignore | 1 - packages/oauth/.eslintrc.js | 1 - packages/oauth/.vscode/launch.json | 45 +- packages/oauth/.vscode/settings.json | 2 +- packages/oauth/api-extractor.json | 34 - packages/oauth/biome.json | 4 + packages/oauth/package.json | 28 +- packages/oauth/src/callback-options.spec.ts | 13 +- packages/oauth/src/callback-options.ts | 16 +- ...fault-render-html-for-install-path.spec.js | 11 - ...fault-render-html-for-install-path.spec.ts | 10 + .../oauth/src/install-path-options.spec.ts | 6 +- packages/oauth/src/install-path-options.ts | 5 +- .../src/install-provider-options.spec.ts | 2 +- .../oauth/src/install-provider-options.ts | 12 +- ...vider.spec.js => install-provider.spec.ts} | 774 ++-- packages/oauth/src/install-provider.ts | 173 +- .../oauth/src/install-url-options.spec.ts | 11 +- packages/oauth/src/installation-query.spec.ts | 2 +- packages/oauth/src/installation-query.ts | 2 +- .../installation-stores/file-store.spec.js | 118 +- .../src/installation-stores/file-store.ts | 28 +- .../src/installation-stores/interface.ts | 18 +- .../installation-stores/memory-store.spec.js | 4 +- .../src/installation-stores/memory-store.ts | 9 +- packages/oauth/src/installation.spec.ts | 2 +- packages/oauth/src/installation.ts | 50 +- .../src/{logger.spec.js => logger.spec.ts} | 11 +- packages/oauth/src/logger.ts | 6 +- .../src/state-stores/clear-state-store.ts | 23 +- .../src/state-stores/file-state-store.spec.ts | 2 +- .../src/state-stores/file-state-store.ts | 36 +- packages/oauth/src/state-stores/interface.ts | 4 +- packages/oauth/src/state-stores/spec-utils.ts | 43 +- packages/oauth/tsconfig.eslint.json | 1 - packages/oauth/tsconfig.json | 12 +- packages/rtm-api/.eslintignore | 1 - packages/rtm-api/.eslintrc.js | 1 - packages/rtm-api/.mocharc.json | 2 +- packages/rtm-api/.vscode/settings.json | 2 +- packages/rtm-api/api-extractor.json | 34 - packages/rtm-api/biome.json | 4 + packages/rtm-api/package.json | 33 +- packages/rtm-api/src/KeepAlive.ts | 52 +- packages/rtm-api/src/RTMClient.ts | 457 ++- packages/rtm-api/src/errors.ts | 22 +- packages/rtm-api/src/logger.ts | 6 +- packages/rtm-api/test/integration.spec.js | 32 +- packages/rtm-api/tsconfig.eslint.json | 1 - packages/rtm-api/tsconfig.json | 11 +- packages/socket-mode/.eslintignore | 1 - packages/socket-mode/.eslintrc.js | 1 - packages/socket-mode/.vscode/settings.json | 2 +- packages/socket-mode/biome.json | 4 + .../examples/manually-connecting.js | 23 +- packages/socket-mode/examples/proxy.js | 10 +- packages/socket-mode/examples/simple.js | 6 +- packages/socket-mode/package.json | 14 +- .../socket-mode/src/SlackWebSocket.spec.ts | 17 +- packages/socket-mode/src/SlackWebSocket.ts | 28 +- .../socket-mode/src/SocketModeClient.spec.ts | 13 +- packages/socket-mode/src/SocketModeClient.ts | 87 +- packages/socket-mode/src/SocketModeOptions.ts | 2 +- .../src/UnrecoverableSocketModeStartError.ts | 2 - packages/socket-mode/src/errors.ts | 24 +- packages/socket-mode/src/logger.ts | 4 +- packages/socket-mode/test/integration.spec.js | 175 +- packages/socket-mode/tsconfig.eslint.json | 1 - packages/socket-mode/tsconfig.json | 26 +- packages/types/.eslintignore | 1 - packages/types/.eslintrc.js | 1 - packages/types/.vscode/settings.json | 2 +- packages/types/api-extractor.json | 34 - packages/types/biome.json | 4 + packages/types/package.json | 27 +- .../types/src/block-kit/block-elements.ts | 123 +- packages/types/src/block-kit/blocks.ts | 70 +- .../src/block-kit/composition-objects.ts | 15 +- packages/types/src/block-kit/extensions.ts | 4 +- packages/types/src/events/app.ts | 10 +- packages/types/src/events/channel.ts | 18 +- packages/types/src/events/function.ts | 2 +- packages/types/src/events/index.ts | 50 +- packages/types/src/events/message-metadata.ts | 8 +- packages/types/src/events/message.ts | 10 +- packages/types/src/events/pin.ts | 8 +- packages/types/src/events/steps-from-apps.ts | 2 +- packages/types/src/events/team.ts | 18 +- packages/types/src/events/user.ts | 68 +- packages/types/src/message-attachments.ts | 6 +- packages/types/src/message-metadata.ts | 4 +- packages/types/src/views.ts | 4 +- packages/types/test/views.test-d.ts | 2 +- packages/types/tsconfig.eslint.json | 1 - packages/types/tsconfig.json | 11 +- packages/web-api/.eslintignore | 1 - packages/web-api/.eslintrc.js | 1 - packages/web-api/.vscode/launch.json | 16 +- packages/web-api/.vscode/settings.json | 2 +- packages/web-api/api-extractor.json | 34 - packages/web-api/biome.json | 19 + packages/web-api/package.json | 33 +- packages/web-api/src/WebClient.spec.js | 1678 -------- packages/web-api/src/WebClient.spec.ts | 1350 ++++++ packages/web-api/src/WebClient.ts | 550 +-- packages/web-api/src/errors.ts | 24 +- ...ile-upload.spec.js => file-upload.spec.ts} | 286 +- packages/web-api/src/file-upload.ts | 163 +- packages/web-api/src/instrument.ts | 20 +- packages/web-api/src/logger.ts | 6 +- packages/web-api/src/methods.ts | 579 ++- packages/web-api/src/retry-policies.ts | 6 +- packages/web-api/src/types/helpers.ts | 2 +- .../src/types/request/admin/analytics.ts | 6 +- .../web-api/src/types/request/admin/apps.ts | 88 +- .../web-api/src/types/request/admin/auth.ts | 7 +- .../src/types/request/admin/barriers.ts | 2 +- .../src/types/request/admin/conversations.ts | 148 +- .../web-api/src/types/request/admin/emoji.ts | 2 +- .../src/types/request/admin/functions.ts | 3 +- .../src/types/request/admin/inviteRequests.ts | 30 +- .../web-api/src/types/request/admin/roles.ts | 24 +- .../web-api/src/types/request/admin/teams.ts | 2 +- .../src/types/request/admin/usergroups.ts | 7 +- .../web-api/src/types/request/admin/users.ts | 53 +- .../src/types/request/admin/workflows.ts | 35 +- packages/web-api/src/types/request/api.ts | 2 +- packages/web-api/src/types/request/apps.ts | 9 +- packages/web-api/src/types/request/auth.ts | 37 +- packages/web-api/src/types/request/bots.ts | 13 +- packages/web-api/src/types/request/calls.ts | 2 +- packages/web-api/src/types/request/canvas.ts | 36 +- packages/web-api/src/types/request/chat.ts | 189 +- packages/web-api/src/types/request/common.ts | 9 + .../src/types/request/conversations.ts | 132 +- packages/web-api/src/types/request/dialog.ts | 2 +- packages/web-api/src/types/request/dnd.ts | 15 +- packages/web-api/src/types/request/emoji.ts | 14 +- packages/web-api/src/types/request/files.ts | 85 +- packages/web-api/src/types/request/index.ts | 292 +- .../web-api/src/types/request/manifest.ts | 10 +- packages/web-api/src/types/request/openid.ts | 2 +- packages/web-api/src/types/request/pins.ts | 2 +- .../web-api/src/types/request/reactions.ts | 33 +- .../web-api/src/types/request/reminders.ts | 6 +- packages/web-api/src/types/request/rtm.ts | 59 +- packages/web-api/src/types/request/search.ts | 11 +- packages/web-api/src/types/request/stars.ts | 13 +- packages/web-api/src/types/request/team.ts | 126 +- .../web-api/src/types/request/usergroups.ts | 35 +- packages/web-api/src/types/request/users.ts | 17 +- packages/web-api/src/types/request/views.ts | 16 +- .../web-api/src/types/request/workflows.ts | 8 +- .../response/AdminAnalyticsGetFileResponse.ts | 112 +- .../AdminAppsActivitiesListResponse.ts | 101 +- .../response/AdminAppsApproveResponse.ts | 10 +- .../response/AdminAppsApprovedListResponse.ts | 72 +- .../AdminAppsClearResolutionResponse.ts | 10 +- .../response/AdminAppsConfigLookupResponse.ts | 18 +- .../response/AdminAppsConfigSetResponse.ts | 8 +- .../AdminAppsRequestsCancelResponse.ts | 10 +- .../response/AdminAppsRequestsListResponse.ts | 82 +- .../response/AdminAppsRestrictResponse.ts | 10 +- .../AdminAppsRestrictedListResponse.ts | 72 +- .../response/AdminAppsUninstallResponse.ts | 10 +- .../AdminAuthPolicyAssignEntitiesResponse.ts | 10 +- .../AdminAuthPolicyGetEntitiesResponse.ts | 16 +- .../AdminAuthPolicyRemoveEntitiesResponse.ts | 10 +- .../response/AdminBarriersCreateResponse.ts | 24 +- .../response/AdminBarriersDeleteResponse.ts | 8 +- .../response/AdminBarriersListResponse.ts | 20 +- .../response/AdminBarriersUpdateResponse.ts | 22 +- .../AdminConversationsArchiveResponse.ts | 8 +- .../AdminConversationsBulkArchiveResponse.ts | 16 +- .../AdminConversationsBulkDeleteResponse.ts | 16 +- .../AdminConversationsBulkMoveResponse.ts | 16 +- ...inConversationsConvertToPrivateResponse.ts | 8 +- ...minConversationsConvertToPublicResponse.ts | 10 +- .../AdminConversationsCreateResponse.ts | 12 +- .../AdminConversationsDeleteResponse.ts | 8 +- ...inConversationsDisconnectSharedResponse.ts | 8 +- ...istOriginalConnectedChannelInfoResponse.ts | 8 +- ...nversationsGetConversationPrefsResponse.ts | 20 +- ...ConversationsGetCustomRetentionResponse.ts | 12 +- .../AdminConversationsGetTeamsResponse.ts | 8 +- .../AdminConversationsInviteResponse.ts | 10 +- .../AdminConversationsLookupResponse.ts | 12 +- ...versationsRemoveCustomRetentionResponse.ts | 8 +- .../AdminConversationsRenameResponse.ts | 8 +- ...ersationsRestrictAccessAddGroupResponse.ts | 10 +- ...sationsRestrictAccessListGroupsResponse.ts | 12 +- ...ationsRestrictAccessRemoveGroupResponse.ts | 10 +- .../AdminConversationsSearchResponse.ts | 110 +- ...nversationsSetConversationPrefsResponse.ts | 8 +- ...ConversationsSetCustomRetentionResponse.ts | 8 +- .../AdminConversationsSetTeamsResponse.ts | 10 +- .../AdminConversationsUnarchiveResponse.ts | 8 +- .../AdminConversationsWhitelistAddResponse.ts | 12 +- ...telistListGroupsLinkedToChannelResponse.ts | 14 +- ...minConversationsWhitelistRemoveResponse.ts | 12 +- .../response/AdminEmojiAddAliasResponse.ts | 10 +- .../types/response/AdminEmojiAddResponse.ts | 10 +- .../types/response/AdminEmojiListResponse.ts | 16 +- .../response/AdminEmojiRemoveResponse.ts | 10 +- .../response/AdminEmojiRenameResponse.ts | 10 +- .../response/AdminFunctionsListResponse.ts | 44 +- ...AdminFunctionsPermissionsLookupResponse.ts | 29 +- .../AdminFunctionsPermissionsSetResponse.ts | 10 +- .../AdminInviteRequestsApproveResponse.ts | 8 +- ...AdminInviteRequestsApprovedListResponse.ts | 42 +- .../AdminInviteRequestsDeniedListResponse.ts | 28 +- .../AdminInviteRequestsDenyResponse.ts | 8 +- .../AdminInviteRequestsListResponse.ts | 26 +- .../AdminRolesAddAssignmentsResponse.ts | 12 +- .../AdminRolesListAssignmentsResponse.ts | 20 +- .../AdminRolesRemoveAssignmentsResponse.ts | 8 +- .../response/AdminTeamsAdminsListResponse.ts | 12 +- .../response/AdminTeamsCreateResponse.ts | 12 +- .../types/response/AdminTeamsListResponse.ts | 22 +- .../response/AdminTeamsOwnersListResponse.ts | 12 +- .../AdminTeamsSettingsInfoResponse.ts | 48 +- ...TeamsSettingsSetDefaultChannelsResponse.ts | 10 +- ...dminTeamsSettingsSetDescriptionResponse.ts | 8 +- ...TeamsSettingsSetDiscoverabilityResponse.ts | 8 +- .../AdminTeamsSettingsSetIconResponse.ts | 10 +- .../AdminTeamsSettingsSetNameResponse.ts | 8 +- .../AdminUsergroupsAddChannelsResponse.ts | 8 +- .../AdminUsergroupsAddTeamsResponse.ts | 8 +- .../AdminUsergroupsListChannelsResponse.ts | 74 +- .../AdminUsergroupsRemoveChannelsResponse.ts | 8 +- .../response/AdminUsersAssignResponse.ts | 8 +- .../response/AdminUsersInviteResponse.ts | 10 +- .../types/response/AdminUsersListResponse.ts | 46 +- .../response/AdminUsersRemoveResponse.ts | 8 +- .../AdminUsersSessionClearSettingsResponse.ts | 8 +- .../AdminUsersSessionGetSettingsResponse.ts | 16 +- .../AdminUsersSessionInvalidateResponse.ts | 10 +- .../response/AdminUsersSessionListResponse.ts | 28 +- .../AdminUsersSessionResetBulkResponse.ts | 8 +- .../AdminUsersSessionResetResponse.ts | 8 +- .../AdminUsersSessionSetSettingsResponse.ts | 8 +- .../response/AdminUsersSetAdminResponse.ts | 8 +- .../AdminUsersSetExpirationResponse.ts | 8 +- .../response/AdminUsersSetOwnerResponse.ts | 8 +- .../response/AdminUsersSetRegularResponse.ts | 8 +- ...nUsersUnsupportedVersionsExportResponse.ts | 8 +- .../AdminWorkflowsCollaboratorsAddResponse.ts | 16 +- ...minWorkflowsCollaboratorsRemoveResponse.ts | 14 +- ...AdminWorkflowsPermissionsLookupResponse.ts | 20 +- .../response/AdminWorkflowsSearchResponse.ts | 72 +- .../AdminWorkflowsUnpublishResponse.ts | 10 +- .../src/types/response/ApiTestResponse.ts | 12 +- .../response/AppsConnectionsOpenResponse.ts | 10 +- .../AppsEventAuthorizationsListResponse.ts | 18 +- .../response/AppsManifestCreateResponse.ts | 30 +- .../response/AppsManifestDeleteResponse.ts | 8 +- .../response/AppsManifestExportResponse.ts | 100 +- .../response/AppsManifestUpdateResponse.ts | 12 +- .../response/AppsManifestValidateResponse.ts | 18 +- .../response/AppsPermissionsInfoResponse.ts | 8 +- .../AppsPermissionsRequestResponse.ts | 8 +- .../AppsPermissionsResourcesListResponse.ts | 8 +- .../AppsPermissionsScopesListResponse.ts | 8 +- .../AppsPermissionsUsersListResponse.ts | 8 +- .../AppsPermissionsUsersRequestResponse.ts | 8 +- .../types/response/AppsUninstallResponse.ts | 10 +- .../src/types/response/AuthRevokeResponse.ts | 8 +- .../types/response/AuthTeamsListResponse.ts | 28 +- .../src/types/response/AuthTestResponse.ts | 30 +- .../types/response/BookmarksAddResponse.ts | 40 +- .../types/response/BookmarksEditResponse.ts | 40 +- .../types/response/BookmarksListResponse.ts | 40 +- .../types/response/BookmarksRemoveResponse.ts | 10 +- .../src/types/response/BotsInfoResponse.ts | 18 +- .../src/types/response/CallsAddResponse.ts | 32 +- .../src/types/response/CallsEndResponse.ts | 34 +- .../src/types/response/CallsInfoResponse.ts | 32 +- .../response/CallsParticipantsAddResponse.ts | 32 +- .../CallsParticipantsRemoveResponse.ts | 32 +- .../src/types/response/CallsUpdateResponse.ts | 32 +- .../response/CanvasesAccessDeleteResponse.ts | 17 +- .../response/CanvasesAccessSetResponse.ts | 17 +- .../types/response/CanvasesCreateResponse.ts | 14 +- .../types/response/CanvasesDeleteResponse.ts | 13 +- .../types/response/CanvasesEditResponse.ts | 12 +- .../CanvasesSectionsLookupResponse.ts | 12 +- .../types/response/ChannelsArchiveResponse.ts | 8 +- .../types/response/ChannelsCreateResponse.ts | 56 +- .../types/response/ChannelsHistoryResponse.ts | 480 +-- .../types/response/ChannelsInfoResponse.ts | 374 +- .../types/response/ChannelsInviteResponse.ts | 66 +- .../types/response/ChannelsJoinResponse.ts | 66 +- .../types/response/ChannelsKickResponse.ts | 8 +- .../types/response/ChannelsLeaveResponse.ts | 8 +- .../types/response/ChannelsListResponse.ts | 58 +- .../types/response/ChannelsMarkResponse.ts | 8 +- .../types/response/ChannelsRenameResponse.ts | 48 +- .../types/response/ChannelsRepliesResponse.ts | 50 +- .../response/ChannelsSetPurposeResponse.ts | 10 +- .../response/ChannelsSetTopicResponse.ts | 10 +- .../response/ChannelsUnarchiveResponse.ts | 8 +- .../src/types/response/ChatDeleteResponse.ts | 12 +- .../ChatDeleteScheduledMessageResponse.ts | 8 +- .../response/ChatGetPermalinkResponse.ts | 12 +- .../types/response/ChatMeMessageResponse.ts | 12 +- .../response/ChatPostEphemeralResponse.ts | 10 +- .../types/response/ChatPostMessageResponse.ts | 1887 +++++---- .../response/ChatScheduleMessageResponse.ts | 993 +++-- .../ChatScheduledMessagesListResponse.ts | 20 +- .../src/types/response/ChatUnfurlResponse.ts | 8 +- .../src/types/response/ChatUpdateResponse.ts | 1005 +++-- ...ConversationsAcceptSharedInviteResponse.ts | 16 +- ...onversationsApproveSharedInviteResponse.ts | 8 +- .../response/ConversationsArchiveResponse.ts | 8 +- .../ConversationsCanvasesCreateResponse.ts | 14 +- .../response/ConversationsCloseResponse.ts | 12 +- .../response/ConversationsCreateResponse.ts | 76 +- ...onversationsDeclineSharedInviteResponse.ts | 8 +- ...onsExternalInvitePermissionsSetResponse.ts | 8 +- .../response/ConversationsHistoryResponse.ts | 1913 +++++---- .../response/ConversationsInfoResponse.ts | 90 +- .../response/ConversationsInviteResponse.ts | 78 +- .../ConversationsInviteSharedResponse.ts | 16 +- .../response/ConversationsJoinResponse.ts | 90 +- .../response/ConversationsKickResponse.ts | 8 +- .../response/ConversationsLeaveResponse.ts | 8 +- ...ConversationsListConnectInvitesResponse.ts | 132 +- .../response/ConversationsListResponse.ts | 100 +- .../response/ConversationsMarkResponse.ts | 8 +- .../response/ConversationsMembersResponse.ts | 12 +- .../response/ConversationsOpenResponse.ts | 948 ++--- .../response/ConversationsRenameResponse.ts | 72 +- .../response/ConversationsRepliesResponse.ts | 1863 +++++---- .../ConversationsSetPurposeResponse.ts | 66 +- .../response/ConversationsSetTopicResponse.ts | 66 +- .../ConversationsUnarchiveResponse.ts | 8 +- .../src/types/response/DialogOpenResponse.ts | 12 +- .../src/types/response/DndEndDndResponse.ts | 8 +- .../types/response/DndEndSnoozeResponse.ts | 16 +- .../src/types/response/DndInfoResponse.ts | 14 +- .../types/response/DndSetSnoozeResponse.ts | 16 +- .../src/types/response/DndTeamInfoResponse.ts | 14 +- .../src/types/response/EmojiListResponse.ts | 18 +- .../response/FilesCommentsAddResponse.ts | 10 +- .../response/FilesCommentsDeleteResponse.ts | 8 +- .../response/FilesCommentsEditResponse.ts | 20 +- .../FilesCompleteUploadExternalResponse.ts | 138 +- .../src/types/response/FilesDeleteResponse.ts | 8 +- .../FilesGetUploadURLExternalResponse.ts | 14 +- .../src/types/response/FilesInfoResponse.ts | 746 ++-- .../src/types/response/FilesListResponse.ts | 734 ++-- .../types/response/FilesRemoteAddResponse.ts | 730 ++-- .../types/response/FilesRemoteInfoResponse.ts | 730 ++-- .../types/response/FilesRemoteListResponse.ts | 732 ++-- .../response/FilesRemoteRemoveResponse.ts | 8 +- .../response/FilesRemoteShareResponse.ts | 730 ++-- .../response/FilesRemoteUpdateResponse.ts | 730 ++-- .../response/FilesRevokePublicURLResponse.ts | 730 ++-- .../response/FilesSharedPublicURLResponse.ts | 730 ++-- .../src/types/response/FilesUploadResponse.ts | 730 ++-- .../FunctionsCompleteErrorResponse.ts | 8 +- .../FunctionsCompleteSuccessResponse.ts | 8 +- .../types/response/GroupsArchiveResponse.ts | 12 +- .../src/types/response/GroupsCloseResponse.ts | 8 +- .../response/GroupsCreateChildResponse.ts | 58 +- .../types/response/GroupsCreateResponse.ts | 48 +- .../types/response/GroupsHistoryResponse.ts | 26 +- .../src/types/response/GroupsInfoResponse.ts | 56 +- .../types/response/GroupsInviteResponse.ts | 58 +- .../src/types/response/GroupsKickResponse.ts | 12 +- .../src/types/response/GroupsLeaveResponse.ts | 12 +- .../src/types/response/GroupsListResponse.ts | 46 +- .../src/types/response/GroupsMarkResponse.ts | 12 +- .../src/types/response/GroupsOpenResponse.ts | 16 +- .../types/response/GroupsRenameResponse.ts | 38 +- .../types/response/GroupsRepliesResponse.ts | 52 +- .../response/GroupsSetPurposeResponse.ts | 14 +- .../types/response/GroupsSetTopicResponse.ts | 14 +- .../types/response/GroupsUnarchiveResponse.ts | 12 +- .../src/types/response/ImCloseResponse.ts | 12 +- .../src/types/response/ImHistoryResponse.ts | 160 +- .../src/types/response/ImListResponse.ts | 32 +- .../src/types/response/ImMarkResponse.ts | 12 +- .../src/types/response/ImOpenResponse.ts | 18 +- .../src/types/response/ImRepliesResponse.ts | 52 +- .../response/MigrationExchangeResponse.ts | 18 +- .../src/types/response/MpimCloseResponse.ts | 12 +- .../src/types/response/MpimHistoryResponse.ts | 56 +- .../src/types/response/MpimListResponse.ts | 44 +- .../src/types/response/MpimMarkResponse.ts | 12 +- .../src/types/response/MpimOpenResponse.ts | 74 +- .../src/types/response/MpimRepliesResponse.ts | 52 +- .../src/types/response/OauthAccessResponse.ts | 54 +- .../src/types/response/OauthTokenResponse.ts | 10 +- .../types/response/OauthV2AccessResponse.ts | 52 +- .../types/response/OauthV2ExchangeResponse.ts | 54 +- .../response/OpenIDConnectTokenResponse.ts | 20 +- .../response/OpenIDConnectUserInfoResponse.ts | 70 +- .../src/types/response/PinsAddResponse.ts | 8 +- .../src/types/response/PinsListResponse.ts | 738 ++-- .../src/types/response/PinsRemoveResponse.ts | 8 +- .../types/response/ReactionsAddResponse.ts | 8 +- .../types/response/ReactionsGetResponse.ts | 991 +++-- .../types/response/ReactionsListResponse.ts | 1883 +++++---- .../types/response/ReactionsRemoveResponse.ts | 8 +- .../types/response/RemindersAddResponse.ts | 24 +- .../response/RemindersCompleteResponse.ts | 8 +- .../types/response/RemindersDeleteResponse.ts | 8 +- .../types/response/RemindersInfoResponse.ts | 20 +- .../types/response/RemindersListResponse.ts | 28 +- .../src/types/response/RtmConnectResponse.ts | 20 +- .../src/types/response/RtmStartResponse.ts | 3639 ++++++++--------- .../src/types/response/SearchAllResponse.ts | 2121 +++++----- .../src/types/response/SearchFilesResponse.ts | 2035 +++++---- .../types/response/SearchMessagesResponse.ts | 1901 +++++---- .../src/types/response/StarsAddResponse.ts | 8 +- .../src/types/response/StarsListResponse.ts | 1106 ++--- .../src/types/response/StarsRemoveResponse.ts | 8 +- .../types/response/TeamAccessLogsResponse.ts | 32 +- .../response/TeamBillableInfoResponse.ts | 12 +- .../types/response/TeamBillingInfoResponse.ts | 10 +- .../TeamExternalTeamsDisconnectResponse.ts | 10 +- .../response/TeamExternalTeamsListResponse.ts | 126 +- .../src/types/response/TeamInfoResponse.ts | 50 +- .../response/TeamIntegrationLogsResponse.ts | 44 +- .../response/TeamPreferencesListResponse.ts | 18 +- .../types/response/TeamProfileGetResponse.ts | 50 +- .../response/ToolingTokensRotateResponse.ts | 22 +- .../response/UsergroupsCreateResponse.ts | 46 +- .../response/UsergroupsDisableResponse.ts | 48 +- .../response/UsergroupsEnableResponse.ts | 46 +- .../types/response/UsergroupsListResponse.ts | 48 +- .../response/UsergroupsUpdateResponse.ts | 46 +- .../response/UsergroupsUsersListResponse.ts | 10 +- .../response/UsergroupsUsersUpdateResponse.ts | 46 +- .../response/UsersConversationsResponse.ts | 106 +- .../response/UsersDeletePhotoResponse.ts | 8 +- ...UsersDiscoverableContactsLookupResponse.ts | 12 +- .../response/UsersGetPresenceResponse.ts | 22 +- .../types/response/UsersIdentityResponse.ts | 30 +- .../src/types/response/UsersInfoResponse.ts | 144 +- .../src/types/response/UsersListResponse.ts | 159 +- .../response/UsersLookupByEmailResponse.ts | 120 +- .../types/response/UsersProfileGetResponse.ts | 76 +- .../types/response/UsersProfileSetResponse.ts | 76 +- .../types/response/UsersSetActiveResponse.ts | 8 +- .../types/response/UsersSetPhotoResponse.ts | 26 +- .../response/UsersSetPresenceResponse.ts | 8 +- .../src/types/response/ViewsOpenResponse.ts | 361 +- .../types/response/ViewsPublishResponse.ts | 361 +- .../src/types/response/ViewsPushResponse.ts | 361 +- .../src/types/response/ViewsUpdateResponse.ts | 361 +- .../WorkflowsStepCompletedResponse.ts | 8 +- .../response/WorkflowsStepFailedResponse.ts | 8 +- .../response/WorkflowsUpdateStepResponse.ts | 8 +- packages/web-api/src/types/response/index.ts | 7 +- .../integration/commonjs-project/index.js | 25 +- .../test/integration/esm-project/index.mjs | 10 +- .../integration/ts-4.7-project/tsconfig.json | 6 +- .../types/methods/admin.analytics.test-d.ts | 88 +- .../test/types/methods/admin.apps.test-d.ts | 494 ++- .../test/types/methods/admin.auth.test-d.ts | 140 +- .../types/methods/admin.barriers.test-d.ts | 254 +- .../methods/admin.conversations.test-d.ts | 488 ++- .../test/types/methods/admin.emoji.test-d.ts | 86 +- .../types/methods/admin.functions.test-d.ts | 50 +- .../methods/admin.inviteRequests.test-d.ts | 76 +- .../test/types/methods/admin.roles.test-d.ts | 180 +- .../test/types/methods/admin.teams.test-d.ts | 190 +- .../types/methods/admin.usergroups.test-d.ts | 116 +- .../test/types/methods/admin.users.test-d.ts | 424 +- .../types/methods/admin.workflows.test-d.ts | 132 +- .../web-api/test/types/methods/apps.test-d.ts | 123 +- .../test/types/methods/bookmarks.test-d.ts | 238 +- .../test/types/methods/calls.test-d.ts | 102 +- .../test/types/methods/canvas.test-d.ts | 319 +- .../web-api/test/types/methods/chat.test-d.ts | 1092 +++-- .../types/methods/conversations.test-d.ts | 398 +- .../test/types/methods/dialog.test-d.ts | 26 +- .../web-api/test/types/methods/dnd.test-d.ts | 16 +- .../test/types/methods/files.test-d.ts | 284 +- .../test/types/methods/functions.test-d.ts | 52 +- .../test/types/methods/migration.test-d.ts | 8 +- .../test/types/methods/oauth.test-d.ts | 112 +- .../test/types/methods/openid.test-d.ts | 24 +- .../web-api/test/types/methods/pins.test-d.ts | 56 +- .../test/types/methods/reactions.test-d.ts | 168 +- .../test/types/methods/reminders.test-d.ts | 98 +- .../test/types/methods/search.test-d.ts | 24 +- .../web-api/test/types/methods/team.test-d.ts | 8 +- .../test/types/methods/tooling.test-d.ts | 8 +- .../test/types/methods/usergroups.test-d.ts | 50 +- .../test/types/methods/users.test-d.ts | 32 +- .../test/types/methods/views.test-d.ts | 221 +- .../test/types/webclient-no-token.test-d.ts | 16 +- .../types/webclient-paginate-types.test-d.ts | 43 +- packages/web-api/tsconfig.eslint.json | 1 - packages/web-api/tsconfig.json | 6 +- packages/webhook/.eslintignore | 1 - packages/webhook/.eslintrc.js | 1 - packages/webhook/.gitignore | 1 - packages/webhook/.vscode/launch.json | 38 +- packages/webhook/.vscode/settings.json | 2 +- packages/webhook/api-extractor.json | 34 - packages/webhook/biome.json | 4 + packages/webhook/package.json | 32 +- packages/webhook/src/IncomingWebhook.spec.js | 137 - packages/webhook/src/IncomingWebhook.spec.ts | 114 + packages/webhook/src/IncomingWebhook.ts | 20 +- packages/webhook/src/errors.ts | 6 +- packages/webhook/src/instrument.ts | 19 +- packages/webhook/tsconfig.eslint.json | 1 - packages/webhook/tsconfig.json | 11 +- scripts/code_generator.rb | 2 +- 592 files changed, 29252 insertions(+), 28270 deletions(-) create mode 100644 biome.json delete mode 100644 lint-configs/.eslintignore delete mode 100644 lint-configs/.eslintrc.js delete mode 100644 lint-configs/tsconfig.eslint.json delete mode 100644 package.json delete mode 120000 packages/cli-hooks/.eslintignore delete mode 100644 packages/cli-hooks/.eslintrc.cjs create mode 100644 packages/cli-hooks/biome.json mode change 100644 => 100755 packages/cli-hooks/src/check-update.spec.js mode change 100644 => 100755 packages/cli-hooks/src/doctor.spec.js mode change 100644 => 100755 packages/cli-hooks/src/get-hooks.spec.js mode change 100644 => 100755 packages/cli-hooks/src/get-manifest.spec.js mode change 100644 => 100755 packages/cli-hooks/src/protocols.js mode change 100644 => 100755 packages/cli-hooks/src/protocols.spec.js mode change 100644 => 100755 packages/cli-hooks/src/start.spec.js delete mode 120000 packages/cli-test/.eslintignore delete mode 100644 packages/cli-test/.eslintrc.js create mode 100644 packages/cli-test/biome.json delete mode 120000 packages/cli-test/tsconfig.eslint.json delete mode 120000 packages/client/.eslintignore delete mode 120000 packages/client/.eslintrc.js delete mode 120000 packages/client/tsconfig.eslint.json delete mode 120000 packages/events-api/.eslintignore delete mode 120000 packages/events-api/.eslintrc.js delete mode 120000 packages/events-api/tsconfig.eslint.json delete mode 120000 packages/interactive-messages/.eslintignore delete mode 120000 packages/interactive-messages/.eslintrc.js delete mode 120000 packages/interactive-messages/tsconfig.eslint.json delete mode 120000 packages/logger/.eslintignore delete mode 120000 packages/logger/.eslintrc.js delete mode 100644 packages/logger/api-extractor.json create mode 100644 packages/logger/biome.json delete mode 120000 packages/logger/tsconfig.eslint.json delete mode 120000 packages/oauth/.eslintignore delete mode 120000 packages/oauth/.eslintrc.js delete mode 100644 packages/oauth/api-extractor.json create mode 100644 packages/oauth/biome.json delete mode 100644 packages/oauth/src/default-render-html-for-install-path.spec.js create mode 100644 packages/oauth/src/default-render-html-for-install-path.spec.ts rename packages/oauth/src/{install-provider.spec.js => install-provider.spec.ts} (57%) rename packages/oauth/src/{logger.spec.js => logger.spec.ts} (59%) delete mode 120000 packages/oauth/tsconfig.eslint.json delete mode 120000 packages/rtm-api/.eslintignore delete mode 120000 packages/rtm-api/.eslintrc.js delete mode 100644 packages/rtm-api/api-extractor.json create mode 100644 packages/rtm-api/biome.json delete mode 120000 packages/rtm-api/tsconfig.eslint.json delete mode 120000 packages/socket-mode/.eslintignore delete mode 120000 packages/socket-mode/.eslintrc.js create mode 100644 packages/socket-mode/biome.json delete mode 120000 packages/socket-mode/tsconfig.eslint.json delete mode 120000 packages/types/.eslintignore delete mode 120000 packages/types/.eslintrc.js delete mode 100644 packages/types/api-extractor.json create mode 100644 packages/types/biome.json delete mode 120000 packages/types/tsconfig.eslint.json delete mode 120000 packages/web-api/.eslintignore delete mode 120000 packages/web-api/.eslintrc.js delete mode 100644 packages/web-api/api-extractor.json create mode 100644 packages/web-api/biome.json delete mode 100644 packages/web-api/src/WebClient.spec.js create mode 100644 packages/web-api/src/WebClient.spec.ts rename packages/web-api/src/{file-upload.spec.js => file-upload.spec.ts} (70%) delete mode 120000 packages/web-api/tsconfig.eslint.json delete mode 120000 packages/webhook/.eslintignore delete mode 120000 packages/webhook/.eslintrc.js delete mode 100644 packages/webhook/api-extractor.json create mode 100644 packages/webhook/biome.json delete mode 100644 packages/webhook/src/IncomingWebhook.spec.js create mode 100644 packages/webhook/src/IncomingWebhook.spec.ts delete mode 120000 packages/webhook/tsconfig.eslint.json diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 2e3bc0abc..e6eb6083a 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -31,8 +31,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm --version - - name: Get Development Dependencies - run: npm i - name: Build and Run Tests in Each Package working-directory: packages/${{ matrix.package }} run: | diff --git a/biome.json b/biome.json new file mode 100644 index 000000000..d4b0246f6 --- /dev/null +++ b/biome.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "formatter": { + "enabled": true, + "formatWithErrors": false, + "ignore": [], + "attributePosition": "auto", + "indentStyle": "space", + "indentWidth": 2, + "lineWidth": 120, + "lineEnding": "lf" + }, + "javascript": { + "formatter": { + "quoteStyle": "single" + } + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "organizeImports": { + "enabled": true + }, + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + } +} diff --git a/lint-configs/.eslintignore b/lint-configs/.eslintignore deleted file mode 100644 index 3c3629e64..000000000 --- a/lint-configs/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/lint-configs/.eslintrc.js b/lint-configs/.eslintrc.js deleted file mode 100644 index 32946c517..000000000 --- a/lint-configs/.eslintrc.js +++ /dev/null @@ -1,337 +0,0 @@ -// -// SlackAPI JavaScript and TypeScript style -// --- -// This style helps maintainers enforce safe and consistent programming practices in this project. It is not meant to be -// comprehensive on its own or vastly different from existing styles. The goal is to inherit and aggregate as many of -// the communities' recommended styles for the technologies used as we can. When, and only when, we have a stated need -// to differentiate, we add more rules (or modify options). Therefore, the fewer rules directly defined in this file, -// the better. - -const jsDocPlugin = require('eslint-plugin-jsdoc'); - -const jsDocRecommendedRulesOff = Object.assign( - ...Object.keys(jsDocPlugin.configs.recommended.rules).map((rule) => ({ [rule]: 'off' })), -); - -const MAX_LINE_LENGTH = 120; - -module.exports = { - // This is a root of the project, ESLint should not look through parent directories to find more config - root: true, - - ignorePatterns: [ - // Ignore all build outputs and artifacts (node_modules, dotfiles, and dot directories are implicitly ignored) - '/dist', - '/coverage', - ], - - // These environments contain lists of global variables which are allowed to be accessed - env: { - // According to https://node.green, the target node version (v10) supports all important ES2018 features. But es2018 - // is not an option since it presumably doesn't introduce any new globals over ES2017. - es2017: true, - node: true, - }, - - extends: [ - // ESLint's recommended built-in rules: https://eslint.org/docs/rules/ - 'eslint:recommended', - - // Node plugin's recommended rules: https://github.com/mysticatea/eslint-plugin-node - 'plugin:node/recommended', - - // AirBnB style guide (without React) rules: https://github.com/airbnb/javascript. - 'airbnb-base', - - // JSDoc plugin's recommended rules - 'plugin:jsdoc/recommended', - ], - - rules: { - // JavaScript rules - // --- - // The top level of this configuration contains rules which apply to JavaScript (and will also be inherited for - // TypeScript). This section does not contain rules meant to override options or disable rules in the base - // configurations (ESLint, Node, AirBnb). Those rules are added in the final override. - - // Eliminate tabs to standardize on spaces for indentation. If you want to use tabs for something other than - // indentation, you may need to turn this rule off using an inline config comments. - 'no-tabs': 'error', - - // Bans use of comma as an operator because it can obscure side effects and is often an accident. - 'no-sequences': 'error', - - // Disallow the use of process.exit() - 'node/no-process-exit': 'error', - - // Allow safe references to functions before the declaration. Overrides AirBnB config. Not located in the override - // section below because a distinct override is necessary in TypeScript files. - 'no-use-before-define': ['error', 'nofunc'], - }, - - overrides: [ - { - files: ['**/*.ts'], - // Allow ESLint to understand TypeScript syntax - parser: '@typescript-eslint/parser', - parserOptions: { - // The following option makes it possible to use rules that require type information - project: './tsconfig.eslint.json', - }, - // Allow ESLint to load rules from the TypeScript plugin - plugins: ['@typescript-eslint', 'import-newlines'], - extends: [ - // TypeScript plugin's recommended rules - 'plugin:@typescript-eslint/recommended', - - // AirBnB style guide (without React), modified for TypeScript rules: https://github.com/iamturns/eslint-config-airbnb-typescript. - 'airbnb-typescript/base', - ], - - rules: { - // TypeScript rules - // --- - // This level of this configuration contains rules which apply only to TypeScript. It also contains rules that - // are meant to override options or disable rules in the base configurations (there are no more base - // configurations in the subsequent overrides). - 'max-classes-per-file': 'off', - - // Disallow invocations of require(). This will help make imports more consistent and ensures a smoother - // transition to the best future syntax. And since this rule affects TypeScript, which is compiled, there's - // no reason we cannot adopt this syntax now. - // NOTE: The `@typescript-eslint/no-require-imports` rule can also achieve the same effect, but it is less - // configurable and only built to provide a migration path from TSLint. - 'import/no-commonjs': ['error', { - allowConditionalRequire: false, - }], - - // Don't verify that all named imports are part of the set of named exports for the referenced module. The - // TypeScript compiler will already perform this check, so it is redundant. - // NOTE: Consider contributing this to the `airbnb-typescript` config. - 'import/named': 'off', - 'node/no-missing-import': 'off', - // Enforce how `import`s can be organized across multiple lines / maximum char lengths - 'import-newlines/enforce': ['error', { - items: 4, // maximum number of import items per line, but all imports must fit within max-len - 'max-len': MAX_LINE_LENGTH, // if imports can be kept to one line AND fit within max-len, great - forceSingleLine: false, // dont force single-line imports as long as the previous two rules are OK - }], - - // Prefer an interface declaration over a type alias because interfaces can be extended, implemented, and merged - '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], - - // Require class properties and methods to explicitly use accessibility modifiers (public, private, protected) - '@typescript-eslint/explicit-member-accessibility': 'error', - - // Forbids an object literal to appear in a type assertion expression unless its used as a parameter (we violate - // this rule for test code, to allow for looser property matching for objects - more in the test-specific rules - // section below). This allows the typechecker to perform validation on the value as an assignment, instead of - // allowing the type assertion to always win. - // Requires use of `as Type` instead of `` for type assertion. Consistency. - '@typescript-eslint/consistent-type-assertions': ['error', { - assertionStyle: 'as', - objectLiteralTypeAssertions: 'allow-as-parameter', - }], - - // Ensure that the values returned from a module are of the expected type - '@typescript-eslint/explicit-module-boundary-types': ['error', { - allowArgumentsExplicitlyTypedAsAny: true, - }], - - // Turns off all JSDoc plugin rules because they don't work consistently in TypeScript contexts. For example, - // it's not an error to export interfaces and types that don't have JSDoc on them without these contexts. Also, - // satisfying some of these rules would require redundant type information in the JSDoc comments, so its in - // conflict with the next rule. - // TODO: track progress on this issue https://github.com/gajus/eslint-plugin-jsdoc/issues/615 - ...jsDocRecommendedRulesOff, - - // No types in JSDoc for @param or @returns. TypeScript will provide this type information, so it would be - // redundant, and possibly conflicting. - 'jsdoc/no-types': 'error', - - // Allow use of import and export syntax, despite it not being supported in the node versions. Since this - // project is transpiled, the ignore option is used. Overrides node/recommended. - // 'node/no-unsupported-features/es-syntax': ['error', { ignores: ['modules'] }], - // TODO: The node plugin's ignore option doesn't work in order to suppress this error. - 'node/no-unsupported-features/es-syntax': 'off', - - // Allow safe references to functions before the declaration. Overrides AirBnB config. Not located in the - // override section below because a distinct override is necessary in JavaScript files. - 'no-use-before-define': 'off', - '@typescript-eslint/no-use-before-define': ['error', 'nofunc'], - // Turn off no-inferrable-types. While it may be obvious what the type of something is by its default - // value, being explicit is good, especially for newcomers. - '@typescript-eslint/no-inferrable-types': 'off', - - 'operator-linebreak': ['error', 'after', { overrides: { - '=': 'none' - }}], - }, - }, - { - files: ['**/*.js', '**/*.ts'], - rules: { - // Override rules - // --- - // This level of this configuration contains rules which override options or disable rules in the base - // configurations in both JavaScript and TypeScript. - - // Increase the max line length to 120. The rest of this setting is copied from the AirBnB config. - 'max-len': ['error', MAX_LINE_LENGTH, 2, { - ignoreUrls: true, - ignoreComments: false, - ignoreRegExpLiterals: true, - ignoreStrings: true, - ignoreTemplateLiterals: true, - }], - - // Restrict the use of backticks to declare a normal string. Template literals should only be used when the - // template string contains placeholders. The rest of this setting is copied from the AirBnb config. - quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }], - - // the server side Slack API uses snake_case for parameters often - // for mocking and override support, we need to allow snake_case - // Allow leading underscores for parameter names, which is used to acknowledge unused variables in TypeScript. - // Also, enforce camelCase naming for variables. Ideally, the leading underscore could be restricted to only - // unused parameter names, but this rule isn't capable of knowing when a variable is unused. The camelcase and - // no-underscore-dangle rules are replaced with the naming-convention rule because this single rule can serve - // both purposes, and it works fine on non-TypeScript code. - camelcase: 'off', - 'no-underscore-dangle': 'off', - '@typescript-eslint/no-unused-vars': [ - 'error', - { - varsIgnorePattern: '^_', - argsIgnorePattern: '^_' - } - ], - '@typescript-eslint/naming-convention': [ - 'error', - { - selector: 'default', - 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 - // section 23.8 of the AirBnB style guide - format: ['camelCase', 'PascalCase', 'UPPER_CASE', 'snake_case'], - leadingUnderscore: 'allow', - }, - { - selector: 'parameter', - format: ['camelCase', 'snake_case'], - leadingUnderscore: 'allow', - }, - { - selector: 'typeLike', - format: ['PascalCase', 'camelCase'], - leadingUnderscore: 'allow', - }, - { - selector: 'typeProperty', - format: ['snake_case', 'camelCase', 'UPPER_CASE'], - }, - { - 'selector': 'objectLiteralProperty', - format: ['camelCase', 'snake_case', 'PascalCase', 'UPPER_CASE'], - }, - { - selector: ['enumMember'], - format: ['PascalCase'], - }, - ], - - // Rules about import ordering/sorting - 'import/order': ['error', { - 'groups': [ - 'builtin', - 'external', - 'internal', - ['parent', 'sibling', 'index'], - 'object', - 'type' - ], - 'newlines-between': 'always', - 'alphabetize': { - 'order': 'asc', - 'caseInsensitive': true - } - }], - 'sort-imports': ['error', { 'ignoreDeclarationSort': true }], - // Allow cyclical imports. Turning this rule on is mainly a way to manage the performance concern for linting - // time. Our projects are not large enough to warrant this. Overrides AirBnB styles. - 'import/no-cycle': 'off', - 'import/prefer-default-export': 'off', - - // Remove the minProperties option for enforcing line breaks between braces. The AirBnB config sets this to 4, - // which is arbitrary and not backed by anything specific in the style guide. If we just remove it, we can - // rely on the max-len rule to determine if the line is too long and then enforce line breaks. Overrides AirBnB - // styles. - 'object-curly-newline': ['error', { multiline: true, consistent: true }], - - }, - }, - { - files: ['src/**/*.spec.ts', 'src/**/*.spec.js'], - rules: { - // Test-specific rules - // --- - // Rules that only apply to Typescript _test_ source files - - // With Mocha as a test framework, it is sometimes helpful to assign - // shared state to Mocha's Context object, for example in setup and - // teardown test methods. Assigning stub/mock objects to the Context - // object via `this` is a common pattern in Mocha. As such, using - // `function` over the the arrow notation binds `this` appropriately and - // should be used in tests. So: we turn off the prefer-arrow-callback - // rule. - // See https://github.com/slackapi/bolt-js/pull/1012#pullrequestreview-711232738 - // for a case of arrow-vs-function syntax coming up for the team - 'prefer-arrow-callback': 'off', - - // Unlike non-test-code, where we require use of `as Type` instead of `` for type assertion, - // in test code using the looser `as Type` syntax leads to easier test writing, since only required - // properties must be adhered to using the `as Type` syntax. - '@typescript-eslint/consistent-type-assertions': ['error', { - assertionStyle: 'as', - objectLiteralTypeAssertions: 'allow', - }], - // Using any types is so useful for mock objects, we are fine with disabling this rule - '@typescript-eslint/no-explicit-any': 'off', - // Some parts in Bolt (e.g., listener arguments) are unnecessarily optional. - // It's okay to omit this validation in tests. - '@typescript-eslint/no-non-null-assertion': 'off', - // Using ununamed functions (e.g., null logger) in tests is fine - 'func-names': 'off', - // Some packages, like socket-mode, use classes, and to test constructors, it may be useful to just create a new Whatever() - 'no-new': 'off', - // In tests, don't force constructing a Symbol with a descriptor, as - // it's probably just for tests - '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 - ], - }], - } - }, - ], -}; - -// Test files globs -// '**/*.spec.ts', -// 'src/test-helpers.ts' diff --git a/lint-configs/tsconfig.eslint.json b/lint-configs/tsconfig.eslint.json deleted file mode 100644 index 13f0cda2f..000000000 --- a/lint-configs/tsconfig.eslint.json +++ /dev/null @@ -1,21 +0,0 @@ -// This config is only used to allow ESLint to use a different include / exclude setting than the actual build -{ - // extend the build config to share compilerOptions - "extends": "./tsconfig.json", - "compilerOptions": { - // Setting "noEmit" prevents misuses of this config such as using it to produce a build - "noEmit": true - }, - "include": [ - // Since extending a config overwrites the entire value for "include", those value are copied here - "src/**/*", - ], - "exclude": [ - // Overwrite exclude from the base config to clear the value - - // Contains external module type definitions, which are not subject to this project's style rules - "types/**/*", - // Contain intentional type checking issues for the purpose of testing the typechecker's output - "types-tests/**/*" - ] -} diff --git a/package.json b/package.json deleted file mode 100644 index 521cfa079..000000000 --- a/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "node-slack-sdk", - "devDependencies": { - "eslint": "^9.9.1", - "eslint-plugin-jsdoc": "^50.2.2" - } -} diff --git a/packages/cli-hooks/.eslintignore b/packages/cli-hooks/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/cli-hooks/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/cli-hooks/.eslintrc.cjs b/packages/cli-hooks/.eslintrc.cjs deleted file mode 100644 index 19f0e0509..000000000 --- a/packages/cli-hooks/.eslintrc.cjs +++ /dev/null @@ -1,188 +0,0 @@ -// SlackAPI JavaScript style -// --- -// This style helps maintainers enforce safe and consistent programming practices in this project. It is not meant to be -// comprehensive on its own or vastly different from existing styles. The goal is to inherit and aggregate as many of -// the communities' recommended styles for the technologies used as we can. When, and only when, we have a stated need -// to differentiate, we add more rules (or modify options). Therefore, the fewer rules directly defined in this file, -// the better. -// -// These styles are a subset of the shared JavaScript and TypeScript configurations to only target JavaScript packages. - -module.exports = { - root: true, - parserOptions: { - ecmaVersion: 2022 - }, - - // Ignore all build outputs and artifacts (node_modules, dotfiles, and dot directories are implicitly ignored) - ignorePatterns: [ - '/coverage', - ], - - // These environments contain lists of global variables which are allowed to be accessed - // - // The target node version (v18) supports all needed ES2022 features: https://node.green - env: { - es2022: true, - node: true, - }, - - extends: [ - // ESLint's recommended built-in rules: https://eslint.org/docs/rules/ - 'eslint:recommended', - - // Node plugin's recommended rules: https://github.com/mysticatea/eslint-plugin-node - 'plugin:node/recommended', - - // AirBnB style guide (without React) rules: https://github.com/airbnb/javascript. - 'airbnb-base', - - // JSDoc plugin's recommended rules - 'plugin:jsdoc/recommended', - ], - - rules: { - // JavaScript rules - // --- - // The top level of this configuration contains rules which apply to JavaScript. - // - // This section does not contain rules meant to override options or disable rules in the base configurations - // (ESLint, Node, AirBnb). Those rules are added in the final override. - - // Eliminate tabs to standardize on spaces for indentation. If you want to use tabs for something other than - // indentation, you may need to turn this rule off using an inline config comments. - 'no-tabs': 'error', - - // Bans use of comma as an operator because it can obscure side effects and is often an accident. - 'no-sequences': 'error', - - // Disallow the use of process.exit() - 'node/no-process-exit': 'error', - - // Allow safe references to functions before the declaration. - 'no-use-before-define': ['error', 'nofunc'], - - // Allow scripts for hooks implementations. - 'node/shebang': 'off', - - // Allow unlimited classes in a file. - 'max-classes-per-file': 'off', - - // Disallow invocations of require(). This will help make imports more consistent and ensures a smoother - // transition to the best future syntax. - 'import/no-commonjs': ['error', { - allowConditionalRequire: false, - }], - - // Don't verify that all named imports are part of the set of named exports for the referenced module. The - // TypeScript compiler will already perform this check, so it is redundant. - 'import/named': 'off', - 'node/no-missing-import': 'off', - - // Require extensions for imported modules - 'import/extensions': ['error', 'ignorePackages', { - 'js': 'always', - }], - - // Allow use of import and export syntax, despite it not being supported in the node versions. Since this - // project is transpiled, the ignore option is used. Overrides node/recommended. - 'node/no-unsupported-features/es-syntax': ['error', { ignores: ['modules'] }], - - 'operator-linebreak': ['error', 'after', { - overrides: { '=': 'none' } - }], - }, - - overrides: [ - { - files: ['**/*.js'], - rules: { - // Override rules - // --- - // This level of this configuration contains rules which override options or disable rules in the base - // configurations in JavaScript. - - // Increase the max line length to 120. The rest of this setting is copied from the AirBnB config. - 'max-len': ['error', 120, 2, { - ignoreUrls: true, - ignoreComments: false, - ignoreRegExpLiterals: true, - ignoreStrings: true, - ignoreTemplateLiterals: true, - }], - - // Restrict the use of backticks to declare a normal string. Template literals should only be used when the - // template string contains placeholders. The rest of this setting is copied from the AirBnb config. - quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }], - - // The server side Slack API uses snake_case for parameters often. - // - // For mocking and override support, we need to allow snake_case. - // Allow leading underscores for parameter names, which is used to acknowledge unused variables in TypeScript. - // Also, enforce camelCase naming for variables. Ideally, the leading underscore could be restricted to only - // unused parameter names, but this rule isn't capable of knowing when a variable is unused. The camelcase and - // no-underscore-dangle rules are replaced with the naming-convention rule because this single rule can serve - // both purposes, and it works fine on non-TypeScript code. - camelcase: 'error', - 'no-underscore-dangle': 'error', - 'no-unused-vars': [ - 'error', - { - varsIgnorePattern: '^_', - argsIgnorePattern: '^_' - } - ], - - // Allow cyclical imports. Turning this rule on is mainly a way to manage the performance concern for linting - // time. Our projects are not large enough to warrant this. Overrides AirBnB styles. - 'import/no-cycle': 'off', - - // Prevent importing submodules of other modules. Using the internal structure of a module exposes - // implementation details that can potentially change in breaking ways. Overrides AirBnB styles. - 'import/no-internal-modules': ['error', { - // Use the following option to set a list of allowable globs in this project. - 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 - ], - }], - - // Remove the minProperties option for enforcing line breaks between braces. The AirBnB config sets this to 4, - // which is arbitrary and not backed by anything specific in the style guide. If we just remove it, we can - // rely on the max-len rule to determine if the line is too long and then enforce line breaks. Overrides AirBnB - // styles. - 'object-curly-newline': ['error', { multiline: true, consistent: true }], - }, - }, - { - files: ['src/**/*.spec.js'], - rules: { - // Test-specific rules - // --- - // Rules that only apply to JavaScript _test_ source files - - // With Mocha as a test framework, it is sometimes helpful to assign - // shared state to Mocha's Context object, for example in setup and - // teardown test methods. Assigning stub/mock objects to the Context - // object via `this` is a common pattern in Mocha. As such, using - // `function` over the the arrow notation binds `this` appropriately and - // should be used in tests. So: we turn off the prefer-arrow-callback - // rule. - // See https://github.com/slackapi/bolt-js/pull/1012#pullrequestreview-711232738 - // for a case of arrow-vs-function syntax coming up for the team - 'prefer-arrow-callback': 'off', - // Using ununamed functions (e.g., null logger) in tests is fine - 'func-names': 'off', - // In tests, don't force constructing a Symbol with a descriptor, as - // it's probably just for tests - 'symbol-description': 'off', - - 'node/no-unpublished-import': ['error', { - "allowModules": ["mocha"], - }], - }, - }, - ], -}; diff --git a/packages/cli-hooks/biome.json b/packages/cli-hooks/biome.json new file mode 100644 index 000000000..ea710a856 --- /dev/null +++ b/packages/cli-hooks/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/cli-hooks/jsconfig.json b/packages/cli-hooks/jsconfig.json index 2e3e52e08..aca7ed985 100644 --- a/packages/cli-hooks/jsconfig.json +++ b/packages/cli-hooks/jsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "module": "es2022", "moduleResolution": "node", - "esModuleInterop" : true, + "esModuleInterop": true, "checkJs": true, "strict": true, @@ -14,14 +14,11 @@ "baseUrl": ".", "paths": { "*": ["./types/*"] - }, + } }, - "include": [ - "src/**/*" - ], + "include": ["src/**/*"], "jsdoc": { "out": "support/jsdoc", "access": "public" } } - diff --git a/packages/cli-hooks/package.json b/packages/cli-hooks/package.json index cae60a360..8aca5e5a0 100644 --- a/packages/cli-hooks/package.json +++ b/packages/cli-hooks/package.json @@ -4,11 +4,7 @@ "description": "Node implementation of the contract between the Slack CLI and Bolt for JavaScript", "author": "Slack Technologies, LLC", "license": "MIT", - "keywords": [ - "slack", - "cli", - "hooks" - ], + "keywords": ["slack", "cli", "hooks"], "type": "module", "main": "src/get-hooks.js", "files": [ @@ -38,8 +34,8 @@ "prebuild": "shx rm -rf ./coverage", "build": "shx chmod +x src/*.js", "prelint": "tsc --noemit --module es2022 --maxNodeModuleJsDepth 0 --project ./jsconfig.json", - "lint": "eslint --ext .js src", - "pretest": "npm run lint -- --fix", + "lint": "npx @biomejs/biome check --write .", + "pretest": "npm run lint", "test": "c8 mocha src/*.spec.js" }, "bin": { @@ -54,15 +50,13 @@ "semver": "^7.5.4" }, "devDependencies": { + "@biomejs/biome": "^1.8.3", "@types/minimist": "^1.2.5", "@types/mocha": "^10.0.6", "@types/node": "^22.5.2", "@types/semver": "^7.5.6", "@types/sinon": "^17.0.3", "c8": "^10.1.2", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-plugin-jsdoc": "^50.2.2", - "eslint-plugin-node": "^11.1.0", "mocha": "^10.2.0", "shx": "^0.3.4", "sinon": "^18.0.0", diff --git a/packages/cli-hooks/src/check-update.js b/packages/cli-hooks/src/check-update.js index ec3b3dc9c..d11a06853 100755 --- a/packages/cli-hooks/src/check-update.js +++ b/packages/cli-hooks/src/check-update.js @@ -1,10 +1,10 @@ #!/usr/bin/env node +import childProcess from 'node:child_process'; +import fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import util from 'node:util'; import { clean, gt, major } from 'semver'; -import { fileURLToPath } from 'url'; -import childProcess from 'child_process'; -import fs from 'fs'; -import util from 'util'; import { getProtocol } from './protocols.js'; @@ -122,16 +122,20 @@ async function gatherDependencyFile(cwd) { const inaccessibleFiles = []; try { const packageJSONFile = await getJSON(`${cwd}/${packageJSONFileName}`); - if ('devDependencies' in packageJSONFile && - typeof packageJSONFile.devDependencies === 'object' && - packageJSONFile.devDependencies !== null && - Object.values(packageJSONFile.devDependencies).every((value) => (typeof value === 'string'))) { + if ( + 'devDependencies' in packageJSONFile && + typeof packageJSONFile.devDependencies === 'object' && + packageJSONFile.devDependencies !== null && + Object.values(packageJSONFile.devDependencies).every((value) => typeof value === 'string') + ) { Object.assign(projectDependencies.dependencies, packageJSONFile.devDependencies); } - if ('dependencies' in packageJSONFile && - typeof packageJSONFile.dependencies === 'object' && - packageJSONFile.dependencies !== null && - Object.values(packageJSONFile.dependencies).every((value) => (typeof value === 'string'))) { + if ( + 'dependencies' in packageJSONFile && + typeof packageJSONFile.dependencies === 'object' && + packageJSONFile.dependencies !== null && + Object.values(packageJSONFile.dependencies).every((value) => typeof value === 'string') + ) { Object.assign(projectDependencies.dependencies, packageJSONFile.dependencies); } } catch (err) { @@ -213,7 +217,8 @@ async function fetchLatestPackageVersion(packageName) { function getReleaseNotesUrl(packageName, latestVersion) { if (packageName === SLACK_BOLT_SDK) { return `https://github.com/slackapi/bolt-js/releases/tag/@slack/bolt@${latestVersion}`; - } if (packageName === SLACK_CLI_HOOKS) { + } + if (packageName === SLACK_CLI_HOOKS) { return `https://github.com/slackapi/node-slack-sdk/releases/tag/@slack/cli-hooks@${latestVersion}`; } return undefined; diff --git a/packages/cli-hooks/src/check-update.spec.js b/packages/cli-hooks/src/check-update.spec.js old mode 100644 new mode 100755 index 217a17bfc..deba88a77 --- a/packages/cli-hooks/src/check-update.spec.js +++ b/packages/cli-hooks/src/check-update.spec.js @@ -1,9 +1,9 @@ +import assert from 'node:assert'; +import fs from 'node:fs'; +import path from 'node:path'; +import util from 'node:util'; import { after, before, describe, it } from 'mocha'; -import assert from 'assert'; -import fs from 'fs'; -import path from 'path'; import sinon from 'sinon'; -import util from 'util'; import checkForSDKUpdates, { hasAvailableUpdates, @@ -32,12 +32,14 @@ const packageJSON = { function mockNPM(command) { if (command === 'npm info @slack/bolt version --tag latest') { return '3.1.4'; - } if (command === 'npm info @slack/cli-hooks version --tag latest') { + } + if (command === 'npm info @slack/cli-hooks version --tag latest') { return '1.0.1'; } if (command === 'npm list @slack/bolt --depth=0 --json') { return '{"dependencies":{"@slack/bolt":{"version":"3.0.0"}}}'; - } if (command === 'npm list @slack/cli-hooks --depth=0 --json') { + } + if (command === 'npm list @slack/cli-hooks --depth=0 --json') { return '{"dependencies":{"@slack/cli-hooks":{"version":"0.0.1"}}}'; } throw new Error('Unknown NPM command mocked'); @@ -49,11 +51,10 @@ describe('check-update implementation', async () => { const packageJSONFilePath = path.join(tempDir, 'package.json'); before(() => { - sinon.stub(util, 'promisify') - .returns((/** @type {string} */ command) => { - const info = mockNPM(command); - return Promise.resolve({ stdout: info }); - }); + sinon.stub(util, 'promisify').returns((/** @type {string} */ command) => { + const info = mockNPM(command); + return Promise.resolve({ stdout: info }); + }); if (!fs.existsSync(tempDir)) { fs.mkdirSync(tempDir); } @@ -192,8 +193,9 @@ describe('check-update implementation', async () => { const fileError = { name: 'package.json', error: 'Not found' }; const message = createUpdateErrorMessage(['@slack/cli-hooks'], [fileError]); const expected = { - message: 'An error occurred fetching updates for the following packages: @slack/cli-hooks\n' + - 'An error occurred while reading the following files:\n package.json: Not found\n', + message: + 'An error occurred fetching updates for the following packages: @slack/cli-hooks\n' + + 'An error occurred while reading the following files:\n package.json: Not found\n', }; assert.deepEqual(message, expected); }); diff --git a/packages/cli-hooks/src/doctor.js b/packages/cli-hooks/src/doctor.js index 6f10fee71..bc2ce2ae4 100755 --- a/packages/cli-hooks/src/doctor.js +++ b/packages/cli-hooks/src/doctor.js @@ -1,7 +1,7 @@ #!/usr/bin/env node -import { fileURLToPath } from 'url'; -import fs from 'fs'; +import fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import { getProtocol } from './protocols.js'; @@ -12,7 +12,7 @@ import { getProtocol } from './protocols.js'; if (fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) { const protocol = getProtocol(process.argv.slice(1)); - protocol.respond(JSON.stringify(doctor())); // eslint-disable-line no-console + protocol.respond(JSON.stringify(doctor())); } /** diff --git a/packages/cli-hooks/src/doctor.spec.js b/packages/cli-hooks/src/doctor.spec.js old mode 100644 new mode 100755 index aa0ea346d..4da60b977 --- a/packages/cli-hooks/src/doctor.spec.js +++ b/packages/cli-hooks/src/doctor.spec.js @@ -1,5 +1,5 @@ +import assert from 'node:assert'; import { describe, it } from 'mocha'; -import assert from 'assert'; import doctor from './doctor.js'; diff --git a/packages/cli-hooks/src/get-hooks.js b/packages/cli-hooks/src/get-hooks.js index 8b6ca7abb..af920a5a4 100755 --- a/packages/cli-hooks/src/get-hooks.js +++ b/packages/cli-hooks/src/get-hooks.js @@ -1,7 +1,7 @@ #!/usr/bin/env node -import { fileURLToPath } from 'url'; -import fs from 'fs'; +import fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import { SUPPORTED_NAMED_PROTOCOLS } from './protocols.js'; @@ -11,7 +11,7 @@ import { SUPPORTED_NAMED_PROTOCOLS } from './protocols.js'; */ if (fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) { - console.log(JSON.stringify(getHooks())); // eslint-disable-line no-console + console.log(JSON.stringify(getHooks())); } /** @@ -53,9 +53,7 @@ export default function getHooks() { config: { watch: { 'filter-regex': '^manifest\\.json$', - paths: [ - '.', - ], + paths: ['.'], }, 'protocol-version': SUPPORTED_NAMED_PROTOCOLS, 'sdk-managed-connection-enabled': true, diff --git a/packages/cli-hooks/src/get-hooks.spec.js b/packages/cli-hooks/src/get-hooks.spec.js old mode 100644 new mode 100755 index d0536eb22..93527c17f --- a/packages/cli-hooks/src/get-hooks.spec.js +++ b/packages/cli-hooks/src/get-hooks.spec.js @@ -1,5 +1,5 @@ +import assert from 'node:assert'; import { describe, it } from 'mocha'; -import assert from 'assert'; import getHooks from './get-hooks.js'; diff --git a/packages/cli-hooks/src/get-manifest.js b/packages/cli-hooks/src/get-manifest.js index a86e66412..0eca77ce7 100755 --- a/packages/cli-hooks/src/get-manifest.js +++ b/packages/cli-hooks/src/get-manifest.js @@ -1,8 +1,8 @@ #!/usr/bin/env node -import { fileURLToPath } from 'url'; -import fs from 'fs'; -import path from 'path'; +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { getProtocol } from './protocols.js'; diff --git a/packages/cli-hooks/src/get-manifest.spec.js b/packages/cli-hooks/src/get-manifest.spec.js old mode 100644 new mode 100755 index 3e5e6eaae..d70463685 --- a/packages/cli-hooks/src/get-manifest.spec.js +++ b/packages/cli-hooks/src/get-manifest.spec.js @@ -1,7 +1,7 @@ +import assert from 'node:assert'; +import fs from 'node:fs'; +import path from 'node:path'; import { after, before, describe, it } from 'mocha'; -import assert from 'assert'; -import fs from 'fs'; -import path from 'path'; import getManifestData from './get-manifest.js'; @@ -97,7 +97,7 @@ describe('get-manifest implementation', async () => { const parsedManifest = getManifestData(process.cwd()); assert.deepEqual(manifest, parsedManifest); } catch (err) { - console.error(err); // eslint-disable-line no-console + console.error(err); assert(false); } }); diff --git a/packages/cli-hooks/src/protocols.js b/packages/cli-hooks/src/protocols.js old mode 100644 new mode 100755 index 9c12a67db..dd96f6a34 --- a/packages/cli-hooks/src/protocols.js +++ b/packages/cli-hooks/src/protocols.js @@ -42,13 +42,13 @@ export function DefaultProtocol(args) { // If the particular hook invocation is requesting manifest generation we // ensure any logging is a no-op to prevent littering stdout with logging // and confusing the CLI's manifest JSON payload parsing. - const loggerMethod = manifestOnly ? () => { } : console.log; // eslint-disable-line no-console + const loggerMethod = manifestOnly ? () => { } : console.log; return { name: DEFAULT_PROTOCOL, log: loggerMethod, error: loggerMethod, warn: loggerMethod, - respond: console.log, // eslint-disable-line no-console + respond: console.log, }; } @@ -64,16 +64,13 @@ export function MessageBoundaryProtocol(args) { if (!boundary) throw new Error('No boundary argument provided!'); const protocol = { name: MSG_BOUNDARY_PROTOCOL, - log: console.log, // eslint-disable-line no-console - error: console.error, // eslint-disable-line no-console - warn: console.warn, // eslint-disable-line no-console + log: console.log, + error: console.error, + warn: console.warn, respond: (/** @type {any} */ data) => { - console.log(boundary + data + boundary); // eslint-disable-line no-console + console.log(boundary + data + boundary); }, - getCLIFlags: () => [ - `--protocol=${MSG_BOUNDARY_PROTOCOL}`, - `--boundary=${boundary}`, - ], + getCLIFlags: () => [`--protocol=${MSG_BOUNDARY_PROTOCOL}`, `--boundary=${boundary}`], }; return protocol; } diff --git a/packages/cli-hooks/src/protocols.spec.js b/packages/cli-hooks/src/protocols.spec.js old mode 100644 new mode 100755 index e99c3ea38..fa0e4fdbd --- a/packages/cli-hooks/src/protocols.spec.js +++ b/packages/cli-hooks/src/protocols.spec.js @@ -1,14 +1,8 @@ -/* eslint-disable no-console */ - +import assert from 'node:assert'; import { afterEach, beforeEach, describe, it } from 'mocha'; -import assert from 'assert'; import sinon from 'sinon'; -import { - DefaultProtocol, - MessageBoundaryProtocol, - getProtocol, -} from './protocols.js'; +import { DefaultProtocol, MessageBoundaryProtocol, getProtocol } from './protocols.js'; describe('protocol implementations', () => { describe('default protocol', () => { @@ -42,12 +36,9 @@ describe('protocol implementations', () => { }); it('errors if no boundary is specified', () => { - assert.throws( - () => { - MessageBoundaryProtocol([]); - }, - /^Error: No boundary argument provided!$/, - ); + assert.throws(() => { + MessageBoundaryProtocol([]); + }, /^Error: No boundary argument provided!$/); }); it('uses the corresponding console methods', () => { diff --git a/packages/cli-hooks/src/start.js b/packages/cli-hooks/src/start.js index 8f08f81c4..f8bbe74c5 100755 --- a/packages/cli-hooks/src/start.js +++ b/packages/cli-hooks/src/start.js @@ -1,9 +1,9 @@ #!/usr/bin/env node -import { fileURLToPath } from 'url'; -import childProcess from 'child_process'; -import path from 'path'; -import fs from 'fs'; +import childProcess from 'node:child_process'; +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; /** * Implementation of the start hook that begins a new process to run the app. @@ -33,7 +33,7 @@ export default function start(cwd) { process.stderr.write(data); }); app.on('close', (code) => { - console.log(`Local run exited with code ${code}`); // eslint-disable-line no-console + console.log(`Local run exited with code ${code}`); }); } diff --git a/packages/cli-hooks/src/start.spec.js b/packages/cli-hooks/src/start.spec.js old mode 100644 new mode 100755 index e6cba8a6f..2ed3f6ed0 --- a/packages/cli-hooks/src/start.spec.js +++ b/packages/cli-hooks/src/start.spec.js @@ -1,8 +1,8 @@ +import assert from 'node:assert'; +import childProcess from 'node:child_process'; +import fs from 'node:fs'; +import path from 'node:path'; import { after, afterEach, before, beforeEach, describe, it } from 'mocha'; -import assert from 'assert'; -import childProcess from 'child_process'; -import fs from 'fs'; -import path from 'path'; import sinon from 'sinon'; import start from './start.js'; @@ -38,19 +38,19 @@ describe('start implementation', async () => { stdoutWriteStub = sinon.stub(process.stdout, 'write'); stderrWriteStub = sinon.stub(process.stderr, 'write'); mockSpawnProcess = { - stdout: { on: sinon.stub(), setEncoding: () => { } }, + stdout: { on: sinon.stub(), setEncoding: () => {} }, stderr: { on: sinon.stub() }, on: sinon.stub(), }; - spawnStub = sinon.stub(childProcess, 'spawn').returns(/** @type {any} */(mockSpawnProcess)); + spawnStub = sinon.stub(childProcess, 'spawn').returns(/** @type {any} */ (mockSpawnProcess)); process.env.SLACK_CLI_XAPP = 'xapp-example'; process.env.SLACK_CLI_XOXB = 'xoxb-example'; }); afterEach(() => { sinon.restore(); - delete process.env.SLACK_CLI_XOXB; - delete process.env.SLACK_CLI_XAPP; + process.env.SLACK_CLI_XOXB = undefined; + process.env.SLACK_CLI_XAPP = undefined; }); describe('runs the package main path', async () => { @@ -109,7 +109,7 @@ describe('start implementation', async () => { }); after(() => { - delete process.env.SLACK_CLI_CUSTOM_FILE_PATH; + process.env.SLACK_CLI_CUSTOM_FILE_PATH = undefined; }); it('writes output from the custom script', async () => { diff --git a/packages/cli-test/.eslintignore b/packages/cli-test/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/cli-test/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/cli-test/.eslintrc.js b/packages/cli-test/.eslintrc.js deleted file mode 100644 index c0c7ff40a..000000000 --- a/packages/cli-test/.eslintrc.js +++ /dev/null @@ -1,15 +0,0 @@ -const slackEslintConfig = require('../../lint-configs/.eslintrc'); -// Same eslint config as the other packages in this monorepo, with some package-specific tweaks listed below - -// Don't check object property name convention; we want to allow kebab case for CLI flags which is not easy to support in eslint -const overrideIndex = slackEslintConfig.overrides.findIndex((o) => o.files.includes('**/*.js') && o.files.includes('**/*.ts')); -const selectorIndex = slackEslintConfig.overrides[overrideIndex].rules['@typescript-eslint/naming-convention'].findIndex((s) => s.selector == 'objectLiteralProperty'); -slackEslintConfig.overrides[overrideIndex].rules['@typescript-eslint/naming-convention'][selectorIndex] = { - 'selector': 'objectLiteralProperty', - format: null -}; - -// Otherwise export the common config. -module.exports = { - ...slackEslintConfig, -} diff --git a/packages/cli-test/biome.json b/packages/cli-test/biome.json new file mode 100644 index 000000000..ea710a856 --- /dev/null +++ b/packages/cli-test/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/cli-test/package.json b/packages/cli-test/package.json index 77934894c..a67d3d1e1 100644 --- a/packages/cli-test/package.json +++ b/packages/cli-test/package.json @@ -4,7 +4,11 @@ "description": "Node.js bindings for the Slack CLI for use in automated testing", "author": "Salesforce, Inc.", "license": "MIT", - "keywords": ["slack", "cli", "test"], + "keywords": [ + "slack", + "cli", + "test" + ], "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ @@ -21,7 +25,7 @@ "url": "https://github.com/slackapi/node-slack-sdk/issues" }, "scripts": { - "lint": "eslint --fix --ext .ts src", + "lint": "npx @biomejs/biome check --write .", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage", "prepare": "npm run build", @@ -33,23 +37,15 @@ "winston": "^3.8.2" }, "devDependencies": { + "@biomejs/biome": "^1.8.3", "@tsconfig/recommended": "^1.0.6", "@types/chai": "^4.3.16", "@types/mocha": "^10.0.6", "@types/node": "^22.5.2", "@types/sinon": "^17.0.3", - "@typescript-eslint/eslint-plugin": "^6", - "@typescript-eslint/parser": "^6", "c8": "^10.1.2", "chai": "^4.4.1", "cross-env": "^7.0.3", - "eslint": "^8", - "eslint-config-airbnb-base": "^15", - "eslint-config-airbnb-typescript": "^17", - "eslint-plugin-import": "^2", - "eslint-plugin-import-newlines": "^1", - "eslint-plugin-jsdoc": "^50", - "eslint-plugin-node": "^11", "mocha": "^10.4.0", "shx": "^0.3.4", "sinon": "^18.0.0", diff --git a/packages/cli-test/src/cli/cli-process.spec.ts b/packages/cli-test/src/cli/cli-process.spec.ts index c607c867b..923ebb192 100644 --- a/packages/cli-test/src/cli/cli-process.spec.ts +++ b/packages/cli-test/src/cli/cli-process.spec.ts @@ -19,7 +19,7 @@ describe('SlackCLIProcess class', () => { describe('constructor', () => { it('should throw if `SLACK_CLI_PATH` env variable is falsy', () => { const orig = process.env.SLACK_CLI_PATH; - delete process.env.SLACK_CLI_PATH; + process.env.SLACK_CLI_PATH = ''; assert.throws(() => { new SlackCLIProcess('help'); }); diff --git a/packages/cli-test/src/cli/cli-process.ts b/packages/cli-test/src/cli/cli-process.ts index a762175eb..a915c01c7 100644 --- a/packages/cli-test/src/cli/cli-process.ts +++ b/packages/cli-test/src/cli/cli-process.ts @@ -1,7 +1,7 @@ import { shell } from './shell'; -import type { ShellProcess } from '../types/shell'; import type { SpawnOptionsWithoutStdio } from 'node:child_process'; +import type { ShellProcess } from '../types/shell'; export interface SlackCLIGlobalOptions { /** @@ -142,14 +142,14 @@ export class SlackCLIProcess { } cmd += ` ${this.command}`; if (this.commandOptions) { - Object.entries(this.commandOptions).forEach(([key, value]) => { + for (const [key, value] of Object.entries(this.commandOptions)) { if (key && value) { cmd += ` ${key}`; if (value !== true) { cmd += ` ${value}`; } } - }); + } } return cmd; } diff --git a/packages/cli-test/src/cli/commands/app.spec.ts b/packages/cli-test/src/cli/commands/app.spec.ts index f618a221d..385bb42c9 100644 --- a/packages/cli-test/src/cli/commands/app.spec.ts +++ b/packages/cli-test/src/cli/commands/app.spec.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import app from './app'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; +import app from './app'; describe('app commands', () => { const sandbox = sinon.createSandbox(); diff --git a/packages/cli-test/src/cli/commands/auth.spec.ts b/packages/cli-test/src/cli/commands/auth.spec.ts index 65c814876..cbb869076 100644 --- a/packages/cli-test/src/cli/commands/auth.spec.ts +++ b/packages/cli-test/src/cli/commands/auth.spec.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import auth from './auth'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; +import auth from './auth'; describe('auth commands', () => { const sandbox = sinon.createSandbox(); diff --git a/packages/cli-test/src/cli/commands/auth.ts b/packages/cli-test/src/cli/commands/auth.ts index 30a30433e..ba9ec077a 100644 --- a/packages/cli-test/src/cli/commands/auth.ts +++ b/packages/cli-test/src/cli/commands/auth.ts @@ -1,7 +1,7 @@ import { - SlackCLICommandOptions, - SlackCLIGlobalOptions, - SlackCLIHostTargetOptions, + type SlackCLICommandOptions, + type SlackCLIGlobalOptions, + type SlackCLIHostTargetOptions, SlackCLIProcess, } from '../cli-process'; @@ -35,7 +35,12 @@ export default { const proc = await cmd.execAsync(); // Get auth token - const authTicketSlashCommand = proc.output.match('/slackauthticket(.*)')![0]; + const authTicketSlashCommand = proc.output.match('/slackauthticket(.*)')?.[0]; + if (!authTicketSlashCommand) { + throw new Error( + `Could not extract \`/slackauthticket\` output from \`login --no-prompt\` command! Output: ${proc.output}`, + ); + } const authTicket = authTicketSlashCommand.split(' ')[1]; return { @@ -51,12 +56,14 @@ export default { * @param options * @returns */ - loginChallengeExchange: async function loginChallengeExchange(args: SlackCLIHostTargetOptions & { - /** @description Challenge string extracted from the Slack client UI after submitting the auth slash command. */ - challenge: string, - /** @description The `authTicket` output from `loginNoPrompt`; required to complete the login flow. */ - authTicket: string, - }): Promise { + loginChallengeExchange: async function loginChallengeExchange( + args: SlackCLIHostTargetOptions & { + /** @description Challenge string extracted from the Slack client UI after submitting the auth slash command. */ + challenge: string; + /** @description The `authTicket` output from `loginNoPrompt`; required to complete the login flow. */ + authTicket: string; + }, + ): Promise { const cmd = new SlackCLIProcess('login', args, { '--no-prompt': true, '--challenge': args.challenge, @@ -70,13 +77,19 @@ export default { * `slack logout` * @returns command output */ - logout: async function logout(args?: Omit & (Pick | { - /** - * @description Perform the logout for all authentications. - * The `team` argument takes precendence over this argument. - */ - all?: boolean; - })): Promise { + logout: async function logout( + args?: Omit & + ( + | Pick + | { + /** + * @description Perform the logout for all authentications. + * The `team` argument takes precendence over this argument. + */ + all?: boolean; + } + ), + ): Promise { // Create the command with workspaces to logout of const cmdOpts: SlackCLICommandOptions = {}; if (args && 'all' in args && !('team' in args) && args.all) { diff --git a/packages/cli-test/src/cli/commands/collaborator.spec.ts b/packages/cli-test/src/cli/commands/collaborator.spec.ts index c68a70ea3..918a439db 100644 --- a/packages/cli-test/src/cli/commands/collaborator.spec.ts +++ b/packages/cli-test/src/cli/commands/collaborator.spec.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import collaborator from './collaborator'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; +import collaborator from './collaborator'; describe('collaborator commands', () => { const sandbox = sinon.createSandbox(); diff --git a/packages/cli-test/src/cli/commands/collaborator.ts b/packages/cli-test/src/cli/commands/collaborator.ts index 698fdf421..46690acba 100644 --- a/packages/cli-test/src/cli/commands/collaborator.ts +++ b/packages/cli-test/src/cli/commands/collaborator.ts @@ -1,9 +1,9 @@ -import { ProjectCommandArguments } from '../../types/commands/common_arguments'; +import type { ProjectCommandArguments } from '../../types/commands/common_arguments'; import { SlackCLIProcess } from '../cli-process'; export interface CollaboratorEmail { /** @description email of the collaborator */ - collaboratorEmail: string, + collaboratorEmail: string; } /** diff --git a/packages/cli-test/src/cli/commands/create.spec.ts b/packages/cli-test/src/cli/commands/create.spec.ts index 153fbb745..239b0937a 100644 --- a/packages/cli-test/src/cli/commands/create.spec.ts +++ b/packages/cli-test/src/cli/commands/create.spec.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import { create } from './create'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; +import { create } from './create'; describe('create', () => { const sandbox = sinon.createSandbox(); diff --git a/packages/cli-test/src/cli/commands/create.ts b/packages/cli-test/src/cli/commands/create.ts index ce95a6e36..a99d10152 100644 --- a/packages/cli-test/src/cli/commands/create.ts +++ b/packages/cli-test/src/cli/commands/create.ts @@ -1,5 +1,5 @@ -import { ProjectCommandArguments } from '../../types/commands/common_arguments'; -import { SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; +import type { ProjectCommandArguments } from '../../types/commands/common_arguments'; +import { type SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; /** * `slack create` diff --git a/packages/cli-test/src/cli/commands/env.spec.ts b/packages/cli-test/src/cli/commands/env.spec.ts index fa410726c..ec55e85e0 100644 --- a/packages/cli-test/src/cli/commands/env.spec.ts +++ b/packages/cli-test/src/cli/commands/env.spec.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import env from './env'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; +import env from './env'; describe('env commands', () => { const sandbox = sinon.createSandbox(); diff --git a/packages/cli-test/src/cli/commands/env.ts b/packages/cli-test/src/cli/commands/env.ts index 63fd3e7a2..912f91138 100644 --- a/packages/cli-test/src/cli/commands/env.ts +++ b/packages/cli-test/src/cli/commands/env.ts @@ -1,4 +1,4 @@ -import { ProjectCommandArguments } from '../../types/commands/common_arguments'; +import type { ProjectCommandArguments } from '../../types/commands/common_arguments'; import { SlackCLIProcess } from '../cli-process'; export interface EnvCommandArguments { @@ -36,7 +36,9 @@ export const list = async function envList(args: ProjectCommandArguments): Promi * `slack env remove` * @returns command output */ -export const remove = async function envRemove(args: ProjectCommandArguments & Pick): Promise { +export const remove = async function envRemove( + args: ProjectCommandArguments & Pick, +): Promise { const cmd = new SlackCLIProcess(`env remove ${args.secretKey}`, args); const proc = await cmd.execAsync({ cwd: args.appPath, diff --git a/packages/cli-test/src/cli/commands/external-auth.spec.ts b/packages/cli-test/src/cli/commands/external-auth.spec.ts index 99e9bc06f..b0a635bb6 100644 --- a/packages/cli-test/src/cli/commands/external-auth.spec.ts +++ b/packages/cli-test/src/cli/commands/external-auth.spec.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import extAuth from './external-auth'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; +import extAuth from './external-auth'; describe('external-auth commands', () => { const sandbox = sinon.createSandbox(); diff --git a/packages/cli-test/src/cli/commands/external-auth.ts b/packages/cli-test/src/cli/commands/external-auth.ts index f3a93300d..23cf7e604 100644 --- a/packages/cli-test/src/cli/commands/external-auth.ts +++ b/packages/cli-test/src/cli/commands/external-auth.ts @@ -1,5 +1,5 @@ -import { ProjectCommandArguments } from '../../types/commands/common_arguments'; -import { SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; +import type { ProjectCommandArguments } from '../../types/commands/common_arguments'; +import { type SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; export interface ExternalAuthCommandArguments { /** @description the OAuth Provider key to target. */ @@ -71,12 +71,13 @@ export const remove = async function extAuthRemove( * @returns command output */ export const selectAuth = async function extAuthSelectAuth( - args: ProjectCommandArguments & Pick & { - /** @description specifies an external account identifier, e.g. an email address. */ - externalAccount?: string; - /** @description specifies a workflow to set selected developer account. */ - workflow?: string; - }, + args: ProjectCommandArguments & + Pick & { + /** @description specifies an external account identifier, e.g. an email address. */ + externalAccount?: string; + /** @description specifies a workflow to set selected developer account. */ + workflow?: string; + }, ): Promise { const cmdOpts: SlackCLICommandOptions = { '--provider': args.provider, diff --git a/packages/cli-test/src/cli/commands/function.spec.ts b/packages/cli-test/src/cli/commands/function.spec.ts index ff0d2fefa..2d19da30f 100644 --- a/packages/cli-test/src/cli/commands/function.spec.ts +++ b/packages/cli-test/src/cli/commands/function.spec.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import func from './function'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; +import func from './function'; describe('function commands', () => { const sandbox = sinon.createSandbox(); diff --git a/packages/cli-test/src/cli/commands/function.ts b/packages/cli-test/src/cli/commands/function.ts index f9d60d776..8c5c05cc7 100644 --- a/packages/cli-test/src/cli/commands/function.ts +++ b/packages/cli-test/src/cli/commands/function.ts @@ -1,10 +1,10 @@ -import { +import type { GroupAccessChangeArguments, InfoArgument, ProjectCommandArguments, UserAccessChangeArguments, } from '../../types/commands/common_arguments'; -import { SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; +import { type SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; type AccessChangeArguments = { /** @description `callback_id` of function being targeted. */ @@ -37,7 +37,9 @@ export const access = async function functionAccess( } else if ('revoke' in args && args.revoke) { cmdOpts['--revoke'] = true; } else { - throw new Error('When granting or revoking function access to users, you must specify one of `grant` or `revoke` as `true`.'); + throw new Error( + 'When granting or revoking function access to users, you must specify one of `grant` or `revoke` as `true`.', + ); } } else { throw new Error('When setting function access, you must specify a target for whom to give access to.'); diff --git a/packages/cli-test/src/cli/commands/manifest.spec.ts b/packages/cli-test/src/cli/commands/manifest.spec.ts index 41d8ba7fd..68a77c3c8 100644 --- a/packages/cli-test/src/cli/commands/manifest.spec.ts +++ b/packages/cli-test/src/cli/commands/manifest.spec.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import manifest from './manifest'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; +import manifest from './manifest'; describe('manifest commands', () => { const sandbox = sinon.createSandbox(); diff --git a/packages/cli-test/src/cli/commands/manifest.ts b/packages/cli-test/src/cli/commands/manifest.ts index 625fefda5..43172b232 100644 --- a/packages/cli-test/src/cli/commands/manifest.ts +++ b/packages/cli-test/src/cli/commands/manifest.ts @@ -1,16 +1,18 @@ -import { ProjectCommandArguments } from '../../types/commands/common_arguments'; -import { SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; +import type { ProjectCommandArguments } from '../../types/commands/common_arguments'; +import { type SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; /** * `slack manifest info` * @returns command output */ -export const info = async function manifestInfo(args: ProjectCommandArguments & { - /** - * @description Whether to retrieve manifest from the local `project`, or `remote` from Slack. Defaults to `project`. - */ - source?: 'project' | 'remote'; -}): Promise { +export const info = async function manifestInfo( + args: ProjectCommandArguments & { + /** + * @description Whether to retrieve manifest from the local `project`, or `remote` from Slack. Defaults to `project`. + */ + source?: 'project' | 'remote'; + }, +): Promise { const cmdOpts: SlackCLICommandOptions = { '--source': args.source || 'project', }; diff --git a/packages/cli-test/src/cli/commands/platform.spec.ts b/packages/cli-test/src/cli/commands/platform.spec.ts index 380a24236..108e55df5 100644 --- a/packages/cli-test/src/cli/commands/platform.spec.ts +++ b/packages/cli-test/src/cli/commands/platform.spec.ts @@ -1,11 +1,11 @@ -import assert from 'assert'; +import assert from 'node:assert'; import sinon from 'sinon'; -import platform from './platform'; -import { ShellProcess } from '../../types/shell'; +import type { ShellProcess } from '../../types/shell'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; +import platform from './platform'; describe('platform commands', () => { const sandbox = sinon.createSandbox(); diff --git a/packages/cli-test/src/cli/commands/platform.ts b/packages/cli-test/src/cli/commands/platform.ts index 93e95607f..61da631fd 100644 --- a/packages/cli-test/src/cli/commands/platform.ts +++ b/packages/cli-test/src/cli/commands/platform.ts @@ -1,7 +1,7 @@ -import { ProjectCommandArguments, WorkspaceGrantArgument } from '../../types/commands/common_arguments'; +import type { ProjectCommandArguments, WorkspaceGrantArgument } from '../../types/commands/common_arguments'; import { SlackTracerId } from '../../utils/constants'; import logger from '../../utils/logger'; -import { SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; +import { type SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; import { shell } from '../shell'; import type { ShellProcess } from '../../types/shell'; @@ -32,10 +32,12 @@ export interface RunDeployArguments extends WorkspaceGrantArgument { * `slack platform activity` * @returns command output */ -export const activity = async function activity(args: ProjectCommandArguments & { - /** @description Source of logs to filter; can be `slack` or `developer`. */ - source?: 'slack' | 'developer'; -}): Promise { +export const activity = async function activity( + args: ProjectCommandArguments & { + /** @description Source of logs to filter; can be `slack` or `developer`. */ + source?: 'slack' | 'developer'; + }, +): Promise { const cmdOpts: SlackCLICommandOptions = {}; if ('source' in args) { cmdOpts['--source'] = args.source; @@ -75,13 +77,16 @@ export const activityTailStop = async function activityTailStop( // Wait for output shell.waitForOutput(args.stringToWaitFor, args.proc, { timeout: args.timeout }).then(() => { // kill the shell process - shell.kill(args.proc).then(() => { - resolve(args.proc.output); - }, (err) => { - const msg = `activityTailStop command failed to kill process: ${err}`; - logger.warn(msg); - reject(new Error(msg)); - }); + shell.kill(args.proc).then( + () => { + resolve(args.proc.output); + }, + (err) => { + const msg = `activityTailStop command failed to kill process: ${err}`; + logger.warn(msg); + reject(new Error(msg)); + }, + ); }, reject); }); }; @@ -90,7 +95,9 @@ export const activityTailStop = async function activityTailStop( * `slack deploy` * @returns command output */ -export const deploy = async function deploy(args: ProjectCommandArguments & Omit): Promise { +export const deploy = async function deploy( + args: ProjectCommandArguments & Omit, +): Promise { const cmd = new SlackCLIProcess('deploy', args, { '--hide-triggers': typeof args.hideTriggers !== 'undefined' ? args.hideTriggers : true, '--org-workspace-grant': args.orgWorkspaceGrantFlag, @@ -125,37 +132,41 @@ export const runStart = async function runStart( * stop `slack run` * @param teamName to check that app was deleted from that team */ -export const runStop = async function runStop(args: ProcessArgument & TimeoutArgument & { - /** - * @description Should wait for the `run` process to spin down before exiting this function. - * On Windows, this property is always set to `true`. Defaults to `false`. - */ - waitForShutdown?: boolean; -}): Promise { +export const runStop = async function runStop( + args: ProcessArgument & + TimeoutArgument & { + /** + * @description Should wait for the `run` process to spin down before exiting this function. + * On Windows, this property is always set to `true`. Defaults to `false`. + */ + waitForShutdown?: boolean; + }, +): Promise { return new Promise((resolve, reject) => { // kill the shell process - shell.kill(args.proc).then(() => { - // Due to the complexity of gracefully shutting down processes on Windows / lack of interrupt signal support, - // we don't wait for the SLACK_TRACE_PLATFORM_RUN_STOP trace on Windows - if (process.platform === 'win32') { - resolve(); - } + shell.kill(args.proc).then( + () => { + // Due to the complexity of gracefully shutting down processes on Windows / lack of interrupt signal support, + // we don't wait for the SLACK_TRACE_PLATFORM_RUN_STOP trace on Windows + if (process.platform === 'win32') { + resolve(); + } - if (args.waitForShutdown) { - // Wait for the output to verify process stopped - shell.waitForOutput( - SlackTracerId.SLACK_TRACE_PLATFORM_RUN_STOP, - args.proc, - { timeout: args.timeout }, - ).then(resolve, reject); - } else { - resolve(); - } - }, (err) => { - const msg = `runStop command failed to kill process: ${err}`; - logger.warn(msg); - reject(new Error(msg)); - }); + if (args.waitForShutdown) { + // Wait for the output to verify process stopped + shell + .waitForOutput(SlackTracerId.SLACK_TRACE_PLATFORM_RUN_STOP, args.proc, { timeout: args.timeout }) + .then(resolve, reject); + } else { + resolve(); + } + }, + (err) => { + const msg = `runStop command failed to kill process: ${err}`; + logger.warn(msg); + reject(new Error(msg)); + }, + ); }); }; diff --git a/packages/cli-test/src/cli/commands/trigger.spec.ts b/packages/cli-test/src/cli/commands/trigger.spec.ts index 18983d404..7c4a066d1 100644 --- a/packages/cli-test/src/cli/commands/trigger.spec.ts +++ b/packages/cli-test/src/cli/commands/trigger.spec.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import trigger from './trigger'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; +import trigger from './trigger'; describe('trigger commands', () => { const sandbox = sinon.createSandbox(); @@ -89,12 +89,23 @@ describe('trigger commands', () => { sandbox.assert.calledWith(spawnSpy, sinon.match('--workflow some#/callback_id')); }); it('should invoke `trigger create --description` if description specified', async () => { - await trigger.create({ appPath: '/some/path', workflow: 'some#/callback_id', title: 'Title', description: 'test' }); + await trigger.create({ + appPath: '/some/path', + workflow: 'some#/callback_id', + title: 'Title', + description: 'test', + }); sandbox.assert.calledWith(spawnSpy, sinon.match('trigger create')); sandbox.assert.calledWith(spawnSpy, sinon.match('--description test')); }); it('should invoke `trigger create --interactivity` if interactivity specified', async () => { - await trigger.create({ appPath: '/some/path', workflow: 'some#/callback_id', title: 'Title', interactivity: true, interactivityName: 'test' }); + await trigger.create({ + appPath: '/some/path', + workflow: 'some#/callback_id', + title: 'Title', + interactivity: true, + interactivityName: 'test', + }); sandbox.assert.calledWith(spawnSpy, sinon.match('trigger create')); sandbox.assert.calledWith(spawnSpy, sinon.match('--interactivity')); sandbox.assert.calledWith(spawnSpy, sinon.match('--interactivity-name test')); diff --git a/packages/cli-test/src/cli/commands/trigger.ts b/packages/cli-test/src/cli/commands/trigger.ts index 3e6dea39d..17909f251 100644 --- a/packages/cli-test/src/cli/commands/trigger.ts +++ b/packages/cli-test/src/cli/commands/trigger.ts @@ -1,4 +1,4 @@ -import { +import type { ChannelAccessChangeArguments, GroupAccessChangeArguments, InfoArgument, @@ -7,14 +7,16 @@ import { UserAccessChangeArguments, WorkspaceGrantArgument, } from '../../types/commands/common_arguments'; -import { SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; +import { type SlackCLICommandOptions, SlackCLIProcess } from '../cli-process'; type AccessChangeArguments = { info?: boolean; } & ( - GroupAccessChangeArguments | UserAccessChangeArguments | ChannelAccessChangeArguments | - OrganizationAccessChangeArguments -); + | GroupAccessChangeArguments + | UserAccessChangeArguments + | ChannelAccessChangeArguments + | OrganizationAccessChangeArguments + ); export interface TriggerIdArgument { /** @description ID of the trigger being targeted. */ @@ -30,7 +32,6 @@ type TriggerAccessArguments = TriggerIdArgument & (AccessChangeArguments | InfoA * @return void */ function setAccessType(args: Parameters[0], cmdOpts: SlackCLICommandOptions) { - /* eslint-disable no-param-reassign */ if ('grant' in args && args.grant) { cmdOpts['--grant'] = true; } else if ('revoke' in args && args.revoke) { @@ -38,7 +39,6 @@ function setAccessType(args: Parameters[0], cmdOpts: SlackCLIComm } else { throw new Error('When granting or revoking trigger access, you must specify one of `grant` or `revoke` as `true`.'); } - /* eslint-enable no-param-reassign */ } /** @@ -87,7 +87,7 @@ export interface CreateFromArguments { * @description When `true`, adds an `interactivity` parameter to the trigger with the name specified * by `interactivityName`. */ - interactivity?: boolean, + interactivity?: boolean; /** @description Specifies the name of the interactivity parameter to use. Defaults to `interactivity`. */ interactivityName?: string; } @@ -103,9 +103,7 @@ type CreateArguments = WorkspaceGrantArgument & (CreateFromArguments | CreateFro * `slack trigger create` * @returns command output */ -export const create = async function triggerCreate( - args: ProjectCommandArguments & CreateArguments, -): Promise { +export const create = async function triggerCreate(args: ProjectCommandArguments & CreateArguments): Promise { const cmdOpts: SlackCLICommandOptions = { '--org-workspace-grant': args.orgWorkspaceGrantFlag, }; @@ -135,9 +133,7 @@ export const create = async function triggerCreate( * `slack trigger delete` * @returns command output */ -export const del = async function triggerDelete( - args: ProjectCommandArguments & TriggerIdArgument, -): Promise { +export const del = async function triggerDelete(args: ProjectCommandArguments & TriggerIdArgument): Promise { const cmd = new SlackCLIProcess('trigger delete', args, { '--trigger-id': args.triggerId, }); @@ -151,9 +147,7 @@ export const del = async function triggerDelete( * `slack trigger info` * @returns command output */ -export const info = async function triggerInfo( - args: ProjectCommandArguments & TriggerIdArgument, -): Promise { +export const info = async function triggerInfo(args: ProjectCommandArguments & TriggerIdArgument): Promise { const cmd = new SlackCLIProcess('trigger info', args, { '--trigger-id': args.triggerId, }); diff --git a/packages/cli-test/src/cli/index.spec.ts b/packages/cli-test/src/cli/index.spec.ts index f84a74b02..15ece66fb 100644 --- a/packages/cli-test/src/cli/index.spec.ts +++ b/packages/cli-test/src/cli/index.spec.ts @@ -1,7 +1,7 @@ import sinon from 'sinon'; -import { SlackCLI } from './index'; import logger from '../utils/logger'; +import { SlackCLI } from './index'; describe('cli module', () => { const sandbox = sinon.createSandbox(); diff --git a/packages/cli-test/src/cli/index.ts b/packages/cli-test/src/cli/index.ts index 14b2bf1a9..4d340bd54 100644 --- a/packages/cli-test/src/cli/index.ts +++ b/packages/cli-test/src/cli/index.ts @@ -1,6 +1,8 @@ import fs from 'node:fs'; import path from 'node:path'; +import type { ProjectCommandArguments } from '../types/commands/common_arguments'; +import logger from '../utils/logger'; import app from './commands/app'; import auth from './commands/auth'; import collaborator from './commands/collaborator'; @@ -11,8 +13,6 @@ import func from './commands/function'; import manifest from './commands/manifest'; import platform from './commands/platform'; import trigger from './commands/trigger'; -import { ProjectCommandArguments } from '../types/commands/common_arguments'; -import logger from '../utils/logger'; /** * Set of functions to spawn and interact with Slack Platform CLI processes and commands @@ -33,10 +33,12 @@ export const SlackCLI = { * Delete app and Log out of current team session * @param options */ - stopSession: async function stopSession(args: Partial & { - /** Should the CLI log out of its session with the team specified by `appTeamID`. Defaults to `true` */ - shouldLogOut?: boolean; - }): Promise { + stopSession: async function stopSession( + args: Partial & { + /** Should the CLI log out of its session with the team specified by `appTeamID`. Defaults to `true` */ + shouldLogOut?: boolean; + }, + ): Promise { if (args.appPath) { // List instances of app installation if app path provided const installedAppsOutput = await SlackCLI.app.list({ diff --git a/packages/cli-test/src/cli/shell.spec.ts b/packages/cli-test/src/cli/shell.spec.ts index bcf945784..2fc03843c 100644 --- a/packages/cli-test/src/cli/shell.spec.ts +++ b/packages/cli-test/src/cli/shell.spec.ts @@ -1,10 +1,10 @@ -import child from 'child_process'; +import child from 'node:child_process'; import { assert } from 'chai'; import sinon from 'sinon'; -import { shell } from './shell'; import { mockProcess } from '../utils/test'; +import { shell } from './shell'; import type { ShellProcess } from '../types/shell'; @@ -44,12 +44,15 @@ describe('shell module', () => { finished: true, command: 'echo "hi"', }; - shell.checkIfFinished(proc).then(() => { - assert.fail('checkIfFinished resolved unexpectedly'); - }, (err) => { - assert.include(err.message, 'boom'); - done(); - }); + shell.checkIfFinished(proc).then( + () => { + assert.fail('checkIfFinished resolved unexpectedly'); + }, + (err) => { + assert.include(err.message, 'boom'); + done(); + }, + ); spawnProcess.emit('error', new Error('boom')); }); }); @@ -96,12 +99,15 @@ describe('shell module', () => { finished: true, command: 'echo "hi"', }; - shell.waitForOutput('heyo', proc, { timeout: 500 }).then(() => { - assert.fail('expected rejection, but got resolution'); - }, (err) => { - assert.include(err.message, 'timed out'); - done(); - }); + shell.waitForOutput('heyo', proc, { timeout: 500 }).then( + () => { + assert.fail('expected rejection, but got resolution'); + }, + (err) => { + assert.include(err.message, 'timed out'); + done(); + }, + ); }); it('should resolve if process includes expected output', async () => { const proc: ShellProcess = { diff --git a/packages/cli-test/src/cli/shell.ts b/packages/cli-test/src/cli/shell.ts index c5b1d4162..161011644 100644 --- a/packages/cli-test/src/cli/shell.ts +++ b/packages/cli-test/src/cli/shell.ts @@ -1,4 +1,4 @@ -import child from 'child_process'; +import child from 'node:child_process'; import treekill from 'tree-kill'; @@ -42,14 +42,14 @@ export const shell = { // If is deploy command // Listen to data event that returns all the output and collect it - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: stdout can accept a variety of data childProcess.stdout.on('data', (data: any) => { sh.output += this.removeANSIcolors(data.toString()); logger.verbose(`Output: ${this.removeANSIcolors(data.toString())}`); }); // Collect error output - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: stderr can accept a variety of data childProcess.stderr.on('data', (data: any) => { sh.output += this.removeANSIcolors(data.toString()); logger.error(`Error: ${this.removeANSIcolors(data.toString())}`); @@ -107,14 +107,22 @@ export const shell = { */ checkIfFinished: async function checkIfFinished(proc: ShellProcess): Promise { return new Promise((resolve, reject) => { + // biome-ignore lint/style/useConst: closing over timeout variable let timeout: NodeJS.Timeout; const killIt = (reason: string) => { - shell.kill(proc).then(() => { - reject(new Error(`${reason}\nCommand: ${proc.command}, output: ${proc.output}`)); - }, (err) => { - reject(new Error(`${reason}\nCommand: ${proc.command}, output: ${proc.output}\nAlso errored killing process: ${err.message}`)); - }); + shell.kill(proc).then( + () => { + reject(new Error(`${reason}\nCommand: ${proc.command}, output: ${proc.output}`)); + }, + (err) => { + reject( + new Error( + `${reason}\nCommand: ${proc.command}, output: ${proc.output}\nAlso errored killing process: ${err.message}`, + ), + ); + }, + ); }; const closeHandler = (code: number | null, signal: NodeJS.Signals | null) => { @@ -158,7 +166,7 @@ export const shell = { */ removeANSIcolors: function removeANSIcolors(text: string): string { const cleanText = text.replace( - // eslint-disable-next-line no-control-regex + // biome-ignore lint/suspicious/noControlCharactersInRegex: regex is magic /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '', ); @@ -183,7 +191,6 @@ export const shell = { let waitedFor = 0; let timedOut = false; while (!proc.output.includes(expString)) { - // eslint-disable-next-line no-await-in-loop await this.sleep(delay); waitedFor += delay; if (waitedFor > timeout) { @@ -195,11 +202,18 @@ export const shell = { if (timedOut) { // Kill the process const reason = `shell.waitForOutput timed out after ${waitedFor} ms. \nExpected output to include: ${expString}\nActual: ${proc.output}`; - shell.kill(proc).then(() => { - reject(new Error(`${reason}\nCommand: ${proc.command}, output: ${proc.output}`)); - }, (err) => { - reject(new Error(`${reason}\nCommand: ${proc.command}, output: ${proc.output}\nAlso errored killing process: ${err.message}`)); - }); + shell.kill(proc).then( + () => { + reject(new Error(`${reason}\nCommand: ${proc.command}, output: ${proc.output}`)); + }, + (err) => { + reject( + new Error( + `${reason}\nCommand: ${proc.command}, output: ${proc.output}\nAlso errored killing process: ${err.message}`, + ), + ); + }, + ); } else { resolve(); } @@ -220,13 +234,21 @@ export const shell = { }, kill: async function kill(proc: ShellProcess): Promise { return new Promise((resolve, reject) => { - treekill(proc.process.pid!, (err) => { - if (err) { - reject(new Error(`Failed to kill command "${proc.command}": errored with ${err.message}\nOutput: ${proc.output}`)); - } else { - resolve(true); - } - }); + if (proc.process.pid) { + treekill(proc.process.pid, (err) => { + if (err) { + reject( + new Error( + `Failed to kill command "${proc.command}": errored with ${err.message}\nOutput: ${proc.output}`, + ), + ); + } else { + resolve(true); + } + }); + } else { + resolve(true); + } }); }, }; diff --git a/packages/cli-test/src/types/shell.ts b/packages/cli-test/src/types/shell.ts index 47627aed7..eb1f31d80 100644 --- a/packages/cli-test/src/types/shell.ts +++ b/packages/cli-test/src/types/shell.ts @@ -1,4 +1,4 @@ -import type { ChildProcessWithoutNullStreams } from 'child_process'; +import type { ChildProcessWithoutNullStreams } from 'node:child_process'; export interface ShellProcess { /** diff --git a/packages/cli-test/src/utils/logger.ts b/packages/cli-test/src/utils/logger.ts index 294594c96..4261878b3 100644 --- a/packages/cli-test/src/utils/logger.ts +++ b/packages/cli-test/src/utils/logger.ts @@ -1,4 +1,4 @@ -import { Logger, createLogger, format, transports } from 'winston'; +import { type Logger, createLogger, format, transports } from 'winston'; // Configure CLI log level // Winston logging levels, see: https://github.com/winstonjs/winston#logging @@ -12,12 +12,7 @@ const logPrintFormat = format.printf( // Create logger const logger: Logger = createLogger({ level: loggerLevel, - format: format.combine( - format.label({ label: 'Slack CLI' }), - format.timestamp(), - format.colorize(), - logPrintFormat, - ), + format: format.combine(format.label({ label: 'Slack CLI' }), format.timestamp(), format.colorize(), logPrintFormat), transports: [new transports.Console()], }); diff --git a/packages/cli-test/src/utils/test.ts b/packages/cli-test/src/utils/test.ts index 294d37bfc..a1ed02359 100644 --- a/packages/cli-test/src/utils/test.ts +++ b/packages/cli-test/src/utils/test.ts @@ -1,6 +1,6 @@ -import child from 'child_process'; -import EventEmitter from 'events'; -import stream from 'stream'; +import type child from 'node:child_process'; +import EventEmitter from 'node:events'; +import stream from 'node:stream'; export function mockProcess(): child.ChildProcessWithoutNullStreams { const spawnProcess = new EventEmitter() as child.ChildProcessWithoutNullStreams; diff --git a/packages/cli-test/tsconfig.eslint.json b/packages/cli-test/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/cli-test/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/cli-test/tsconfig.json b/packages/cli-test/tsconfig.json index 92139ec88..83670b354 100644 --- a/packages/cli-test/tsconfig.json +++ b/packages/cli-test/tsconfig.json @@ -21,7 +21,7 @@ "access": "public" }, "exclude": [ - "src/**/*.js" + "src/**/*.spec.*" ], "ts-node": { "esm": true diff --git a/packages/client/.eslintignore b/packages/client/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/client/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/client/.eslintrc.js b/packages/client/.eslintrc.js deleted file mode 120000 index 5962fa3ca..000000000 --- a/packages/client/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintrc.js \ No newline at end of file diff --git a/packages/client/tsconfig.eslint.json b/packages/client/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/client/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/events-api/.eslintignore b/packages/events-api/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/events-api/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/events-api/.eslintrc.js b/packages/events-api/.eslintrc.js deleted file mode 120000 index 5962fa3ca..000000000 --- a/packages/events-api/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintrc.js \ No newline at end of file diff --git a/packages/events-api/tsconfig.eslint.json b/packages/events-api/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/events-api/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/interactive-messages/.eslintignore b/packages/interactive-messages/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/interactive-messages/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/interactive-messages/.eslintrc.js b/packages/interactive-messages/.eslintrc.js deleted file mode 120000 index 5962fa3ca..000000000 --- a/packages/interactive-messages/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintrc.js \ No newline at end of file diff --git a/packages/interactive-messages/tsconfig.eslint.json b/packages/interactive-messages/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/interactive-messages/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/logger/.eslintignore b/packages/logger/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/logger/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/logger/.eslintrc.js b/packages/logger/.eslintrc.js deleted file mode 120000 index 5962fa3ca..000000000 --- a/packages/logger/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintrc.js \ No newline at end of file diff --git a/packages/logger/.mocharc.json b/packages/logger/.mocharc.json index d69e0b8b3..09b509473 100644 --- a/packages/logger/.mocharc.json +++ b/packages/logger/.mocharc.json @@ -1,4 +1,4 @@ { "require": ["ts-node/register", "source-map-support/register"], "timeout": 3000 -} \ No newline at end of file +} diff --git a/packages/logger/.vscode/launch.json b/packages/logger/.vscode/launch.json index c2094e412..1c0e170cb 100644 --- a/packages/logger/.vscode/launch.json +++ b/packages/logger/.vscode/launch.json @@ -1,25 +1,15 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "node", - "request": "launch", - "name": "Logger Tests", - "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", - "args": [ - "--timeout", - "999999", - "--colors", - "${workspaceFolder}/src/*.spec.js" - ], - "internalConsoleOptions": "openOnSessionStart", - "skipFiles": [ - "/**" - ], - "cwd": "${workspaceFolder}" - }, - ] -} \ No newline at end of file + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Logger Tests", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": ["--timeout", "999999", "--colors", "${workspaceFolder}/src/*.spec.js"], + "internalConsoleOptions": "openOnSessionStart", + "skipFiles": ["/**"], + "cwd": "${workspaceFolder}" + } + ] +} diff --git a/packages/logger/.vscode/settings.json b/packages/logger/.vscode/settings.json index 6de18e4ed..97bef4c57 100644 --- a/packages/logger/.vscode/settings.json +++ b/packages/logger/.vscode/settings.json @@ -1,3 +1,3 @@ { - "typescript.tsdk": "./node_modules/typescript/lib" + "typescript.tsdk": "./node_modules/typescript/lib" } diff --git a/packages/logger/api-extractor.json b/packages/logger/api-extractor.json deleted file mode 100644 index dbbbba8b5..000000000 --- a/packages/logger/api-extractor.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - /** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - "mainEntryPointFilePath": "/dist/index.d.ts", - - "apiReport": { - "enabled": false - }, - - "docModel": { - "enabled": true, - "apiJsonFilePath": "/../../support/ref-docs/models/.api.json" - }, - - "dtsRollup": { - "enabled": false - }, - - "tsdocMetadata": { - "enabled": false - }, - - "messages": { - "extractorMessageReporting": { - // Disable release tagging warnings - "ae-missing-release-tag": { - "logLevel": "none" - } - } - } -} diff --git a/packages/logger/biome.json b/packages/logger/biome.json new file mode 100644 index 000000000..ea710a856 --- /dev/null +++ b/packages/logger/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/logger/package.json b/packages/logger/package.json index 6a0069102..f220633f3 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -4,15 +4,10 @@ "description": "Logging utility used by Node Slack SDK", "author": "Slack Technologies, LLC", "license": "MIT", - "keywords": [ - "slack", - "logging" - ], + "keywords": ["slack", "logging"], "main": "dist/index.js", "types": "dist/index.d.ts", - "files": [ - "dist/**/*" - ], + "files": ["dist/**/*"], "engines": { "node": ">= 18", "npm": ">= 8.6.0" @@ -29,31 +24,21 @@ "prepare": "npm run build", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage", - "lint": "eslint --fix --ext .ts src", + "lint": "npx @biomejs/biome check --write .", "mocha": "mocha --config .mocharc.json src/*.spec.js", "test:unit": "npm run build && npm run mocha", "test": "npm run lint && npm run coverage", - "coverage": "npm run build && c8 npm run mocha", - "ref-docs:model": "api-extractor run" + "coverage": "npm run build && c8 npm run mocha" }, "dependencies": { "@types/node": ">=18.0.0" }, "devDependencies": { - "@microsoft/api-extractor": "^7.36.4", + "@biomejs/biome": "^1.8.3", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", - "@typescript-eslint/eslint-plugin": "^6.4.1", - "@typescript-eslint/parser": "^6.4.0", "c8": "^9.1.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-import-newlines": "^1.3.4", - "eslint-plugin-jsdoc": "^46.5.0", - "eslint-plugin-node": "^11.1.0", "mocha": "^10.2.0", "shx": "^0.3.2", "sinon": "^18.0.0", diff --git a/packages/logger/src/index.spec.js b/packages/logger/src/index.spec.js index 7d284fda1..f5b5eb69e 100644 --- a/packages/logger/src/index.spec.js +++ b/packages/logger/src/index.spec.js @@ -20,10 +20,10 @@ describe('Logger', () => { }); it('should get LogLevel corrrectly', () => { - [LogLevel.DEBUG, LogLevel.ERROR, LogLevel.WARN, LogLevel.INFO].forEach((level) => { + for (const level of [LogLevel.DEBUG, LogLevel.ERROR, LogLevel.WARN, LogLevel.INFO]) { logger.setLevel(level); assert.equal(logger.getLevel(), level); - }); + } }); }); @@ -58,11 +58,7 @@ describe('Logger', () => { logger.info('test'); - assert.deepEqual(infoStub.firstCall.args, [ - '[INFO] ', - 'foobles', - 'test', - ]); + assert.deepEqual(infoStub.firstCall.args, ['[INFO] ', 'foobles', 'test']); }); }); @@ -144,4 +140,4 @@ describe('Logger', () => { }); }); }); -}); \ No newline at end of file +}); diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index 5f23f131a..177bd3415 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -1,5 +1,3 @@ -/* eslint-disable no-console */ - /** * Severity levels for log entries */ @@ -18,28 +16,28 @@ export interface Logger { * Output debug message * @param msg any data to log */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: can log anything debug(...msg: any[]): void; /** * Output info message * @param msg any data to log */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: can log anything info(...msg: any[]): void; /** * Output warn message * @param msg any data to log */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: can log anything warn(...msg: any[]): void; /** * Output error message * @param msg any data to log */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: can log anything error(...msg: any[]): void; /** @@ -74,7 +72,7 @@ export class ConsoleLogger implements Logger { /** Map of labels for each log level */ private static labels: Map = (() => { - const entries = Object.entries(LogLevel) as ([string, LogLevel])[]; + const entries = Object.entries(LogLevel) as [string, LogLevel][]; const map = entries.map(([key, value]) => [value, `[${key}] `] as [LogLevel, string]); return new Map(map); })(); @@ -113,7 +111,7 @@ export class ConsoleLogger implements Logger { /** * Log a debug message */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: can log anything public debug(...msg: any[]): void { if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.DEBUG, this.level)) { console.debug(ConsoleLogger.labels.get(LogLevel.DEBUG), this.name, ...msg); @@ -123,7 +121,7 @@ export class ConsoleLogger implements Logger { /** * Log an info message */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: can log anything public info(...msg: any[]): void { if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.INFO, this.level)) { console.info(ConsoleLogger.labels.get(LogLevel.INFO), this.name, ...msg); @@ -133,7 +131,7 @@ export class ConsoleLogger implements Logger { /** * Log a warning message */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: can log anything public warn(...msg: any[]): void { if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.WARN, this.level)) { console.warn(ConsoleLogger.labels.get(LogLevel.WARN), this.name, ...msg); @@ -143,7 +141,7 @@ export class ConsoleLogger implements Logger { /** * Log an error message */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: can log anything public error(...msg: any[]): void { if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.ERROR, this.level)) { console.error(ConsoleLogger.labels.get(LogLevel.ERROR), this.name, ...msg); diff --git a/packages/logger/tsconfig.eslint.json b/packages/logger/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/logger/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/logger/tsconfig.json b/packages/logger/tsconfig.json index b61d86ce5..139d474c6 100644 --- a/packages/logger/tsconfig.json +++ b/packages/logger/tsconfig.json @@ -13,14 +13,14 @@ "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", "baseUrl": ".", "paths": { - "*": ["./types/*"] + "*": [ + "./types/*" + ] }, - "esModuleInterop" : true, - + "esModuleInterop": true // Not using this setting because its only used to require the package.json file, and that would change the // structure of the files in the dist directory because package.json is not located inside src. It would be nice // to use import instead of require(), but its not worth the tradeoff of restructuring the build (for now). @@ -30,8 +30,7 @@ "src/**/*" ], "exclude": [ - "src/**/*.spec.js", - "src/**/*.js" + "src/**/*.spec.*" ], "jsdoc": { "out": "support/jsdoc", diff --git a/packages/oauth/.eslintignore b/packages/oauth/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/oauth/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/oauth/.eslintrc.js b/packages/oauth/.eslintrc.js deleted file mode 120000 index 5962fa3ca..000000000 --- a/packages/oauth/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintrc.js \ No newline at end of file diff --git a/packages/oauth/.vscode/launch.json b/packages/oauth/.vscode/launch.json index 5ee4fc03a..085d6544e 100644 --- a/packages/oauth/.vscode/launch.json +++ b/packages/oauth/.vscode/launch.json @@ -1,26 +1,21 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "1.0.0", - "configurations": [ - { - "type": "node", - "request": "launch", - "name": "OAuth Tests", - "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", - "args": [ - "--timeout", - "999999", - "--colors", - "${workspaceFolder}/test/integration/*.js", - "${workspaceFolder}/src/*.spec.js" - ], - "internalConsoleOptions": "openOnSessionStart", - "skipFiles": [ - "/**" - ], - "cwd": "${workspaceFolder}" - }, - ] -} \ No newline at end of file + "version": "1.0.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "OAuth Tests", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": [ + "--timeout", + "999999", + "--colors", + "${workspaceFolder}/test/integration/*.js", + "${workspaceFolder}/src/*.spec.js" + ], + "internalConsoleOptions": "openOnSessionStart", + "skipFiles": ["/**"], + "cwd": "${workspaceFolder}" + } + ] +} diff --git a/packages/oauth/.vscode/settings.json b/packages/oauth/.vscode/settings.json index 6de18e4ed..97bef4c57 100644 --- a/packages/oauth/.vscode/settings.json +++ b/packages/oauth/.vscode/settings.json @@ -1,3 +1,3 @@ { - "typescript.tsdk": "./node_modules/typescript/lib" + "typescript.tsdk": "./node_modules/typescript/lib" } diff --git a/packages/oauth/api-extractor.json b/packages/oauth/api-extractor.json deleted file mode 100644 index dbbbba8b5..000000000 --- a/packages/oauth/api-extractor.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - /** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - "mainEntryPointFilePath": "/dist/index.d.ts", - - "apiReport": { - "enabled": false - }, - - "docModel": { - "enabled": true, - "apiJsonFilePath": "/../../support/ref-docs/models/.api.json" - }, - - "dtsRollup": { - "enabled": false - }, - - "tsdocMetadata": { - "enabled": false - }, - - "messages": { - "extractorMessageReporting": { - // Disable release tagging warnings - "ae-missing-release-tag": { - "logLevel": "none" - } - } - } -} diff --git a/packages/oauth/biome.json b/packages/oauth/biome.json new file mode 100644 index 000000000..ea710a856 --- /dev/null +++ b/packages/oauth/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/oauth/package.json b/packages/oauth/package.json index 597ec6325..c1aa136a4 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -4,17 +4,9 @@ "description": "Official library for interacting with Slack's Oauth endpoints", "author": "Slack Technologies, LLC", "license": "MIT", - "keywords": [ - "slack", - "oauth", - "bot", - "http", - "api" - ], + "keywords": ["slack", "oauth", "bot", "http", "api"], "main": "dist/index.js", - "files": [ - "dist/**/*" - ], + "files": ["dist/**/*"], "engines": { "node": ">=18", "npm": ">=8.6.0" @@ -31,11 +23,10 @@ "prepare": "npm run build", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage", - "lint": "eslint --fix --ext .ts src", + "lint": "npx @biomejs/biome check --write .", "test": "npm run lint && npm run coverage", "coverage": "npm run build && c8 npm run test:mocha", - "test:mocha": "mocha --config .mocharc.json src/*.spec.js src/**/*.spec.js src/*.spec.ts src/**/*.spec.ts", - "ref-docs:model": "api-extractor run", + "test:mocha": "mocha --config .mocharc.json src/*.spec.ts src/**/*.spec.ts", "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build" }, "dependencies": { @@ -47,21 +38,12 @@ "lodash.isstring": "^4" }, "devDependencies": { - "@microsoft/api-extractor": "^7", + "@biomejs/biome": "^1.8.3", "@types/chai": "^4", "@types/mocha": "^10", "@types/sinon": "^17", - "@typescript-eslint/eslint-plugin": "^6", - "@typescript-eslint/parser": "^6", "c8": "^10.1.2", "chai": "^4", - "eslint": "^8", - "eslint-config-airbnb-base": "^15", - "eslint-config-airbnb-typescript": "^17", - "eslint-plugin-import": "^2", - "eslint-plugin-import-newlines": "^1.3.4", - "eslint-plugin-jsdoc": "^48", - "eslint-plugin-node": "^11", "mocha": "^10", "rewiremock": "^3", "shx": "^0.3.2", diff --git a/packages/oauth/src/callback-options.spec.ts b/packages/oauth/src/callback-options.spec.ts index b8cb3817f..cac66ae80 100644 --- a/packages/oauth/src/callback-options.spec.ts +++ b/packages/oauth/src/callback-options.spec.ts @@ -1,10 +1,10 @@ -import { IncomingMessage, ServerResponse } from 'http'; +import { IncomingMessage, ServerResponse } from 'node:http'; import { assert } from 'chai'; import { describe, it } from 'mocha'; import sinon from 'sinon'; -import { CallbackOptions, escapeHtml } from './callback-options'; +import { type CallbackOptions, escapeHtml } from './callback-options'; import { MissingStateError } from './errors'; describe('CallbackOptions', async () => { @@ -46,15 +46,18 @@ describe('CallbackOptions', async () => { }; const req = sinon.createStubInstance(IncomingMessage) as IncomingMessage; const resp = sinon.createStubInstance(ServerResponse) as ServerResponse; - callbackOptions.success!(installation, options, req, resp); + callbackOptions.success?.(installation, options, req, resp); const error = new MissingStateError(); - callbackOptions.failure!(error, options, req, resp); + callbackOptions.failure?.(error, options, req, resp); }); it('should escape special characters when using the default page rendering', async () => { assert.strictEqual(escapeHtml('slack://app?team=T111&id=A111'), 'slack://app?team=T111&id=A111'); - assert.strictEqual(escapeHtml('https://www.example.com?foo=bar&baz=123'), 'https://www.example.com?foo=bar&baz=123'); + assert.strictEqual( + escapeHtml('https://www.example.com?foo=bar&baz=123'), + 'https://www.example.com?foo=bar&baz=123', + ); assert.strictEqual(escapeHtml('test'), '<b>test</b>'); }); // TODO: tests for default callbacks diff --git a/packages/oauth/src/callback-options.ts b/packages/oauth/src/callback-options.ts index 7e4f06a7f..a75b36b54 100644 --- a/packages/oauth/src/callback-options.ts +++ b/packages/oauth/src/callback-options.ts @@ -1,11 +1,10 @@ -import { IncomingMessage, ServerResponse } from 'http'; +import type { IncomingMessage, ServerResponse } from 'node:http'; -import { CodedError, ErrorCode } from './errors'; -import { InstallURLOptions } from './install-url-options'; -import { Installation, OrgInstallation } from './installation'; +import { type CodedError, ErrorCode } from './errors'; +import type { InstallURLOptions } from './install-url-options'; +import type { Installation, OrgInstallation } from './installation'; export interface CallbackOptions { - /** * An additional logic to run right before executing the Slack app installation with the given OAuth code parameter. * @@ -119,7 +118,6 @@ 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); } @@ -141,7 +139,6 @@ 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 = ` @@ -171,12 +168,13 @@ function isOrgInstall(installation: Installation): installation is OrgInstallati } function isNotOrgInstall(installation: Installation): installation is Installation<'v1' | 'v2', false> { - return !(isOrgInstall(installation)); + return !isOrgInstall(installation); } export function escapeHtml(input: string | undefined | null): string { if (input) { - return input.replace(/&/g, '&') + return input + .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') diff --git a/packages/oauth/src/default-render-html-for-install-path.spec.js b/packages/oauth/src/default-render-html-for-install-path.spec.js deleted file mode 100644 index bdf5d37e4..000000000 --- a/packages/oauth/src/default-render-html-for-install-path.spec.js +++ /dev/null @@ -1,11 +0,0 @@ -require('mocha'); -const { assert } = require('chai'); -const { default: defaultRenderHtmlForInstallPath } = require('./default-render-html-for-install-path'); - -describe('defaultRenderHtmlForInstallPath', async () => { - it('should render an HTML text with a given URL', async () => { - const url = 'https://expected-url'; - const html = defaultRenderHtmlForInstallPath(url); - assert.isTrue(html.includes(``)); - }); -}); diff --git a/packages/oauth/src/default-render-html-for-install-path.spec.ts b/packages/oauth/src/default-render-html-for-install-path.spec.ts new file mode 100644 index 000000000..88f0dbcf3 --- /dev/null +++ b/packages/oauth/src/default-render-html-for-install-path.spec.ts @@ -0,0 +1,10 @@ +import { assert } from 'chai'; +import defaultRenderHtmlForInstallPath from './default-render-html-for-install-path'; + +describe('defaultRenderHtmlForInstallPath', () => { + it('should render an HTML text with a given URL', () => { + const url = 'https://expected-url'; + const html = defaultRenderHtmlForInstallPath(url); + assert.isTrue(html.includes(``)); + }); +}); diff --git a/packages/oauth/src/install-path-options.spec.ts b/packages/oauth/src/install-path-options.spec.ts index 43ecb19f2..1bc79325e 100644 --- a/packages/oauth/src/install-path-options.spec.ts +++ b/packages/oauth/src/install-path-options.spec.ts @@ -1,10 +1,10 @@ -import { IncomingMessage, ServerResponse } from 'http'; +import { IncomingMessage, ServerResponse } from 'node:http'; import { assert } from 'chai'; import { describe, it } from 'mocha'; import sinon from 'sinon'; -import { InstallPathOptions } from './install-path-options'; +import type { InstallPathOptions } from './install-path-options'; describe('InstallPathOptions', async () => { it('should have beforeRedirection', async () => { @@ -20,7 +20,7 @@ describe('InstallPathOptions', async () => { const req = sinon.createStubInstance(IncomingMessage) as IncomingMessage; const resp = sinon.createStubInstance(ServerResponse) as ServerResponse; const options = { scopes: ['commands', 'chat:write'] }; - const result = await installPathOptions.beforeRedirection!(req, resp, options); + const result = await installPathOptions.beforeRedirection?.(req, resp, options); assert.isFalse(result); }); }); diff --git a/packages/oauth/src/install-path-options.ts b/packages/oauth/src/install-path-options.ts index b1c6733b5..f53f43555 100644 --- a/packages/oauth/src/install-path-options.ts +++ b/packages/oauth/src/install-path-options.ts @@ -1,13 +1,12 @@ -import { IncomingMessage, ServerResponse } from 'http'; +import type { IncomingMessage, ServerResponse } from 'node:http'; -import { InstallURLOptions } from './install-url-options'; +import type { InstallURLOptions } from './install-url-options'; /** * Customizable callbacks that are supposed to be called * inside InstallProvider#handleInstallPath() method. */ export interface InstallPathOptions { - /** * Customize the response headers and body data for * additional user-specific data handling such as acccount mapping and activity tracking. diff --git a/packages/oauth/src/install-provider-options.spec.ts b/packages/oauth/src/install-provider-options.spec.ts index 40df9c299..ffcd5fff8 100644 --- a/packages/oauth/src/install-provider-options.spec.ts +++ b/packages/oauth/src/install-provider-options.spec.ts @@ -1,7 +1,7 @@ import { assert } from 'chai'; import { describe, it } from 'mocha'; -import { InstallProviderOptions } from './install-provider-options'; +import type { InstallProviderOptions } from './install-provider-options'; describe('InstallProviderOptions', async () => { it('should be compatible with past versions in terms of required args', async () => { diff --git a/packages/oauth/src/install-provider-options.ts b/packages/oauth/src/install-provider-options.ts index bc9583fab..dddb3b3ac 100644 --- a/packages/oauth/src/install-provider-options.ts +++ b/packages/oauth/src/install-provider-options.ts @@ -1,12 +1,11 @@ -import { LogLevel, Logger } from '@slack/logger'; -import { WebClientOptions } from '@slack/web-api'; +import type { LogLevel, Logger } from '@slack/logger'; +import type { WebClientOptions } from '@slack/web-api'; -import { InstallURLOptions } from './install-url-options'; -import { InstallationStore } from './installation-stores'; -import { StateStore } from './state-stores'; +import type { InstallURLOptions } from './install-url-options'; +import type { InstallationStore } from './installation-stores'; +import type { StateStore } from './state-stores'; export interface InstallProviderOptions { - /** * Client ID, which can be found under the Basic Information section of your application on https://api.slack.com/apps */ @@ -97,5 +96,4 @@ export interface InstallProviderOptions { * The customization options for WebClient */ clientOptions?: Omit; - } diff --git a/packages/oauth/src/install-provider.spec.js b/packages/oauth/src/install-provider.spec.ts similarity index 57% rename from packages/oauth/src/install-provider.spec.js rename to packages/oauth/src/install-provider.spec.ts index 1bd4603c2..e4f0d80c4 100644 --- a/packages/oauth/src/install-provider.spec.js +++ b/packages/oauth/src/install-provider.spec.ts @@ -1,22 +1,12 @@ -require('mocha'); -const { assert } = require('chai'); - -const url = require('url'); -const rewiremock = require('rewiremock/node'); -const sinon = require('sinon'); -const { ErrorCode } = require('./errors'); -const { LogLevel } = require('./logger'); +import url from 'node:url'; +import { assert } from 'chai'; +import rewiremock from 'rewiremock'; +import sinon from 'sinon'; // Stub WebClient api calls that the OAuth package makes -// expose clientOptions passed in to WebClient as global so we can assert on its contents -let webClientOptions; rewiremock(() => require('@slack/web-api')).with({ + // @ts-expect-error: missing some irrelevant class properties in this mock WebClient: class { - constructor(token, options) { - this.token = token; - this.options = options; - webClientOptions = options; - }; auth = { test: sinon.fake.resolves({ bot_id: '' }), }; @@ -33,20 +23,42 @@ rewiremock(() => require('@slack/web-api')).with({ appId: 'fakeAppId', }), v2: { - access: (options) => mockedV2AccessResp(options), - } - } + access: async (options: OAuthV2AccessArguments) => { + return mockedV2AccessResp(options); + }, + }, + }; }, }); +rewiremock.enable(); +import { + type CallbackOptions, + type InstallPathOptions, + InstallProvider, + type Installation, + type InstallationStore, + type StateStore, +} from './index'; +rewiremock.disable(); +import type { OAuthV2AccessArguments, OauthV2AccessResponse, WebClientOptions } from '@slack/web-api'; +import { + type AuthorizationError, + ErrorCode, + type GenerateInstallUrlError, + type InstallerInitializationError, +} from './errors'; +import { LogLevel, type Logger } from './logger'; +const webClientOptions: WebClientOptions = { timeout: 1000 }; -async function mockedV2AccessResp(options) { - const mockedResp = { +async function mockedV2AccessResp(options: OAuthV2AccessArguments): Promise { + const mockedResp: OauthV2AccessResponse = { + ok: true, team: { id: 'fake-v2-team-id', name: 'fake-team-name' }, access_token: 'botToken', bot_user_id: 'botUserId', scope: 'chat:write,chat:read', - appId: 'fakeAppId', - enterprise: null, + app_id: 'fakeAppId', + enterprise: undefined, token_type: 'bot', }; @@ -56,51 +68,47 @@ async function mockedV2AccessResp(options) { mockedResp.refresh_token = 'newRefreshToken'; mockedResp.expires_in = 43200; // 12 hours - if (options.refresh_token.startsWith('user')) { + if (options.refresh_token?.startsWith('user')) { mockedResp.token_type = 'user'; } } else { - mockedResp.authed_user = { id: 'userId', access_token: 'userAccessToken', }; + mockedResp.authed_user = { id: 'userId', access_token: 'userAccessToken' }; } - return mockedResp; + return Promise.resolve(mockedResp); } -rewiremock.enable(); -const { InstallProvider } = require('./index'); -rewiremock.disable(); - const clientSecret = 'MY_SECRET'; const clientId = 'MY_ID'; const stateSecret = 'stateSecret'; // Memory database -const devDB = {}; +const devDB: Record = {}; // MemoryInstallation Store for testing -const installationStore = { +const installationStore: InstallationStore = { storeInstallation: (installation) => { + const id = installation.team?.id || installation.enterprise?.id; + if (!id) return Promise.reject('no team or enterprise ID found!'); // db write - devDB[installation.team.id] = installation; - return new Promise((resolve) => { - resolve(); - }); + devDB[id] = installation; + return Promise.resolve(); }, fetchInstallation: (installQuery) => { + const id = installQuery.teamId || installQuery.enterpriseId; + if (!id) return Promise.reject('no team or enterprise ID found!'); // db read - const item = devDB[installQuery.teamId]; - return new Promise((resolve) => { - resolve(item); - }); + const item = devDB[id]; + return Promise.resolve(item); }, deleteInstallation: (installQuery) => { + const id = installQuery.teamId || installQuery.enterpriseId; + if (!id) return Promise.reject('no team or enterprise ID found!'); // db delete - delete devDB[installQuery.teamId]; - return new Promise((resolve) => { - resolve(); - }); - } -} + delete devDB[id]; + return Promise.resolve(); + }, +}; const storedInstallation = { team: { @@ -120,6 +128,7 @@ const storedInstallation = { user: { token: 'userToken', id: 'userId', + scopes: [], }, incomingWebhook: { url: 'example.com', @@ -128,13 +137,13 @@ const storedInstallation = { configurationUrl: 'someConfigURL', }, appId: 'fakeAppId', - tokenType: 'tokenType', + tokenType: 'bot' as const, isEnterpriseInstall: false, -} +}; // TODO: valid tests with org-wide installations const storedOrgInstallation = { - team: null, + team: undefined, enterprise: { id: 'test-enterprise-id', name: 'ent-name', @@ -148,6 +157,7 @@ const storedOrgInstallation = { user: { token: 'userToken', id: 'userId', + scopes: [], }, incomingWebhook: { url: 'example.com', @@ -156,91 +166,137 @@ const storedOrgInstallation = { configurationUrl: 'someConfigURL', }, appId: undefined, - tokenType: 'tokenType', + tokenType: 'bot' as const, isEnterpriseInstall: true, -} +}; // store our fake installation Object to the memory database. devDB[storedInstallation.team.id] = storedInstallation; devDB[storedOrgInstallation.enterprise.id] = storedOrgInstallation; describe('InstallProvider', async () => { - const noopLogger = { - debug(..._msg) { /* noop */ }, - info(..._msg) { /* noop */ }, - warn(..._msg) { /* noop */ }, - error(..._msg) { /* noop */ }, - setLevel(_level) { /* noop */ }, - getLevel() { return LogLevel.DEBUG; }, - setName(_name) { /* noop */ }, + const noopLogger: Logger = { + debug(..._msg) { + /* noop */ + }, + info(..._msg) { + /* noop */ + }, + warn(..._msg) { + /* noop */ + }, + error(..._msg) { + /* noop */ + }, + setLevel(_level) { + /* noop */ + }, + getLevel() { + return LogLevel.DEBUG; + }, + setName(_name) { + /* noop */ + }, }; describe('constructor()', async () => { it('should build a default installer given a clientID, client secret and stateSecret', async () => { - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, logger: noopLogger, }); + const installer = new InstallProvider({ clientId, clientSecret, stateSecret, logger: noopLogger }); assert.instanceOf(installer, InstallProvider); - assert.equal(installer.authVersion, 'v2'); + assert.propertyVal(installer, 'authVersion', 'v2'); }); it('should build a default installer given a clientID, client secret, stateSecret and clientOptions', async () => { - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, logger: noopLogger, clientOptions: fooClientOptions }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + logger: noopLogger, + clientOptions: webClientOptions, + }); assert.instanceOf(installer, InstallProvider); - assert.equal(installer.authVersion, 'v2'); - assert.equal(installer.clientOptions.foo, 'bar'); + assert.propertyVal(installer, 'authVersion', 'v2'); + assert.nestedPropertyVal(installer, 'clientOptions.timeout', webClientOptions.timeout); }); it('should build a default installer given a clientID, client secret and state store', async () => { // stateStore for testing const fakeStateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) - } + verifyStateParam: sinon.fake.resolves({}), + }; - const installer = new InstallProvider({ clientId, clientSecret, stateStore: fakeStateStore, logger: noopLogger, }); + const installer = new InstallProvider({ clientId, clientSecret, stateStore: fakeStateStore, logger: noopLogger }); assert.instanceOf(installer, InstallProvider); }); it('should build a default installer given a clientID, client secret, stateSecrect and installationStore', async () => { - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, logger: noopLogger, }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + logger: noopLogger, + }); assert.instanceOf(installer, InstallProvider); }); it('should build a default installer given a clientID, client secret, stateSecrect and authVersion v2', async () => { - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, authVersion: 'v2', logger: noopLogger, }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + authVersion: 'v2', + logger: noopLogger, + }); assert.instanceOf(installer, InstallProvider); - assert.equal(installer.authVersion, 'v2'); + assert.propertyVal(installer, 'authVersion', 'v2'); }); it('should build a default installer given a clientID, client secret, stateSecrect and authVersion v1', async () => { - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, authVersion: 'v1', logger: noopLogger, }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + authVersion: 'v1', + logger: noopLogger, + }); assert.instanceOf(installer, InstallProvider); - assert.equal(installer.authVersion, 'v1'); + assert.propertyVal(installer, 'authVersion', 'v1'); }); it('should throw an error if missing a clientSecret', async () => { try { - new InstallProvider({ clientId, stateSecret, logger: noopLogger, }); + // @ts-expect-error missing required arguments + new InstallProvider({ clientId, stateSecret, logger: noopLogger }); + assert.fail('expected rejection'); } catch (error) { - assert.equal(error.code, ErrorCode.InstallerInitializationError); - assert.equal(error.message, 'You must provide a valid clientId and clientSecret'); + const e = error as InstallerInitializationError; + assert.equal(e.code, ErrorCode.InstallerInitializationError); + assert.equal(e.message, 'You must provide a valid clientId and clientSecret'); } }); it('should throw an error if missing a clientID', async () => { try { - new InstallProvider({ clientSecret, stateSecret, logger: noopLogger, }); + // @ts-expect-error missing required arguments + new InstallProvider({ clientSecret, stateSecret, logger: noopLogger }); + assert.fail('expected rejection'); } catch (error) { - assert.equal(error.code, ErrorCode.InstallerInitializationError); - assert.equal(error.message, 'You must provide a valid clientId and clientSecret'); + const e = error as InstallerInitializationError; + assert.equal(e.code, ErrorCode.InstallerInitializationError); + assert.equal(e.message, 'You must provide a valid clientId and clientSecret'); } }); it('should throw an error if missing a stateSecret when using default state store', async () => { try { - new InstallProvider({ clientId, clientSecret, logger: noopLogger, }); + new InstallProvider({ clientId, clientSecret, logger: noopLogger }); + assert.fail('expected rejection'); } catch (error) { - assert.equal(error.code, ErrorCode.InstallerInitializationError); - assert.equal(error.message, 'To use the built-in state store you must provide a State Secret'); + const e = error as InstallerInitializationError; + assert.equal(e.code, ErrorCode.InstallerInitializationError); + assert.equal(e.message, 'To use the built-in state store you must provide a State Secret'); } }); }); @@ -253,28 +309,34 @@ describe('InstallProvider', async () => { installUrlOptions: undefined, stateStore: { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) + verifyStateParam: sinon.fake.resolves({ scopes: [] }), }, logger: noopLogger, }); const req = {}; - const headers = {}; + const headers: Record = {}; const res = { - getHeader(n) { return headers[n]; }, - setHeader(n, v) { headers[n] = v; }, - writeHead: () => {}, end: () => {}, + getHeader(n: string) { + return headers[n]; + }, + setHeader(n: string, v: string) { + headers[n] = v; + }, + writeHead: () => {}, + end: () => {}, }; try { + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleInstallPath(req, res); - assert.fail('Exception should be thrown') - } catch (e) { + assert.fail('Exception should be thrown'); + } catch (error) { + const e = error as GenerateInstallUrlError; assert.equal(e.code, ErrorCode.GenerateInstallUrlError); } }); const installUrlOptions = { scopes: ['channels:read'], - metadata: 'some_metadata', teamId: 'T12345', redirectUri: 'https://mysite.com/slack/redirect', userScopes: ['chat:write:user'], @@ -289,21 +351,29 @@ describe('InstallProvider', async () => { directInstall: true, stateStore: { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) + verifyStateParam: sinon.fake.resolves({ scopes: [] }), }, logger: noopLogger, }); const req = {}; - const headers = {}; + const headers: Record = {}; const res = { - getHeader(n) { return headers[n]; }, - setHeader(n, v) { headers[n] = v; }, - writeHead: () => {}, end: () => {}, + getHeader(n: string) { + return headers[n]; + }, + setHeader(n: string, v: string) { + headers[n] = v; + }, + writeHead: () => {}, end: () => {}, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleInstallPath(req, res); - assert.equal(headers['Location'], 'https://slack.com/oauth/v2/authorize?scope=channels%3Aread&state=fakeState&client_id=MY_ID&redirect_uri=https%3A%2F%2Fmysite.com%2Fslack%2Fredirect&team=T12345&user_scope=chat%3Awrite%3Auser'); + assert.equal( + headers.Location, + 'https://slack.com/oauth/v2/authorize?scope=channels%3Aread&state=fakeState&client_id=MY_ID&redirect_uri=https%3A%2F%2Fmysite.com%2Fslack%2Fredirect&team=T12345&user_scope=chat%3Awrite%3Auser', + ); assert.equal(headers['Set-Cookie'], 'slack-app-oauth-state=fakeState; Secure; HttpOnly; Path=/; Max-Age=600'); }); it('should redirect installers with data set by InstallPathOptions.beforeRedirection()', async () => { @@ -314,27 +384,35 @@ describe('InstallProvider', async () => { directInstall: true, stateStore: { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) + verifyStateParam: sinon.fake.resolves({ scopes: [] }), }, logger: noopLogger, }); const req = {}; - const headers = {}; + const headers: Record = {}; const res = { - getHeader(n) { return headers[n]; }, - setHeader(n, v) { headers[n] = v; }, + getHeader(n: string) { + return headers[n]; + }, + setHeader(n: string, v: string) { + headers[n] = v; + }, writeHead: () => {}, end: () => {}, }; - const installPathOptions = { + const installPathOptions: InstallPathOptions = { beforeRedirection: async (_, res) => { res.setHeader('Set-Cookie', 'additional-cookie=external-service-user-id; Secure; HttpOnly;'); return true; }, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleInstallPath(req, res, installPathOptions); - assert.equal(headers['Location'], 'https://slack.com/oauth/v2/authorize?scope=channels%3Aread&state=fakeState&client_id=MY_ID&redirect_uri=https%3A%2F%2Fmysite.com%2Fslack%2Fredirect&team=T12345&user_scope=chat%3Awrite%3Auser'); + assert.equal( + headers.Location, + 'https://slack.com/oauth/v2/authorize?scope=channels%3Aread&state=fakeState&client_id=MY_ID&redirect_uri=https%3A%2F%2Fmysite.com%2Fslack%2Fredirect&team=T12345&user_scope=chat%3Awrite%3Auser', + ); assert.equal(headers['Set-Cookie'][0], 'additional-cookie=external-service-user-id; Secure; HttpOnly;'); assert.equal(headers['Set-Cookie'][1], 'slack-app-oauth-state=fakeState; Secure; HttpOnly; Path=/; Max-Age=600'); }); @@ -344,9 +422,9 @@ describe('InstallProvider', async () => { it('should return a generated v2 url', async () => { const fakeStateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) - } - const installer = new InstallProvider({ clientId, clientSecret, stateStore: fakeStateStore, logger: noopLogger, }); + verifyStateParam: sinon.fake.resolves({}), + }; + const installer = new InstallProvider({ clientId, clientSecret, stateStore: fakeStateStore, logger: noopLogger }); const scopes = ['channels:read']; const teamId = '1234Team'; const redirectUri = 'https://mysite.com/slack/redirect'; @@ -360,7 +438,7 @@ describe('InstallProvider', async () => { userScopes, }; try { - const generatedUrl = await installer.generateInstallUrl(installUrlOptions, stateVerification) + const generatedUrl = await installer.generateInstallUrl(installUrlOptions, stateVerification); assert.exists(generatedUrl); assert.equal(fakeStateStore.generateStateParam.callCount, 1); assert.equal(fakeStateStore.verifyStateParam.callCount, 0); @@ -374,20 +452,26 @@ describe('InstallProvider', async () => { assert.equal(teamId, parsedUrl.query.team); assert.equal(userScopes.join(','), parsedUrl.query.user_scope); } catch (error) { - assert.fail(error.message); + assert.fail((error as Error).message); } }); it('should not call generate state param when state validation is false', async () => { const fakeStateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) - } + verifyStateParam: sinon.fake.resolves({}), + }; const authorizationUrl = 'https://dev.slack.com/oauth/v2/authorize'; - const installer = new InstallProvider({ clientId, clientSecret, stateStore: fakeStateStore, authorizationUrl, logger: noopLogger, }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateStore: fakeStateStore, + authorizationUrl, + logger: noopLogger, + }); const scopes = ['channels:read']; const teamId = '1234Team'; const redirectUri = 'https://mysite.com/slack/redirect'; - const userScopes = ['chat:write:user'] + const userScopes = ['chat:write:user']; const stateVerification = false; const installUrlOptions = { scopes, @@ -397,25 +481,31 @@ describe('InstallProvider', async () => { userScopes, }; try { - const generatedUrl = await installer.generateInstallUrl(installUrlOptions, stateVerification) + const generatedUrl = await installer.generateInstallUrl(installUrlOptions, stateVerification); assert.exists(generatedUrl); assert.equal(fakeStateStore.generateStateParam.callCount, 0); assert.equal(fakeStateStore.verifyStateParam.callCount, 0); } catch (error) { - assert.fail(error.message); + assert.fail((error as Error).message); } }); it('should return a generated url when passed a custom authorizationUrl', async () => { const fakeStateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) - } + verifyStateParam: sinon.fake.resolves({}), + }; const authorizationUrl = 'https://dev.slack.com/oauth/v2/authorize'; - const installer = new InstallProvider({ clientId, clientSecret, stateStore: fakeStateStore, authorizationUrl, logger: noopLogger, }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateStore: fakeStateStore, + authorizationUrl, + logger: noopLogger, + }); const scopes = ['channels:read']; const teamId = '1234Team'; const redirectUri = 'https://mysite.com/slack/redirect'; - const userScopes = ['chat:write:user'] + const userScopes = ['chat:write:user']; const installUrlOptions = { scopes, metadata: 'some_metadata', @@ -424,7 +514,7 @@ describe('InstallProvider', async () => { userScopes, }; try { - const generatedUrl = await installer.generateInstallUrl(installUrlOptions) + const generatedUrl = await installer.generateInstallUrl(installUrlOptions); assert.exists(generatedUrl); assert.equal(fakeStateStore.generateStateParam.callCount, 1); assert.equal(fakeStateStore.verifyStateParam.callCount, 0); @@ -433,22 +523,28 @@ describe('InstallProvider', async () => { const parsedUrl = url.parse(generatedUrl, true); assert.equal(parsedUrl.query.state, 'fakeState'); assert.equal(parsedUrl.pathname, '/oauth/v2/authorize'); - assert.equal(parsedUrl.host, 'dev.slack.com') + assert.equal(parsedUrl.host, 'dev.slack.com'); assert.equal(scopes.join(','), parsedUrl.query.scope); assert.equal(redirectUri, parsedUrl.query.redirect_uri); assert.equal(teamId, parsedUrl.query.team); assert.equal(userScopes.join(','), parsedUrl.query.user_scope); } catch (error) { - assert.fail(error.message); + assert.fail((error as Error).message); } }); it('should return a generated v1 url', async () => { const fakeStateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) - } - const installer = new InstallProvider({ clientId, clientSecret, 'stateStore': fakeStateStore, authVersion: 'v1', logger: noopLogger, }); + verifyStateParam: sinon.fake.resolves({}), + }; + const installer = new InstallProvider({ + clientId, + clientSecret, + stateStore: fakeStateStore, + authVersion: 'v1', + logger: noopLogger, + }); const scopes = ['bot']; const teamId = '1234Team'; const redirectUri = 'https://mysite.com/slack/redirect'; @@ -460,7 +556,7 @@ describe('InstallProvider', async () => { redirectUri, }; try { - const generatedUrl = await installer.generateInstallUrl(installUrlOptions, stateVerification) + const generatedUrl = await installer.generateInstallUrl(installUrlOptions, stateVerification); assert.exists(generatedUrl); const parsedUrl = url.parse(generatedUrl, true); assert.equal(fakeStateStore.generateStateParam.callCount, 1); @@ -472,85 +568,120 @@ describe('InstallProvider', async () => { assert.equal(redirectUri, parsedUrl.query.redirect_uri); assert.equal(teamId, parsedUrl.query.team); } catch (error) { - assert.fail(error.message); + assert.fail((error as Error).message); } }); it('should fail if missing scopes', async () => { - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, logger: noopLogger, }); + const installer = new InstallProvider({ clientId, clientSecret, stateSecret, logger: noopLogger }); try { - const generatedUrl = await installer.generateInstallUrl({}) + const generatedUrl = await installer.generateInstallUrl({ scopes: [] }); assert.exists(generatedUrl); } catch (error) { - assert.equal(error.message, 'You must provide a scope parameter when calling generateInstallUrl'); - assert.equal(error.code, ErrorCode.GenerateInstallUrlError); + const e = error as GenerateInstallUrlError; + assert.equal(e.message, 'You must provide a scope parameter when calling generateInstallUrl'); + assert.equal(e.code, ErrorCode.GenerateInstallUrlError); } }); }); describe('installer.authorize', async () => { it('should fail if database does not have an entry for authorize query', async () => { - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore,logger: noopLogger, }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + logger: noopLogger, + }); try { - const authResult = await installer.authorize({ teamId: 'non_existing_team_id' }); + await installer.authorize({ + teamId: 'non_existing_team_id', + isEnterpriseInstall: false, + enterpriseId: undefined, + }); assert.fail('Should have failed'); } catch (error) { - assert.equal(error.code, ErrorCode.AuthorizationError); - assert.equal(error.message, 'Failed fetching data from the Installation Store (source: {"teamId":"non_existing_team_id"})'); + const e = error as AuthorizationError; + assert.equal(e.code, ErrorCode.AuthorizationError); + assert.equal( + e.message, + 'Failed fetching data from the Installation Store (source: {"teamId":"non_existing_team_id","isEnterpriseInstall":false})', + ); } }); it('should successfully return the Installation Object from the database', async () => { - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore,logger: noopLogger, }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + logger: noopLogger, + }); const fakeAuthResult = { userToken: 'userToken', botToken: 'botToken', botId: 'botId', - botUserId: 'botUserId' + botUserId: 'botUserId', }; try { - const authResult = await installer.authorize({ teamId: 'test-team-id' }); + const authResult = await installer.authorize({ + teamId: 'test-team-id', + isEnterpriseInstall: false, + enterpriseId: undefined, + }); assert.equal(authResult.userToken, fakeAuthResult.userToken); assert.equal(authResult.botToken, fakeAuthResult.botToken); assert.equal(authResult.botId, fakeAuthResult.botId); assert.equal(authResult.botUserId, fakeAuthResult.botUserId); } catch (error) { - assert.fail(error.message); + assert.fail((error as Error).message); } }); }); describe('installer.handleCallback', async () => { - let fakeStateStore = undefined; + let fakeStateStore: StateStore; + let sent = false; + const res = { + end: () => { + sent = true; + }, + setHeader: () => {}, + }; beforeEach(() => { fakeStateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) - } + verifyStateParam: sinon.fake.resolves({ scopes: [] }), + }; + sent = false; }); it('should call the failure callback with a valid installOptions due to missing code query parameter on the URL', async () => { - const req = { headers: { host: 'example.com'}, url: 'http://example.com' }; - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, - }; - const callbackOptions = { - success: async (installation, installOptions, req, res) => { - res.send('successful!'); + const req = { headers: { host: 'example.com' }, url: 'http://example.com' }; + const callbackOptions: CallbackOptions = { + success: async (_installation, _installOptions, _req, res) => { + res.end('successful!'); assert.fail('should have failed'); }, - failure: async (error, installOptions, req, res) => { + failure: async (error, installOptions, _req, res) => { // To detect future regressions, we verify if there is a valid installOptions here // Refer to https://github.com/slackapi/node-slack-sdk/pull/1410 for the context assert.isDefined(installOptions); assert.equal(error.code, ErrorCode.MissingCodeError); - res.send('failure'); + res.end('failure'); }, - } - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, logger: noopLogger, }); + }; + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + logger: noopLogger, + }); + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, callbackOptions); assert.isTrue(sent); @@ -563,71 +694,79 @@ describe('InstallProvider', async () => { }, url: 'http://example.com?code=1234', }; - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, - }; - const callbackOptions = { - success: async (installation, installOptions, req, res) => { - res.send('successful!'); + const callbackOptions: CallbackOptions = { + success: async (_installation, _installOptions, _req, res) => { + res.end('successful!'); assert.fail('should have failed'); }, - failure: async (error, installOptions, req, res) => { + failure: async (error, installOptions, _req, res) => { assert.isDefined(installOptions); - assert.equal(error.code, ErrorCode.MissingStateError) - res.send('failure'); + assert.equal(error.code, ErrorCode.MissingStateError); + res.end('failure'); }, - } - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, logger: noopLogger, }); + }; + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + logger: noopLogger, + }); + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, callbackOptions); assert.isTrue(sent); }); it('should call the success callback when state query param is missing but stateVerification disabled', async () => { - const req = { headers: { host: 'example.com'}, url: 'http://example.com?code=1234' }; - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, - }; - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, stateVerification: false, installationStore, logger: noopLogger, }); + const req = { headers: { host: 'example.com' }, url: 'http://example.com?code=1234' }; + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + stateVerification: false, + installationStore, + logger: noopLogger, + }); + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, successExpectedCallbackOptions); assert.isTrue(sent); }); it('should call the failure callback if an access_denied error query parameter was returned on the URL', async () => { - const req = { headers: { host: 'example.com'}, url: 'http://example.com?error=access_denied' }; - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, - }; - const callbackOptions = { - success: async (installation, installOptions, req, res) => { - res.send('successful!'); + const req = { headers: { host: 'example.com' }, url: 'http://example.com?error=access_denied' }; + const callbackOptions: CallbackOptions = { + success: async (_installation, _installOptions, _req, res) => { + res.end('successful!'); assert.fail('should have failed'); }, - failure: async (error, installOptions, req, res) => { + failure: async (error, installOptions, _req, res) => { assert.isDefined(installOptions); - assert.equal(error.code, ErrorCode.AuthorizationError) - res.send('failure'); + assert.equal(error.code, ErrorCode.AuthorizationError); + res.end('failure'); }, - } - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, logger: noopLogger, }); + }; + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + logger: noopLogger, + }); + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, callbackOptions); assert.isTrue(sent); }); it('should call the success callback for a v2 url', async () => { - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, - }; - const installer = new InstallProvider({ clientId, clientSecret, installationStore, stateStore: fakeStateStore, logger: noopLogger, }); + const installer = new InstallProvider({ + clientId, + clientSecret, + installationStore, + stateStore: fakeStateStore, + logger: noopLogger, + }); const fakeState = 'fakeState'; const fakeCode = 'fakeCode'; const req = { @@ -637,18 +776,21 @@ describe('InstallProvider', async () => { }, url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, successExpectedCallbackOptions); assert.isTrue(sent); - assert.equal(fakeStateStore.verifyStateParam.callCount, 1); + assert.equal((fakeStateStore.verifyStateParam as sinon.SinonSpy).callCount, 1); }); - it('should call the success callback for a v2 url and client options passed into InstallProvider should be propagated to the underlying @web-api WebClient', async () => { - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, - }; - const installer = new InstallProvider({ clientId, clientSecret, installationStore, stateStore: fakeStateStore, logger: noopLogger, clientOptions: fooClientOptions }); + it('should call the success callback for a v2 url', async () => { + const installer = new InstallProvider({ + clientId, + clientSecret, + installationStore, + stateStore: fakeStateStore, + logger: noopLogger, + clientOptions: webClientOptions, + }); const fakeState = 'fakeState'; const fakeCode = 'fakeCode'; const req = { @@ -658,19 +800,22 @@ describe('InstallProvider', async () => { }, url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, successExpectedCallbackOptions); assert.isTrue(sent); - assert.equal(fakeStateStore.verifyStateParam.callCount, 1); - assert.equal(webClientOptions.foo, fooClientOptions.foo); + assert.equal((fakeStateStore.verifyStateParam as sinon.SinonSpy).callCount, 1); }); it('should call the success callback for a v1 url', async () => { - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, - }; - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, stateStore: fakeStateStore, authVersion: 'v1', logger: noopLogger, }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + stateStore: fakeStateStore, + authVersion: 'v1', + logger: noopLogger, + }); const fakeState = 'fakeState'; const fakeCode = 'fakeCode'; const req = { @@ -680,18 +825,23 @@ describe('InstallProvider', async () => { }, url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, successExpectedCallbackOptions); assert.isTrue(sent); - assert.equal(fakeStateStore.verifyStateParam.callCount, 1); + assert.equal((fakeStateStore.verifyStateParam as sinon.SinonSpy).callCount, 1); }); - it('should call the success callback for a v1 url and client options passed into InstallProvider should be propagated to the underlying @web-api WebClient', async () => { - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, - }; - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, stateStore: fakeStateStore, authVersion: 'v1', logger: noopLogger, clientOptions: fooClientOptions }); + it('should call the success callback for a v1 url', async () => { + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + stateStore: fakeStateStore, + authVersion: 'v1', + logger: noopLogger, + clientOptions: webClientOptions, + }); const fakeState = 'fakeState'; const fakeCode = 'fakeCode'; const req = { @@ -701,20 +851,26 @@ describe('InstallProvider', async () => { }, url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, successExpectedCallbackOptions); assert.isTrue(sent); - assert.equal(fakeStateStore.verifyStateParam.callCount, 1); - assert.equal(webClientOptions.foo, fooClientOptions.foo); + assert.equal((fakeStateStore.verifyStateParam as sinon.SinonSpy).callCount, 1); }); it('should not verify state when stateVerification is false', async () => { const fakeStateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) + verifyStateParam: sinon.fake.resolves({}), }; - let sent = false; - const res = { send: () => { sent = true; } }; - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, stateVerification: false, installationStore, stateStore: fakeStateStore, logger: noopLogger, }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + stateVerification: false, + installationStore, + stateStore: fakeStateStore, + logger: noopLogger, + }); const fakeState = 'fakeState'; const fakeCode = 'fakeCode'; const req = { @@ -724,6 +880,7 @@ describe('InstallProvider', async () => { }, url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, successExpectedCallbackOptions); assert.isTrue(sent); assert.equal(fakeStateStore.verifyStateParam.callCount, 0); @@ -741,27 +898,39 @@ describe('InstallProvider', async () => { }; let endCalled = false; const res = { - writeHead: (status) => { assert.equal(status, 400); }, - end: () => { endCalled = true; }, + writeHead: (status: number) => { + assert.equal(status, 400); + }, + end: () => { + endCalled = true; + }, }; - const callbackOptions = { - beforeInstallation: async (installOptions, req, res) => { + const callbackOptions: CallbackOptions = { + beforeInstallation: async (_installOptions, _req, res) => { // if the installation is not acceptable res.writeHead(400); res.end('error page content'); return false; }, - afterInstallation: async (installation, installOptions, req, res) => { + afterInstallation: async (_installation, _installOptions, _req, _res) => { assert.fail('afterInstallation should not be called'); }, - successAsync: async (installation, installOptions, req, res) => { + successAsync: async (_installation, _installOptions, _req, _res) => { assert.fail('successAsync should not be called'); }, - failureAsync: async (error, installOptions, req, res) => { + failureAsync: async (error, _installOptions, _req, _res) => { assert.fail(`failureAsync should not be called ${error}`); }, - } - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, stateVerification: false, logger: noopLogger, }); + }; + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + stateVerification: false, + logger: noopLogger, + }); + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, callbackOptions); assert.isTrue(endCalled); @@ -778,27 +947,39 @@ describe('InstallProvider', async () => { }; let endCalled = false; const res = { - writeHead: (status) => { assert.equal(status, 400); }, - end: () => { endCalled = true; }, + writeHead: (status: number) => { + assert.equal(status, 400); + }, + end: () => { + endCalled = true; + }, }; - const callbackOptions = { - beforeInstallation: async (installOptions, req, res) => { + const callbackOptions: CallbackOptions = { + beforeInstallation: async (_installOptions, _req, _res) => { return true; }, - afterInstallation: async (installation, installOptions, req, res) => { + afterInstallation: async (_installation, _installOptions, _req, res) => { // revoke the tokens and display error to the installing user res.writeHead(400); res.end('error page content'); return false; }, - successAsync: async (installation, installOptions, req, res) => { + successAsync: async (_installation, _installOptions, _req, _res) => { assert.fail('successAsync should not be called'); }, - failureAsync: async (error, installOptions, req, res) => { + failureAsync: async (error, _installOptions, _req, _res) => { assert.fail(`failureAsync should not be called ${error}`); }, - } - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, stateVerification: false, logger: noopLogger, }); + }; + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + stateVerification: false, + logger: noopLogger, + }); + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, callbackOptions); assert.isTrue(endCalled); @@ -814,11 +995,13 @@ describe('InstallProvider', async () => { url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; const res = { - writeHead: (status) => { assert.equal(status, 400); }, - end: () => { }, + writeHead: (status: number) => { + assert.equal(status, 400); + }, + end: () => {}, }; let callCount = 0; - const callbackOptions = { + const callbackOptions: CallbackOptions = { success: () => { callCount += 1; }, @@ -828,8 +1011,16 @@ describe('InstallProvider', async () => { failureAsync: async (error) => { assert.fail(`failureAsync should not be called ${error}`); }, - } - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, stateVerification: false, logger: noopLogger, }); + }; + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + stateVerification: false, + logger: noopLogger, + }); + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, callbackOptions); assert.equal(callCount, 2); @@ -845,8 +1036,10 @@ describe('InstallProvider', async () => { url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; const res = { - writeHead: (status) => { assert.equal(status, 400); }, - end: () => { }, + writeHead: (status: number) => { + assert.equal(status, 400); + }, + end: () => {}, }; let callCount = 0; const callbackOptions = { @@ -859,24 +1052,35 @@ describe('InstallProvider', async () => { success: async () => { assert.fail('success should not be called in this test'); }, - } - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, logger: noopLogger, }); + }; + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + logger: noopLogger, + }); + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, callbackOptions); assert.equal(callCount, 2); }); it('should fail if the state value is not in cookies', async () => { - const fakeStateStore = { + const fakeStateStore: StateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) - }; - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, + verifyStateParam: sinon.fake.resolves({ scopes: [] }), }; - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, stateStore: fakeStateStore, authVersion: 'v2', logger: noopLogger, clientOptions: fooClientOptions }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + stateStore: fakeStateStore, + authVersion: 'v2', + logger: noopLogger, + clientOptions: webClientOptions, + }); const fakeState = 'fakeState'; const fakeCode = 'fakeCode'; const req = { @@ -886,41 +1090,42 @@ describe('InstallProvider', async () => { }, url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, failureExpectedCallbackOptions); assert.isTrue(sent); }); it('should fail if there is a different state value in cookies', async () => { - const fakeStateStore = { + const fakeStateStore: StateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) - }; - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, + verifyStateParam: sinon.fake.resolves({ scopes: [] }), }; - const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore, stateStore: fakeStateStore, authVersion: 'v2', logger: noopLogger, clientOptions: fooClientOptions }); + const installer = new InstallProvider({ + clientId, + clientSecret, + stateSecret, + installationStore, + stateStore: fakeStateStore, + authVersion: 'v2', + logger: noopLogger, + clientOptions: webClientOptions, + }); const fakeState = 'fakeState'; const fakeCode = 'fakeCode'; const req = { headers: { host: 'example.com', - cookie: `slack-app-oauth-state=something-different`, + cookie: 'slack-app-oauth-state=something-different', }, url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, failureExpectedCallbackOptions); assert.isTrue(sent); }); it('should not fail if no state cookie returned and legacyStateVerification is enabled', async () => { const fakeStateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) - }; - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, + verifyStateParam: sinon.fake.resolves({}), }; const installer = new InstallProvider({ clientId, @@ -929,7 +1134,7 @@ describe('InstallProvider', async () => { installationStore, logger: noopLogger, stateStore: fakeStateStore, - clientOptions: fooClientOptions, + clientOptions: webClientOptions, legacyStateVerification: true, // this is the key configuration in this test }); const fakeState = 'fakeState'; @@ -941,18 +1146,14 @@ describe('InstallProvider', async () => { }, url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, successExpectedCallbackOptions); assert.isTrue(sent); }); it('should not fail if a different state cookie returned and legacyStateVerification is enabled', async () => { - const fakeStateStore = { + const fakeStateStore: StateStore = { generateStateParam: sinon.fake.resolves('fakeState'), - verifyStateParam: sinon.fake.resolves({}) - }; - let sent = false; - const res = { - send: () => { sent = true; }, - setHeader: () => {}, + verifyStateParam: sinon.fake.resolves({ scopes: [] }), }; const installer = new InstallProvider({ clientId, @@ -961,7 +1162,7 @@ describe('InstallProvider', async () => { installationStore, logger: noopLogger, stateStore: fakeStateStore, - clientOptions: fooClientOptions, + clientOptions: webClientOptions, legacyStateVerification: true, // this is the key configuration in this test }); const fakeState = 'fakeState'; @@ -969,32 +1170,31 @@ describe('InstallProvider', async () => { const req = { headers: { host: 'example.com', - cookie: `slack-app-oauth-state=something-different`, + cookie: 'slack-app-oauth-state=something-different', }, url: `http://example.com?state=${fakeState}&code=${fakeCode}`, }; + // @ts-expect-error req is not an instance of IncomingMessage, TODO: type or stub IncomingMessage for req properly await installer.handleCallback(req, res, successExpectedCallbackOptions); assert.isTrue(sent); }); }); }); -const successExpectedCallbackOptions = { +const successExpectedCallbackOptions: CallbackOptions = { success: async (_installation, _options, _req, res) => { - res.send('success as expected!'); + res.end('success as expected!'); }, failure: async (error, _options, _req, _res) => { assert.fail(error.message); }, }; -const failureExpectedCallbackOptions = { +const failureExpectedCallbackOptions: CallbackOptions = { success: async (_installation, _ptions, _req, _res) => { assert.fail('should fail'); }, failure: async (_error, _options, _req, res) => { - res.send('failed as expected!'); + res.end('failed as expected!'); }, }; - -const fooClientOptions = { foo: 'bar' }; diff --git a/packages/oauth/src/install-provider.ts b/packages/oauth/src/install-provider.ts index a27054f8c..5d20210c8 100644 --- a/packages/oauth/src/install-provider.ts +++ b/packages/oauth/src/install-provider.ts @@ -1,14 +1,14 @@ -import { IncomingMessage, ServerResponse } from 'http'; -import { URL, URLSearchParams } from 'url'; +import type { IncomingMessage, ServerResponse } from 'node:http'; +import { URL, URLSearchParams } from 'node:url'; -import { WebAPICallResult, WebClient, WebClientOptions } from '@slack/web-api'; +import { type WebAPICallResult, WebClient, type WebClientOptions } from '@slack/web-api'; -import { AuthorizeResult } from './authorize-result'; -import { CallbackOptions, defaultCallbackFailure, defaultCallbackSuccess } from './callback-options'; +import type { AuthorizeResult } from './authorize-result'; +import { type CallbackOptions, defaultCallbackFailure, defaultCallbackSuccess } from './callback-options'; import defaultRenderHtmlForInstallPath from './default-render-html-for-install-path'; import { AuthorizationError, - CodedError, + type CodedError, ErrorCode, GenerateInstallUrlError, InstallerInitializationError, @@ -17,14 +17,14 @@ import { MissingStateError, UnknownError, } from './errors'; -import { InstallPathOptions } from './install-path-options'; -import { InstallProviderOptions } from './install-provider-options'; -import { InstallURLOptions } from './install-url-options'; -import { Installation } from './installation'; -import { InstallationQuery } from './installation-query'; -import { InstallationStore, MemoryInstallationStore } from './installation-stores'; -import { LogLevel, Logger, getLogger } from './logger'; -import { ClearStateStore, StateStore } from './state-stores'; +import type { InstallPathOptions } from './install-path-options'; +import type { InstallProviderOptions } from './install-provider-options'; +import type { InstallURLOptions } from './install-url-options'; +import type { Installation } from './installation'; +import type { InstallationQuery } from './installation-query'; +import { type InstallationStore, MemoryInstallationStore } from './installation-stores'; +import { LogLevel, type Logger, getLogger } from './logger'; +import { ClearStateStore, type StateStore } from './state-stores'; /** * InstallProvider Class. Refer to InsallProviderOptions interface for the details of constructor arguments. @@ -125,7 +125,9 @@ export class InstallProvider { this.directInstall = directInstall; if (!stateVerification) { - this.logger.warn("You've set InstallProvider#stateVerification to false. This flag is intended to enable org-wide app installations from admin pages. If this isn't your scenario, we recommend setting stateVerification to true and starting your OAuth flow from the provided `/slack/install` or your own starting endpoint."); + this.logger.warn( + "You've set InstallProvider#stateVerification to false. This flag is intended to enable org-wide app installations from admin pages. If this isn't your scenario, we recommend setting stateVerification to true and starting your OAuth flow from the provided `/slack/install` or your own starting endpoint.", + ); } // Setup stateStore if (stateStore !== undefined) { @@ -150,7 +152,9 @@ export class InstallProvider { this.authorizationUrl = authorizationUrl; if (authorizationUrl !== 'https://slack.com/oauth/v2/authorize' && authVersion === 'v1') { - this.logger.info('You provided both an authorizationUrl and an authVersion! The authVersion will be ignored in favor of the authorizationUrl.'); + this.logger.info( + 'You provided both an authorizationUrl and an authVersion! The authVersion will be ignored in favor of the authorizationUrl.', + ); } else if (authVersion === 'v1') { this.authorizationUrl = 'https://slack.com/oauth/authorize'; } @@ -222,18 +226,19 @@ export class InstallProvider { } /* - * Token Rotation (Expiry Check + Refresh) - * The presence of `(bot|user)TokenExpiresAt` indicates having opted into token rotation. - * If the token has expired, or will expire within 2 hours, the token is refreshed and - * the `authResult` and `Installation` are updated with the new values. - */ + * Token Rotation (Expiry Check + Refresh) + * The presence of `(bot|user)TokenExpiresAt` indicates having opted into token rotation. + * If the token has expired, or will expire within 2 hours, the token is refreshed and + * the `authResult` and `Installation` are updated with the new values. + */ if (authResult.botRefreshToken || authResult.userRefreshToken) { const currentUTCSec = Math.floor(Date.now() / 1000); // seconds const tokensToRefresh: string[] = detectExpiredOrExpiringTokens(authResult, currentUTCSec); if (tokensToRefresh.length > 0) { if (queryResult.authVersion !== 'v2') { - const errorMessage = 'Unexpected data structure detected. ' + + const errorMessage = + 'Unexpected data structure detected. ' + 'The data returned by your InstallationStore#fetchInstallation() method must have "authVersion": "v2" ' + 'if it has a refresh token'; throw new UnknownError(errorMessage); @@ -241,9 +246,9 @@ export class InstallProvider { const refreshResponses: OAuthV2TokenRefreshResponse[] = await this.refreshExpiringTokens(tokensToRefresh); if (refreshResponses.length) { const installationUpdates: TokenRefreshInstallationUpdates = { - ...queryResult as Installation<'v2', boolean>, + ...(queryResult as Installation<'v2', boolean>), }; - refreshResponses.forEach((refreshResp) => { + for (const refreshResp of refreshResponses) { const tokenType = refreshResp.token_type; // Update Authorization @@ -270,7 +275,7 @@ export class InstallProvider { const errorMessage = `Unexpected data structure detected. The data returned by your InstallationStore#fetchInstallation() method must have ${tokenType} at top-level`; throw new UnknownError(errorMessage); } - }); + } await this.installationStore.storeInstallation(installationUpdates); this.logger.debug('Refreshed tokens have been saved in InstallationStore'); } else { @@ -281,7 +286,7 @@ export class InstallProvider { return authResult; } catch (error) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: errors can be any throw new AuthorizationError((error as any).message); } finally { this.logger.debug(`Completed authorize() execution (source: ${sourceForLogging})`); @@ -301,12 +306,13 @@ export class InstallProvider { } private async refreshExpiringToken(refreshToken: string): Promise { - return this.noTokenClient.oauth.v2.access({ - client_id: this.clientId, - client_secret: this.clientSecret, - grant_type: 'refresh_token', - refresh_token: refreshToken, - }) + return this.noTokenClient.oauth.v2 + .access({ + client_id: this.clientId, + client_secret: this.clientSecret, + grant_type: 'refresh_token', + refresh_token: refreshToken, + }) .then((res) => res as OAuthV2TokenRefreshResponse) .catch((e) => { this.logger.error(`Failed to perform oauth.v2.access API call for token rotation: (error: ${e})`); @@ -320,7 +326,7 @@ export class InstallProvider { /** * Handles the install path (the default is /slack/install) requests from an app installer. - */ + */ public async handleInstallPath( req: IncomingMessage, res: ServerResponse, @@ -328,11 +334,12 @@ export class InstallProvider { installOptions?: InstallURLOptions, ): Promise { if (installOptions === undefined && this.installUrlOptions === undefined) { - const errorMessage = 'To enable the built-in install path handler, you need to pass InstallURLOptions to InstallProvider. ' + + const errorMessage = + 'To enable the built-in install path handler, you need to pass InstallURLOptions to InstallProvider. ' + "If you're using @slack/bolt, please upgrade the framework to the latest version."; throw new GenerateInstallUrlError(errorMessage); } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + // biome-ignore lint/style/noNonNullAssertion: TODO: we should really rewrite the logic here to drop these const _installOptions: InstallURLOptions = installOptions! || this.installUrlOptions!; const _printableOptions = JSON.stringify(_installOptions); this.logger.debug(`Running handleInstallPath() with ${_printableOptions}`); @@ -396,7 +403,7 @@ export class InstallProvider { } catch (e: unknown) { const message = `An unhandled error occurred while processing an install path request (error: ${e})`; this.logger.error(message); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: errors can be any throw new GenerateInstallUrlError((e as any).message); } } @@ -407,7 +414,7 @@ export class InstallProvider { */ public async generateInstallUrl( options: InstallURLOptions, - stateVerification: boolean = true, + stateVerification = true, state?: string, ): Promise { const slackURL = new URL(this.authorizationUrl); @@ -418,7 +425,7 @@ export class InstallProvider { // scope let scopes: string; - if (options.scopes instanceof Array) { + if (Array.isArray(options.scopes)) { scopes = options.scopes.join(','); } else { scopes = options.scopes; @@ -455,7 +462,7 @@ export class InstallProvider { // user scope, only available for OAuth v2 if (options.userScopes !== undefined && this.authVersion === 'v2') { let userScopes: string; - if (options.userScopes instanceof Array) { + if (Array.isArray(options.userScopes)) { userScopes = options.userScopes.join(','); } else { userScopes = options.userScopes; @@ -500,7 +507,9 @@ export class InstallProvider { throw new MissingCodeError('Redirect url is missing the required code query parameter'); } if (this.stateVerification && !stateInQueryString) { - throw new MissingStateError('Redirect url is missing the state query parameter. If this is intentional, see options for disabling default state verification.'); + throw new MissingStateError( + 'Redirect url is missing the state query parameter. If this is intentional, see options for disabling default state verification.', + ); } } else { throw new UnknownError('Something went wrong'); @@ -511,15 +520,17 @@ export class InstallProvider { if (this.legacyStateVerification) { // This mode is not enabled by default // This option is for some of the existing developers that need time for migration - this.logger.warn('Enabling legacyStateVerification is not recommended as it does not properly work for OAuth CSRF protection. Please consider migrating from directly using InstallProvider#generateInstallUrl() to InstallProvider#handleInstallPath() for serving the install path.'); + this.logger.warn( + 'Enabling legacyStateVerification is not recommended as it does not properly work for OAuth CSRF protection. Please consider migrating from directly using InstallProvider#generateInstallUrl() to InstallProvider#handleInstallPath() for serving the install path.', + ); } else { const stateInBrowserSession: string | undefined = extractCookieValue(req, this.stateCookieName); - if (!stateInBrowserSession || (stateInBrowserSession !== stateInQueryString)) { + if (!stateInBrowserSession || stateInBrowserSession !== stateInQueryString) { throw new InvalidStateError('The state parameter is not for this browser session.'); } } if (this.stateStore) { - // eslint-disable-next-line no-param-reassign + // biome-ignore lint/style/noParameterAssign: we reassigning, deal with it installOptions = await this.stateStore.verifyStateParam(new Date(), stateInQueryString); } else { throw new InstallerInitializationError('StateStore is not properly configured'); @@ -531,7 +542,7 @@ export class InstallProvider { } if (!installOptions) { const emptyInstallOptions: InstallURLOptions = { scopes: [] }; - // eslint-disable-next-line no-param-reassign + // biome-ignore lint/style/noParameterAssign: we reassigning, deal with it installOptions = emptyInstallOptions; } @@ -554,12 +565,12 @@ export class InstallProvider { if (this.authVersion === 'v1') { // convert response type from WebApiCallResult to OAuthResponse - const v1Resp = await this.noTokenClient.oauth.access({ + const v1Resp = (await this.noTokenClient.oauth.access({ code, client_id: this.clientId, client_secret: this.clientSecret, redirect_uri: installOptions.redirectUri, - }) as OAuthV1Response; + })) as OAuthV1Response; // resp obj for v1 - https://api.slack.com/methods/oauth.access#response const v1Installation: Installation<'v1', false> = { @@ -595,12 +606,12 @@ export class InstallProvider { installation = v1Installation; } else { // convert response type from WebApiCallResult to OAuthResponse - const v2Resp = await this.noTokenClient.oauth.v2.access({ + const v2Resp = (await this.noTokenClient.oauth.v2.access({ code, client_id: this.clientId, client_secret: this.clientSecret, redirect_uri: installOptions.redirectUri, - }) as OAuthV2Response; + })) as OAuthV2Response; // resp obj for v2 - https://api.slack.com/methods/oauth.v2.access#response const v2Installation: Installation<'v2', boolean> = { @@ -690,9 +701,7 @@ export class InstallProvider { await this.installationStore.storeInstallation(installation, this.logger); // Call the success callback - if (options !== undefined && ( - options.success !== undefined || options.successAsync !== undefined - )) { + if (options !== undefined && (options.success !== undefined || options.successAsync !== undefined)) { if (options.success !== undefined) { this.logger.debug('Calling passed function as callbackOptions.success'); options.success(installation, installOptions, req, res); @@ -711,7 +720,7 @@ export class InstallProvider { if (!installOptions) { // To make the `installOptions` type compatible with `CallbackOptions#failure` signature const emptyInstallOptions: InstallURLOptions = { scopes: [] }; - // eslint-disable-next-line no-param-reassign + // biome-ignore lint/style/noParameterAssign: we reassigning, deal with it installOptions = emptyInstallOptions; } @@ -720,9 +729,7 @@ export class InstallProvider { if (codedError.code === undefined) { codedError.code = ErrorCode.UnknownError; } - if (options !== undefined && ( - options.failure !== undefined || options.failureAsync !== undefined - )) { + if (options !== undefined && (options.failure !== undefined || options.failureAsync !== undefined)) { if (options.failure !== undefined) { this.logger.debug('Calling passed function as callbackOptions.failure'); options.failure(codedError, installOptions, req, res); @@ -757,12 +764,12 @@ export class InstallProvider { export interface OAuthV2Response extends WebAPICallResult { app_id: string; authed_user: { - id: string, - scope?: string, - access_token?: string, - token_type?: string, - refresh_token?: string, - expires_in?: number, + id: string; + scope?: string; + access_token?: string; + token_type?: string; + refresh_token?: string; + expires_in?: number; }; scope?: string; token_type?: 'bot'; @@ -770,14 +777,14 @@ export interface OAuthV2Response extends WebAPICallResult { refresh_token?: string; expires_in?: number; bot_user_id?: string; - team: { id: string, name: string } | null; - enterprise: { name: string, id: string } | null; + team: { id: string; name: string } | null; + enterprise: { name: string; id: string } | null; is_enterprise_install: boolean; incoming_webhook?: { - url: string, - channel: string, - channel_id: string, - configuration_url: string, + url: string; + channel: string; + channel_id: string; + configuration_url: string; }; } @@ -789,8 +796,8 @@ export interface OAuthV2TokenRefreshResponse extends WebAPICallResult { refresh_token: string; expires_in: number; bot_user_id?: string; - team: { id: string, name: string }; - enterprise: { name: string, id: string } | null; + team: { id: string; name: string }; + enterprise: { name: string; id: string } | null; is_enterprise_install: boolean; } @@ -807,12 +814,12 @@ interface OAuthV1Response extends WebAPICallResult { team_id: string; enterprise_id: string | null; // if they request bot user token - bot?: { bot_user_id: string, bot_access_token: string }; + bot?: { bot_user_id: string; bot_access_token: string }; incoming_webhook?: { - url: string, - channel: string, - channel_id: string, - configuration_url: string, + url: string; + channel: string; + channel_id: string; + configuration_url: string; }; // app_id is currently undefined but leaving it in here incase the v1 method adds it app_id: string | undefined; @@ -840,12 +847,12 @@ async function runAuthTest(token: string, clientOptions: WebClientOptions): Prom // This type is used only in this source file type TokenRefreshInstallationUpdates = Installation<'v2', boolean> & { bot?: { - token: string, + token: string; refreshToken?: string; expiresAt?: number; }; user: { - token?: string, + token?: string; refreshToken?: string; expiresAt?: number; }; @@ -860,16 +867,22 @@ function detectExpiredOrExpiringTokens(authResult: AuthorizeResult, currentUTCSe const tokensToRefresh: string[] = []; const EXPIRY_WINDOW: number = 7200; // 2 hours - if (authResult.botRefreshToken && - (authResult.botTokenExpiresAt !== undefined && authResult.botTokenExpiresAt !== null)) { + if ( + authResult.botRefreshToken && + authResult.botTokenExpiresAt !== undefined && + authResult.botTokenExpiresAt !== null + ) { const botTokenExpiresIn = authResult.botTokenExpiresAt - currentUTCSec; if (botTokenExpiresIn <= EXPIRY_WINDOW) { tokensToRefresh.push(authResult.botRefreshToken); } } - if (authResult.userRefreshToken && - (authResult.userTokenExpiresAt !== undefined && authResult.userTokenExpiresAt !== null)) { + if ( + authResult.userRefreshToken && + authResult.userTokenExpiresAt !== undefined && + authResult.userTokenExpiresAt !== null + ) { const userTokenExpiresIn = authResult.userTokenExpiresAt - currentUTCSec; if (userTokenExpiresIn <= EXPIRY_WINDOW) { tokensToRefresh.push(authResult.userRefreshToken); diff --git a/packages/oauth/src/install-url-options.spec.ts b/packages/oauth/src/install-url-options.spec.ts index 0916e1bdf..5ee2fba06 100644 --- a/packages/oauth/src/install-url-options.spec.ts +++ b/packages/oauth/src/install-url-options.spec.ts @@ -1,7 +1,7 @@ import { assert } from 'chai'; import { describe, it } from 'mocha'; -import { InstallURLOptions } from './install-url-options'; +import type { InstallURLOptions } from './install-url-options'; describe('InstallURLOptions', async () => { // TODO: the use cases with only userScopes should be supported in TS @@ -10,9 +10,7 @@ describe('InstallURLOptions', async () => { const options: InstallURLOptions = { scopes: ['commands', 'chat:write'], }; - const actual = typeof options.scopes === 'string' ? - options.scopes.split(',').sort() : - options.scopes.sort(); + const actual = typeof options.scopes === 'string' ? options.scopes.split(',').sort() : options.scopes.sort(); assert.deepEqual(actual, ['chat:write', 'commands']); }); @@ -24,6 +22,9 @@ describe('InstallURLOptions', async () => { userScopes: ['chat:write'], metadata: 'meta', }; - assert.deepEqual(JSON.stringify(options), '{"teamId":"T111","redirectUri":"https://www.example.com/slack/oauth_redirect","scopes":["commands","chat:write"],"userScopes":["chat:write"],"metadata":"meta"}'); + assert.deepEqual( + JSON.stringify(options), + '{"teamId":"T111","redirectUri":"https://www.example.com/slack/oauth_redirect","scopes":["commands","chat:write"],"userScopes":["chat:write"],"metadata":"meta"}', + ); }); }); diff --git a/packages/oauth/src/installation-query.spec.ts b/packages/oauth/src/installation-query.spec.ts index 529f8bc45..fb095d00b 100644 --- a/packages/oauth/src/installation-query.spec.ts +++ b/packages/oauth/src/installation-query.spec.ts @@ -1,7 +1,7 @@ import { assert } from 'chai'; import { describe, it } from 'mocha'; -import { InstallationQuery } from './installation-query'; +import type { InstallationQuery } from './installation-query'; describe('InstallationQuery', async () => { it('should be a team-level installation query', async () => { diff --git a/packages/oauth/src/installation-query.ts b/packages/oauth/src/installation-query.ts index 496075e0d..1b2a9c1d4 100644 --- a/packages/oauth/src/installation-query.ts +++ b/packages/oauth/src/installation-query.ts @@ -3,7 +3,7 @@ // the rest of Bolt. export interface InstallationQuery { teamId: isEnterpriseInstall extends false ? string : undefined; - enterpriseId: isEnterpriseInstall extends true ? string : (string | undefined); + enterpriseId: isEnterpriseInstall extends true ? string : string | undefined; userId?: string; conversationId?: string; isEnterpriseInstall: isEnterpriseInstall; diff --git a/packages/oauth/src/installation-stores/file-store.spec.js b/packages/oauth/src/installation-stores/file-store.spec.js index 0e9066cd0..0c6ffde7c 100644 --- a/packages/oauth/src/installation-stores/file-store.spec.js +++ b/packages/oauth/src/installation-stores/file-store.spec.js @@ -2,8 +2,8 @@ require('mocha'); const { assert, expect } = require('chai'); const sinon = require('sinon'); -const fs = require('fs'); -const os = require('os'); +const fs = require('node:fs'); +const os = require('node:os'); const { InstallProvider } = require('../index'); const { FileInstallationStore } = require('./index'); @@ -40,7 +40,7 @@ const storedInstallation = { appId: 'fakeAppId', tokenType: 'tokenType', isEnterpriseInstall: false, -} +}; // TODO: valid tests with org-wide installations const storedOrgInstallation = { @@ -68,13 +68,14 @@ const storedOrgInstallation = { appId: undefined, tokenType: 'tokenType', isEnterpriseInstall: true, -} +}; describe('FileInstallationStore', async () => { - - let fsMakeDirSync, - fsWriteFileSync, fsReadFileSync, - fsUnlinkSync, fsReaddirSync; + let fsMakeDirSync; + let fsWriteFileSync; + let fsReadFileSync; + let fsUnlinkSync; + let fsReaddirSync; beforeEach(() => { // Note that these sinon stubs affect the `os` package behaviors @@ -102,7 +103,10 @@ describe('FileInstallationStore', async () => { await installationStore.storeInstallation(storedInstallation); assert.equal(fsWriteFileSync.calledWith(`${fakeInstallDir}/app-latest`, installationJSON), true); - assert.equal(fsWriteFileSync.calledWith(sinon.match(`${fakeInstallDir}/user-${user.id}-latest`), installationJSON), true); + assert.equal( + fsWriteFileSync.calledWith(sinon.match(`${fakeInstallDir}/user-${user.id}-latest`), installationJSON), + true, + ); }); it('should throw an exception with sufficient information when failing to store data', async () => { fsWriteFileSync.restore(); // disable sinon stub for this test case @@ -115,7 +119,10 @@ describe('FileInstallationStore', async () => { await installationStore.storeInstallation(storedInstallation); assert.fail('An exception should be thrown'); } catch (e) { - assert.equal(e.message, 'Failed to save installation to FileInstallationStore (error: Error: The original error message)'); + assert.equal( + e.message, + 'Failed to save installation to FileInstallationStore (error: Error: The original error message)', + ); } }); @@ -159,8 +166,7 @@ describe('FileInstallationStore', async () => { }); assert.fail(`An exception should be thrown ${JSON.stringify(res)}`); } catch (e) { - assert.equal(e.message, - 'No installation data found (enterprise_id: E999, team_id: T111, user_id: undefined)'); + assert.equal(e.message, 'No installation data found (enterprise_id: E999, team_id: T111, user_id: undefined)'); } }); @@ -173,8 +179,8 @@ describe('FileInstallationStore', async () => { await installationStore.deleteInstallation(query); assert.equal(fsReaddirSync.calledWith(sinon.match(fakeInstallDir)), true); - assert.equal(fsUnlinkSync.calledWith(sinon.match(`app-latest`)), true); - assert.equal(fsUnlinkSync.calledWith(sinon.match(`user-userId-latest`)), true); + assert.equal(fsUnlinkSync.calledWith(sinon.match('app-latest')), true); + assert.equal(fsUnlinkSync.calledWith(sinon.match('user-userId-latest')), true); // fsReaddirSync returns ['app-latest', 'user-userId-latest'] expect(fsUnlinkSync.callCount).equals(2); @@ -195,37 +201,30 @@ describe('FileInstallationStore', async () => { expect(fsUnlinkSync.callCount).equals(1); }); - it('should run authorize with triage-bot\'s MongoDB data', async () => { + it("should run authorize with triage-bot's MongoDB data", async () => { // Refer to https://github.com/slackapi/bolt-js/issues/1265 to learn the context const storedInstallation = { - "_id": "6.....", - "id": "T....", - "__v": 0, - "appId": "A...", - "authVersion": "v2", - "bot": { - "scopes": [ - "channels:history", - "channels:join", - "channels:read", - "chat:write", - "commands", - "files:write" - ], - "token": "xoxb-...", - "userId": "U...", - "id": "B02SS7QU407" + _id: '6.....', + id: 'T....', + __v: 0, + appId: 'A...', + authVersion: 'v2', + bot: { + scopes: ['channels:history', 'channels:join', 'channels:read', 'chat:write', 'commands', 'files:write'], + token: 'xoxb-...', + userId: 'U...', + id: 'B02SS7QU407', + }, + db_record_created_at: '2022-01-08T02:24:40.470Z', + db_record_updated_at: '2022-01-08T02:24:40.470Z', + enterprise: null, + isEnterpriseInstall: false, + name: 'My Team', + tokenType: 'bot', + user: { + scopes: null, + id: 'U...', }, - "db_record_created_at": "2022-01-08T02:24:40.470Z", - "db_record_updated_at": "2022-01-08T02:24:40.470Z", - "enterprise": null, - "isEnterpriseInstall": false, - "name": "My Team", - "tokenType": "bot", - "user": { - "scopes": null, - "id": "U..." - } }; const installationStore = { fetchInstallation: (_) => { @@ -235,21 +234,21 @@ describe('FileInstallationStore', async () => { }, storeInstallation: () => {}, deleteInstallation: (_) => {}, - } + }; const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore }); const authorizeResult = await installer.authorize({ teamId: 'T111' }); assert.deepEqual(authorizeResult, { - "teamId": "T111", - "botId": "B02SS7QU407", - "botUserId": "U...", - "botToken": "xoxb-...", - "userToken": undefined, + teamId: 'T111', + botId: 'B02SS7QU407', + botUserId: 'U...', + botToken: 'xoxb-...', + userToken: undefined, }); }); it('should run authorize even if there are null objects in data', async () => { const storedInstallation = { // https://github.com/slackapi/template-triage-bot/blob/c1e54fb9d760b46cc8809c57e307061fdb3e0a91/app.js#L51-L55 - id: "T999", // template-triage-bot specific + id: 'T999', // template-triage-bot specific name: 'My Team', // template-triage-bot specific appId: 'A111', tokenType: 'bot', @@ -257,21 +256,14 @@ describe('FileInstallationStore', async () => { bot: { id: 'B111', userId: 'U111', - scopes: [ - 'channels:history', - 'channels:join', - 'channels:read', - 'chat:write', - 'commands', - 'files:write', - ], + scopes: ['channels:history', 'channels:join', 'channels:read', 'chat:write', 'commands', 'files:write'], token: 'xoxb-____', }, enterprise: null, team: null, // v2.3 does not work with this data due to "Error: Cannot read property 'id' of null" isEnterpriseInstall: false, user: null, - } + }; const installationStore = { fetchInstallation: (_) => { return new Promise((resolve) => { @@ -280,14 +272,14 @@ describe('FileInstallationStore', async () => { }, storeInstallation: () => {}, deleteInstallation: (_) => {}, - } + }; const installer = new InstallProvider({ clientId, clientSecret, stateSecret, installationStore }); const authorizeResult = await installer.authorize({ teamId: 'T111' }); assert.deepEqual(authorizeResult, { - "teamId": "T111", - "botId": "B111", - "botUserId": "U111", - "botToken": "xoxb-____", + teamId: 'T111', + botId: 'B111', + botUserId: 'U111', + botToken: 'xoxb-____', }); }); }); diff --git a/packages/oauth/src/installation-stores/file-store.ts b/packages/oauth/src/installation-stores/file-store.ts index fca180953..673604049 100644 --- a/packages/oauth/src/installation-stores/file-store.ts +++ b/packages/oauth/src/installation-stores/file-store.ts @@ -1,9 +1,9 @@ -import fs from 'fs'; -import { homedir } from 'os'; -import path from 'path'; +import fs from 'node:fs'; +import { homedir } from 'node:os'; +import path from 'node:path'; -import { Installation, InstallationQuery, InstallationStore } from '../index'; -import { Logger } from '../logger'; +import type { Installation, InstallationQuery, InstallationStore } from '../index'; +import type { Logger } from '../logger'; export interface FileInstallationOptions { baseDir?: string; @@ -82,15 +82,17 @@ export default class FileInstallationStore implements InstallationStore { } } catch (err) { logger?.debug(`The user-token installation for the request user (user_id: ${query.userId}) was not found.`); - delete installation.user.token; - delete installation.user.refreshToken; - delete installation.user.expiresAt; - delete installation.user.scopes; + installation.user.token = undefined; + installation.user.refreshToken = undefined; + installation.user.expiresAt = undefined; + installation.user.scopes = undefined; } } return installation; } catch (err) { - throw new Error(`No installation data found (enterprise_id: ${query.enterpriseId}, team_id: ${query.teamId}, user_id: ${query.userId})`); + throw new Error( + `No installation data found (enterprise_id: ${query.enterpriseId}, team_id: ${query.teamId}, user_id: ${query.userId})`, + ); } } @@ -113,7 +115,9 @@ export default class FileInstallationStore implements InstallationStore { } try { - filesToDelete.forEach((filePath) => deleteFile(path.resolve(`${installationDir}/${filePath}`))); + for (const filePath of filesToDelete) { + deleteFile(path.resolve(`${installationDir}/${filePath}`)); + } } catch (err) { throw new Error(`Failed to delete installation from FileInstallationStore (error: ${err})`); } @@ -122,7 +126,7 @@ export default class FileInstallationStore implements InstallationStore { private getInstallationDir(enterpriseId = '', teamId = '', isEnterpriseInstall = false): string { let installDir = `${this.baseDir}/${enterpriseId}`; if (teamId !== '' && !isEnterpriseInstall) { - installDir += (enterpriseId !== '') ? `-${teamId}` : `${teamId}`; + installDir += enterpriseId !== '' ? `-${teamId}` : `${teamId}`; } return installDir; } diff --git a/packages/oauth/src/installation-stores/interface.ts b/packages/oauth/src/installation-stores/interface.ts index 1c363724b..15ba1b1f4 100644 --- a/packages/oauth/src/installation-stores/interface.ts +++ b/packages/oauth/src/installation-stores/interface.ts @@ -1,17 +1,17 @@ -import { Logger } from '@slack/logger'; +import type { Logger } from '@slack/logger'; -import { Installation, InstallationQuery } from '..'; +import type { Installation, InstallationQuery } from '..'; export interface InstallationStore { - storeInstallation( installation: Installation, - logger?: Logger): Promise; - - fetchInstallation: - (query: InstallationQuery, logger?: Logger) => Promise>; + logger?: Logger, + ): Promise; - deleteInstallation?: - (query: InstallationQuery, logger?: Logger) => Promise; + fetchInstallation: ( + query: InstallationQuery, + logger?: Logger, + ) => Promise>; + deleteInstallation?: (query: InstallationQuery, logger?: Logger) => Promise; } diff --git a/packages/oauth/src/installation-stores/memory-store.spec.js b/packages/oauth/src/installation-stores/memory-store.spec.js index e1352eabc..a32993123 100644 --- a/packages/oauth/src/installation-stores/memory-store.spec.js +++ b/packages/oauth/src/installation-stores/memory-store.spec.js @@ -36,7 +36,7 @@ const storedInstallation = { appId: 'fakeAppId', tokenType: 'tokenType', isEnterpriseInstall: false, -} +}; // TODO: valid tests with org-wide installations const storedOrgInstallation = { @@ -64,7 +64,7 @@ const storedOrgInstallation = { appId: undefined, tokenType: 'tokenType', isEnterpriseInstall: true, -} +}; describe('MemoryInstallationStore', async () => { it('should store and fetch an installation', async () => { diff --git a/packages/oauth/src/installation-stores/memory-store.ts b/packages/oauth/src/installation-stores/memory-store.ts index a20b07491..a2fe1a0fa 100644 --- a/packages/oauth/src/installation-stores/memory-store.ts +++ b/packages/oauth/src/installation-stores/memory-store.ts @@ -1,5 +1,5 @@ -import { Installation, InstallationQuery, InstallationStore, OrgInstallation } from '../index'; -import { Logger } from '../logger'; +import type { Installation, InstallationQuery, InstallationStore, OrgInstallation } from '../index'; +import type { Logger } from '../logger'; // using a javascript object as a makeshift database for development // storing user tokens is not supported @@ -35,7 +35,10 @@ export default class MemoryInstallationStore implements InstallationStore { } } - public async fetchInstallation(query: InstallationQuery, logger?: Logger): Promise> { + public async fetchInstallation( + query: InstallationQuery, + logger?: Logger, + ): Promise> { if (logger !== undefined) { logger.warn('Retrieving Access Token from DB. Please use a real Installation Store for production!'); } diff --git a/packages/oauth/src/installation.spec.ts b/packages/oauth/src/installation.spec.ts index 856511a3c..4fe8896e5 100644 --- a/packages/oauth/src/installation.spec.ts +++ b/packages/oauth/src/installation.spec.ts @@ -1,7 +1,7 @@ import { assert } from 'chai'; import { describe, it } from 'mocha'; -import { Installation } from './installation'; +import type { Installation } from './installation'; describe('Installation', async () => { it('should be a team-level installation (bot)', async () => { diff --git a/packages/oauth/src/installation.ts b/packages/oauth/src/installation.ts index 3eb21f744..41585e00c 100644 --- a/packages/oauth/src/installation.ts +++ b/packages/oauth/src/installation.ts @@ -28,29 +28,33 @@ * * TODO: IsEnterpriseInstall is always false when AuthVersion is v1 */ -export interface Installation { +export interface Installation< + AuthVersion extends 'v1' | 'v2' = 'v1' | 'v2', + IsEnterpriseInstall extends boolean = boolean, +> { /** - * TODO: when performing a “single workspace” install with the admin scope on the enterprise, - * is the team property returned from oauth.access? - */ - team: IsEnterpriseInstall extends true ? undefined : { - id: string; - /** Left as undefined when not returned from fetch. */ - name?: string; - }; + * TODO: when performing a “single workspace” install with the admin scope on the enterprise, + * is the team property returned from oauth.access? + */ + team: IsEnterpriseInstall extends true + ? undefined + : { + id: string; + /** Left as undefined when not returned from fetch. */ + name?: string; + }; /** - * When the installation is an enterprise install or when the installation occurs on the org to acquire `admin` scope, - * the name and ID of the enterprise org. - */ - enterprise: IsEnterpriseInstall extends true ? EnterpriseInfo : (EnterpriseInfo | undefined); + * When the installation is an enterprise install or when the installation occurs on the org to acquire `admin` scope, + * the name and ID of the enterprise org. + */ + enterprise: IsEnterpriseInstall extends true ? EnterpriseInfo : EnterpriseInfo | undefined; user: { - token: AuthVersion extends 'v1' ? string : (string | undefined); - refreshToken?: AuthVersion extends 'v1' ? never : (string | undefined); - expiresAt?: AuthVersion extends 'v1' ? never : (number | undefined); // utc, seconds - scopes: AuthVersion extends 'v1' ? string[] : (string[] | undefined); + token: AuthVersion extends 'v1' ? string : string | undefined; + refreshToken?: AuthVersion extends 'v1' ? never : string | undefined; + expiresAt?: AuthVersion extends 'v1' ? never : number | undefined; // utc, seconds + scopes: AuthVersion extends 'v1' ? string[] : string[] | undefined; id: string; }; @@ -79,9 +83,9 @@ export interface Installation; interface EnterpriseInfo { diff --git a/packages/oauth/src/logger.spec.js b/packages/oauth/src/logger.spec.ts similarity index 59% rename from packages/oauth/src/logger.spec.js rename to packages/oauth/src/logger.spec.ts index 46f24389b..5a55a99bc 100644 --- a/packages/oauth/src/logger.spec.js +++ b/packages/oauth/src/logger.spec.ts @@ -1,21 +1,16 @@ -require('mocha'); -const { assert } = require('chai'); -const { getLogger } = require('./logger'); -const { LogLevel } = require('@slack/logger'); +import { LogLevel } from '@slack/logger'; +import { assert } from 'chai'; +import { getLogger } from './logger'; describe('Logger', async () => { it('should create a new logger instance', async () => { const newLogger = getLogger('test-logger-name', LogLevel.DEBUG); - assert.match(newLogger.name, /test-logger-name:\d+/); assert.equal(newLogger.getLevel(), LogLevel.DEBUG); }); it('should modify the passed logger', async () => { const existingLogger = getLogger('test-logger-name', LogLevel.ERROR); - assert.match(existingLogger.name, /test-logger-name:\d+/); const returnedLogger = getLogger('overriden-logger-name', LogLevel.DEBUG, existingLogger); - assert.match(returnedLogger.name, /overriden-logger-name:\d+/); assert.equal(returnedLogger.getLevel(), LogLevel.DEBUG); - assert.match(existingLogger.name, /overriden-logger-name:\d+/); assert.equal(existingLogger.getLevel(), LogLevel.DEBUG); }); }); diff --git a/packages/oauth/src/logger.ts b/packages/oauth/src/logger.ts index 5d98b1477..f7bdf10a1 100644 --- a/packages/oauth/src/logger.ts +++ b/packages/oauth/src/logger.ts @@ -1,4 +1,4 @@ -import { ConsoleLogger, LogLevel, Logger } from '@slack/logger'; +import { ConsoleLogger, type LogLevel, type Logger } from '@slack/logger'; export { Logger, LogLevel } from '@slack/logger'; @@ -14,7 +14,9 @@ export function getLogger(name: string, level: LogLevel, existingLogger?: Logger // Set up the logger. const logger: Logger = (() => { - if (existingLogger !== undefined) { return existingLogger; } + if (existingLogger !== undefined) { + return existingLogger; + } return new ConsoleLogger(); })(); logger.setName(`${name}:${instanceId}`); diff --git a/packages/oauth/src/state-stores/clear-state-store.ts b/packages/oauth/src/state-stores/clear-state-store.ts index 465b7fc71..f2219bd98 100644 --- a/packages/oauth/src/state-stores/clear-state-store.ts +++ b/packages/oauth/src/state-stores/clear-state-store.ts @@ -1,8 +1,8 @@ import { sign, verify } from 'jsonwebtoken'; -import { StateObj, StateStore } from './interface'; import { InvalidStateError } from '../errors'; -import { InstallURLOptions } from '../install-url-options'; +import type { InstallURLOptions } from '../install-url-options'; +import type { StateObj, StateStore } from './interface'; // default implementation of StateStore export default class ClearStateStore implements StateStore { @@ -10,18 +10,12 @@ export default class ClearStateStore implements StateStore { private stateExpirationSeconds: number; - public constructor( - stateSecret: string, - stateExpirationSeconds: number = 600, - ) { + public constructor(stateSecret: string, stateExpirationSeconds = 600) { this.stateSecret = stateSecret; this.stateExpirationSeconds = stateExpirationSeconds; } - public async generateStateParam( - installOptions: InstallURLOptions, - now: Date, - ): Promise { + public async generateStateParam(installOptions: InstallURLOptions, now: Date): Promise { const source = { installOptions, now: now.toJSON(), @@ -30,10 +24,7 @@ export default class ClearStateStore implements StateStore { return sign(source, this.stateSecret); } - public async verifyStateParam( - now: Date, - state: string, - ): Promise { + public async verifyStateParam(now: Date, state: string): Promise { // decode the state using the secret let decoded: StateObj; try { @@ -44,9 +35,7 @@ export default class ClearStateStore implements StateStore { } // Check if the state value is not too old const generatedAt = new Date(decoded.now); - const passedSeconds = Math.floor( - (now.getTime() - generatedAt.getTime()) / 1000, - ); + const passedSeconds = Math.floor((now.getTime() - generatedAt.getTime()) / 1000); if (passedSeconds > this.stateExpirationSeconds) { throw new InvalidStateError('The state value is already expired'); } diff --git a/packages/oauth/src/state-stores/file-state-store.spec.ts b/packages/oauth/src/state-stores/file-state-store.spec.ts index 97295fe69..7f7edc4ef 100644 --- a/packages/oauth/src/state-stores/file-state-store.spec.ts +++ b/packages/oauth/src/state-stores/file-state-store.spec.ts @@ -1,4 +1,4 @@ -import os from 'os'; +import os from 'node:os'; import { FileStateStore } from './file-state-store'; import { StateStoreChaiTestRunner } from './spec-utils'; diff --git a/packages/oauth/src/state-stores/file-state-store.ts b/packages/oauth/src/state-stores/file-state-store.ts index 8d1bdb5ea..7f4b260f7 100644 --- a/packages/oauth/src/state-stores/file-state-store.ts +++ b/packages/oauth/src/state-stores/file-state-store.ts @@ -1,12 +1,12 @@ -import fs from 'fs'; -import { homedir } from 'os'; -import path from 'path'; +import fs from 'node:fs'; +import { homedir } from 'node:os'; +import path from 'node:path'; -import { ConsoleLogger, Logger } from '@slack/logger'; +import { ConsoleLogger, type Logger } from '@slack/logger'; -import { StateObj, StateStore } from './interface'; import { InvalidStateError } from '../errors'; -import { InstallURLOptions } from '../install-url-options'; +import type { InstallURLOptions } from '../install-url-options'; +import type { StateObj, StateStore } from './interface'; export interface FileStateStoreArgs { stateExpirationSeconds?: number; @@ -22,19 +22,12 @@ export class FileStateStore implements StateStore { private logger: Logger; public constructor(args: FileStateStoreArgs) { - this.baseDir = args.baseDir !== undefined ? - args.baseDir : - `${homedir()}/.bolt-js-oauth-states`; - this.stateExpirationSeconds = args.stateExpirationSeconds !== undefined ? - args.stateExpirationSeconds : - 600; + this.baseDir = args.baseDir !== undefined ? args.baseDir : `${homedir()}/.bolt-js-oauth-states`; + this.stateExpirationSeconds = args.stateExpirationSeconds !== undefined ? args.stateExpirationSeconds : 600; this.logger = args.logger !== undefined ? args.logger : new ConsoleLogger(); } - public async generateStateParam( - installOptions: InstallURLOptions, - now: Date, - ): Promise { + public async generateStateParam(installOptions: InstallURLOptions, now: Date): Promise { let state = generateRandomString(); while (this.alreadyExists(state)) { // Still race condition can arise here @@ -45,10 +38,7 @@ export class FileStateStore implements StateStore { return state; } - public async verifyStateParam( - now: Date, - state: string, - ): Promise { + public async verifyStateParam(now: Date, state: string): Promise { try { // decode the state using the secret let decoded: StateObj | undefined; @@ -61,9 +51,7 @@ export class FileStateStore implements StateStore { if (decoded !== undefined) { // Check if the state value is not too old const generatedAt = new Date(decoded.now); - const passedSeconds = Math.floor( - (now.getTime() - generatedAt.getTime()) / 1000, - ); + const passedSeconds = Math.floor((now.getTime() - generatedAt.getTime()) / 1000); if (passedSeconds > this.stateExpirationSeconds) { throw new InvalidStateError('The state value is already expired'); } @@ -115,7 +103,7 @@ export class FileStateStore implements StateStore { const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; -function generateRandomString(length: number = 10): string { +function generateRandomString(length = 10): string { let generated = ''; for (let i = 0; i < length; i += 1) { const position = Math.floor(Math.random() * chars.length); diff --git a/packages/oauth/src/state-stores/interface.ts b/packages/oauth/src/state-stores/interface.ts index 53d7ca0db..a7eafe19c 100644 --- a/packages/oauth/src/state-stores/interface.ts +++ b/packages/oauth/src/state-stores/interface.ts @@ -1,10 +1,9 @@ -import { InstallURLOptions } from '../install-url-options'; +import type { InstallURLOptions } from '../install-url-options'; /** * The data structure represented by the state parameter. */ export interface StateObj { - /** * The timestamp that the state object was generated. */ @@ -24,7 +23,6 @@ export interface StateObj { * (Redirect URL: the default path is "/slack/oauth_redirect") */ export interface StateStore { - /** * Generates a valid state parameter value, which can be decoded as a StateObj object * by the verifyStateParam() method. This value may be stored on the server-side with expiration. diff --git a/packages/oauth/src/state-stores/spec-utils.ts b/packages/oauth/src/state-stores/spec-utils.ts index 59ee22efe..fa7d1a334 100644 --- a/packages/oauth/src/state-stores/spec-utils.ts +++ b/packages/oauth/src/state-stores/spec-utils.ts @@ -1,9 +1,7 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable import/no-extraneous-dependencies */ import { assert } from 'chai'; -import { StateStore } from './interface'; -import { InstallURLOptions } from '../install-url-options'; +import type { InstallURLOptions } from '../install-url-options'; +import type { StateStore } from './interface'; export interface StateStoreChaiTestRunnerArgs { stateStore: StateStore; @@ -17,9 +15,7 @@ export class StateStoreChaiTestRunner { public constructor(args: StateStoreChaiTestRunnerArgs) { this.stateStore = args.stateStore; - this.shouldVerifyOnlyOnce = args.shouldVerifyOnlyOnce === undefined ? - true : - args.shouldVerifyOnlyOnce; + this.shouldVerifyOnlyOnce = args.shouldVerifyOnlyOnce === undefined ? true : args.shouldVerifyOnlyOnce; } public async enableTests(testTarget: string): Promise { @@ -42,16 +38,12 @@ export class StateStoreChaiTestRunner { it('should detect old state values', async () => { const { stateStore } = this; const installUrlOptions = { scopes: ['channels:read'] }; - const fifteenMinutesLater = new Date( - new Date().getTime() + 15 * 60 * 1000, - ); - const state = await stateStore.generateStateParam( - installUrlOptions, - new Date(), - ); + const fifteenMinutesLater = new Date(new Date().getTime() + 15 * 60 * 1000); + const state = await stateStore.generateStateParam(installUrlOptions, new Date()); try { await stateStore.verifyStateParam(fifteenMinutesLater, state); assert.fail('Exception should be thrown'); + // biome-ignore lint/suspicious/noExplicitAny: errors can be anything } catch (e: any) { assert.equal(e.code, 'slack_oauth_invalid_state'); } @@ -61,29 +53,20 @@ export class StateStoreChaiTestRunner { it('should detect multiple consumption', async () => { const { stateStore } = this; const installUrlOptions = { scopes: ['channels:read'] }; - Array.from(Array(200)).forEach(async () => { + for (let i = 0; i < 200; i++) { // generate other states await stateStore.generateStateParam(installUrlOptions, new Date()); - }); - const state = await stateStore.generateStateParam( - installUrlOptions, - new Date(), - ); + } + const state = await stateStore.generateStateParam(installUrlOptions, new Date()); const result = await stateStore.verifyStateParam(new Date(), state); assert.exists(result); - let expectedlyReturnedResult; + let expectedlyReturnedResult: InstallURLOptions = { scopes: [] }; try { - expectedlyReturnedResult = await stateStore.verifyStateParam( - new Date(), - state, - ); + expectedlyReturnedResult = await stateStore.verifyStateParam(new Date(), state); assert.fail('Exception should be thrown'); + // biome-ignore lint/suspicious/noExplicitAny: errors can be anything } catch (e: any) { - assert.equal( - e.code, - 'slack_oauth_invalid_state', - `${state} ${JSON.stringify(expectedlyReturnedResult)}`, - ); + assert.equal(e.code, 'slack_oauth_invalid_state', `${state} ${JSON.stringify(expectedlyReturnedResult)}`); } }); } diff --git a/packages/oauth/tsconfig.eslint.json b/packages/oauth/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/oauth/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/oauth/tsconfig.json b/packages/oauth/tsconfig.json index 0576e60d6..2077d7927 100644 --- a/packages/oauth/tsconfig.json +++ b/packages/oauth/tsconfig.json @@ -13,14 +13,14 @@ "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", "baseUrl": ".", "paths": { - "*": ["./types/*"] + "*": [ + "./types/*" + ] }, - "esModuleInterop" : true, - + "esModuleInterop": true // Not using this setting because its only used to require the package.json file, and that would change the // structure of the files in the dist directory because package.json is not located inside src. It would be nice // to use import instead of require(), but its not worth the tradeoff of restructuring the build (for now). @@ -31,9 +31,7 @@ ], "exclude": [ "src/**/spec-utils.ts", - "src/**/*.spec.js", - "src/**/*.spec.ts", - "src/**/*.js" + "src/**/*.spec.*" ], "jsdoc": { "out": "support/jsdoc", diff --git a/packages/rtm-api/.eslintignore b/packages/rtm-api/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/rtm-api/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/rtm-api/.eslintrc.js b/packages/rtm-api/.eslintrc.js deleted file mode 120000 index 5962fa3ca..000000000 --- a/packages/rtm-api/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintrc.js \ No newline at end of file diff --git a/packages/rtm-api/.mocharc.json b/packages/rtm-api/.mocharc.json index d69e0b8b3..09b509473 100644 --- a/packages/rtm-api/.mocharc.json +++ b/packages/rtm-api/.mocharc.json @@ -1,4 +1,4 @@ { "require": ["ts-node/register", "source-map-support/register"], "timeout": 3000 -} \ No newline at end of file +} diff --git a/packages/rtm-api/.vscode/settings.json b/packages/rtm-api/.vscode/settings.json index 6de18e4ed..97bef4c57 100644 --- a/packages/rtm-api/.vscode/settings.json +++ b/packages/rtm-api/.vscode/settings.json @@ -1,3 +1,3 @@ { - "typescript.tsdk": "./node_modules/typescript/lib" + "typescript.tsdk": "./node_modules/typescript/lib" } diff --git a/packages/rtm-api/api-extractor.json b/packages/rtm-api/api-extractor.json deleted file mode 100644 index dbbbba8b5..000000000 --- a/packages/rtm-api/api-extractor.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - /** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - "mainEntryPointFilePath": "/dist/index.d.ts", - - "apiReport": { - "enabled": false - }, - - "docModel": { - "enabled": true, - "apiJsonFilePath": "/../../support/ref-docs/models/.api.json" - }, - - "dtsRollup": { - "enabled": false - }, - - "tsdocMetadata": { - "enabled": false - }, - - "messages": { - "extractorMessageReporting": { - // Disable release tagging warnings - "ae-missing-release-tag": { - "logLevel": "none" - } - } - } -} diff --git a/packages/rtm-api/biome.json b/packages/rtm-api/biome.json new file mode 100644 index 000000000..ea710a856 --- /dev/null +++ b/packages/rtm-api/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/rtm-api/package.json b/packages/rtm-api/package.json index eedc78b0a..6b01ce4f2 100644 --- a/packages/rtm-api/package.json +++ b/packages/rtm-api/package.json @@ -4,23 +4,10 @@ "description": "Official library for using the Slack Platform's Real Time Messaging API", "author": "Slack Technologies, LLC", "license": "MIT", - "keywords": [ - "slack", - "rtm-api", - "bot", - "client", - "http", - "websocket", - "api", - "proxy", - "state", - "connection" - ], + "keywords": ["slack", "rtm-api", "bot", "client", "http", "websocket", "api", "proxy", "state", "connection"], "main": "dist/index.js", "types": "./dist/index.d.ts", - "files": [ - "dist/**/*" - ], + "files": ["dist/**/*"], "engines": { "node": ">=18", "npm": ">=8.6.0" @@ -37,10 +24,9 @@ "prepare": "npm run build", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist", - "lint": "eslint --fix --ext .ts src", + "lint": "npx @biomejs/biome check --write .", "test": "npm run lint && npm run build && npm run test:integration", - "test:integration": "mocha --config .mocharc.json test/integration.spec.js", - "ref-docs:model": "api-extractor run" + "test:integration": "mocha --config .mocharc.json test/integration.spec.js" }, "dependencies": { "@slack/logger": "^4", @@ -53,21 +39,12 @@ "ws": "^8" }, "devDependencies": { - "@microsoft/api-extractor": "^7", - "@typescript-eslint/eslint-plugin": "^6", - "@typescript-eslint/parser": "^6", + "@biomejs/biome": "^1.8.3", "@types/chai": "^4", "@types/mocha": "^10", "@types/sinon": "^17", "@types/ws": "^8", "chai": "^4", - "eslint": "^8", - "eslint-config-airbnb-base": "^15", - "eslint-config-airbnb-typescript": "^17", - "eslint-plugin-import": "^2", - "eslint-plugin-import-newlines": "^1.3.4", - "eslint-plugin-jsdoc": "^48", - "eslint-plugin-node": "^11", "mocha": "^10", "shx": "^0.3.2", "sinon": "^17", diff --git a/packages/rtm-api/src/KeepAlive.ts b/packages/rtm-api/src/KeepAlive.ts index 831881b45..90654fa82 100644 --- a/packages/rtm-api/src/KeepAlive.ts +++ b/packages/rtm-api/src/KeepAlive.ts @@ -1,8 +1,8 @@ import { EventEmitter } from 'eventemitter3'; -import { CodedError, ErrorCode } from './errors'; -import { LogLevel, Logger, getLogger } from './logger'; -import { RTMClient } from './RTMClient'; +import type { RTMClient } from './RTMClient'; +import { type CodedError, ErrorCode } from './errors'; +import { LogLevel, type Logger, getLogger } from './logger'; export interface KeepAliveOptions { logger?: Logger; @@ -140,7 +140,7 @@ export class KeepAlive extends EventEmitter { private clearPreviousPingTimer(): void { if (this.pingTimer !== undefined) { clearTimeout(this.pingTimer); - delete this.pingTimer; + this.pingTimer = undefined; } } @@ -175,7 +175,8 @@ export class KeepAlive extends EventEmitter { throw error; } this.logger.debug('ping timer expired, sending ping'); - this.client.send('ping') + this.client + .send('ping') .then((messageId) => { if (this.client === undefined) { if (!this.isMonitoring) { @@ -192,35 +193,32 @@ export class KeepAlive extends EventEmitter { this.logger.debug('setting pong timer'); - this.pongTimer = setTimeout( - () => { - if (this.client === undefined) { - // if monitoring stopped before the pong timer fires, its safe to return - if (!this.isMonitoring) { - this.logger.debug('stopped monitoring before pong timer fired'); - return; - } - const error = new Error('no client found'); - (error as CodedError).code = ErrorCode.KeepAliveInconsistentState; - throw error; + this.pongTimer = setTimeout(() => { + if (this.client === undefined) { + // if monitoring stopped before the pong timer fires, its safe to return + if (!this.isMonitoring) { + this.logger.debug('stopped monitoring before pong timer fired'); + return; } - // signal that this pong is done being handled - this.client.off('slack_event', this.attemptAcknowledgePong); + const error = new Error('no client found'); + (error as CodedError).code = ErrorCode.KeepAliveInconsistentState; + throw error; + } + // signal that this pong is done being handled + this.client.off('slack_event', this.attemptAcknowledgePong); - // no pong received to acknowledge the last ping within the serverPongTimeout - this.logger.debug('pong timer expired, recommend reconnect'); - this.recommendReconnect = true; - this.emit('recommend_reconnect'); - }, - this.serverPongTimeout, - ); + // no pong received to acknowledge the last ping within the serverPongTimeout + this.logger.debug('pong timer expired, recommend reconnect'); + this.recommendReconnect = true; + this.emit('recommend_reconnect'); + }, this.serverPongTimeout); this.client.on('slack_event', this.attemptAcknowledgePong, this); }) .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 + // biome-ignore lint/suspicious/noExplicitAny: errors can be anything } catch (error: any) { this.logger.error(`Unhandled error: ${error.message}. Please report to @slack/rtm-api package maintainers.`); } @@ -250,7 +248,7 @@ export class KeepAlive extends EventEmitter { if (this.lastPing !== undefined && event.reply_to !== undefined && (event.reply_to as number) >= this.lastPing) { // this message is a reply that acks the previous ping, clear the last ping this.logger.debug('received pong, clearing pong timer'); - delete this.lastPing; + this.lastPing = undefined; // signal that this pong is done being handled this.clearPreviousPongTimer(); diff --git a/packages/rtm-api/src/RTMClient.ts b/packages/rtm-api/src/RTMClient.ts index 42ae8f4c9..8c63893bd 100644 --- a/packages/rtm-api/src/RTMClient.ts +++ b/packages/rtm-api/src/RTMClient.ts @@ -1,22 +1,23 @@ -import { Agent } from 'http'; +import type { Agent } from 'node:http'; import { ErrorCode as APICallErrorCode, - RTMConnectArguments, - RTMStartArguments, - RetryOptions, - TLSOptions, - WebAPICallError, - WebAPICallResult, + type RTMConnectArguments, + type RTMStartArguments, + type RetryOptions, + type TLSOptions, + type WebAPICallError, + type WebAPICallResult, WebClient, addAppMetadata, } from '@slack/web-api'; import { EventEmitter } from 'eventemitter3'; -import Finity, { StateMachine } from 'finity'; +import Finity, { type StateMachine } from 'finity'; import PCancelable from 'p-cancelable'; import PQueue from 'p-queue'; import WebSocket from 'ws'; +import { KeepAlive } from './KeepAlive'; import { noReplyReceivedError, platformErrorFromEvent, @@ -24,10 +25,9 @@ import { sendWhileNotReadyError, websocketErrorWithOriginal, } from './errors'; -import { KeepAlive } from './KeepAlive'; -import { LogLevel, Logger, getLogger } from './logger'; +import { LogLevel, type Logger, getLogger } from './logger'; -const packageJson = require('../package.json'); // eslint-disable-line import/no-commonjs, @typescript-eslint/no-var-requires +const packageJson = require('../package.json'); /* * Helpers @@ -64,13 +64,13 @@ export class RTMClient extends EventEmitter { /** * Whether or not the client is currently connected to the RTM API */ - public connected: boolean = false; + public connected = false; /** * Whether or not the client has authenticated to the RTM API. This occurs when the connect method * completes, and a WebSocket URL is available for the client's connection. */ - public authenticated: boolean = false; + public authenticated = false; /** * The user ID for the connected client. @@ -107,7 +107,7 @@ export class RTMClient extends EventEmitter { * The number of milliseconds to wait upon connection for reply messages from the previous connection. The default * value is 2 seconds. */ - private replyAckOnReconnectTimeout: number = 2000; + private replyAckOnReconnectTimeout = 2000; /** * State machine that backs the transition and action behavior @@ -117,175 +117,202 @@ export class RTMClient extends EventEmitter { /** * Configuration for the state machine */ - private stateMachineConfig = Finity - .configure() + private stateMachineConfig = Finity.configure() /* eslint-disable @typescript-eslint/indent, newline-per-chained-call */ - .initialState('disconnected') - .on('start').transitionTo('connecting') - .on('explicit disconnect').transitionTo('disconnected') - .onEnter(() => { - // each client should start out with the outgoing event queue paused - this.logger.debug('pausing outgoing event queue'); - this.outgoingEventQueue.pause(); - // when a formerly connected client gets disconnected, all outgoing messages whose promises were waiting - // for a reply from the server should be canceled - this.awaitingReplyList.forEach((p) => { p.cancel(); }); - }) - .state('connecting') - .submachine(Finity.configure() - .initialState('authenticating') - .do(() => { - // determine which Web API method to use for the connection - const connectMethod = this.useRtmConnect ? 'rtm.connect' : 'rtm.start'; - - return this.webClient.apiCall(connectMethod, this.startOpts !== undefined ? { ...this.startOpts } : {}) - .then((result: WebAPICallResult) => { - const startData = result as RTMStartResult; - - // capture identity information - this.activeUserId = startData.self.id; - this.activeTeamId = startData.team.id; - - return result; - }); - }) - .onSuccess().transitionTo('authenticated') - .onFailure() - .transitionTo('reconnecting').withCondition((context) => { - const error = context.error as WebAPICallError; - - this.logger.info(`unable to RTM start: ${error.message}`); - - // Observe this event when the error which causes reconnecting or disconnecting is meaningful - this.emit('unable_to_rtm_start', error); - - let isRecoverable = true; - if (error.code === APICallErrorCode.PlatformError && - (Object.values(UnrecoverableRTMStartError) as string[]).includes(error.data.error)) { - isRecoverable = false; - } else if (error.code === APICallErrorCode.RequestError) { - isRecoverable = false; - } else if (error.code === APICallErrorCode.HTTPError) { - isRecoverable = false; - } - - return this.autoReconnect && isRecoverable; - }) - .transitionTo('failed') - .state('authenticated') - .onEnter((_state, context) => { - this.authenticated = true; - this.setupWebsocket(context.result.url); - setImmediate(() => { - this.emit('authenticated', context.result); - }); - }) - .on('websocket open').transitionTo('handshaking') - .state('handshaking') // a state in which to wait until the 'server hello' event - .state('failed') - .onEnter((_state, context) => { - // dispatch 'failure' on parent machine to transition out of this submachine's states - this.stateMachine.handle('failure', context.error); - }) - .global() - .onStateEnter((state) => { - this.logger.debug(`transitioning to state: connecting:${state}`); - }) - .getConfig()) - .on('server hello').transitionTo('connected') - .on('websocket close') - .transitionTo('reconnecting').withCondition(() => this.autoReconnect) - .transitionTo('disconnected').withAction(() => { - // this transition circumvents the 'disconnecting' state (since the websocket is already closed), so we need - // to execute its onExit behavior here. - this.teardownWebsocket(); - }) - .on('failure').transitionTo('disconnected') - .on('explicit disconnect').transitionTo('disconnecting') - .state('connected') - .onEnter(() => { - this.connected = true; - }) - .submachine(Finity.configure() - .initialState('resuming') - // when a reply to the last message sent is received, we assume that the client is "caught up" from its - // previous connection - .on('replay finished').transitionTo('ready') - // when this client is connecting for the first time, or if the last message sent on the previous connection - // would not get a reply from the server, or if for any other reason we do not receive a reply to the last - // message sent - after a timeout, we assume that the client is "caught up" - .onTimeout(this.replyAckOnReconnectTimeout).transitionTo('ready') - .onExit(() => { - // once all replay messages are processed, if there are any more messages awaiting a reply message, let - // them know that there are none expected to arrive. - this.awaitingReplyList.forEach((p) => { p.cancel(); }); - }) - .state('ready') - .onEnter(() => { - this.keepAlive.start(this); - // the transition isn't done yet, so we delay the following statement until after the event loop returns - setImmediate(() => { - this.logger.debug('resuming outgoing event queue'); - this.outgoingEventQueue.start(); - this.emit('ready'); - }); - }) - .global() - .onStateEnter((state) => { - this.logger.debug(`transitioning to state: connected:${state}`); - }) - .getConfig()) - .on('websocket close') - .transitionTo('reconnecting').withCondition(() => this.autoReconnect) - .transitionTo('disconnected').withAction(() => { - // this transition circumvents the 'disconnecting' state (since the websocket is already closed), so we need - // to execute its onExit behavior here. - this.teardownWebsocket(); - }) - .on('explicit disconnect').transitionTo('disconnecting') - .onExit(() => { - this.connected = false; - this.authenticated = false; + .initialState('disconnected') + .on('start') + .transitionTo('connecting') + .on('explicit disconnect') + .transitionTo('disconnected') + .onEnter(() => { + // each client should start out with the outgoing event queue paused + this.logger.debug('pausing outgoing event queue'); + this.outgoingEventQueue.pause(); + // when a formerly connected client gets disconnected, all outgoing messages whose promises were waiting + // for a reply from the server should be canceled + for (const p of this.awaitingReplyList) { + p.cancel(); + } + }) + .state('connecting') + .submachine( + Finity.configure() + .initialState('authenticating') + .do(() => { + // determine which Web API method to use for the connection + const connectMethod = this.useRtmConnect ? 'rtm.connect' : 'rtm.start'; - // clear data that is now stale - this.activeUserId = undefined; - this.activeTeamId = undefined; + return this.webClient + .apiCall(connectMethod, this.startOpts !== undefined ? { ...this.startOpts } : {}) + .then((result: WebAPICallResult) => { + const startData = result as RTMStartResult; - this.keepAlive.stop(); - this.outgoingEventQueue.pause(); + // capture identity information + this.activeUserId = startData.self.id; + this.activeTeamId = startData.team.id; + + return result; + }); }) - .state('disconnecting') - .onEnter(() => { - // Most of the time, a websocket will exist. The only time it does not is when transitioning from connecting, - // before the rtm.start() has finished and the websocket hasn't been set up. - if (this.websocket !== undefined) { - this.websocket.close(); + .onSuccess() + .transitionTo('authenticated') + .onFailure() + .transitionTo('reconnecting') + .withCondition((context) => { + const error = context.error as WebAPICallError; + + this.logger.info(`unable to RTM start: ${error.message}`); + + // Observe this event when the error which causes reconnecting or disconnecting is meaningful + this.emit('unable_to_rtm_start', error); + + let isRecoverable = true; + if ( + error.code === APICallErrorCode.PlatformError && + (Object.values(UnrecoverableRTMStartError) as string[]).includes(error.data.error) + ) { + isRecoverable = false; + } else if (error.code === APICallErrorCode.RequestError) { + isRecoverable = false; + } else if (error.code === APICallErrorCode.HTTPError) { + isRecoverable = false; } + + return this.autoReconnect && isRecoverable; }) - .on('websocket close').transitionTo('disconnected') - .onExit(() => this.teardownWebsocket()) - // reconnecting is just like disconnecting, except that the websocket should already be closed before we enter - // this state, and that the next state should be connecting. - .state('reconnecting') - .do(() => { - this.keepAlive.stop(); - return Promise.resolve(true); + .transitionTo('failed') + .state('authenticated') + .onEnter((_state, context) => { + this.authenticated = true; + this.setupWebsocket(context.result.url); + setImmediate(() => { + this.emit('authenticated', context.result); + }); + }) + .on('websocket open') + .transitionTo('handshaking') + .state('handshaking') // a state in which to wait until the 'server hello' event + .state('failed') + .onEnter((_state, context) => { + // dispatch 'failure' on parent machine to transition out of this submachine's states + this.stateMachine.handle('failure', context.error); + }) + .global() + .onStateEnter((state) => { + this.logger.debug(`transitioning to state: connecting:${state}`); }) - .onSuccess().transitionTo('connecting') - .onExit(() => this.teardownWebsocket()) - .global() - .onStateEnter((state, context) => { - this.logger.debug(`transitioning to state: ${state}`); - if (state === 'disconnected') { - // Emits a `disconnected` event with a possible error object (might be undefined) - this.emit(state, context.eventPayload); - } else { - // Emits events: `connecting`, `connected`, `disconnecting`, `reconnecting` - this.emit(state); + .getConfig(), + ) + .on('server hello') + .transitionTo('connected') + .on('websocket close') + .transitionTo('reconnecting') + .withCondition(() => this.autoReconnect) + .transitionTo('disconnected') + .withAction(() => { + // this transition circumvents the 'disconnecting' state (since the websocket is already closed), so we need + // to execute its onExit behavior here. + this.teardownWebsocket(); + }) + .on('failure') + .transitionTo('disconnected') + .on('explicit disconnect') + .transitionTo('disconnecting') + .state('connected') + .onEnter(() => { + this.connected = true; + }) + .submachine( + Finity.configure() + .initialState('resuming') + // when a reply to the last message sent is received, we assume that the client is "caught up" from its + // previous connection + .on('replay finished') + .transitionTo('ready') + // when this client is connecting for the first time, or if the last message sent on the previous connection + // would not get a reply from the server, or if for any other reason we do not receive a reply to the last + // message sent - after a timeout, we assume that the client is "caught up" + .onTimeout(this.replyAckOnReconnectTimeout) + .transitionTo('ready') + .onExit(() => { + // once all replay messages are processed, if there are any more messages awaiting a reply message, let + // them know that there are none expected to arrive. + for (const p of this.awaitingReplyList) { + p.cancel(); } }) + .state('ready') + .onEnter(() => { + this.keepAlive.start(this); + // the transition isn't done yet, so we delay the following statement until after the event loop returns + setImmediate(() => { + this.logger.debug('resuming outgoing event queue'); + this.outgoingEventQueue.start(); + this.emit('ready'); + }); + }) + .global() + .onStateEnter((state) => { + this.logger.debug(`transitioning to state: connected:${state}`); + }) + .getConfig(), + ) + .on('websocket close') + .transitionTo('reconnecting') + .withCondition(() => this.autoReconnect) + .transitionTo('disconnected') + .withAction(() => { + // this transition circumvents the 'disconnecting' state (since the websocket is already closed), so we need + // to execute its onExit behavior here. + this.teardownWebsocket(); + }) + .on('explicit disconnect') + .transitionTo('disconnecting') + .onExit(() => { + this.connected = false; + this.authenticated = false; + + // clear data that is now stale + this.activeUserId = undefined; + this.activeTeamId = undefined; + + this.keepAlive.stop(); + this.outgoingEventQueue.pause(); + }) + .state('disconnecting') + .onEnter(() => { + // Most of the time, a websocket will exist. The only time it does not is when transitioning from connecting, + // before the rtm.start() has finished and the websocket hasn't been set up. + if (this.websocket !== undefined) { + this.websocket.close(); + } + }) + .on('websocket close') + .transitionTo('disconnected') + .onExit(() => this.teardownWebsocket()) + // reconnecting is just like disconnecting, except that the websocket should already be closed before we enter + // this state, and that the next state should be connecting. + .state('reconnecting') + .do(() => { + this.keepAlive.stop(); + return Promise.resolve(true); + }) + .onSuccess() + .transitionTo('connecting') + .onExit(() => this.teardownWebsocket()) + .global() + .onStateEnter((state, context) => { + this.logger.debug(`transitioning to state: ${state}`); + if (state === 'disconnected') { + // Emits a `disconnected` event with a possible error object (might be undefined) + this.emit(state, context.eventPayload); + } else { + // Emits events: `connecting`, `connected`, `disconnecting`, `reconnecting` + this.emit(state); + } + }) .getConfig(); - /* eslint-enable @typescript-eslint/indent, newline-per-chained-call */ + /* eslint-enable @typescript-eslint/indent, newline-per-chained-call */ /** * The client's websocket @@ -337,30 +364,35 @@ export class RTMClient extends EventEmitter { */ private logger: Logger; - public constructor(token: string, { - slackApiUrl = 'https://slack.com/api/', - logger = undefined, - logLevel = LogLevel.INFO, - retryConfig, - agent = undefined, - autoReconnect = true, - useRtmConnect = true, - clientPingTimeout, - serverPongTimeout, - replyAckOnReconnectTimeout = 2000, - tls = undefined, - webClient, - }: RTMClientOptions = {}) { - super(); - this.webClient = webClient || new WebClient(token, { - slackApiUrl, - logger, - logLevel, + public constructor( + token: string, + { + slackApiUrl = 'https://slack.com/api/', + logger = undefined, + logLevel = LogLevel.INFO, retryConfig, - agent, - tls, - maxRequestConcurrency: 1, - }); + agent = undefined, + autoReconnect = true, + useRtmConnect = true, + clientPingTimeout, + serverPongTimeout, + replyAckOnReconnectTimeout = 2000, + tls = undefined, + webClient, + }: RTMClientOptions = {}, + ) { + super(); + this.webClient = + webClient || + new WebClient(token, { + slackApiUrl, + logger, + logLevel, + retryConfig, + agent, + tls, + maxRequestConcurrency: 1, + }); this.agentConfig = agent; this.autoReconnect = autoReconnect; @@ -491,8 +523,13 @@ export class RTMClient extends EventEmitter { * @param body - the message body */ public addOutgoingEvent(awaitReply: true, type: string, body?: Record): Promise; - public addOutgoingEvent(awaitReply: false, type: string, body?: Record): Promise; - public addOutgoingEvent(awaitReply: boolean, type: string, body?: Record): Promise { // eslint-disable-line max-len + public addOutgoingEvent(awaitReply: false, type: string, body?: Record): Promise; + public addOutgoingEvent( + awaitReply: boolean, + type: string, + body?: Record, + ): Promise { + // eslint-disable-line max-len const awaitReplyTask = (messageId: number) => { const replyPromise = new PCancelable((resolve, reject, onCancel) => { // We only want the event handler to resolve the Promise in the case the message IDs match @@ -502,7 +539,7 @@ export class RTMClient extends EventEmitter { if (event.reply_to === messageId) { this.off('slack_event', eventHandler); if (event.error !== undefined) { - const error = platformErrorFromEvent(event as RTMCallResult & { error: { msg: string; } }); + const error = platformErrorFromEvent(event as RTMCallResult & { error: { msg: string } }); return reject(error); } return resolve(event); @@ -518,12 +555,12 @@ export class RTMClient extends EventEmitter { return replyPromise; }; - const sendTask = (): Promise => { + const sendTask = (): Promise => { const sendPromise = this.send(type, body); if (awaitReply) { return sendPromise.then(awaitReplyTask); } - return sendPromise.then(() => Promise.resolve()); + return sendPromise.then(() => Promise.resolve(undefined)); }; return this.outgoingEventQueue.add(sendTask); @@ -550,8 +587,9 @@ export class RTMClient extends EventEmitter { if (this.websocket === undefined) { this.logger.error('cannot send message when client is not connected'); reject(sendWhileDisconnectedError()); - } else if (!(this.stateMachine.getCurrentState() === 'connected' && - this.stateMachine.getStateHierarchy()[1] === 'ready')) { + } else if ( + !(this.stateMachine.getCurrentState() === 'connected' && this.stateMachine.getStateHierarchy()[1] === 'ready') + ) { this.logger.error('cannot send message when client is not ready'); reject(sendWhileNotReadyError()); } else { @@ -626,10 +664,10 @@ export class RTMClient extends EventEmitter { this.logger.debug(`received message on websocket: ${data.toString()}`); // parse message into slack event - let event; + let event: { type: string } & Record; try { event = JSON.parse(data.toString()); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: errors can be anything } catch (parseError: any) { // prevent application from crashing on a bad message, but log an error to bring attention this.logger.error( @@ -649,9 +687,12 @@ export class RTMClient extends EventEmitter { } } - if (this.stateMachine.getCurrentState() === 'connected' && - this.stateMachine.getStateHierarchy()[1] === 'resuming' && - event.reply_to !== undefined && event.reply_to === this.messageId) { + if ( + this.stateMachine.getCurrentState() === 'connected' && + this.stateMachine.getStateHierarchy()[1] === 'resuming' && + event.reply_to !== undefined && + event.reply_to === this.messageId + ) { this.stateMachine.handle('replay finished'); } diff --git a/packages/rtm-api/src/errors.ts b/packages/rtm-api/src/errors.ts index 045d73db1..1fb79cd9f 100644 --- a/packages/rtm-api/src/errors.ts +++ b/packages/rtm-api/src/errors.ts @@ -1,4 +1,4 @@ -import { RTMCallResult } from './RTMClient'; +import type { RTMCallResult } from './RTMClient'; /** * All errors produced by this package adhere to this interface @@ -23,8 +23,12 @@ export enum ErrorCode { KeepAliveInconsistentState = 'slack_rtmapi_keepalive_inconsistent_state', } -export type RTMCallError = RTMPlatformError | RTMWebsocketError | RTMNoReplyReceivedError -| RTMSendWhileDisconnectedError | RTMSendWhileNotReadyError; +export type RTMCallError = + | RTMPlatformError + | RTMWebsocketError + | RTMNoReplyReceivedError + | RTMSendWhileDisconnectedError + | RTMSendWhileNotReadyError; export interface RTMPlatformError extends CodedError { code: ErrorCode.SendMessagePlatformError; @@ -67,19 +71,19 @@ export function websocketErrorWithOriginal(original: Error): RTMWebsocketError { ErrorCode.WebsocketError, ) as Partial; error.original = original; - return (error as RTMWebsocketError); + return error as RTMWebsocketError; } /** * A factory to create RTMPlatformError objects. */ -export function platformErrorFromEvent(event: RTMCallResult & { error: { msg: string; } }): RTMPlatformError { +export function platformErrorFromEvent(event: RTMCallResult & { error: { msg: string } }): RTMPlatformError { const error = errorWithCode( new Error(`An API error occurred: ${event.error.msg}`), ErrorCode.SendMessagePlatformError, ) as Partial; error.data = event; - return (error as RTMPlatformError); + return error as RTMPlatformError; } /** @@ -87,8 +91,10 @@ export function platformErrorFromEvent(event: RTMCallResult & { error: { msg: st */ export function noReplyReceivedError(): RTMNoReplyReceivedError { return errorWithCode( - new Error('Message sent but no server acknowledgement was received. This may be caused by the client ' + - 'changing connection state rather than any issue with the specific message. Check before resending.'), + new Error( + 'Message sent but no server acknowledgement was received. This may be caused by the client ' + + 'changing connection state rather than any issue with the specific message. Check before resending.', + ), ErrorCode.NoReplyReceivedError, ) as RTMNoReplyReceivedError; } diff --git a/packages/rtm-api/src/logger.ts b/packages/rtm-api/src/logger.ts index db9318513..c7b1cf6e4 100644 --- a/packages/rtm-api/src/logger.ts +++ b/packages/rtm-api/src/logger.ts @@ -1,4 +1,4 @@ -import { ConsoleLogger, LogLevel, Logger } from '@slack/logger'; +import { ConsoleLogger, type LogLevel, type Logger } from '@slack/logger'; export { Logger, LogLevel } from '@slack/logger'; @@ -14,7 +14,9 @@ export function getLogger(name: string, level: LogLevel, existingLogger?: Logger // Set up the logger. const logger: Logger = (() => { - if (existingLogger !== undefined) { return existingLogger; } + if (existingLogger !== undefined) { + return existingLogger; + } return new ConsoleLogger(); })(); logger.setName(`rtm-api:${name}:${instanceId}`); diff --git a/packages/rtm-api/test/integration.spec.js b/packages/rtm-api/test/integration.spec.js index 0d81cddb9..aa19cd58e 100644 --- a/packages/rtm-api/test/integration.spec.js +++ b/packages/rtm-api/test/integration.spec.js @@ -1,8 +1,8 @@ const { assert } = require('chai'); const { RTMClient } = require('../src/RTMClient'); const { LogLevel } = require('../src/logger'); -const { WebSocketServer} = require('ws'); -const { createServer } = require('http'); +const { WebSocketServer } = require('ws'); +const { createServer } = require('node:http'); const sinon = require('sinon'); const HTTP_PORT = 12345; @@ -21,12 +21,14 @@ describe('Integration tests with a WebSocket server', () => { beforeEach(() => { server = createServer((req, res) => { res.writeHead(200, { 'content-type': 'application/json' }); - res.end(JSON.stringify({ - ok: true, - url: `ws://localhost:${WSS_PORT}/`, - self: { id: 'elclassico' }, - team: { id: 'T12345' }, - })); + res.end( + JSON.stringify({ + ok: true, + url: `ws://localhost:${WSS_PORT}/`, + self: { id: 'elclassico' }, + team: { id: 'T12345' }, + }), + ); }); server.listen(HTTP_PORT); wss = new WebSocketServer({ port: WSS_PORT }); @@ -35,7 +37,7 @@ describe('Integration tests with a WebSocket server', () => { assert.fail(err); }); // Send `Event.ServerHello` - ws.send(JSON.stringify({type: 'hello'})); + ws.send(JSON.stringify({ type: 'hello' })); exposed_ws_connection = ws; }); }); @@ -63,10 +65,12 @@ describe('Integration tests with a WebSocket server', () => { }); it('can listen on slack event types and receive payload properties', async () => { client.on('connected', () => { - exposed_ws_connection.send(JSON.stringify({ - type: 'team_member_joined', - envelope_id: 12345, - })); + exposed_ws_connection.send( + JSON.stringify({ + type: 'team_member_joined', + envelope_id: 12345, + }), + ); }); await client.start(); await new Promise((res, _rej) => { @@ -85,5 +89,5 @@ describe('Integration tests with a WebSocket server', () => { }); function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); + return new Promise((resolve) => setTimeout(resolve, ms)); } diff --git a/packages/rtm-api/tsconfig.eslint.json b/packages/rtm-api/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/rtm-api/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/rtm-api/tsconfig.json b/packages/rtm-api/tsconfig.json index b61d86ce5..139d474c6 100644 --- a/packages/rtm-api/tsconfig.json +++ b/packages/rtm-api/tsconfig.json @@ -13,14 +13,14 @@ "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", "baseUrl": ".", "paths": { - "*": ["./types/*"] + "*": [ + "./types/*" + ] }, - "esModuleInterop" : true, - + "esModuleInterop": true // Not using this setting because its only used to require the package.json file, and that would change the // structure of the files in the dist directory because package.json is not located inside src. It would be nice // to use import instead of require(), but its not worth the tradeoff of restructuring the build (for now). @@ -30,8 +30,7 @@ "src/**/*" ], "exclude": [ - "src/**/*.spec.js", - "src/**/*.js" + "src/**/*.spec.*" ], "jsdoc": { "out": "support/jsdoc", diff --git a/packages/socket-mode/.eslintignore b/packages/socket-mode/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/socket-mode/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/socket-mode/.eslintrc.js b/packages/socket-mode/.eslintrc.js deleted file mode 120000 index 5962fa3ca..000000000 --- a/packages/socket-mode/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintrc.js \ No newline at end of file diff --git a/packages/socket-mode/.vscode/settings.json b/packages/socket-mode/.vscode/settings.json index 6de18e4ed..97bef4c57 100644 --- a/packages/socket-mode/.vscode/settings.json +++ b/packages/socket-mode/.vscode/settings.json @@ -1,3 +1,3 @@ { - "typescript.tsdk": "./node_modules/typescript/lib" + "typescript.tsdk": "./node_modules/typescript/lib" } diff --git a/packages/socket-mode/biome.json b/packages/socket-mode/biome.json new file mode 100644 index 000000000..ea710a856 --- /dev/null +++ b/packages/socket-mode/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/socket-mode/examples/manually-connecting.js b/packages/socket-mode/examples/manually-connecting.js index 91060dbef..121dae68f 100644 --- a/packages/socket-mode/examples/manually-connecting.js +++ b/packages/socket-mode/examples/manually-connecting.js @@ -1,5 +1,5 @@ -const { SocketModeClient, LogLevel } = require("@slack/socket-mode"); -const { WebClient } = require("@slack/web-api"); +const { SocketModeClient, LogLevel } = require('@slack/socket-mode'); +const { WebClient } = require('@slack/web-api'); const logLevel = LogLevel.DEBUG; const socketModeClient = new SocketModeClient({ @@ -13,7 +13,7 @@ const webClient = new WebClient(process.env.SLACK_BOT_TOKEN, { logLevel, }); -socketModeClient.on("slack_event", async ({ ack, body }) => { +socketModeClient.on('slack_event', async ({ ack, body }) => { try { console.log(body); // setTimeout(() => { ack(); }, 2000); @@ -24,12 +24,13 @@ socketModeClient.on("slack_event", async ({ ack, body }) => { }); (async () => { - socketModeClient.start() - .then(() => console.log("Connected")) - .catch(() => console.log("Failed")); - setTimeout(() => socketModeClient.disconnect(), 5000) - setTimeout(() => socketModeClient.start(), 10000) - setTimeout(() => socketModeClient.disconnect(), 15000) - setTimeout(() => socketModeClient.start(), 20000) - setTimeout(() => {}, 1000000) + socketModeClient + .start() + .then(() => console.log('Connected')) + .catch(() => console.log('Failed')); + setTimeout(() => socketModeClient.disconnect(), 5000); + setTimeout(() => socketModeClient.start(), 10000); + setTimeout(() => socketModeClient.disconnect(), 15000); + setTimeout(() => socketModeClient.start(), 20000); + setTimeout(() => {}, 1000000); })(); diff --git a/packages/socket-mode/examples/proxy.js b/packages/socket-mode/examples/proxy.js index b06e77d5f..9efb87e54 100644 --- a/packages/socket-mode/examples/proxy.js +++ b/packages/socket-mode/examples/proxy.js @@ -1,7 +1,7 @@ -const { SocketModeClient, LogLevel } = require("@slack/socket-mode"); -const { WebClient } = require("@slack/web-api"); -const HttpsProxyAgent = require("https-proxy-agent"); -const clientOptions = { agent: new HttpsProxyAgent("http://localhost:9001") }; +const { SocketModeClient, LogLevel } = require('@slack/socket-mode'); +const { WebClient } = require('@slack/web-api'); +const HttpsProxyAgent = require('https-proxy-agent'); +const clientOptions = { agent: new HttpsProxyAgent('http://localhost:9001') }; const socketModeClient = new SocketModeClient({ appToken: process.env.SLACK_APP_TOKEN, @@ -13,7 +13,7 @@ const webClient = new WebClient(process.env.SLACK_BOT_TOKEN, { clientOptions, }); -socketModeClient.on("slack_event", async ({ ack, body }) => { +socketModeClient.on('slack_event', async ({ ack, body }) => { console.log(body); await ack(); }); diff --git a/packages/socket-mode/examples/simple.js b/packages/socket-mode/examples/simple.js index 2d36eba81..d4170538e 100644 --- a/packages/socket-mode/examples/simple.js +++ b/packages/socket-mode/examples/simple.js @@ -1,5 +1,5 @@ -const { SocketModeClient, LogLevel } = require("@slack/socket-mode"); -const { WebClient } = require("@slack/web-api"); +const { SocketModeClient, LogLevel } = require('@slack/socket-mode'); +const { WebClient } = require('@slack/web-api'); const logLevel = LogLevel.INFO; const socketModeClient = new SocketModeClient({ @@ -13,7 +13,7 @@ const webClient = new WebClient(process.env.SLACK_BOT_TOKEN, { logLevel, }); -socketModeClient.on("slack_event", async ({ ack, body }) => { +socketModeClient.on('slack_event', async ({ ack, body }) => { try { console.log(body); // setTimeout(() => { ack(); }, 2000); diff --git a/packages/socket-mode/package.json b/packages/socket-mode/package.json index b38b0c313..659b7c047 100644 --- a/packages/socket-mode/package.json +++ b/packages/socket-mode/package.json @@ -39,7 +39,7 @@ "prepare": "npm run build", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage", - "lint": "eslint --fix --ext .ts src", + "lint": "npx @biomejs/biome check --write .", "test:unit": "mocha --config .mocharc.json src/**/*.spec.ts", "test:coverage": "c8 npm run test:unit", "test:integration": "mocha --config .mocharc.json test/integration.spec.js", @@ -52,24 +52,16 @@ "@types/node": ">=18", "@types/ws": "^8", "eventemitter3": "^5", - "finity": "^0.5.4", "ws": "^8" }, "devDependencies": { + "@biomejs/biome": "^1.8.3", + "@tsconfig/recommended": "^1.0.7", "@types/chai": "^4", "@types/mocha": "^10", "@types/sinon": "^17", - "@typescript-eslint/eslint-plugin": "^6", - "@typescript-eslint/parser": "^6", "c8": "^10.1.2", "chai": "^4", - "eslint": "^8", - "eslint-config-airbnb-base": "^15", - "eslint-config-airbnb-typescript": "^17", - "eslint-plugin-import": "^2", - "eslint-plugin-import-newlines": "^1.3.4", - "eslint-plugin-jsdoc": "^48", - "eslint-plugin-node": "^11", "mocha": "^10", "nodemon": "^3.1.0", "shx": "^0.3.2", diff --git a/packages/socket-mode/src/SlackWebSocket.spec.ts b/packages/socket-mode/src/SlackWebSocket.spec.ts index 4ceb86bfa..2a8447152 100644 --- a/packages/socket-mode/src/SlackWebSocket.spec.ts +++ b/packages/socket-mode/src/SlackWebSocket.spec.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; import EventEmitter from 'eventemitter3'; import sinon from 'sinon'; -import logModule from './logger'; import { SlackWebSocket } from './SlackWebSocket'; +import logModule from './logger'; describe('SlackWebSocket', () => { const sandbox = sinon.createSandbox(); @@ -19,11 +19,22 @@ describe('SlackWebSocket', () => { logFactory = sandbox.stub(logModule, 'getLogger'); }); it('should set a default logger if none provided', () => { - new SlackWebSocket({ url: 'https://whatever.com', client: new EventEmitter(), clientPingTimeoutMS: 1, serverPingTimeoutMS: 1 }); + new SlackWebSocket({ + url: 'https://whatever.com', + client: new EventEmitter(), + clientPingTimeoutMS: 1, + serverPingTimeoutMS: 1, + }); assert.isTrue(logFactory.called); }); it('should not set a default logger if one provided', () => { - new SlackWebSocket({ url: 'https://whatever.com', client: new EventEmitter(), clientPingTimeoutMS: 1, serverPingTimeoutMS: 1, logger: new ConsoleLogger() }); + new SlackWebSocket({ + url: 'https://whatever.com', + client: new EventEmitter(), + clientPingTimeoutMS: 1, + serverPingTimeoutMS: 1, + logger: new ConsoleLogger(), + }); assert.isFalse(logFactory.called); }); }); diff --git a/packages/socket-mode/src/SlackWebSocket.ts b/packages/socket-mode/src/SlackWebSocket.ts index f2606b234..42af60ee1 100644 --- a/packages/socket-mode/src/SlackWebSocket.ts +++ b/packages/socket-mode/src/SlackWebSocket.ts @@ -1,10 +1,10 @@ -import { Agent } from 'http'; +import type { Agent } from 'node:http'; -import { EventEmitter } from 'eventemitter3'; -import { WebSocket, ClientOptions as WebSocketClientOptions } from 'ws'; +import type { EventEmitter } from 'eventemitter3'; +import { WebSocket, type ClientOptions as WebSocketClientOptions } from 'ws'; import { websocketErrorWithOriginal } from './errors'; -import log, { LogLevel, Logger } from './logger'; +import log, { LogLevel, type Logger } from './logger'; // Maps ws `readyState` to human readable labels https://github.com/websockets/ws/blob/HEAD/doc/ws.md#ready-state-constants export const WS_READY_STATES = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']; @@ -17,7 +17,7 @@ export interface SlackWebSocketOptions { /** @description A LogLevel at which this class should log to. */ logLevel?: LogLevel; /** @description A Logger instance used to log activity to. */ - logger?: Logger, + logger?: Logger; /** @description Delay between this client sending a `ping` message, in milliseconds. */ pingInterval?: number; /** @description The HTTP Agent to use when establishing a WebSocket connection. */ @@ -40,7 +40,8 @@ export interface SlackWebSocketOptions { * Encapsulates the Slack-specific details around establishing a WebSocket connection with the Slack backend. * Manages the ping/pong heartbeat of the connection. */ -export class SlackWebSocket { // python equiv: Connection +export class SlackWebSocket { + // python equiv: Connection private static loggerName = 'SlackWebSocket'; private options: SlackWebSocketOptions; @@ -189,7 +190,8 @@ export class SlackWebSocket { // python equiv: Connection * Returns true if the underlying WebSocket connection is active, meaning the underlying * {@link https://github.com/websockets/ws/blob/master/doc/ws.md#ready-state-constants WebSocket ready state is "OPEN"}. */ - public isActive(): boolean { // python equiv: SocketModeClient.is_connected + public isActive(): boolean { + // python equiv: SocketModeClient.is_connected if (!this.websocket) { this.logger.debug('isActive(): websocket not instantiated!'); return false; @@ -210,8 +212,8 @@ export class SlackWebSocket { // python equiv: Connection /** * Sends data via the underlying WebSocket. Accepts an errorback argument. */ - public send(data: string, cb: ((err: Error | undefined) => void)): void { - return this.websocket?.send(data, cb); + public send(data: string, cb: (err: Error | undefined) => void): void { + this.websocket?.send(data, cb); } /** @@ -221,7 +223,9 @@ export class SlackWebSocket { // python equiv: Connection private monitorPingFromSlack(): void { clearTimeout(this.serverPingTimeout); this.serverPingTimeout = setTimeout(() => { - this.logger.warn(`A ping wasn't received from the server before the timeout of ${this.options.serverPingTimeoutMS}ms!`); + this.logger.warn( + `A ping wasn't received from the server before the timeout of ${this.options.serverPingTimeoutMS}ms!`, + ); this.disconnect(); }, this.options.serverPingTimeoutMS); } @@ -262,7 +266,9 @@ export class SlackWebSocket { // python equiv: Connection isInvalid = millis > this.options.clientPingTimeoutMS; } if (isInvalid) { - this.logger.warn(`A pong wasn't received from the server before the timeout of ${this.options.clientPingTimeoutMS}ms!`); + this.logger.warn( + `A pong wasn't received from the server before the timeout of ${this.options.clientPingTimeoutMS}ms!`, + ); this.disconnect(); } }, this.options.clientPingTimeoutMS / 3); diff --git a/packages/socket-mode/src/SocketModeClient.spec.ts b/packages/socket-mode/src/SocketModeClient.spec.ts index 118d5314b..09e68bb13 100644 --- a/packages/socket-mode/src/SocketModeClient.spec.ts +++ b/packages/socket-mode/src/SocketModeClient.spec.ts @@ -2,8 +2,8 @@ import { ConsoleLogger } from '@slack/logger'; import { assert } from 'chai'; import sinon from 'sinon'; -import logModule from './logger'; import { SocketModeClient } from './SocketModeClient'; +import logModule from './logger'; describe('SocketModeClient', () => { const sandbox = sinon.createSandbox(); @@ -70,7 +70,9 @@ describe('SocketModeClient', () => { }); let slackEventListenerCalled = false; client.on('slack_event', async (args) => { - slackEventListenerCalled = args.ack !== undefined && args.body !== undefined && + slackEventListenerCalled = + args.ack !== undefined && + args.body !== undefined && args.type === 'slash_commands' && args.retry_num === undefined && args.retry_reason === undefined; @@ -167,14 +169,17 @@ describe('SocketModeClient', () => { }); let eventsApiListenerCalled = false; client.on('app_mention', async (args) => { - eventsApiListenerCalled = args.ack !== undefined && + eventsApiListenerCalled = + args.ack !== undefined && args.body !== undefined && args.retry_num === 2 && args.retry_reason === 'timeout'; }); let slackEventListenerCalled = false; client.on('slack_event', async (args) => { - slackEventListenerCalled = args.ack !== undefined && args.body !== undefined && + slackEventListenerCalled = + args.ack !== undefined && + args.body !== undefined && args.retry_num === 2 && args.retry_reason === 'timeout'; }); diff --git a/packages/socket-mode/src/SocketModeClient.ts b/packages/socket-mode/src/SocketModeClient.ts index c03023094..09df604bf 100644 --- a/packages/socket-mode/src/SocketModeClient.ts +++ b/packages/socket-mode/src/SocketModeClient.ts @@ -1,24 +1,20 @@ import { ErrorCode as APICallErrorCode, - AppsConnectionsOpenResponse, - WebAPICallError, + type AppsConnectionsOpenResponse, + type WebAPICallError, WebClient, - WebClientOptions, + type WebClientOptions, addAppMetadata, } from '@slack/web-api'; import { EventEmitter } from 'eventemitter3'; -import WebSocket from 'ws'; +import type WebSocket from 'ws'; -import { - sendWhileDisconnectedError, - sendWhileNotReadyError, - websocketErrorWithOriginal, -} from './errors'; -import log, { LogLevel, Logger } from './logger'; +import packageJson from '../package.json'; import { SlackWebSocket, WS_READY_STATES } from './SlackWebSocket'; -import { SocketModeOptions } from './SocketModeOptions'; +import type { SocketModeOptions } from './SocketModeOptions'; import { UnrecoverableSocketModeStartError } from './UnrecoverableSocketModeStartError'; -import packageJson from '../package.json'; +import { sendWhileDisconnectedError, sendWhileNotReadyError, websocketErrorWithOriginal } from './errors'; +import log, { LogLevel, type Logger } from './logger'; // Lifecycle events as described in the README enum State { @@ -80,32 +76,34 @@ export class SocketModeClient extends EventEmitter { /** * How long to wait for pongs from server before timing out - */ + */ private clientPingTimeoutMS: number; /** * Internal count for managing the reconnection state */ - private numOfConsecutiveReconnectionFailures: number = 0; + private numOfConsecutiveReconnectionFailures = 0; - private customLoggerProvided: boolean = false; + private customLoggerProvided = false; /** * Sentinel tracking if user invoked `disconnect()`; for enforcing shutting down of client * even if `autoReconnectEnabled` is `true`. */ - private shuttingDown: boolean = false; - - public constructor({ - logger = undefined, - logLevel = undefined, - autoReconnectEnabled = true, - pingPongLoggingEnabled = false, - clientPingTimeout = 5000, - serverPingTimeout = 30000, - appToken = '', - clientOptions = {}, - }: SocketModeOptions = { appToken: '' }) { + private shuttingDown = false; + + public constructor( + { + logger = undefined, + logLevel = undefined, + autoReconnectEnabled = true, + pingPongLoggingEnabled = false, + clientPingTimeout = 5000, + serverPingTimeout = 30000, + appToken = '', + clientOptions = {}, + }: SocketModeOptions = { appToken: '' }, + ) { super(); if (!appToken) { throw new Error('Must provide an App-Level Token when initializing a Socket Mode Client'); @@ -160,7 +158,8 @@ export class SocketModeClient extends EventEmitter { * This method must be called before any messages can be sent or received, * or to disconnect the client via the `disconnect` method. */ - public async start(): Promise { // python equiv: SocketModeClient.connect + public async start(): Promise { + // python equiv: SocketModeClient.connect this.shuttingDown = false; this.logger.debug('Starting Socket Mode session ...'); // create a socket connection using SlackWebSocket @@ -179,9 +178,9 @@ export class SocketModeClient extends EventEmitter { // Return a promise that resolves with the connection information return new Promise((resolve, reject) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: untyped connection callback parameters let connectedCallback = (_res: any) => {}; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: untyped connection callback parameters let disconnectedCallback = (_err: any) => {}; connectedCallback = (result) => { this.removeListener(State.Disconnected, disconnectedCallback); @@ -240,7 +239,8 @@ export class SocketModeClient extends EventEmitter { /** * Retrieves a new WebSocket URL to connect to. */ - private async retrieveWSSURL(): Promise { // python equiv: BaseSocketModeClient.issue_new_wss_url + private async retrieveWSSURL(): Promise { + // python equiv: BaseSocketModeClient.issue_new_wss_url try { this.logger.debug('Going to retrieve a new WSS URL ...'); const resp = await this.webClient.apps.connections.open({}); @@ -257,8 +257,10 @@ export class SocketModeClient extends EventEmitter { this.logger.error(`Failed to retrieve a new WSS URL (error: ${error})`); const err = error as WebAPICallError; let isRecoverable = true; - if (err.code === APICallErrorCode.PlatformError && - (Object.values(UnrecoverableSocketModeStartError) as string[]).includes(err.data.error)) { + if ( + err.code === APICallErrorCode.PlatformError && + (Object.values(UnrecoverableSocketModeStartError) as string[]).includes(err.data.error) + ) { isRecoverable = false; } else if (err.code === APICallErrorCode.RequestError) { isRecoverable = false; @@ -285,13 +287,14 @@ export class SocketModeClient extends EventEmitter { return; } const payload = data.toString(); + // TODO: should we redact things in here? this.logger.debug(`Received a message on the WebSocket: ${payload}`); // Parse message into slack event let event: { type: string; reason: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: untyped connection callback parameters payload: Record; envelope_id: string; retry_attempt?: number; // type: events_api @@ -303,9 +306,7 @@ export class SocketModeClient extends EventEmitter { event = JSON.parse(payload); } catch (parseError) { // Prevent application from crashing on a bad message, but log an error to bring attention - this.logger.debug( - `Unable to parse an incoming WebSocket message (will ignore): ${parseError}, ${payload}`, - ); + this.logger.debug(`Unable to parse an incoming WebSocket message (will ignore): ${parseError}, ${payload}`); return; } @@ -317,7 +318,9 @@ export class SocketModeClient extends EventEmitter { // Slack is recycling the pod handling the connection (or otherwise requires the client to reconnect) if (event.type === 'disconnect') { - this.logger.debug(`Received "${event.type}" (${event.reason}) message - disconnecting.${this.autoReconnectEnabled ? ' Will reconnect.' : ''}`); + this.logger.debug( + `Received "${event.type}" (${event.reason}) message - disconnecting.${this.autoReconnectEnabled ? ' Will reconnect.' : ''}`, + ); this.websocket?.disconnect(); return; } @@ -325,7 +328,9 @@ export class SocketModeClient extends EventEmitter { // Define Ack, a helper method for acknowledging events incoming from Slack const ack = async (response: Record): Promise => { if (this.logger.getLevel() === LogLevel.DEBUG) { - this.logger.debug(`Calling ack() - type: ${event.type}, envelope_id: ${event.envelope_id}, data: ${JSON.stringify(response)}`); + this.logger.debug( + `Calling ack() - type: ${event.type}, envelope_id: ${event.envelope_id}, data: ${JSON.stringify(response)}`, + ); } await this.send(event.envelope_id, response); }; @@ -376,7 +381,9 @@ export class SocketModeClient extends EventEmitter { return new Promise((resolve, reject) => { const wsState = this.websocket?.readyState; - this.logger.debug(`send() method was called (WebSocket state: ${wsState ? WS_READY_STATES[wsState] : 'uninitialized'})`); + this.logger.debug( + `send() method was called (WebSocket state: ${wsState ? WS_READY_STATES[wsState] : 'uninitialized'})`, + ); if (this.websocket === undefined) { this.logger.error('Failed to send a message as the client is not connected'); reject(sendWhileDisconnectedError()); diff --git a/packages/socket-mode/src/SocketModeOptions.ts b/packages/socket-mode/src/SocketModeOptions.ts index 5e2856098..a55fc15f8 100644 --- a/packages/socket-mode/src/SocketModeOptions.ts +++ b/packages/socket-mode/src/SocketModeOptions.ts @@ -1,5 +1,5 @@ -import type { LogLevel, Logger } from './logger'; import type { WebClientOptions } from '@slack/web-api'; +import type { LogLevel, Logger } from './logger'; export interface SocketModeOptions { /** diff --git a/packages/socket-mode/src/UnrecoverableSocketModeStartError.ts b/packages/socket-mode/src/UnrecoverableSocketModeStartError.ts index 16d794046..dbd5ae6bc 100644 --- a/packages/socket-mode/src/UnrecoverableSocketModeStartError.ts +++ b/packages/socket-mode/src/UnrecoverableSocketModeStartError.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - // NOTE: there may be a better way to add metadata to an error about being "unrecoverable" than to keep an // independent enum, probably a Set (this isn't used as a type). export enum UnrecoverableSocketModeStartError { diff --git a/packages/socket-mode/src/errors.ts b/packages/socket-mode/src/errors.ts index 4110964b0..412a79bb2 100644 --- a/packages/socket-mode/src/errors.ts +++ b/packages/socket-mode/src/errors.ts @@ -17,12 +17,16 @@ export enum ErrorCode { InitializationError = 'slack_socket_mode_initialization_error', } -export type SMCallError = SMPlatformError | SMWebsocketError | SMNoReplyReceivedError -| SMSendWhileDisconnectedError | SMSendWhileNotReadyError; +export type SMCallError = + | SMPlatformError + | SMWebsocketError + | SMNoReplyReceivedError + | SMSendWhileDisconnectedError + | SMSendWhileNotReadyError; export interface SMPlatformError extends CodedError { code: ErrorCode.SendMessagePlatformError; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: errors can be anything data: any; } @@ -62,22 +66,22 @@ export function websocketErrorWithOriginal(original: Error): SMWebsocketError { ErrorCode.WebsocketError, ) as Partial; error.original = original; - return (error as SMWebsocketError); + return error as SMWebsocketError; } /** * A factory to create SMPlatformError objects. */ export function platformErrorFromEvent( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - event: any & { error: { msg: string; } }, + // biome-ignore lint/suspicious/noExplicitAny: errors can be anything + event: any & { error: { msg: string } }, ): SMPlatformError { const error = errorWithCode( new Error(`An API error occurred: ${event.error.msg}`), ErrorCode.SendMessagePlatformError, ) as Partial; error.data = event; - return (error as SMPlatformError); + return error as SMPlatformError; } // TODO: Is the below factory needed still? @@ -86,8 +90,10 @@ export function platformErrorFromEvent( */ export function noReplyReceivedError(): SMNoReplyReceivedError { return errorWithCode( - new Error('Message sent but no server acknowledgement was received. This may be caused by the client ' + - 'changing connection state rather than any issue with the specific message. Check before resending.'), + new Error( + 'Message sent but no server acknowledgement was received. This may be caused by the client ' + + 'changing connection state rather than any issue with the specific message. Check before resending.', + ), ErrorCode.NoReplyReceivedError, ) as SMNoReplyReceivedError; } diff --git a/packages/socket-mode/src/logger.ts b/packages/socket-mode/src/logger.ts index 4ff13337f..21749a031 100644 --- a/packages/socket-mode/src/logger.ts +++ b/packages/socket-mode/src/logger.ts @@ -12,7 +12,9 @@ export default { // Set up the logger. const logger: Logger = (() => { - if (existingLogger !== undefined) { return existingLogger; } + if (existingLogger !== undefined) { + return existingLogger; + } return new ConsoleLogger(); })(); logger.setName(`socket-mode:${name}:${instanceId}`); diff --git a/packages/socket-mode/test/integration.spec.js b/packages/socket-mode/test/integration.spec.js index a7b2d6aef..c4ff60de4 100644 --- a/packages/socket-mode/test/integration.spec.js +++ b/packages/socket-mode/test/integration.spec.js @@ -1,8 +1,8 @@ const { assert } = require('chai'); -const { SocketModeClient} = require('../src/SocketModeClient'); +const { SocketModeClient } = require('../src/SocketModeClient'); const { LogLevel } = require('../src/logger'); -const { WebSocketServer} = require('ws'); -const { createServer } = require('http'); +const { WebSocketServer } = require('ws'); +const { createServer } = require('node:http'); const sinon = require('sinon'); const HTTP_PORT = 12345; @@ -17,17 +17,18 @@ let exposed_ws_connection = null; // Socket mode client pointing to the above two posers let client = null; - const DISCONNECT_REASONS = ['warning', 'refresh_requested', 'too_many_websockets']; describe('Integration tests with a WebSocket server', () => { beforeEach(() => { server = createServer((_req, res) => { res.writeHead(200, { 'content-type': 'application/json' }); - res.end(JSON.stringify({ - ok: true, - url: `ws://localhost:${WSS_PORT}/`, - })); + res.end( + JSON.stringify({ + ok: true, + url: `ws://localhost:${WSS_PORT}/`, + }), + ); }); server.listen(HTTP_PORT); wss = new WebSocketServer({ port: WSS_PORT }); @@ -36,7 +37,7 @@ describe('Integration tests with a WebSocket server', () => { assert.fail(err); }); // Send `Event.ServerHello` - ws.send(JSON.stringify({type: 'hello'})); + ws.send(JSON.stringify({ type: 'hello' })); exposed_ws_connection = ws; }); }); @@ -55,9 +56,13 @@ describe('Integration tests with a WebSocket server', () => { }); describe('establishing connection, receiving valid messages', () => { beforeEach(() => { - client = new SocketModeClient({ appToken: 'whatever', logLevel: LogLevel.ERROR, clientOptions: { - slackApiUrl: `http://localhost:${HTTP_PORT}/` - }}); + client = new SocketModeClient({ + appToken: 'whatever', + logLevel: LogLevel.ERROR, + clientOptions: { + slackApiUrl: `http://localhost:${HTTP_PORT}/`, + }, + }); }); it('connects to a server via `start()` and gracefully disconnects via `disconnect()`', async () => { await client.start(); @@ -68,10 +73,12 @@ describe('Integration tests with a WebSocket server', () => { }); it('can listen on random event types and receive payload properties', async () => { client.on('connected', () => { - exposed_ws_connection.send(JSON.stringify({ - type: 'integration-test', - envelope_id: 12345, - })); + exposed_ws_connection.send( + JSON.stringify({ + type: 'integration-test', + envelope_id: 12345, + }), + ); }); await client.start(); await new Promise((res, _rej) => { @@ -85,9 +92,14 @@ describe('Integration tests with a WebSocket server', () => { }); describe('catastrophic server behaviour', () => { beforeEach(() => { - client = new SocketModeClient({ appToken: 'whatever', logLevel: LogLevel.ERROR, clientOptions: { - slackApiUrl: `http://localhost:${HTTP_PORT}/` - }, clientPingTimeout: 25}); + client = new SocketModeClient({ + appToken: 'whatever', + logLevel: LogLevel.ERROR, + clientOptions: { + slackApiUrl: `http://localhost:${HTTP_PORT}/`, + }, + clientPingTimeout: 25, + }); }); it('should retry if retrieving a WSS URL fails', async () => { // Shut down the main WS-endpoint-retrieval server - we will customize its behaviour for this test @@ -96,16 +108,20 @@ describe('Integration tests with a WebSocket server', () => { server = createServer((_req, res) => { num_attempts += 1; res.writeHead(200, { 'content-type': 'application/json' }); - if (num_attempts < 3) { - res.end(JSON.stringify({ - ok: false, - error: "fatal_error", - })); + if (num_attempts < 3) { + res.end( + JSON.stringify({ + ok: false, + error: 'fatal_error', + }), + ); } else { - res.end(JSON.stringify({ - ok: true, - url: `ws://localhost:${WSS_PORT}/`, - })); + res.end( + JSON.stringify({ + ok: true, + url: `ws://localhost:${WSS_PORT}/`, + }), + ); } }); server.listen(HTTP_PORT); @@ -115,24 +131,28 @@ describe('Integration tests with a WebSocket server', () => { }); }); describe('failure modes / unexpected messages sent to client', () => { - let debugLoggerSpy = sinon.stub(); // add the following to expose further logging: .callsFake(console.log); + const debugLoggerSpy = sinon.stub(); // add the following to expose further logging: .callsFake(console.log); const noop = () => {}; beforeEach(() => { - client = new SocketModeClient({ appToken: 'whatever', clientOptions: { - slackApiUrl: `http://localhost:${HTTP_PORT}/` - }, logger: { - debug: debugLoggerSpy, - info: noop, - error: noop, - getLevel: () => 'debug', - }}); + client = new SocketModeClient({ + appToken: 'whatever', + clientOptions: { + slackApiUrl: `http://localhost:${HTTP_PORT}/`, + }, + logger: { + debug: debugLoggerSpy, + info: noop, + error: noop, + getLevel: () => 'debug', + }, + }); }); afterEach(() => { debugLoggerSpy.resetHistory(); }); it('should ignore binary messages', async () => { client.on('connected', () => { - exposed_ws_connection.send(Buffer.from([1,2,3,4]), { binary: true }); + exposed_ws_connection.send(Buffer.from([1, 2, 3, 4]), { binary: true }); }); await client.start(); await sleep(10); @@ -151,41 +171,56 @@ describe('Integration tests with a WebSocket server', () => { }); describe('lifecycle events', () => { beforeEach(() => { - client = new SocketModeClient({ appToken: 'whatever', logLevel: LogLevel.ERROR, clientOptions: { - slackApiUrl: `http://localhost:${HTTP_PORT}/` - }, clientPingTimeout: 25}); + client = new SocketModeClient({ + appToken: 'whatever', + logLevel: LogLevel.ERROR, + clientOptions: { + slackApiUrl: `http://localhost:${HTTP_PORT}/`, + }, + clientPingTimeout: 25, + }); }); it('raises connecting event during `start()`', async () => { let raised = false; - client.on('connecting', () => { raised = true; }); + client.on('connecting', () => { + raised = true; + }); await client.start(); assert.isTrue(raised); await client.disconnect(); }); it('raises authenticated event during `start()`', async () => { let raised = false; - client.on('authenticated', () => { raised = true; }); + client.on('authenticated', () => { + raised = true; + }); await client.start(); assert.isTrue(raised); await client.disconnect(); }); it('raises connected event during `start()`', async () => { let raised = false; - client.on('connected', () => { raised = true; }); + client.on('connected', () => { + raised = true; + }); await client.start(); assert.isTrue(raised); await client.disconnect(); }); it('raises disconnecting event during `disconnect()`', async () => { let raised = false; - client.on('disconnecting', () => { raised = true; }); + client.on('disconnecting', () => { + raised = true; + }); await client.start(); await client.disconnect(); assert.isTrue(raised); }); it('raises disconnected event after `disconnect()`', async () => { let raised = false; - client.on('disconnected', () => { raised = true; }); + client.on('disconnected', () => { + raised = true; + }); await client.start(); await client.disconnect(); assert.isTrue(raised); @@ -193,19 +228,24 @@ describe('Integration tests with a WebSocket server', () => { describe('slack_event', () => { beforeEach(() => { // Disable auto reconnect for these tests - client = new SocketModeClient({ appToken: 'whatever', logLevel: LogLevel.ERROR, autoReconnectEnabled: false, clientOptions: { - slackApiUrl: `http://localhost:${HTTP_PORT}/` - }}); + client = new SocketModeClient({ + appToken: 'whatever', + logLevel: LogLevel.ERROR, + autoReconnectEnabled: false, + clientOptions: { + slackApiUrl: `http://localhost:${HTTP_PORT}/`, + }, + }); }); afterEach(async () => { await client.disconnect(); }); // These tests check that specific type:disconnect events, of various reasons, sent by Slack backend are not raised as slack_events for apps to consume. - DISCONNECT_REASONS.forEach((reason) => { + for (const reason of DISCONNECT_REASONS) { it(`should not raise a type:disconnect reason:${reason} message as a slack_event`, async () => { let raised = false; client.on('connected', () => { - exposed_ws_connection.send(JSON.stringify({type:'disconnect', reason})); + exposed_ws_connection.send(JSON.stringify({ type: 'disconnect', reason })); }); client.on('slack_event', () => { raised = true; @@ -214,7 +254,7 @@ describe('Integration tests with a WebSocket server', () => { await sleep(10); assert.isFalse(raised); }); - }); + } }); describe('including reconnection ability', () => { it('raises reconnecting event after peer disconnects underlying WS connection', async () => { @@ -230,11 +270,11 @@ describe('Integration tests with a WebSocket server', () => { await reconnectedWaiter; // wait for this to ensure we dont raise an unexpected error by calling `disconnect` mid-reconnect. await client.disconnect(); }); - DISCONNECT_REASONS.forEach((reason) => { + for (const reason of DISCONNECT_REASONS) { it(`should reconnect gracefully if server sends a disconnect (reason: ${reason}) message`, async () => { await client.start(); // force a WS disconnect from the server - exposed_ws_connection.send(JSON.stringify({type:"disconnect", reason})); + exposed_ws_connection.send(JSON.stringify({ type: 'disconnect', reason })); // create a waiter for post-reconnect connected event const reconnectedWaiter = new Promise((res) => client.on('connected', res)); // if we pass the point where the reconnectedWaiter succeeded, then we have verified the reconnection succeeded @@ -242,19 +282,26 @@ describe('Integration tests with a WebSocket server', () => { await reconnectedWaiter; await client.disconnect(); }); - }); + } describe('related to ping/pong events', () => { beforeEach(() => { - client = new SocketModeClient({ appToken: 'whatever', logLevel: LogLevel.ERROR, clientOptions: { - slackApiUrl: `http://localhost:${HTTP_PORT}/` - }, clientPingTimeout: 25, serverPingTimeout: 25, pingPongLoggingEnabled: false }); + client = new SocketModeClient({ + appToken: 'whatever', + logLevel: LogLevel.ERROR, + clientOptions: { + slackApiUrl: `http://localhost:${HTTP_PORT}/`, + }, + clientPingTimeout: 25, + serverPingTimeout: 25, + pingPongLoggingEnabled: false, + }); }); it('should reconnect if server does not send `ping` message within specified server ping timeout', async () => { await client.start(); // create a waiter for post-reconnect connected event const reconnectedWaiter = new Promise((res) => client.on('connected', res)); exposed_ws_connection.ping(); - // we set server and client ping timeout to 25, so waiting for 50 + a bit should force a reconnect + // we set server and client ping timeout to 25, so waiting for 50 + a bit should force a reconnect await sleep(60); // if we pass the point where the reconnectedWaiter succeeded, then we have verified the reconnection succeeded // and this test can be considered passing. if we time out here, then that is an indication of a failure. @@ -270,13 +317,13 @@ describe('Integration tests with a WebSocket server', () => { assert.fail(err); }); // Send `Event.ServerHello` - ws.send(JSON.stringify({type: 'hello'})); + ws.send(JSON.stringify({ type: 'hello' })); exposed_ws_connection = ws; }); await client.start(); // create a waiter for post-reconnect connected event const reconnectedWaiter = new Promise((res) => client.on('connected', res)); - // we set server and client ping timeout to 25, so waiting for 50 + a bit should force a reconnect + // we set server and client ping timeout to 25, so waiting for 50 + a bit should force a reconnect await sleep(60); // if we pass the point where the reconnectedWaiter succeeded, then we have verified the reconnection succeeded // and this test can be considered passing. if we time out here, then that is an indication of a failure. @@ -301,13 +348,13 @@ describe('Integration tests with a WebSocket server', () => { } }); // Send `Event.ServerHello` - ws.send(JSON.stringify({type: 'hello'})); + ws.send(JSON.stringify({ type: 'hello' })); exposed_ws_connection = ws; }); await client.start(); // create a waiter for post-reconnect connected event const reconnectedWaiter = new Promise((res) => client.on('connected', res)); - // we set server and client ping timeout to 25, so waiting for 50 + a bit should force a reconnect + // we set server and client ping timeout to 25, so waiting for 50 + a bit should force a reconnect await sleep(60); // if we pass the point where the reconnectedWaiter succeeded, then we have verified the reconnection succeeded // and this test can be considered passing. if we time out here, then that is an indication of a failure. @@ -320,5 +367,5 @@ describe('Integration tests with a WebSocket server', () => { }); function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); + return new Promise((resolve) => setTimeout(resolve, ms)); } diff --git a/packages/socket-mode/tsconfig.eslint.json b/packages/socket-mode/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/socket-mode/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/socket-mode/tsconfig.json b/packages/socket-mode/tsconfig.json index c2f5647ee..4e01adcd7 100644 --- a/packages/socket-mode/tsconfig.json +++ b/packages/socket-mode/tsconfig.json @@ -1,33 +1,23 @@ { "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { - "target": "es2017", - "module": "commonjs", "declaration": true, "declarationMap": true, - "sourceMap": true, - "outDir": "dist", - "skipLibCheck": true, - "strict": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, "noUnusedLocals": true, "noUnusedParameters": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - - "moduleResolution": "node", - "baseUrl": ".", - "paths": { - "*": ["./types/*"] - }, - "esModuleInterop" : true, - "resolveJsonModule": true + "outDir": "dist", + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true }, + "extends": "@tsconfig/recommended/tsconfig.json", "include": [ "src/**/*" ], "exclude": [ - "src/**/*.spec.ts", - "src/**/*.js" + "src/**/*.spec.*" ], "jsdoc": { "out": "support/jsdoc", diff --git a/packages/types/.eslintignore b/packages/types/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/types/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/types/.eslintrc.js b/packages/types/.eslintrc.js deleted file mode 120000 index 5962fa3ca..000000000 --- a/packages/types/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintrc.js \ No newline at end of file diff --git a/packages/types/.vscode/settings.json b/packages/types/.vscode/settings.json index 6de18e4ed..97bef4c57 100644 --- a/packages/types/.vscode/settings.json +++ b/packages/types/.vscode/settings.json @@ -1,3 +1,3 @@ { - "typescript.tsdk": "./node_modules/typescript/lib" + "typescript.tsdk": "./node_modules/typescript/lib" } diff --git a/packages/types/api-extractor.json b/packages/types/api-extractor.json deleted file mode 100644 index dbbbba8b5..000000000 --- a/packages/types/api-extractor.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - /** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - "mainEntryPointFilePath": "/dist/index.d.ts", - - "apiReport": { - "enabled": false - }, - - "docModel": { - "enabled": true, - "apiJsonFilePath": "/../../support/ref-docs/models/.api.json" - }, - - "dtsRollup": { - "enabled": false - }, - - "tsdocMetadata": { - "enabled": false - }, - - "messages": { - "extractorMessageReporting": { - // Disable release tagging warnings - "ae-missing-release-tag": { - "logLevel": "none" - } - } - } -} diff --git a/packages/types/biome.json b/packages/types/biome.json new file mode 100644 index 000000000..ea710a856 --- /dev/null +++ b/packages/types/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/types/package.json b/packages/types/package.json index de3477451..aabdacf25 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -4,17 +4,10 @@ "description": "Shared type definitions for the Node Slack SDK", "author": "Slack Technologies, LLC", "license": "MIT", - "keywords": [ - "slack", - "typescript", - "types", - "api" - ], + "keywords": ["slack", "typescript", "types", "api"], "main": "dist/index.js", "types": "dist/index.d.ts", - "files": [ - "dist/**/*" - ], + "files": ["dist/**/*"], "engines": { "node": ">= 12.13.0", "npm": ">= 6.12.0" @@ -31,22 +24,12 @@ "prepare": "npm run build", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist", - "lint": "eslint --fix --ext .ts src", + "lint": "npx @biomejs/biome check --write .", "test": "npm run lint && npm run build && npm run test:types", - "test:types": "tsd", - "ref-docs:model": "api-extractor run" + "test:types": "tsd" }, "devDependencies": { - "@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-import-newlines": "^1.3.4", - "eslint-plugin-jsdoc": "^46.5.0", - "eslint-plugin-node": "^11.1.0", + "@biomejs/biome": "^1.8.3", "shx": "^0.3.2", "tsd": "^0.31.0", "typescript": "^5.5.4" diff --git a/packages/types/src/block-kit/block-elements.ts b/packages/types/src/block-kit/block-elements.ts index 00ba2420b..840cc58c0 100644 --- a/packages/types/src/block-kit/block-elements.ts +++ b/packages/types/src/block-kit/block-elements.ts @@ -1,7 +1,7 @@ // This file contains objects documented here: https://api.slack.com/reference/block-kit/block-elements -import { RichTextBlock } from './blocks'; -import { +import type { RichTextBlock } from './blocks'; +import type { ColorScheme, Option, PlainTextElement, @@ -9,7 +9,7 @@ import { SlackFileImageObject, UrlImageObject, } from './composition-objects'; -import { +import type { Actionable, Confirmable, Dispatchable, @@ -89,11 +89,7 @@ export interface Checkboxes extends Actionable, Confirmable, Focusable { * @see {@link https://api.slack.com/reference/block-kit/block-elements#datepicker Date picker element reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface Datepicker - extends Actionable, - Confirmable, - Focusable, - Placeholdable { +export interface Datepicker extends Actionable, Confirmable, Focusable, Placeholdable { /** * @description The type of element. In this case `type` is always `datepicker`. */ @@ -131,11 +127,7 @@ export interface DateTimepicker extends Actionable, Confirmable, Focusable { * @see {@link https://api.slack.com/reference/block-kit/block-elements#email Email input element reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface EmailInput - extends Actionable, - Dispatchable, - Focusable, - Placeholdable { +export interface EmailInput extends Actionable, Dispatchable, Focusable, Placeholdable { /** * @description The type of element. In this case `type` is always `email_text_input`. */ @@ -199,12 +191,7 @@ export type ImageElement = { * @see {@link https://api.slack.com/reference/block-kit/block-elements#select Select menu element reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export type Select = - | UsersSelect - | StaticSelect - | ConversationsSelect - | ChannelsSelect - | ExternalSelect; +export type Select = UsersSelect | StaticSelect | ConversationsSelect | ChannelsSelect | ExternalSelect; /** * @description Allows users to select multiple items from a list of options. @@ -229,11 +216,7 @@ export type MultiSelect = * @see {@link https://api.slack.com/reference/block-kit/block-elements#users_select Select menu of users reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface UsersSelect - extends Actionable, - Confirmable, - Focusable, - Placeholdable { +export interface UsersSelect extends Actionable, Confirmable, Focusable, Placeholdable { /** * @description The type of element. In this case `type` is always `users_select`. */ @@ -250,12 +233,7 @@ export interface UsersSelect * @see {@link https://api.slack.com/reference/block-kit/block-elements#users_multi_select Multi-select menu of users reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface MultiUsersSelect - extends Actionable, - Confirmable, - Focusable, - MaxItemsSelectable, - Placeholdable { +export interface MultiUsersSelect extends Actionable, Confirmable, Focusable, MaxItemsSelectable, Placeholdable { /** * @description The type of element. In this case `type` is always `multi_users_select`. */ @@ -272,11 +250,7 @@ export interface MultiUsersSelect * @see {@link https://api.slack.com/reference/block-kit/block-elements#static_select Select menu of static options reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface StaticSelect - extends Actionable, - Confirmable, - Focusable, - Placeholdable { +export interface StaticSelect extends Actionable, Confirmable, Focusable, Placeholdable { /** * @description The type of element. In this case `type` is always `static_select`. */ @@ -313,12 +287,7 @@ export interface StaticSelect * @see {@link https://api.slack.com/reference/block-kit/block-elements#static_multi_select Multi-select menu of static options reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface MultiStaticSelect - extends Actionable, - Confirmable, - Focusable, - MaxItemsSelectable, - Placeholdable { +export interface MultiStaticSelect extends Actionable, Confirmable, Focusable, MaxItemsSelectable, Placeholdable { /** * @description The type of element. In this case `type` is always `multi_static_select`. */ @@ -355,12 +324,7 @@ export interface MultiStaticSelect * @see {@link https://api.slack.com/reference/block-kit/block-elements#conversations_select Select menu of conversations reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface ConversationsSelect - extends Actionable, - Confirmable, - Focusable, - Placeholdable, - URLRespondable { +export interface ConversationsSelect extends Actionable, Confirmable, Focusable, Placeholdable, URLRespondable { /** * @description The type of element. In this case `type` is always `conversations_select`. */ @@ -396,10 +360,10 @@ export interface ConversationsSelect */ export interface MultiConversationsSelect extends Actionable, - Confirmable, - Focusable, - MaxItemsSelectable, - Placeholdable { + Confirmable, + Focusable, + MaxItemsSelectable, + Placeholdable { /** * @description The type of element. In this case `type` is always `conversations_select`. */ @@ -432,12 +396,7 @@ export interface MultiConversationsSelect * @see {@link https://api.slack.com/reference/block-kit/block-elements#channels_select Select menu of public channels reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface ChannelsSelect - extends Actionable, - Confirmable, - Focusable, - Placeholdable, - URLRespondable { +export interface ChannelsSelect extends Actionable, Confirmable, Focusable, Placeholdable, URLRespondable { /** * @description The type of element. In this case `type` is always `channels_select`. */ @@ -454,12 +413,7 @@ export interface ChannelsSelect * @see {@link https://api.slack.com/reference/block-kit/block-elements#channel_multi_select Multi-select menu of public channels reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface MultiChannelsSelect - extends Actionable, - Confirmable, - Focusable, - MaxItemsSelectable, - Placeholdable { +export interface MultiChannelsSelect extends Actionable, Confirmable, Focusable, MaxItemsSelectable, Placeholdable { /** * @description The type of element. In this case `type` is always `multi_channels_select`. */ @@ -477,11 +431,7 @@ export interface MultiChannelsSelect * @see {@link https://api.slack.com/reference/block-kit/block-elements#external_select Select menu of external data source reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface ExternalSelect - extends Actionable, - Confirmable, - Focusable, - Placeholdable { +export interface ExternalSelect extends Actionable, Confirmable, Focusable, Placeholdable { /** * @description The type of element. In this case `type` is always `external_select`. */ @@ -504,12 +454,7 @@ export interface ExternalSelect * @see {@link https://api.slack.com/reference/block-kit/block-elements#external_multi_select Multi-select menu of external data source reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface MultiExternalSelect - extends Actionable, - Confirmable, - Focusable, - MaxItemsSelectable, - Placeholdable { +export interface MultiExternalSelect extends Actionable, Confirmable, Focusable, MaxItemsSelectable, Placeholdable { /** * @description The type of element. In this case `type` is always `multi_external_select`. */ @@ -538,11 +483,7 @@ export interface MultiExternalSelect * @see {@link https://api.slack.com/reference/block-kit/block-elements#number Number input element reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface NumberInput - extends Actionable, - Dispatchable, - Focusable, - Placeholdable { +export interface NumberInput extends Actionable, Dispatchable, Focusable, Placeholdable { /** * @description The type of element. In this case `type` is always `number_input`. */ @@ -591,11 +532,7 @@ export interface Overflow extends Actionable, Confirmable { * @see {@link https://api.slack.com/reference/block-kit/block-elements#input Plain-text input element reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface PlainTextInput - extends Actionable, - Dispatchable, - Focusable, - Placeholdable { +export interface PlainTextInput extends Actionable, Dispatchable, Focusable, Placeholdable { /** * @description The type of element. In this case `type` is always `plain_text_input`. */ @@ -649,11 +586,7 @@ export interface RadioButtons extends Actionable, Confirmable, Focusable { * @see {@link https://api.slack.com/reference/block-kit/block-elements#timepicker Time picker element reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface Timepicker - extends Actionable, - Confirmable, - Focusable, - Placeholdable { +export interface Timepicker extends Actionable, Confirmable, Focusable, Placeholdable { /** * @description The type of element. In this case `type` is always `timepicker`. */ @@ -676,11 +609,7 @@ export interface Timepicker * @see {@link https://api.slack.com/reference/block-kit/block-elements#url URL input element reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface URLInput - extends Actionable, - Dispatchable, - Focusable, - Placeholdable { +export interface URLInput extends Actionable, Dispatchable, Focusable, Placeholdable { /** * @description The type of element. In this case `type` is always `url_text_input`. */ @@ -1024,11 +953,7 @@ export interface RichTextPreformatted extends RichTextBorderable { * @see {@link https://api.slack.com/reference/block-kit/block-elements#rich_text_input Rich-text input element reference}. * @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}. */ -export interface RichTextInput - extends Actionable, - Dispatchable, - Focusable, - Placeholdable { +export interface RichTextInput extends Actionable, Dispatchable, Focusable, Placeholdable { /** * @description The type of element. In this case `type` is always `rich_text_input`. */ diff --git a/packages/types/src/block-kit/blocks.ts b/packages/types/src/block-kit/blocks.ts index 101ca11c5..c1e851923 100644 --- a/packages/types/src/block-kit/blocks.ts +++ b/packages/types/src/block-kit/blocks.ts @@ -1,5 +1,5 @@ // This file contains objects documented here: https://api.slack.com/reference/block-kit/blocks -import { +import type { Button, Checkboxes, DateTimepicker, @@ -22,12 +22,7 @@ import { URLInput, WorkflowButton, } from './block-elements'; -import { - PlainTextElement, - SlackFileImageObject, - TextObject, - UrlImageObject, -} from './composition-objects'; +import type { PlainTextElement, SlackFileImageObject, TextObject, UrlImageObject } from './composition-objects'; export interface Block { /** @@ -48,8 +43,17 @@ export interface Block { * A helper union type of all known Blocks, as listed out on the * {@link https://api.slack.com/reference/block-kit/blocks Blocks reference}. */ -export type KnownBlock = ImageBlock | ContextBlock | ActionsBlock | DividerBlock | -SectionBlock | InputBlock | FileBlock | HeaderBlock | VideoBlock | RichTextBlock; +export type KnownBlock = + | ImageBlock + | ContextBlock + | ActionsBlock + | DividerBlock + | SectionBlock + | InputBlock + | FileBlock + | HeaderBlock + | VideoBlock + | RichTextBlock; /** * A helper union type of all known Blocks as well as the generic {@link Block} interface. A full list of known blocks @@ -61,8 +65,18 @@ export type AnyBlock = KnownBlock | Block; * A helper union type of all Block Elements that can be used in an {@link ActionsBlock}. * @see {@link https://api.slack.com/reference/block-kit/blocks#actions Actions block reference}. */ -export type ActionsBlockElement = Button | Checkboxes | Datepicker | DateTimepicker | MultiSelect | Overflow | -RadioButtons | Select | Timepicker | WorkflowButton | RichTextInput; +export type ActionsBlockElement = + | Button + | Checkboxes + | Datepicker + | DateTimepicker + | MultiSelect + | Overflow + | RadioButtons + | Select + | Timepicker + | WorkflowButton + | RichTextInput; /** * @description Holds multiple interactive elements. @@ -172,14 +186,27 @@ export type ImageBlock = { * Maximum length for the text in this field is 2000 characters. */ title?: PlainTextElement; -} & Block & (UrlImageObject | SlackFileImageObject); +} & Block & + (UrlImageObject | SlackFileImageObject); /** * A helper union type of all Block Elements that can be used in an {@link InputBlock}. * @see {@link https://api.slack.com/reference/block-kit/blocks#input Input block reference}. */ -export type InputBlockElement = Checkboxes | Datepicker | DateTimepicker | EmailInput | FileInput | MultiSelect | -NumberInput | PlainTextInput | RadioButtons | RichTextInput | Select | Timepicker | URLInput; +export type InputBlockElement = + | Checkboxes + | Datepicker + | DateTimepicker + | EmailInput + | FileInput + | MultiSelect + | NumberInput + | PlainTextInput + | RadioButtons + | RichTextInput + | Select + | Timepicker + | URLInput; /** * @description Collects information from users via block elements. @@ -237,7 +264,7 @@ export interface RichTextBlock extends Block { /** * @description The type of block. For a rich text block, `type` is always `rich_text`. */ - type: 'rich_text', + type: 'rich_text'; elements: RichTextBlockElement[]; } @@ -245,8 +272,17 @@ export interface RichTextBlock extends Block { * A helper union type of all Block Elements that can be used as an accessory in a {@link SectionBlock}. * @see {@link https://api.slack.com/reference/block-kit/blocks#section Section block reference}. */ -export type SectionBlockAccessory = Button | Checkboxes | Datepicker | ImageElement | MultiSelect | Overflow | -RadioButtons | Select | Timepicker | WorkflowButton; +export type SectionBlockAccessory = + | Button + | Checkboxes + | Datepicker + | ImageElement + | MultiSelect + | Overflow + | RadioButtons + | Select + | Timepicker + | WorkflowButton; // TODO: breaking change: use a discriminative union to represent section block using `text` or `fields` but // not both or neither. diff --git a/packages/types/src/block-kit/composition-objects.ts b/packages/types/src/block-kit/composition-objects.ts index 41ce1e346..9c2886f33 100644 --- a/packages/types/src/block-kit/composition-objects.ts +++ b/packages/types/src/block-kit/composition-objects.ts @@ -49,7 +49,7 @@ export interface Confirm { * @description Defines a dialog that adds a confirmation step to interactive elements. * @see {@link https://api.slack.com/reference/block-kit/composition-objects#confirm Confirmation dialog object reference}. */ -export interface ConfirmationDialog extends Confirm {} // eslint-disable-line @typescript-eslint/no-empty-interface +export interface ConfirmationDialog extends Confirm { } /** * @description Defines when a {@link PlainTextElement} will return a {@link https://api.slack.com/reference/interaction-payloads/block-actions `block_actions` interaction payload}. @@ -175,10 +175,10 @@ export interface MrkdwnElement { interface BaseConversationFilter { /** - * @description Indicates which type of conversations should be included in the list. When this field is provided, any - * conversations that do not match will be excluded. You should provide an array of strings from the following options: - * `im`, `mpim`, `private`, and `public`. The array cannot be empty. - */ + * @description Indicates which type of conversations should be included in the list. When this field is provided, any + * conversations that do not match will be excluded. You should provide an array of strings from the following options: + * `im`, `mpim`, `private`, and `public`. The array cannot be empty. + */ include?: [ConversationType, ...ConversationType[]]; /** * @description Indicates whether to exclude external {@link https://api.slack.com/enterprise/shared-channels shared channels} @@ -196,7 +196,10 @@ interface BaseConversationFilter { * conversations select menu or a conversations multi-select menu. * @see {@link https://api.slack.com/reference/block-kit/composition-objects#filter_conversations Conversation filter object reference}. */ -export type ConversationFilter = (BaseConversationFilter & Required>) | (BaseConversationFilter & Required>) | (BaseConversationFilter & Required>); +export type ConversationFilter = + | (BaseConversationFilter & Required>) + | (BaseConversationFilter & Required>) + | (BaseConversationFilter & Required>); /** * @description Object for image which contains a image_url. */ diff --git a/packages/types/src/block-kit/extensions.ts b/packages/types/src/block-kit/extensions.ts index 5204f414f..1011b6363 100644 --- a/packages/types/src/block-kit/extensions.ts +++ b/packages/types/src/block-kit/extensions.ts @@ -1,5 +1,5 @@ // This file contains reusable extensions/mixins that other Block Kit elements will extend from. -import { ConfirmationDialog, DispatchActionConfig, PlainTextElement } from './composition-objects'; +import type { ConfirmationDialog, DispatchActionConfig, PlainTextElement } from './composition-objects'; // TODO: breaking change: remove `Action` and move properties to `Actionable` on next major release. /** @@ -15,7 +15,7 @@ export interface Action { action_id?: string; } -export interface Actionable extends Action {} // eslint-disable-line @typescript-eslint/no-empty-interface +export interface Actionable extends Action { } export interface Confirmable { /** diff --git a/packages/types/src/events/app.ts b/packages/types/src/events/app.ts index 15780edc2..44123d28a 100644 --- a/packages/types/src/events/app.ts +++ b/packages/types/src/events/app.ts @@ -1,7 +1,7 @@ -import { Block, KnownBlock } from '../block-kit/blocks'; -import { BotProfile } from '../common/bot-profile'; -import { MessageAttachment } from '../message-attachments'; -import { View } from '../views'; +import type { Block, KnownBlock } from '../block-kit/blocks'; +import type { BotProfile } from '../common/bot-profile'; +import type { MessageAttachment } from '../message-attachments'; +import type { View } from '../views'; export interface AppRequestedEvent { type: 'app_requested'; @@ -31,7 +31,7 @@ export interface AppRequestedEvent { image_512?: string; image_1024?: string; image_original?: string; - } + }; }; }; previous_resolution: { diff --git a/packages/types/src/events/channel.ts b/packages/types/src/events/channel.ts index 7c41d854a..97e54e4ff 100644 --- a/packages/types/src/events/channel.ts +++ b/packages/types/src/events/channel.ts @@ -18,16 +18,16 @@ export interface ChannelCreatedEvent { creator: string; // user ID is_shared: boolean; is_org_shared: boolean; - context_team_id: string, + context_team_id: string; is_archived: boolean; - is_frozen: boolean, - is_general: boolean, - is_group: boolean, - is_private: boolean, - is_ext_shared: boolean, - is_im: boolean, - is_mpim: boolean, - is_pending_ext_shared: boolean, + is_frozen: boolean; + is_general: boolean; + is_group: boolean; + is_private: boolean; + is_ext_shared: boolean; + is_im: boolean; + is_mpim: boolean; + is_pending_ext_shared: boolean; }; } diff --git a/packages/types/src/events/function.ts b/packages/types/src/events/function.ts index d8e3278e6..cd72af570 100644 --- a/packages/types/src/events/function.ts +++ b/packages/types/src/events/function.ts @@ -23,7 +23,7 @@ export interface FunctionExecutedEvent { app_id: string; date_created: number; date_updated: number; - date_deleted: number + date_deleted: number; }; inputs: FunctionInputs; function_execution_id: string; diff --git a/packages/types/src/events/index.ts b/packages/types/src/events/index.ts index c49dfca56..df4491a56 100644 --- a/packages/types/src/events/index.ts +++ b/packages/types/src/events/index.ts @@ -1,4 +1,4 @@ -import { +import type { AppDeletedEvent, AppHomeOpenedEvent, AppInstalledEvent, @@ -8,8 +8,8 @@ import { AppUninstalledEvent, AppUninstalledTeamEvent, } from './app'; -import { CallRejectedEvent } from './call'; -import { +import type { CallRejectedEvent } from './call'; +import type { ChannelArchiveEvent, ChannelCreatedEvent, ChannelDeletedEvent, @@ -21,10 +21,10 @@ import { ChannelUnarchiveEvent, ChannelUnsharedEvent, } from './channel'; -import { DNDUpdatedEvent, DNDUpdatedUserEvent } from './dnd'; -import { EmailDomainChangedEvent } from './email'; -import { EmojiChangedEvent } from './emoji'; -import { +import type { DNDUpdatedEvent, DNDUpdatedUserEvent } from './dnd'; +import type { EmailDomainChangedEvent } from './email'; +import type { EmojiChangedEvent } from './emoji'; +import type { FileChangeEvent, FileCommentDeletedEvent, FileCreatedEvent, @@ -33,9 +33,9 @@ import { FileSharedEvent, FileUnsharedEvent, } from './file'; -import { FunctionExecutedEvent } from './function'; -import { GridMigrationFinishedEvent, GridMigrationStartedEvent } from './grid-migration'; -import { +import type { FunctionExecutedEvent } from './function'; +import type { GridMigrationFinishedEvent, GridMigrationStartedEvent } from './grid-migration'; +import type { GroupArchiveEvent, GroupCloseEvent, GroupDeletedEvent, @@ -45,45 +45,45 @@ import { GroupRenameEvent, GroupUnarchiveEvent, } from './group'; -import { IMCloseEvent, IMCreatedEvent, IMHistoryChangedEvent, IMOpenEvent } from './im'; -import { InviteRequestedEvent } from './invite'; -import { LinkSharedEvent } from './link-shared'; -import { MemberJoinedChannelEvent, MemberLeftChannelEvent } from './member'; -import { AllMessageEvents } from './message'; -import { AllMessageMetadataEvents } from './message-metadata'; -import { PinAddedEvent, PinRemovedEvent } from './pin'; -import { ReactionAddedEvent, ReactionRemovedEvent } from './reaction'; -import { +import type { IMCloseEvent, IMCreatedEvent, IMHistoryChangedEvent, IMOpenEvent } from './im'; +import type { InviteRequestedEvent } from './invite'; +import type { LinkSharedEvent } from './link-shared'; +import type { MemberJoinedChannelEvent, MemberLeftChannelEvent } from './member'; +import type { AllMessageEvents } from './message'; +import type { AllMessageMetadataEvents } from './message-metadata'; +import type { PinAddedEvent, PinRemovedEvent } from './pin'; +import type { ReactionAddedEvent, ReactionRemovedEvent } from './reaction'; +import type { SharedChannelInviteAcceptedEvent, SharedChannelInviteApprovedEvent, SharedChannelInviteDeclinedEvent, SharedChannelInviteReceivedEvent, SharedChannelInviteRequestedEvent, } from './shared-channel'; -import { StarAddedEvent, StarRemovedEvent } from './star'; -import { +import type { StarAddedEvent, StarRemovedEvent } from './star'; +import type { WorkflowDeletedEvent, WorkflowPublishedEvent, WorkflowStepDeletedEvent, WorkflowStepExecuteEvent, WorkflowUnpublishedEvent, } from './steps-from-apps'; -import { +import type { SubteamCreatedEvent, SubteamMembersChangedEvent, SubteamSelfAddedEvent, SubteamSelfRemovedEvent, SubteamUpdatedEvent, } from './subteam'; -import { +import type { TeamAccessGrantedEvent, TeamAccessRevokedEvent, TeamDomainChangedEvent, TeamJoinEvent, TeamRenameEvent, } from './team'; -import { TokensRevokedEvent } from './token'; -import { UserChangeEvent, UserHuddleChangedEvent, UserProfileChangedEvent, UserStatusChangedEvent } from './user'; +import type { TokensRevokedEvent } from './token'; +import type { UserChangeEvent, UserHuddleChangedEvent, UserProfileChangedEvent, UserStatusChangedEvent } from './user'; export type MessageEvent = AllMessageEvents; export * from './app'; diff --git a/packages/types/src/events/message-metadata.ts b/packages/types/src/events/message-metadata.ts index a7772438a..e932ccaae 100644 --- a/packages/types/src/events/message-metadata.ts +++ b/packages/types/src/events/message-metadata.ts @@ -1,9 +1,9 @@ -import { MessageMetadata } from '../message-metadata'; +import type { MessageMetadata } from '../message-metadata'; export type AllMessageMetadataEvents = -| MessageMetadataDeletedEvent -| MessageMetadataPostedEvent -| MessageMetadataUpdatedEvent; + | MessageMetadataDeletedEvent + | MessageMetadataPostedEvent + | MessageMetadataUpdatedEvent; export interface MessageMetadataPostedEvent { type: 'message_metadata_posted'; diff --git a/packages/types/src/events/message.ts b/packages/types/src/events/message.ts index bdd371f32..1d3bf921e 100644 --- a/packages/types/src/events/message.ts +++ b/packages/types/src/events/message.ts @@ -1,6 +1,6 @@ -import { Block, KnownBlock } from '../block-kit/blocks'; -import { BotProfile } from '../common/bot-profile'; -import { MessageAttachment } from '../message-attachments'; +import type { Block, KnownBlock } from '../block-kit/blocks'; +import type { BotProfile } from '../common/bot-profile'; +import type { MessageAttachment } from '../message-attachments'; type ChannelTypes = 'channel' | 'group' | 'im' | 'mpim' | 'app_home'; @@ -338,7 +338,7 @@ interface File { has_rich_preview?: boolean; shares?: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: TODO: type shares [key: string]: any; }; channels: string[] | null; @@ -346,7 +346,7 @@ interface File { users?: string[]; pinned_to?: string[]; reactions?: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: TODO: type reactions [key: string]: any; }[]; is_starred?: boolean; diff --git a/packages/types/src/events/pin.ts b/packages/types/src/events/pin.ts index 59fbaf2d1..968daa389 100644 --- a/packages/types/src/events/pin.ts +++ b/packages/types/src/events/pin.ts @@ -1,6 +1,6 @@ -import { Block, KnownBlock } from '../block-kit/blocks'; -import { BotProfile } from '../common/bot-profile'; -import { MessageAttachment } from '../message-attachments'; +import type { Block, KnownBlock } from '../block-kit/blocks'; +import type { BotProfile } from '../common/bot-profile'; +import type { MessageAttachment } from '../message-attachments'; interface PinnedMessageItem { client_msg_id?: string; @@ -15,7 +15,7 @@ interface PinnedMessageItem { blocks?: (KnownBlock | Block)[]; pinned_to?: string[]; permalink: string; - ts: string + ts: string; } interface PinnedFileItem { id: string; diff --git a/packages/types/src/events/steps-from-apps.ts b/packages/types/src/events/steps-from-apps.ts index 395f4b112..0b57efebf 100644 --- a/packages/types/src/events/steps-from-apps.ts +++ b/packages/types/src/events/steps-from-apps.ts @@ -72,7 +72,7 @@ export interface WorkflowStepExecuteEvent { step_id: string; inputs: { [key: string]: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: untyped step inputs value: any; }; }; diff --git a/packages/types/src/events/team.ts b/packages/types/src/events/team.ts index ea084e07d..0c4b89f00 100644 --- a/packages/types/src/events/team.ts +++ b/packages/types/src/events/team.ts @@ -1,4 +1,4 @@ -import { StatusEmojiDisplayInfo } from '../common/status-emoji-display-info'; +import type { StatusEmojiDisplayInfo } from '../common/status-emoji-display-info'; export interface TeamAccessGrantedEvent { type: 'team_access_granted'; @@ -60,14 +60,14 @@ export interface TeamJoinEvent { image_1024?: string; team: string; fields: - | { - [key: string]: { - value: string; - alt: string; - }; - } - | [] - | null; + | { + [key: string]: { + value: string; + alt: string; + }; + } + | [] + | null; }; is_admin: boolean; is_owner: boolean; diff --git a/packages/types/src/events/user.ts b/packages/types/src/events/user.ts index 928af13bf..bedc3e85a 100644 --- a/packages/types/src/events/user.ts +++ b/packages/types/src/events/user.ts @@ -1,4 +1,4 @@ -import { StatusEmojiDisplayInfo } from '../common/status-emoji-display-info'; +import type { StatusEmojiDisplayInfo } from '../common/status-emoji-display-info'; export interface UserChangeEvent { type: 'user_change'; @@ -42,14 +42,14 @@ export interface UserChangeEvent { image_1024?: string; team: string; fields: - | { - [key: string]: { - value: string; - alt: string; - }; - } - | [] - | null; + | { + [key: string]: { + value: string; + alt: string; + }; + } + | [] + | null; }; is_admin: boolean; is_owner: boolean; @@ -124,14 +124,14 @@ export interface UserHuddleChangedEvent { image_1024?: string; team: string; fields: - | { - [key: string]: { - value: string; - alt: string; - }; - } - | [] - | null; + | { + [key: string]: { + value: string; + alt: string; + }; + } + | [] + | null; }; is_admin: boolean; is_owner: boolean; @@ -206,14 +206,14 @@ export interface UserProfileChangedEvent { image_1024?: string; team: string; fields: - | { - [key: string]: { - value: string; - alt: string; - }; - } - | [] - | null; + | { + [key: string]: { + value: string; + alt: string; + }; + } + | [] + | null; }; is_admin: boolean; is_owner: boolean; @@ -269,7 +269,7 @@ export interface UserStatusChangedEvent { status_text: string; status_text_canonical: string; status_emoji: string; - status_emoji_display_info: StatusEmojiDisplayInfo[], + status_emoji_display_info: StatusEmojiDisplayInfo[]; status_expiration: number; avatar_hash: string; first_name: string; @@ -286,14 +286,14 @@ export interface UserStatusChangedEvent { image_1024?: string; team: string; fields: - | { - [key: string]: { - value: string; - alt: string; - }; - } - | [] - | null; + | { + [key: string]: { + value: string; + alt: string; + }; + } + | [] + | null; }; is_admin: boolean; is_owner: boolean; diff --git a/packages/types/src/message-attachments.ts b/packages/types/src/message-attachments.ts index 9426465ea..ae1ce9ea6 100644 --- a/packages/types/src/message-attachments.ts +++ b/packages/types/src/message-attachments.ts @@ -1,5 +1,5 @@ -import { AnyBlock } from './block-kit/blocks'; -import { PlainTextElement } from './block-kit/composition-objects'; +import type { AnyBlock } from './block-kit/blocks'; +import type { PlainTextElement } from './block-kit/composition-objects'; // TODO: breaking changes, use discriminated union for `fallback`, `text` and `block` properties, maybe LegacyAttachment // vs. BlocksAttachment? as per https://api.slack.com/reference/messaging/attachments#legacy_fields @@ -155,7 +155,7 @@ interface AttachmentAction { name?: string; options?: OptionField[]; option_groups?: { - text: string + text: string; options: OptionField[]; }[]; selected_options?: OptionField[]; diff --git a/packages/types/src/message-metadata.ts b/packages/types/src/message-metadata.ts index 66e2a8758..69721ec68 100644 --- a/packages/types/src/message-metadata.ts +++ b/packages/types/src/message-metadata.ts @@ -14,9 +14,9 @@ export interface MessageMetadata { */ event_payload: { [key: string]: string | number | boolean | MessageMetadataEventPayloadObject | MessageMetadataEventPayloadObject[]; - } + }; } export interface MessageMetadataEventPayloadObject { - [key: string]: string | number | boolean + [key: string]: string | number | boolean; } diff --git a/packages/types/src/views.ts b/packages/types/src/views.ts index 4bdbf9123..74c9a7407 100644 --- a/packages/types/src/views.ts +++ b/packages/types/src/views.ts @@ -1,5 +1,5 @@ -import { AnyBlock } from './block-kit/blocks'; -import { PlainTextElement } from './block-kit/composition-objects'; +import type { AnyBlock } from './block-kit/blocks'; +import type { PlainTextElement } from './block-kit/composition-objects'; interface BaseView { /** @description An array of {@link AnyBlock} that defines the content of the view. Max of 100 blocks. */ diff --git a/packages/types/test/views.test-d.ts b/packages/types/test/views.test-d.ts index 48fcb57d8..9f5af870c 100644 --- a/packages/types/test/views.test-d.ts +++ b/packages/types/test/views.test-d.ts @@ -1,5 +1,5 @@ import { expectAssignable, expectError } from 'tsd'; -import { HomeView, ModalView, PlainTextElement } from '../src/index'; +import type { HomeView, ModalView, PlainTextElement } from '../src/index'; const plaintext: PlainTextElement = { type: 'plain_text', text: 'hi' }; diff --git a/packages/types/tsconfig.eslint.json b/packages/types/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/types/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index b61d86ce5..139d474c6 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -13,14 +13,14 @@ "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", "baseUrl": ".", "paths": { - "*": ["./types/*"] + "*": [ + "./types/*" + ] }, - "esModuleInterop" : true, - + "esModuleInterop": true // Not using this setting because its only used to require the package.json file, and that would change the // structure of the files in the dist directory because package.json is not located inside src. It would be nice // to use import instead of require(), but its not worth the tradeoff of restructuring the build (for now). @@ -30,8 +30,7 @@ "src/**/*" ], "exclude": [ - "src/**/*.spec.js", - "src/**/*.js" + "src/**/*.spec.*" ], "jsdoc": { "out": "support/jsdoc", diff --git a/packages/web-api/.eslintignore b/packages/web-api/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/web-api/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/web-api/.eslintrc.js b/packages/web-api/.eslintrc.js deleted file mode 120000 index 5962fa3ca..000000000 --- a/packages/web-api/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintrc.js \ No newline at end of file diff --git a/packages/web-api/.vscode/launch.json b/packages/web-api/.vscode/launch.json index 68863cc64..756ca0ade 100644 --- a/packages/web-api/.vscode/launch.json +++ b/packages/web-api/.vscode/launch.json @@ -1,7 +1,4 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { @@ -9,17 +6,10 @@ "request": "launch", "name": "Web API Tests", "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", - "args": [ - "--timeout", - "999999", - "--colors", - "${workspaceFolder}/src/*.spec.js" - ], + "args": ["--timeout", "999999", "--colors", "${workspaceFolder}/src/*.spec.js"], "internalConsoleOptions": "openOnSessionStart", - "skipFiles": [ - "/**" - ], + "skipFiles": ["/**"], "cwd": "${workspaceFolder}" - }, + } ] } diff --git a/packages/web-api/.vscode/settings.json b/packages/web-api/.vscode/settings.json index 6de18e4ed..97bef4c57 100644 --- a/packages/web-api/.vscode/settings.json +++ b/packages/web-api/.vscode/settings.json @@ -1,3 +1,3 @@ { - "typescript.tsdk": "./node_modules/typescript/lib" + "typescript.tsdk": "./node_modules/typescript/lib" } diff --git a/packages/web-api/api-extractor.json b/packages/web-api/api-extractor.json deleted file mode 100644 index dbbbba8b5..000000000 --- a/packages/web-api/api-extractor.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - /** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - "mainEntryPointFilePath": "/dist/index.d.ts", - - "apiReport": { - "enabled": false - }, - - "docModel": { - "enabled": true, - "apiJsonFilePath": "/../../support/ref-docs/models/.api.json" - }, - - "dtsRollup": { - "enabled": false - }, - - "tsdocMetadata": { - "enabled": false - }, - - "messages": { - "extractorMessageReporting": { - // Disable release tagging warnings - "ae-missing-release-tag": { - "logLevel": "none" - } - } - } -} diff --git a/packages/web-api/biome.json b/packages/web-api/biome.json new file mode 100644 index 000000000..be3f4babf --- /dev/null +++ b/packages/web-api/biome.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "extends": ["../../biome.json"], + "overrides": [ + { + "include": ["src/types/response/**/*.ts"], + "linter": { + "rules": { + "complexity": { + "noBannedTypes": "off" + }, + "suspicious": { + "noExplicitAny": "off" + } + } + } + } + ] +} diff --git a/packages/web-api/package.json b/packages/web-api/package.json index fcfb3b8f8..7ba7d7b68 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -4,22 +4,10 @@ "description": "Official library for using the Slack Platform's Web API", "author": "Slack Technologies, LLC", "license": "MIT", - "keywords": [ - "slack", - "web-api", - "bot", - "client", - "http", - "api", - "proxy", - "rate-limiting", - "pagination" - ], + "keywords": ["slack", "web-api", "bot", "client", "http", "api", "proxy", "rate-limiting", "pagination"], "main": "dist/index.js", "types": "./dist/index.d.ts", - "files": [ - "dist/**/*" - ], + "files": ["dist/**/*"], "engines": { "node": ">= 18", "npm": ">= 8.6.0" @@ -36,14 +24,13 @@ "prepare": "npm run build", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage", - "lint": "eslint --fix --ext .ts src", - "mocha": "mocha --config .mocharc.json src/*.spec.js", + "lint": "npx @biomejs/biome check --write .", + "mocha": "mocha --config .mocharc.json \"./src/**/*.spec.ts\"", "test": "npm run lint && npm run test:types && npm run test:integration && npm run test:unit", "test:integration": "npm run build && node test/integration/commonjs-project/index.js && node test/integration/esm-project/index.mjs && npm run test:integration:ts", "test:integration:ts": "cd test/integration/ts-4.7-project && npm i && npm run build", "test:unit": "npm run build && c8 npm run mocha", "test:types": "tsd", - "ref-docs:model": "api-extractor run", "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build" }, "dependencies": { @@ -61,23 +48,15 @@ "retry": "^0.13.1" }, "devDependencies": { - "@microsoft/api-extractor": "^7", + "@biomejs/biome": "^1.8.3", "@tsconfig/recommended": "^1", + "@types/busboy": "^1.5.4", "@types/chai": "^4", "@types/mocha": "^10", "@types/sinon": "^17", - "@typescript-eslint/eslint-plugin": "^6", - "@typescript-eslint/parser": "^6", "busboy": "^1", "c8": "^10.1.2", "chai": "^4", - "eslint": "^8", - "eslint-config-airbnb-base": "^15", - "eslint-config-airbnb-typescript": "^17", - "eslint-plugin-import": "^2", - "eslint-plugin-import-newlines": "^1.3.4", - "eslint-plugin-jsdoc": "^48", - "eslint-plugin-node": "^11", "mocha": "^10", "nock": "^13", "shx": "^0.3.2", diff --git a/packages/web-api/src/WebClient.spec.js b/packages/web-api/src/WebClient.spec.js deleted file mode 100644 index 40ff34729..000000000 --- a/packages/web-api/src/WebClient.spec.js +++ /dev/null @@ -1,1678 +0,0 @@ -require('mocha'); -const fs = require('fs'); -const path = require('path'); -const { Agent } = require('https'); -const { assert, expect } = require('chai'); -const { WebClient, buildThreadTsWarningMessage } = require('./WebClient'); -const { ErrorCode } = require('./errors'); -const { LogLevel } = require('./logger'); -const { addAppMetadata } = require('./instrument'); -const { rapidRetryPolicy } = require('./retry-policies'); -const { Methods } = require('./methods'); -const nock = require('nock'); -const Busboy = require('busboy'); -const sinon = require('sinon'); -const { buildLegacyMethodWarning, buildGeneralFilesUploadWarning, buildInvalidFilesUploadParamError } = require('./file-upload'); -const axios = require('axios').default; - -const token = 'xoxb-faketoken'; - -describe('WebClient', function () { - - describe('constructor()', function () { - it('should build a default client given a token', function () { - const client = new WebClient(token); - assert.instanceOf(client, WebClient); - assert.equal(client.token, token); - assert.equal(client.slackApiUrl, 'https://slack.com/api/') - assert.equal(client.axios.defaults.headers.Authorization, `Bearer ${token}`); - }); - - it('should build a client without a token', function () { - const client = new WebClient(); - assert.instanceOf(client, WebClient); - assert.notExists(client.axios.defaults.headers.Authorization); - }); - }); - - describe('Methods superclass', function () { - it('should fail to construct classes that don\'t extend WebClient', function () { - assert.throws(function () { - class X extends Methods { - apiCall() {} - } - new X(); - }); - }); - - it('should succeed when constructing WebClient', function () { - assert.doesNotThrow(function () { - new WebClient(); - }); - }); - - it('should succeed when constructing a class that extends WebClient', function () { - assert.doesNotThrow(function () { - class X extends WebClient {} - new X(); - }); - }); - }); - - describe('has an option to change the log output severity', function () { - let sandbox = null; - beforeEach(function () { - sandbox = sinon.createSandbox(); - sandbox.stub(console, 'debug'); - }); - afterEach(function () { - sandbox.restore(); - }); - it('outputs a debug log on initialization', function () { - const debuggingClient = new WebClient(token, { logLevel: LogLevel.DEBUG }); - const output = console.debug.getCalls()[0].args.join(' '); - assert.isNotEmpty(output); // should have at least 1 log line, but not asserting since that is an implementation detail - }); - }); - - describe('has a logger option', function () { - let sandbox = null; - beforeEach(function () { - this.logger = { - debug: sinon.spy(), - info: sinon.spy(), - warn: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - }; - sandbox = sinon.createSandbox(); - sandbox.stub(console, 'debug'); - }); - afterEach(function () { - sandbox.restore(); - }); - it('sends logs to a logger and not to stdout', function () { - const debuggingClient = new WebClient(token, { logLevel: LogLevel.DEBUG, logger: this.logger }); - assert.isTrue(this.logger.debug.called); - assert.isEmpty(console.debug.getCalls()); - }); - it('never modifies the original logger', function () { - new WebClient(token, { logger: this.logger }); - // Calling #setName of the given logger is destructive - assert.isFalse(this.logger.setName.called); - }); - }); - - describe('has an option to override the Axios timeout value', function () { - it('should log warning and throw error if timeout exceeded', function (done) { - const timeoutOverride = 1; // ms, guaranteed failure - - const logger = { - debug: sinon.spy(), - info: sinon.spy(), - warn: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - }; - - const client = new WebClient(undefined, { - timeout: timeoutOverride, - retryConfig: { retries: 0 }, - logLevel: LogLevel.WARN, - logger - }); - - client.apiCall('users.list') - .then(_ => { - done(new Error("expected timeout to throw error")); - }) - .catch(error => { - try { - assert.isTrue(logger.warn.calledOnce, 'expected Logger to be called once'); - assert.instanceOf(error, Error); - assert.equal(error.code, ErrorCode.RequestError); - assert.equal(error.original.config.timeout, timeoutOverride); - assert.equal(error.original.isAxiosError, true); - done(); - } catch (err) { - done(err); - } - }); - }); - }); - - describe('apiCall()', function () { - beforeEach(function () { - this.client = new WebClient(token, { retryConfig: rapidRetryPolicy }); - }); - - describe('when making a successful call', function () { - beforeEach(function () { - this.scope = nock('https://slack.com') - .post(/api/) - .reply(200, { ok: true, - response_metadata: { - warnings: ['testWarning1', 'testWarning2'], - messages: [ - "[ERROR] unsupported type: sections [json-pointer:/blocks/0/type]", - "[WARN] A Content-Type HTTP header was presented but did not declare a charset, such as a 'utf-8'" - ] - } - }); - }); - - it('should return results in a Promise', function () { - const r = this.client.apiCall('method'); - return r.then((result) => { - assert(result.ok); - this.scope.done(); - }); - }); - - it('should send warnings to logs from both response_metadata.warnings & response_metadata.messages', function() { - const logger = { - debug: sinon.spy(), - info: sinon.spy(), - warn: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - }; - const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); - return warnClient.apiCall('method') - .then(() => { - assert.isTrue(logger.warn.calledThrice); - }); - }); - - it('should send response_metadata.messages errors to logs', function() { - const logger = { - debug: sinon.spy(), - info: sinon.spy(), - warn: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - }; - const errorClient = new WebClient(token, { logLevel: LogLevel.ERROR, logger }); - return errorClient.apiCall('method') - .then(() => { - assert.isTrue(logger.error.calledOnce); - }); - }); - - const attachmentWarningTestPatterns = [ - { method: 'chat.postMessage', args: { channel: "C123", attachments: [{ blocks: [] }] } }, - { method: 'chat.postMessage', args: { channel: "C123", attachments: [{ blocks: [], fallback: " " }] } }, - ]; - const textWarningTestPatterns = [ - { method: 'chat.postEphemeral', args: { channel: "C123", blocks: [] } }, - { method: 'chat.postMessage', args: { channel: "C123", blocks: [] } }, - { method: 'chat.scheduleMessage', args: { channel: "C123", post_at: "100000000", blocks: [] } }, - ]; - const warningTestPatterns = textWarningTestPatterns.concat(attachmentWarningTestPatterns); - - attachmentWarningTestPatterns.reduce((acc, { method, args }) => { - const attachmentPatterns = [{ fallback: "fallback" }].map((attachmentOverrides) => { - const attachments = args.attachments.map( attachment => { - return Object.assign({}, attachment, attachmentOverrides); - }) - return { method, args: Object.assign({}, args, { attachments }) }; - }); - - return acc.concat(attachmentPatterns) - }, []).forEach(({ method, args }) => { - it(`should not send warning to logs when client executes ${method} without text but with attachment fallback argument`, function () { - const logger = { - debug: sinon.spy(), - info: sinon.spy(), - warn: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - }; - const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); - return warnClient.apiCall(method, args).then(() => { - assert.equal(logger.warn.callCount, 3) - }); - }); - }); - - warningTestPatterns.reduce((acc, { method, args }) => { - const textPatterns = [{ text: "text" }] - .map((v) => ({ method, args: Object.assign({}, v, args) })) - return acc.concat(textPatterns) - }, []).forEach(({ method, args }) => { - it(`should not send warning to logs when client executes ${method} with text argument`, function () { - const logger = { - debug: sinon.spy(), - info: sinon.spy(), - warn: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - }; - const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); - return warnClient.apiCall(method, args) - .then(() => { - assert.isTrue(logger.warn.calledThrice); - }); - }); - }); - - textWarningTestPatterns.reduce((acc, { method, args }) => { - const textPatterns = [{ text: "" }, { text: null }, {}] - .map((v) => ({ method, args: Object.assign({}, v, args) })) - return acc.concat(textPatterns) - }, []).forEach(({ method, args }) => { - it(`should send a text-argument-specific warning to logs when client executes ${method} without text argument(${args.text === "" ? "empty" : args.text})`, function () { - const logger = { - debug: sinon.spy(), - info: sinon.spy(), - warn: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - }; - const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); - return warnClient.apiCall(method, args) - .then(() => { - assert.equal(logger.warn.callCount, 4) - }); - }); - }); - - attachmentWarningTestPatterns.reduce((acc, { method, args }) => { - const textPatterns = [{ text: "" }, { text: null }, {}] - .map((v) => ({ method, args: Object.assign({}, v, args) })) - return acc.concat(textPatterns) - }, []).forEach(({ method, args }) => { - it(`should send both text and fallback-argument-specific warning to logs when client executes ${method} without text argument(${args.text === "" ? "empty" : args.text}) nor without attachment-level fallback argument (${args.attachments[0].fallback === " " ? "empty" : args.attachments[0].fallback})`, function () { - const logger = { - debug: sinon.spy(), - info: sinon.spy(), - warn: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - }; - const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); - return warnClient.apiCall(method, args) - .then(() => { - assert.equal(logger.warn.callCount, 5) - }); - }); - }); - - const threadTsTestPatterns = [ - { method: 'chat.postEphemeral' }, - { method: 'chat.postMessage' }, - { method: 'chat.scheduleMessage' }, - { method: 'files.upload' }, - ]; - - threadTsTestPatterns.reduce((acc, { method, args }) => { - const threadTs = [{ thread_ts: 1503435956.000247, text: 'text' }] - .map((v) => ({ method, args: Object.assign({}, v, args) })) - return acc.concat(threadTs) - }, []).forEach(({ method, args }) => { - it(`should send warning to logs when thread_ts in ${method} arguments is a float`, function () { - const logger = { - debug: sinon.spy(), - info: sinon.spy(), - warn: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - }; - const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); - return warnClient.apiCall(method, args) - .then(() => { - // assume no warning about thread_ts has been sent - let warnedAboutThreadTS = false; - - // for each of the calls made of this method's spy function - const spyCalls = logger.warn.getCalls(); - for (const call of spyCalls) { - // determine whether it was called with the correct warning as arguments - if (call.args[0] === buildThreadTsWarningMessage(method)) { - warnedAboutThreadTS = true; - break; - } - } - if (!warnedAboutThreadTS) { - assert.fail(`Expected a warning when thread_ts in ${method} is a float but got none`); - } - }); - }); - }); - - threadTsTestPatterns.reduce((acc, { method, args }) => { - const threadTs = [{ thread_ts: '1503435956.000247', text: 'text' }] - .map((v) => ({ method, args: Object.assign({}, v, args) })) - return acc.concat(threadTs) - }, []).forEach(({ method, args }) => { - it(`should not send warning to logs when thread_ts in ${method} arguments is a string`, function () { - const logger = { - debug: sinon.spy(), - info: sinon.spy(), - warn: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - }; - const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); - return warnClient.apiCall(method, args) - .then(() => { - logger.warn.getCalls().forEach((call) => { - assert.notEqual(call.args[0], buildThreadTsWarningMessage(method)); - }); - }); - }); - }); - - it('warns when user is accessing the files.upload (legacy) method', async () => { - const logger = { - info: sinon.spy(), - warn: sinon.spy(), - debug: sinon.spy(), - error: sinon.spy(), - setLevel: sinon.spy(), - setName: sinon.spy(), - } - const client = new WebClient(token, { logLevel: LogLevel.INFO, logger }); - const res = await client.apiCall('files.upload', {}); - - // both must be true to pass this test - let warnedAboutLegacyFilesUpload = false; - let infoAboutRecommendedFilesUploadV2 = false; - - // check the warn spy for whether it was called with the correct warning - logger.warn.getCalls().forEach(call => { - if (call.args[0] === buildLegacyMethodWarning('files.upload')) { - warnedAboutLegacyFilesUpload = true; - } - }); - // check the info spy for whether it was called with the correct warning - logger.info.getCalls().forEach(call => { - if (call.args[0] === buildGeneralFilesUploadWarning()) { - infoAboutRecommendedFilesUploadV2 = true; - } - }) - if (!warnedAboutLegacyFilesUpload || !infoAboutRecommendedFilesUploadV2) { - assert.fail('Should have logged a warning and info when files.upload is used'); - } - }); - - }); - - describe('with OAuth scopes in the response headers', function () { - it('should expose a scopes and acceptedScopes properties on the result', function () { - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, { ok: true }, { - 'X-OAuth-Scopes': 'files:read, chat:write:bot', - 'X-Accepted-OAuth-Scopes': 'files:read' - }); - return this.client.apiCall('method') - .then((result) => { - assert.deepNestedInclude(result.response_metadata, { scopes: ['files:read', 'chat:write:bot'] }); - assert.deepNestedInclude(result.response_metadata, { acceptedScopes: ['files:read'] }); - scope.done(); - }) - }); - }); - - describe('when called with bad options', function () { - it('should reject its Promise with TypeError', function (done) { - const results = [ - this.client.apiCall('method', 4), - this.client.apiCall('method', 'a string'), - this.client.apiCall('method', false), - ]; - const caughtErrors = results.map((r) => { - return r - .then(() => { - // if any of these promises resolve, this test fails - assert(false); - }) - .catch((error) => { - // each promise should reject with the right kind of error - assert.instanceOf(error, TypeError); - }); - }); - Promise.all(caughtErrors) - .then(() => done()); - }); - }); - - describe('when an API call fails', function () { - it('should return a Promise which rejects on error', function (done) { - const client = new WebClient(undefined, { retryConfig: { retries: 0 } }); - - this.scope = nock('https://slack.com') - .post(/api/) - .reply(500); - - client.apiCall('method').catch((error) => { - assert.instanceOf(error, Error); - this.scope.done(); - done(); - }); - }); - }); - - it('should fail with WebAPIPlatformError when the API response has an error', function (done) { - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, { ok: false, error: 'bad error' }); - this.client.apiCall('method') - .catch((error) => { - assert.instanceOf(error, Error); - assert.equal(error.code, ErrorCode.PlatformError); - assert.nestedPropertyVal(error, 'data.ok', false); - assert.nestedPropertyVal(error, 'data.error', 'bad error'); - scope.done(); - done(); - }); - }); - - it('should fail with WebAPIHTTPError when the API response has an unexpected status', function (done) { - const body = { foo: 'bar' }; - const scope = nock('https://slack.com') - .post(/api/) - .reply(500, body); - const client = new WebClient(token, { retryConfig: { retries: 0 } }); - client.apiCall('method') - .catch((error) => { - assert.instanceOf(error, Error); - assert.equal(error.code, ErrorCode.HTTPError); - assert.equal(error.statusCode, 500); - assert.exists(error.headers); - assert.deepEqual(error.body, body); - scope.done(); - done(); - }); - }); - - it('should fail with WebAPIRequestError when the API request fails', function (done) { - // One known request error is when the node encounters an ECONNREFUSED. In order to simulate this, rather than - // using nock, we send the request to a host:port that is not listening. - const client = new WebClient(token, { slackApiUrl: 'https://localhost:8999/api/', retryConfig: { retries: 0 } }); - client.apiCall('method') - .catch((error) => { - assert.instanceOf(error, Error); - assert.equal(error.code, ErrorCode.RequestError); - assert.instanceOf(error.original, Error); - done(); - }); - }); - - it('should properly serialize simple API arguments', function () { - const scope = nock('https://slack.com') - // NOTE: this could create false negatives if the serialization order changes (it shouldn't matter) - .post(/api/, 'team_id=T12345678&foo=stringval&bar=42&baz=false') - .reply(200, { ok: true }); - return this.client.apiCall('method', { foo: 'stringval', bar: 42, baz: false, team_id: 'T12345678' }) - .then(() => { - scope.done(); - }); - }); - - it('should properly serialize complex API arguments', function () { - const scope = nock('https://slack.com') - // NOTE: this could create false negatives if the serialization order changes (it shouldn't matter) - .post(/api/, 'arraything=%5B%7B%22foo%22%3A%22stringval%22%2C%22bar%22%3A42%2C%22baz%22%3Afalse%2C%22zup%22%3A%5B%22one%22%2C%22two%22%2C%22three%22%5D%7D%5D&objectthing=%7B%22foo%22%3A7%2C%22hum%22%3Afalse%7D') - .reply(200, { ok: true }); - return this.client.apiCall('method', { - // TODO: include things like quotes and emojis - arraything: [{ - foo: 'stringval', - bar: 42, - baz: false, - zup: ['one', 'two', 'three'] - }], - objectthing: { - foo: 7, - hum: false, - }, - }) - .then(() => { - scope.done(); - }); - }); - - it('should remove undefined or null values from simple API arguments', function () { - const scope = nock('https://slack.com') - .post(/api/, 'something=else') - .reply(200, { ok: true }); - return this.client.apiCall('method', { - something_undefined: undefined, - something_null: null, - something: 'else' - }) - .then(() => { - scope.done(); - }); - }); - - describe('when API arguments contain binary to upload', function () { - beforeEach(function () { - const self = this; - self.scope = nock('https://slack.com') - .post(/api/) - // rather than matching on the body, that nock cannot do for content-type multipart/form-data, we use the - // response to signal that the body was correctly serialized - .reply(function (_uri, requestBody, cb) { - // busboy is a parser for for multipart/form-data bodies - const busboy = Busboy({ headers: this.req.headers }); - // capture state about all the parts that are in the body - const parts = { files: [], fields: [], errors: [] }; - - // attaching event handlers to track incoming parts - busboy.on('file', (fieldname, file, filename) => { - parts.files.push({ fieldname, filename }); - file.resume(); - }); - busboy.on('field', (fieldname, value) => { - parts.fields.push({ fieldname, value }); - }); - busboy.on('error', (error) => { - parts.errors.push(error); - }); - busboy.on('finish', () => { - // when the parser is done, respond to the request with the state captured - if (parts.errors.length > 0) { - cb(parts.errors[0]); - } else { - // the response must contain `ok: true` for the client to accept it - parts.ok = true; - cb(null, [200, JSON.stringify(parts)]); - } - }); - - // Write incoming string body to busboy parser - busboy.end(requestBody ? Buffer.from(requestBody, 'hex') : undefined); - }); - }); - - // TODO: resolve this test failure starting in September 2022 - // it('should properly serialize when the binary argument is a ReadableStream', function () { - // const imageStream = fs.createReadStream(path.resolve('test', 'fixtures', 'train.jpg')); - // return this.client.apiCall('upload', { - // someBinaryField: imageStream, - // }) - // .then((parts) => { - // assert.lengthOf(parts.files, 1); - // const file = parts.files[0]; - // // the filename is picked up from the the ReadableStream since it originates from fs - // assert.include(file, { fieldname: 'someBinaryField', filename: 'train.jpg' }); - // }); - // }); - - // TODO: some tests with streams/buffers that originate from formiddable and/or request - // TODO: resolve this test failure starting in September 2022 - // it('should use a default name when binary argument is a Buffer', function () { - // const imageBuffer = fs.readFileSync(path.resolve('test', 'fixtures', 'train.jpg')); - // // intentially vague about the method name and argument name - // return this.client.apiCall('upload', { - // someBinaryField: imageBuffer, - // }) - // .then((parts) => { - // assert.lengthOf(parts.files, 1); - // const file = parts.files[0]; - // assert.include(file, { fieldname: 'someBinaryField' }); - // assert.isString(file.filename); - // }); - // }); - - // TODO: resolve this test failure starting in September 2022 - // it('should filter out undefined values', function () { - // const imageBuffer = fs.readFileSync(path.resolve('test', 'fixtures', 'train.jpg')); - // return this.client.apiCall('upload', { - // // the binary argument is necessary to trigger form data serialization - // someBinaryField: imageBuffer, - // someUndefinedField: undefined, - // }) - // .then((parts) => { - // assert.lengthOf(parts.fields, 0); - // }) - // }); - }); - - describe('metadata in the user agent', function () { - it('should set the user agent to contain package metadata', function () { - const scope = nock('https://slack.com', { - reqheaders: { - 'User-Agent': (value) => { - const metadata = parseUserAgentIntoMetadata(value) - // NOTE: this assert isn't that strong and doesn't say anything about the values. at this time, there - // isn't a good way to test this without dupicating the logic of the code under test. - assert.containsAllKeys(metadata, ['node', '@slack:web-api']); - // NOTE: there's an assumption that if there's any keys besides these left at all, its the platform part - delete metadata.node; - delete metadata['@slack:client']; - assert.isNotEmpty(metadata); - return true; - }, - }, - }) - .post(/api/) - .reply(200, { ok: true }); - return this.client.apiCall('method') - .then(() => { - scope.done(); - }); - }); - - it('should set the user agent to contain application metadata', function () { - const [name, version] = ['appmedataname', 'appmetadataversion']; - addAppMetadata({ name, version }); - const scope = nock('https://slack.com', { - reqheaders: { - 'User-Agent': (value) => { - const metadata = parseUserAgentIntoMetadata(value) - assert.propertyVal(metadata, name, version); - return true; - }, - }, - }) - .post(/api/) - .reply(200, { ok: true }); - // NOTE: appMetaData is only evalued on client construction, so we cannot use the client already created - const client = new WebClient(token, { retryConfig: rapidRetryPolicy }); - return client.apiCall('method') - .then(() => { - scope.done(); - }); - }); - }); - - describe('with string response body for some reason', function () { - it('should try to parse the body', function () { - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, '{ "ok": true, "response_metadata": { "foo": "bar" } }', { - 'X-OAuth-Scopes': 'files:read, chat:write:bot', - 'X-Accepted-OAuth-Scopes': 'files:read' - }); - return this.client.apiCall('method') - .then((result) => { - assert.deepNestedInclude(result.response_metadata, { scopes: ['files:read', 'chat:write:bot'] }); - assert.deepNestedInclude(result.response_metadata, { acceptedScopes: ['files:read'] }); - assert.deepNestedInclude(result.response_metadata, { foo: 'bar' }); - scope.done(); - }) - }); - it('should work even if the body is not a JSON data', function () { - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, 'something wrong!', { - 'X-OAuth-Scopes': 'files:read, chat:write:bot', - 'X-Accepted-OAuth-Scopes': 'files:read' - }); - return this.client.apiCall('method') - .catch(err => { - assert.equal(err.message, 'An API error occurred: something wrong!'); - scope.done(); - }); - }); - }); - }); - - describe('apiCall() - without a token', function () { - it('should make successful api calls', function () { - const client = new WebClient(undefined, { retryConfig: rapidRetryPolicy }); - - const scope = nock('https://slack.com') - // NOTE: this could create false negatives if the serialization order changes (it shouldn't matter) - .post(/api/, 'foo=stringval') - .reply(200, { ok: true }); - - const r = client.apiCall('method', { foo: 'stringval' }); - return r.then((result) => { - scope.done(); - }); - }); - }); - - describe('apiCall() - when using static headers', function () { - it('should include static headers on api request', function () { - const client = new WebClient(token, { headers: { 'X-XYZ': 'value' } }); - const scope = nock('https://slack.com', { - reqheaders: { - 'X-XYZ': 'value' - } - }) - .post(/api/) - .reply(200, { ok: true }); - const r = client.apiCall('method'); - return r.then((result) => { - scope.done(); - }); - }); - it('should override Authorization header if passed as an option to apiCall()', function () { - const client = new WebClient(token, { headers: { 'X-XYZ': 'value' } }); - const scope = nock('https://slack.com', { - reqheaders: { - 'X-XYZ': 'value', - 'Authorization': 'Bearer xoxp-superfake' - } - }) - .post(/api/) - .reply(200, { ok: true }); - const r = client.apiCall('method', { token: 'xoxp-superfake' }); - return r.then((result) => { - scope.done(); - }); - }); - }); - - describe('named method aliases (facets)', function () { - beforeEach(function () { - this.client = new WebClient(token, { retryConfig: rapidRetryPolicy }); - }); - it('should properly mount methods as functions', function () { - // This test doesn't exhaustively check all the method aliases, it just tries a couple. - // This should be enough since all methods are mounted in the exact same way. - const scope = nock('https://slack.com') - .post('/api/chat.postMessage', 'foo=stringval') - .reply(200, { ok: true }) - // Trying this method because its mounted one layer "deeper" - .post('/api/team.profile.get') - .reply(200, { ok: true }); - return Promise.all([this.client.chat.postMessage({ foo: 'stringval' }), this.client.team.profile.get()]) - .then(() => { - scope.done(); - }); - }); - }) - - describe('paginate()', function () { - beforeEach(function () { - this.client = new WebClient(token, { retryConfig: rapidRetryPolicy }); - this.method = 'conversations.list'; - }); - - describe('when not given shouldStop predicate', function () { - it('should return an AsyncIterator', function () { - const iterator = this.client.paginate(this.method); - assert.isOk(iterator[Symbol.asyncIterator]); - }); - it('can iterate multiple pages', async function () { - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR' } }) - .post(/api/, (body) => { - // NOTE: limit value is compared as a string because nock doesn't properly serialize the param into a number - return body.limit && body.limit === '200' && body.cursor && body.cursor === 'CURSOR'; - }) - .reply(200, { ok: true }); - const iterator = this.client.paginate(this.method); - - const { value: firstPage, done: firstDone } = await iterator.next(); - assert.isOk(firstPage); - assert.isFalse(firstDone); - const { value: secondPage, done: secondDone } = await iterator.next(); - assert.isOk(secondPage); - assert.isFalse(secondDone); - const { value: thirdPage, done: thirdDone } = await iterator.next(); - assert.isNotOk(thirdPage); - assert.isTrue(thirdDone); - - scope.done(); - }); - it('can iterate multiple pages with limit items per page', async function () { - const limit = 4; - const scope = nock('https://slack.com') - .post(/api/, (body) => { - // NOTE: limit value is compared as a string because nock doesn't properly serialize the param into a number - return body.limit && body.limit === limit.toString(); - }) - .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR' } }) - .post(/api/, (body) => { - // NOTE: limit value is compared as a string because nock doesn't properly serialize the param into a number - return body.limit && body.limit === limit.toString() && body.cursor && body.cursor === 'CURSOR'; - }) - .reply(200, { ok: true }); - const iterator = this.client.paginate(this.method, { limit }); - - const { value: firstPage, done: firstDone } = await iterator.next(); - assert.isOk(firstPage); - assert.isFalse(firstDone); - const { value: secondPage, done: secondDone } = await iterator.next(); - assert.isOk(secondPage); - assert.isFalse(secondDone); - const { value: thirdPage, done: thirdDone } = await iterator.next(); - assert.isNotOk(thirdPage); - assert.isTrue(thirdDone); - - scope.done(); - }); - it('can resume iteration from a result with an existing cursor', async function () { - const cursor = 'PRE_CURSOR'; - const scope = nock('https://slack.com') - .post(/api/, (body) => { - return body.cursor && body.cursor === cursor; - }) - .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR' } }) - .post(/api/, (body) => { - return body.cursor && body.cursor === 'CURSOR'; - }) - .reply(200, { ok: true }); - const iterator = this.client.paginate(this.method, { cursor }); - - const { value: firstPage, done: firstDone } = await iterator.next(); - assert.isOk(firstPage); - assert.isFalse(firstDone); - const { value: secondPage, done: secondDone } = await iterator.next(); - assert.isOk(secondPage); - assert.isFalse(secondDone); - const { value: thirdPage, done: thirdDone } = await iterator.next(); - assert.isNotOk(thirdPage); - assert.isTrue(thirdDone); - - scope.done(); - }); - }); - - describe('when given shouldStop predicate', function () { - it('should iterate until the end when shouldStop always returns false', async function () { - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR' } }) - .post(/api/, (body) => { - // NOTE: limit value is compared as a string because nock doesn't properly serialize the param into a number - return body.limit && body.limit === '200' && body.cursor && body.cursor === 'CURSOR'; - }) - .reply(200, { ok: true }); - - const neverStop = sinon.fake.returns(false); - await this.client.paginate(this.method, {}, neverStop); - assert.equal(neverStop.callCount, 2); - - scope.done(); - }); - it('should only iterate once when shouldStop always returns true', async function () { - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR' } }); - - const neverStop = sinon.fake.returns(true); - await this.client.paginate(this.method, {}, neverStop); - assert.equal(neverStop.callCount, 1); - - scope.done(); - }); - it('should iterate twice when shouldStop always returns false then true', async function () { - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR_1' } }) - .post(/api/, (body) => { - return body.cursor && body.cursor === 'CURSOR_1'; - }) - .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR_2' } }) - - const shouldStop = sinon.stub(); - shouldStop.onCall(0).returns(false); - shouldStop.onCall(1).returns(true); - await this.client.paginate(this.method, {}, shouldStop); - assert.equal(shouldStop.callCount, 2); - - scope.done(); - }); - - describe('when given a reduce function', function () { - it('should resolve for the accumulated value', async function () { - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, { ok: true, v: 1, response_metadata: { next_cursor: 'CURSOR' } }) - .post(/api/, (body) => { - // NOTE: limit value is compared as a string because nock doesn't properly serialize the param into a number - return body.limit && body.limit === '200' && body.cursor && body.cursor === 'CURSOR'; - }) - .reply(200, { ok: true, v: 2 }); - - const sum = await this.client.paginate(this.method, {}, () => false, (acc, page) => { - if (acc === undefined) { - acc = 0; - } - if (page.v && typeof page.v === 'number') { - acc += page.v; - } - return acc; - }); - assert.equal(sum, 3); - - scope.done(); - }); - }); - }); - }); - - describe('has option to change slackApiUrl', function () { - it('should send requests to an alternative URL', function () { - const alternativeUrl = 'http://12.34.56.78/api/'; - const scope = nock(alternativeUrl) - .post(/api\/method/) - .reply(200, { ok: true }); - const client = new WebClient(token, { slackApiUrl: alternativeUrl }); - return client.apiCall('method'); - }); - }); - - describe('has an option to set a custom HTTP agent', function () { - it('should send a request using the custom agent', function () { - const agent = new Agent({ keepAlive: true }); - const spy = sinon.spy(agent, 'addRequest'); - const client = new WebClient(token, { agent, retryConfig: rapidRetryPolicy }); - return client.apiCall('method') - .catch(() => { - assert(spy.called); - }) - .then(() => { - agent.addRequest.restore(); - agent.destroy(); - }) - .catch((error) => { - agent.addRequest.restore(); - agent.destroy(); - throw error; - }); - }); - }); - - describe('has an option to set request concurrency', function () { - // TODO: factor out common logic into test helpers - const responseDelay = 100; // ms - - beforeEach(function () { - const self = this; - self.testStart = Date.now(); - self.scope = nock('https://slack.com') - .persist() - .post(/api/) - .delay(responseDelay) - .reply(function (uri, requestBody) { - // NOTE: the assumption is that this function gets called right away when the request body is available, - // not after the delay - const diff = Date.now() - self.testStart; - return [200, JSON.stringify({ ok: true, diff })]; - }); - }); - - it('should have a default conncurrency of 100', function () { - const client = new WebClient(token); - const requests = []; - for (let i = 0; i < 101; i++) { - requests.push(client.apiCall(`${i}`)); - } - return Promise.all(requests) - .then((responses) => { - // verify all responses are present - assert.lengthOf(responses, 101); - - // verify that maxRequestConcurrency requests were all sent concurrently - const concurrentResponses = responses.slice(0, 100); // the first 100 responses - concurrentResponses.forEach((r) => assert.isBelow(r.diff, responseDelay)); - - // verify that any requests after maxRequestConcurrency were delayed by the responseDelay - const queuedResponses = responses.slice(100); - const minDiff = concurrentResponses[concurrentResponses.length - 1].diff + responseDelay; - queuedResponses.forEach((r) => assert.isAtLeast(r.diff, minDiff)); - }); - }); - - it('should allow concurrency to be set', function () { - const client = new WebClient(token, { maxRequestConcurrency: 1 }); - const requests = [client.apiCall('1'), client.apiCall('2')]; - return Promise.all(requests) - .then((responses) => { - // verify all responses are present - assert.lengthOf(responses, 2); - - // verify that maxRequestConcurrency requets were all sent concurrently - const concurrentResponses = responses.slice(0, 1); // the first response - concurrentResponses.forEach((r) => assert.isBelow(r.diff, responseDelay)); - - // verify that any requests after maxRequestConcurrency were delayed by the responseDelay - const queuedResponses = responses.slice(1);// the second response - const minDiff = concurrentResponses[concurrentResponses.length - 1].diff + responseDelay; - queuedResponses.forEach((r) => { assert.isAtLeast(r.diff, minDiff) }); - }); - }); - - afterEach(function () { - this.scope.persist(false); - }); - }); - - describe('has an option to set the retry policy ', function () { - it('retries a request which fails to get a response', function () { - const scope = nock('https://slack.com') - .post(/api/) - .replyWithError('could be a ECONNREFUSED, ENOTFOUND, ETIMEDOUT, ECONNRESET') - .post(/api/) - .reply(200, { ok: true }); - const client = new WebClient(token, { retryConfig: rapidRetryPolicy }); - return client.apiCall('method') - .then((resp) => { - assert.propertyVal(resp, 'ok', true); - scope.done(); - }); - }); - it('retries a request whose response has a status code that is not 200 nor 429 (rate limited)', function () { - const scope = nock('https://slack.com') - .post(/api/) - .reply(500) - .post(/api/) - .reply(200, { ok: true }); - const client = new WebClient(token, { retryConfig: rapidRetryPolicy }); - return client.apiCall('method') - .then((resp) => { - assert.propertyVal(resp, 'ok', true); - scope.done(); - }); - }); - }); - - describe('has rate limit handling', function () { - describe('when configured to reject rate-limited calls', function () { - beforeEach(function () { - this.client = new WebClient(token, { rejectRateLimitedCalls: true }); - }); - - it('should reject with a WebAPIRateLimitedError when a request fails due to rate-limiting', function (done) { - const retryAfter = 5; - const scope = nock('https://slack.com') - .post(/api/) - .reply(429, '', { 'retry-after': retryAfter }); - this.client.apiCall('method') - .catch((error) => { - assert.instanceOf(error, Error); - assert.equal(error.code, ErrorCode.RateLimitedError); - assert.equal(error.retryAfter, retryAfter); - scope.done(); - done(); - }); - }); - - it('should emit a rate_limited event on the client', function (done) { - const spy = sinon.spy(); - const scope = nock('https://slack.com') - .post(/api/) - .reply(429, {}, { 'retry-after': 0 }); - const client = new WebClient(token, { rejectRateLimitedCalls: true }); - client.on('rate_limited', spy); - client.apiCall('method', { foo: 'bar' }) - .catch((err) => { - assert(spy.calledOnceWith(0, sinon.match({ url: 'method', body: { foo: 'bar' } }))) - scope.done(); - done(); - }); - }); - }); - - it('should automatically retry the request after the specified timeout', function () { - const retryAfter = 1; - const scope = nock('https://slack.com') - .post(/api/) - .reply(429, '', { 'retry-after': retryAfter }) - .post(/api/) - .reply(200, { ok: true }); - const client = new WebClient(token, { retryConfig: rapidRetryPolicy }); - const startTime = Date.now(); - return client.apiCall('method') - .then(() => { - const diff = Date.now() - startTime; - assert.isAtLeast(diff, retryAfter * 1000, 'elapsed time is at least a second'); - scope.done(); - }); - }); - - it('should include retryAfter metadata if the response has retry info', function () { - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, { ok: true }, { 'retry-after': 100 }); - const client = new WebClient(token); - return client.apiCall('method') - .then((data) => { - assert(data.response_metadata.retryAfter === 100); - scope.done(); - }); - }); - - it('should pause the remaining requests in queue', function () { - const startTime = Date.now(); - const retryAfter = 1; - const scope = nock('https://slack.com') - .post(/api/) - .reply(429, '', { 'retry-after': retryAfter }) - .post(/api/) - .reply(200, function (uri, requestBody) { - return JSON.stringify({ ok: true, diff: Date.now() - startTime }); - }) - .post(/api/) - .reply(200, function (uri, requestBody) { - return JSON.stringify({ ok: true, diff: Date.now() - startTime }); - }); - const client = new WebClient(token, { retryConfig: rapidRetryPolicy, maxRequestConcurrency: 1 }); - const firstCall = client.apiCall('method'); - const secondCall = client.apiCall('method'); - return Promise.all([firstCall, secondCall]) - .then(([firstResult, secondResult]) => { - assert.isAtLeast(firstResult.diff, retryAfter * 1000); - assert.isAtLeast(secondResult.diff, retryAfter * 1000); - scope.done(); - }); - }); - - it('should emit a rate_limited event on the client', function (done) { - const spy = sinon.spy(); - const scope = nock('https://slack.com') - .post(/api/) - .reply(429, {}, { 'retry-after': 0 }); - const client = new WebClient(token, { retryConfig: { retries: 0 } }); - client.on('rate_limited', spy); - client.apiCall('method', { foo: 'bar' }) - .catch((err) => { - assert(spy.calledOnceWith(0, sinon.match({ url: 'method', body: { foo: 'bar' } }))) - scope.done(); - done(); - }); - }); - }); - - it('should throw an error if the response has no retry info', function (done) { - const scope = nock('https://slack.com') - .post(/api/) - .reply(429, {}, { 'retry-after': undefined }); - const client = new WebClient(token); - client.apiCall('method') - .catch((err) => { - assert.instanceOf(err, Error); - scope.done(); - done(); - }); - }); - - it('should throw an error if the response has an invalid retry-after header', function (done) { - const scope = nock('https://slack.com') - .post(/api/) - .reply(429, {}, { 'retry-after': 'notanumber' }); - const client = new WebClient(token); - client.apiCall('method') - .catch((err) => { - assert.instanceOf(err, Error); - assert.include(err.message, 'retry-after header: notanumber', 'Raw retry-after header value included in error'); - scope.done(); - done(); - }); - }); - - describe('admin.inviteRequests.* APIs', function () { - const client = new WebClient(token); - - beforeEach(function() { - this.scope = nock('https://slack.com') - .post(/api/) - .reply(200, function (_uri, body) { - return { ok: true, body: body }; - }); - }); - - it('properly serializes arguments to admin.inviteRequests.approve', async function () { - const res = await client.admin.inviteRequests.approve({ team_id: 'T123', invite_request_id: 'I123' }); - assert.equal(res.body, 'team_id=T123&invite_request_id=I123'); - this.scope.done(); - }); - it('properly serializes arguments to admin.inviteRequests.deny', async function () { - const res = await client.admin.inviteRequests.deny({ team_id: 'T123', invite_request_id: 'I123' }); - assert.equal(res.body, 'team_id=T123&invite_request_id=I123'); - this.scope.done(); - }); - it('properly serializes arguments to admin.inviteRequests.list', async function () { - const res = await client.admin.inviteRequests.list({ team_id: 'T123', limit: 10, cursor: 'position' }); - assert.equal(res.body, 'team_id=T123&limit=10&cursor=position'); - this.scope.done(); - }); - it('properly serializes arguments to admin.inviteRequests.approved.list', async function () { - const res = await client.admin.inviteRequests.approved.list({ team_id: 'T123', limit: 10, cursor: 'position' }); - assert.equal(res.body, 'team_id=T123&limit=10&cursor=position'); - this.scope.done(); - }); - it('properly serializes arguments to admin.inviteRequests.denied.list', async function () { - const res = await client.admin.inviteRequests.denied.list({ team_id: 'T123', limit: 10, cursor: 'position' }); - assert.equal(res.body, 'team_id=T123&limit=10&cursor=position'); - this.scope.done(); - }); - }); - - describe('admin.usergroups.* APIs', function () { - const client = new WebClient(token); - - beforeEach(function() { - this.scope = nock('https://slack.com') - .post(/api/) - .reply(200, function (_uri, body) { - return { ok: true, body: body }; - }); - }); - - it('properly serializes string of comma-separated channel_ids argument to admin.usergroups.addChannels', async function () { - const res = await client.admin.usergroups.addChannels({ team_id: 'T123', usergroup_id: 'S123', channel_ids: 'C123,C234' }); - assert.equal(res.body, 'team_id=T123&usergroup_id=S123&channel_ids=C123%2CC234'); - this.scope.done(); - }); - it('properly serializes array of channel_ids argument to admin.usergroups.addChannels', async function () { - const res = await client.admin.usergroups.addChannels({ team_id: 'T123', usergroup_id: 'S123', channel_ids: ['C123','C234'] }); // URL encoded "['C123','C234']" - assert.equal(res.body, 'team_id=T123&usergroup_id=S123&channel_ids=%5B%22C123%22%2C%22C234%22%5D'); - this.scope.done(); - }); - it('properly serializes arguments to admin.usergroups.listChannels', async function () { - const res = await client.admin.usergroups.listChannels({ team_id: 'T123', include_num_members: true, usergroup_id: 'S123' }); - assert.equal(res.body, 'team_id=T123&include_num_members=true&usergroup_id=S123'); - this.scope.done(); - }); - it('properly serializes string of comma-separated channel_ids argument to admin.usergroups.removeChannels', async function () { - const res = await client.admin.usergroups.removeChannels({ usergroup_id: 'S123', channel_ids: 'C123,C234' }); - assert.equal(res.body, 'usergroup_id=S123&channel_ids=C123%2CC234'); // URL encoded "C123,C234" - this.scope.done(); - }); - it('properly serializes array of channel_ids argument to admin.usergroups.removeChannels', async function () { - const res = await client.admin.usergroups.removeChannels({ usergroup_id: 'S123', channel_ids: ['C123','C234'] }); - assert.equal(res.body, 'usergroup_id=S123&channel_ids=%5B%22C123%22%2C%22C234%22%5D'); // URL encoded "['C123','C234']" - this.scope.done(); - }); - }); - - describe('apps.event.authorizations.list API', function () { - it('should not send the token in the body if token is passed as a method argument', function () { - const client = new WebClient(); - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, (_uri, body) => { - assert.notInclude(body, token); - console.log('body is', body); - return { ok: true } - }); - return client.apps.event.authorizations.list({ - token, - }) - .then(() => { - scope.done(); - }); - }); - it('should not send the token in the body if token passed as client constructor', function () { - const client = new WebClient(token); - const scope = nock('https://slack.com') - .post(/api/) - .reply(200, (_uri, body) => { - assert.notInclude(body, token); - return { ok: true } - }); - return client.apps.event.authorizations.list({ - }) - .then(() => { - scope.done(); - }); - }); - }); - - describe('getAllFileUploads', () => { - const client = new WebClient(token); - it('adds a single file data to uploads with content supplied', async () => { - const testWithContent = { - content: 'Happiness!', // test string - filename: 'happiness.txt', - title: 'Testing Happiness', - channels: 'C1234', - }; - - // returns exactly one file upload - const res = await client.getAllFileUploads(testWithContent); - assert.equal(res.length, 1); - }); - it('adds a single file data to uploads with file supplied', async () => { - const testWithFile = { - file: './test/fixtures/test-txt.txt', // test string - filename: 'test.txt', - title: 'Test file', - channels: 'C1234', - }; - - const res = await client.getAllFileUploads(testWithFile); - assert.equal(res.length, 1); - }); - it('adds multiple files data to an upload', async () => { - const files = ['txt', 'jpg', 'svg', 'png']; - const fileUploads = files.map((ext) => { - const filename = `test-${ext}.${ext}`; - return { - file: fs.createReadStream(`./test/fixtures/${filename}`), - filename - } - }); - const entryWithFileUploads = { - channel_id: 'C1234', - initial_comment: `Here is a single comment wit many files attached`, - title: `Many files`, - file_uploads: fileUploads, - }; - // 4 entries added - const res = await client.getAllFileUploads(entryWithFileUploads); - assert.equal(res.length, 4); - - // check the filename of each entry matches - files.forEach((ext, idx) => { - const filename = `test-${ext}.${ext}`; - assert.equal(res[idx].filename, filename); - }); - }); - it('adds single and multiple files data to uploads', async () => { - const files = ['txt', 'jpg', 'svg', 'png']; - const fileUploads = files.map((ext) => { - const filename = `test-${ext}.${ext}`; - return { - file: fs.createReadStream(`./test/fixtures/${filename}`), - filename - } - }); - const entryWithFileUploadsAndSingleFile = { - file_uploads: fileUploads, - file: './test/fixtures/test-txt.txt', // test string - filename: 'test.txt', - title: 'Test file', - channels: 'C1234', - }; - // 1 entry at the top level + 4 jobs from files in files_uploads - const res = await client.getAllFileUploads(entryWithFileUploadsAndSingleFile); - assert.equal(res.length, 5); - }); - it('handles multiple files with a single channel_id, initial_comment and/or thread_ts', async () => { - const validPattern = { - initial_comment: 'Here are the files!', - thread_ts: '1223313423434.131321', - channel_id: 'C123', - file_uploads: [ - { - file: './test/fixtures/test-txt.txt', - filename: 'test-txt.txt', - }, - { - file: './test/fixtures/test-png.png', - filename: 'test-png.png', - }, - ], - }; - const invalidPattern = { - file_uploads: [ - { - file: './test/fixtures/test-txt.txt', - filename: 'test-txt.txt', - initial_comment: 'Here are the files!', - thread_ts: '1223313423434.131321', - channel_id: 'C123', - }, - { - file: './test/fixtures/test-png.png', - filename: 'test-png.png', - initial_comment: 'Here are the files!', - thread_ts: '1223313423434.131321', - channel_id: 'C123', - }, - ], - }; - // in this case the two file uploads should be sent along with a single - // message corresponding to initial_comment - const res = await client.getAllFileUploads(validPattern); - res.forEach((entry) => { - assert.equal(entry.initial_comment, validPattern.initial_comment); - assert.equal(entry.thread_ts, validPattern.thread_ts); - assert.equal(entry.channel_id, validPattern.channel_id); - }); - - // in this case, there should be an error - try { - const res2 = await client.getAllFileUploads(invalidPattern); - assert.fail('Should have thrown an error for invalid arguments but didnt'); - } catch (error) { - assert.equal(error.message, buildInvalidFilesUploadParamError()); - } - }); - }); - - describe('fetchAllUploadURLExternal', () => { - let client; - beforeEach(() => { - client = new WebClient(token); - }); - afterEach(() => { - client = null; - }); - it('makes calls to files.getUploadURLExternal for each fileUpload', async () => { - const testFileUploads = [{ - channel_id: 'C1234', - filename: 'test-txt.txt', - initial_comment: 'Doo ba doo here is the: test-txt.txt', - title: 'Spaghetti test-txt.txt', - data: Buffer.from('Here is a txt file'), - length: 18, - }]; - - var spy = sinon.spy(); - client.files.getUploadURLExternal = spy; - await client.fetchAllUploadURLExternal(testFileUploads); - assert.isTrue(spy.calledOnce); - }); - it('honours overriden token provided as an argument', async () => { - const tokenOverride = 'overriden-token'; - const testFileUploads = [{ - channel_id: 'C1234', - filename: 'test-txt.txt', - initial_comment: 'Doo ba doo here is the: test-txt.txt', - title: 'Spaghetti test-txt.txt', - data: Buffer.from('Here is a txt file'), - length: 18, - token: tokenOverride, - }]; - - var spy = sinon.spy(); - client.files.getUploadURLExternal = spy; - await client.fetchAllUploadURLExternal(testFileUploads); - assert.isTrue(spy.calledWith(sinon.match({ token: tokenOverride })), 'token override not passed through to underlying `files.getUploadURLExternal` API method'); - }); - }); - - describe('completeFileUploads', () => { - let client; - beforeEach(() => { - client = new WebClient(token); - }); - afterEach(() => { - client = null; - }); - it('rejects with an error when missing required file id', async () => { - const invalidTestFileUploadsToComplete = [{ - channel_id: 'C1234', - // missing file_id field - filename: 'test-txt.txt', - initial_comment: 'Doo ba doo here is the: test-txt.txt', - title: 'Spaghetti test-txt.txt', - }]; - - // should reject because of missing file_id - try { - const res = await client.completeFileUploads(invalidTestFileUploadsToComplete); - assert.fail('Should have errored but did not'); - } catch (err) { - assert.equal(err.message, 'Missing required file id for file upload completion'); - } - - }); - it('makes calls to files.completeUploadExternal for each fileUpload', async () => { - const testFileUploadsToComplete = [{ - channel_id: 'C1234', - file_id: 'test', - filename: 'test-txt.txt', - initial_comment: 'Doo ba doo here is the: test-txt.txt', - title: 'Spaghetti test-txt.txt', - }]; - - var spy = sinon.spy(); - client.files.completeUploadExternal = spy; - await client.completeFileUploads(testFileUploadsToComplete); - assert.isTrue(spy.calledOnce); - }); - it('honours overriden token provided as an argument', async () => { - const tokenOverride = 'overriden-token'; - const testFileUploadsToComplete = [{ - channel_id: 'C1234', - file_id: 'test', - filename: 'test-txt.txt', - initial_comment: 'Doo ba doo here is the: test-txt.txt', - title: 'Spaghetti test-txt.txt', - token: tokenOverride, - }]; - - var spy = sinon.spy(); - client.files.completeUploadExternal = spy; - await client.completeFileUploads(testFileUploadsToComplete); - assert.isTrue(spy.calledWith(sinon.match({ token: tokenOverride })), 'token override not passed through to underlying `files.completeUploadExternal` API method'); - }); - }); - - describe('postFileUploadsToExternalURL', () => { - const client = new WebClient(token); - - it('rejects with an error when missing required upload_url', async () => { - const invalidTestFileUploadsToComplete = [{ - channel_id: 'C1234', - // missing upload_url field - filename: 'test-txt.txt', - initial_comment: 'Doo ba doo here is the: test-txt.txt', - title: 'Spaghetti test-txt.txt', - }]; - - // should reject because of missing upload_url - try { - const res = await client.postFileUploadsToExternalURL(invalidTestFileUploadsToComplete); - assert.fail('Should have rejected with an error but did not'); - } catch (error) { - assert.equal(error.message.startsWith('No upload url found for file'), true); - } - }); - }); - - describe('getFileInfo', () => { - const client = new WebClient(token); - client.getAllFileUploads = sinon.spy(); - client.completeFileUploads = sinon.spy(); - client.fetchAllUploadURLExternal = sinon.spy(() => { - return []; - }); - client.postFileUploadsToExternalURL = sinon.spy(() => { - return [{ - files: [{ id: 'F123', title: 'test.txt'}], - }] - }); - - // since v7, the behavior has been changed - it('is not called when request_file_info is true or undefined', async () => { - client.getFileInfo = sinon.spy(); - // set initial files upload arguments with request_file_info true - const withRequestFileInfoTrue = { - file: Buffer.from('test'), - filename: 'test.txt', - request_file_info: true, - }; - await client.filesUploadV2(withRequestFileInfoTrue); - // since v7, the behavior has been changed - assert.equal(client.getFileInfo.called, false); - - const withRequestFileInfoOmitted = { - file: Buffer.from('test'), - filename: 'test.txt', - } - await client.filesUploadV2(withRequestFileInfoOmitted); - // since v7, the behavior has been changed - assert.equal(client.getFileInfo.calledTwice, false); - }); - it('is not called when request_file_info is set as false', async () => { - client.getFileInfo = sinon.spy(); - const withRequestFileInfoFalse = { - file: Buffer.from('test'), - filename: 'test.txt', - request_file_info: false, - }; - await client.filesUploadV2(withRequestFileInfoFalse); - assert.equal(client.getFileInfo.called, false); - }); - }); - - describe('has an option to suppress request error from Axios', () => { - - beforeEach(function () { - this.scope = nock('https://slack.com') - .post(/api/) - .replyWithError('Request failed!!') - }) - - it('the \'original\' property is attached when the option, attachOriginalToWebAPIRequestError is absent', async () => { - const client = new WebClient(token, { - retryConfig: { retries: 0 }, - }); - - client.apiCall('conversations/list').catch((error) => { - expect(error).to.haveOwnProperty('original') - this.scope.done(); - done(); - }); - - }); - - it('the \'original\' property is attached when the option, attachOriginalToWebAPIRequestError is set to true', async () => { - const client = new WebClient(token, { - attachOriginalToWebAPIRequestError: true, - retryConfig: { retries: 0 }, - }); - - client.apiCall('conversations/list').catch((error) => { - expect(error).to.haveOwnProperty('original') - this.scope.done(); - done(); - }); - }); - - it('the \'original\' property is not attached when the option, attachOriginalToWebAPIRequestError is set to false', async () => { - const client = new WebClient(token, { - attachOriginalToWebAPIRequestError: false, - retryConfig: { retries: 0 }, - }); - - client.apiCall('conversations/list').catch((error) => { - expect(error).not.to.haveOwnProperty('original') - this.scope.done(); - done(); - }); - }); - }); - - afterEach(function () { - nock.cleanAll(); - }); -}); - -// Helpers -function parseUserAgentIntoMetadata(userAgent) { - // naive implementation, this might break on platforms whose names or version numbers have spaces or slashes in them, - // and that if app metadata keys or values have spaces or slashes in them. - const parts = userAgent.split(' '); - return parts.reduce((digest, part) => { - const [key, val] = part.split('/'); - digest[key] = val; - return digest; - }, {}); -} diff --git a/packages/web-api/src/WebClient.spec.ts b/packages/web-api/src/WebClient.spec.ts new file mode 100644 index 000000000..03a4165c1 --- /dev/null +++ b/packages/web-api/src/WebClient.spec.ts @@ -0,0 +1,1350 @@ +import fs from 'node:fs'; +import { assert, expect } from 'chai'; +import nock from 'nock'; +import sinon from 'sinon'; +import { type WebAPICallResult, WebClient, WebClientEvent, buildThreadTsWarningMessage } from './WebClient'; +import { ErrorCode, type WebAPIRequestError } from './errors'; +import { + buildGeneralFilesUploadWarning, + buildInvalidFilesUploadParamError, + buildLegacyMethodWarning, +} from './file-upload'; +import { addAppMetadata } from './instrument'; +import { LogLevel, type Logger } from './logger'; +import { rapidRetryPolicy } from './retry-policies'; + +const token = 'xoxb-faketoken'; + +describe('WebClient', () => { + const sandbox = sinon.createSandbox(); + let debugMock: sinon.SinonStub; + let logger: Logger; + let client: WebClient; + + beforeEach(() => { + debugMock = sandbox.stub(console, 'debug'); + logger = { + debug: sinon.spy(), + info: sinon.spy(), + warn: sinon.spy(), + error: sinon.spy(), + getLevel: sinon.spy(), + setLevel: sinon.spy(), + setName: sinon.spy(), + }; + }); + + afterEach(() => { + sandbox.restore(); + nock.cleanAll(); + }); + + describe('constructor()', () => { + it('should build a default client given a token', () => { + const client = new WebClient(token); + assert.instanceOf(client, WebClient); + assert.equal(client.token, token); + assert.equal(client.slackApiUrl, 'https://slack.com/api/'); + }); + + it('should build a client without a token', () => { + const client = new WebClient(); + assert.instanceOf(client, WebClient); + }); + }); + + describe('Methods superclass', () => { + it('should succeed when constructing WebClient', () => { + assert.doesNotThrow(() => { + new WebClient(); + }); + }); + + it('should succeed when constructing a class that extends WebClient', () => { + assert.doesNotThrow(() => { + class X extends WebClient {} + new X(); + }); + }); + }); + + describe('has an option to change the log output severity', () => { + it('outputs a debug log on initialization', () => { + new WebClient(token, { logLevel: LogLevel.DEBUG }); + const output = debugMock.getCalls()[0].args.join(' '); + assert.isNotEmpty(output); // should have at least 1 log line, but not asserting since that is an implementation detail + }); + }); + + describe('has a logger option', () => { + it('sends logs to a logger and not to stdout', () => { + new WebClient(token, { logLevel: LogLevel.DEBUG, logger }); + assert.isTrue((logger.debug as sinon.SinonStub).called); + assert.isEmpty(debugMock.getCalls()); + }); + it('never modifies the original logger', () => { + new WebClient(token, { logger }); + // Calling #setName of the given logger is destructive + assert.isFalse((logger.setName as sinon.SinonStub).called); + }); + }); + + describe('has an option to override the Axios timeout value', () => { + it('should log warning and throw error if timeout exceeded', async () => { + const timeoutOverride = 1; // ms, guaranteed failure + + const client = new WebClient(undefined, { + timeout: timeoutOverride, + retryConfig: { retries: 0 }, + logLevel: LogLevel.WARN, + logger, + }); + + try { + await client.apiCall('users.list'); + assert.fail('expected error to be thrown'); + } catch (e) { + // biome-ignore lint/suspicious/noExplicitAny: TODO: type this better, should be whatever error class web-api throws for timeouts + const error = e as any; + assert.isTrue((logger.warn as sinon.SinonStub).calledOnce, 'expected Logger to be called once'); + assert.equal(error.code, ErrorCode.RequestError); + assert.equal(error.original.config.timeout, timeoutOverride); + assert.equal(error.original.isAxiosError, true); + assert.instanceOf(error, Error); + } + }); + }); + + describe('apiCall()', () => { + beforeEach(() => { + client = new WebClient(token, { retryConfig: rapidRetryPolicy }); + }); + + describe('when making a successful call', () => { + let scope: nock.Scope; + beforeEach(() => { + scope = nock('https://slack.com') + .post(/api/) + .reply(200, { + ok: true, + response_metadata: { + warnings: ['testWarning1', 'testWarning2'], + messages: [ + '[ERROR] unsupported type: sections [json-pointer:/blocks/0/type]', + "[WARN] A Content-Type HTTP header was presented but did not declare a charset, such as a 'utf-8'", + ], + }, + }); + }); + + it('should return results in a Promise', async () => { + const result = await client.apiCall('method'); + assert(result.ok); + scope.done(); + }); + + it('should send warnings to logs from both response_metadata.warnings & response_metadata.messages', async () => { + const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); + await warnClient.apiCall('method'); + assert.isTrue((logger.warn as sinon.SinonStub).calledThrice); + }); + + it('should send response_metadata.messages errors to logs', async () => { + const errorClient = new WebClient(token, { logLevel: LogLevel.ERROR, logger }); + await errorClient.apiCall('method'); + assert.isTrue((logger.error as sinon.SinonStub).calledOnce); + }); + + type MethodArgs = { method: string; args: Record }; + const attachmentWarningTestPatterns: MethodArgs[] = [ + { method: 'chat.postMessage', args: { channel: 'C123', attachments: [{ blocks: [] }] } }, + { method: 'chat.postMessage', args: { channel: 'C123', attachments: [{ blocks: [], fallback: ' ' }] } }, + ]; + const textWarningTestPatterns: MethodArgs[] = [ + { method: 'chat.postEphemeral', args: { channel: 'C123', blocks: [] } }, + { method: 'chat.postMessage', args: { channel: 'C123', blocks: [] } }, + { method: 'chat.scheduleMessage', args: { channel: 'C123', post_at: '100000000', blocks: [] } }, + ]; + const warningTestPatterns = textWarningTestPatterns.concat(attachmentWarningTestPatterns); + + const attachPatterns = attachmentWarningTestPatterns.reduce((acc, { method, args }) => { + const attachmentPatterns = [{ fallback: 'fallback' }].map((attachmentOverrides) => { + const attachments = (args.attachments as Record[]).map((attachment) => { + return Object.assign({}, attachment, attachmentOverrides); + }); + return { method, args: Object.assign({}, args, { attachments }) }; + }); + + return acc.concat(attachmentPatterns); + }, [] as MethodArgs[]); + for (const { method, args } of attachPatterns) { + it(`should not send warning to logs when client executes ${method} without text but with attachment fallback argument`, async () => { + const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); + await warnClient.apiCall(method, args); + assert.equal((logger.warn as sinon.SinonStub).callCount, 3); + }); + } + + const warningPatterns = warningTestPatterns.reduce((acc, { method, args }) => { + const textPatterns = [{ text: 'text' }].map((v) => ({ method, args: Object.assign({}, v, args) })); + return acc.concat(textPatterns); + }, [] as MethodArgs[]); + for (const { method, args } of warningPatterns) { + it(`should not send warning to logs when client executes ${method} with text argument`, async () => { + const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); + await warnClient.apiCall(method, args); + assert.isTrue((logger.warn as sinon.SinonStub).calledThrice); + }); + } + + const textPatterns = textWarningTestPatterns.reduce((acc, { method, args }) => { + const textPatterns = [{ text: '' }, { text: null }, {}].map((v) => ({ + method, + args: Object.assign({}, v, args), + })); + return acc.concat(textPatterns); + }, [] as MethodArgs[]); + for (const { method, args } of textPatterns) { + it(`should send a text-argument-specific warning to logs when client executes ${method} without text argument(${args.text === '' ? 'empty' : args.text})`, async () => { + const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); + await warnClient.apiCall(method, args); + assert.equal((logger.warn as sinon.SinonStub).callCount, 4); + }); + } + + const attachWarnPatterns = attachmentWarningTestPatterns.reduce((acc, { method, args }) => { + const textPatterns = [{ text: '' }, { text: null }, {}].map((v) => ({ + method, + args: Object.assign({}, v, args), + })); + return acc.concat(textPatterns); + }, [] as MethodArgs[]); + for (const { method, args } of attachWarnPatterns) { + it(`should send both text and fallback-argument-specific warning to logs when client executes ${method} without text argument(${args.text === '' ? 'empty' : args.text}) nor without attachment-level fallback argument`, async () => { + const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); + await warnClient.apiCall(method, args); + assert.equal((logger.warn as sinon.SinonStub).callCount, 5); + }); + } + + const threadTsTestPatterns = [ + { method: 'chat.postEphemeral' }, + { method: 'chat.postMessage' }, + { method: 'chat.scheduleMessage' }, + { method: 'files.upload' }, + ]; + + const threadPatterns = threadTsTestPatterns.reduce((acc, { method }) => { + const threadTs = [{ thread_ts: 1503435956.000247, text: 'text' }].map((v) => ({ + method, + args: v, + })); + return acc.concat(threadTs); + }, [] as MethodArgs[]); + for (const { method, args } of threadPatterns) { + it(`should send warning to logs when thread_ts in ${method} arguments is a float`, async () => { + const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); + await warnClient.apiCall(method, args); + // assume no warning about thread_ts has been sent + let warnedAboutThreadTS = false; + + // for each of the calls made of this method's spy function + const spyCalls = (logger.warn as sinon.SinonStub).getCalls(); + for (const call of spyCalls) { + // determine whether it was called with the correct warning as arguments + if (call.args[0] === buildThreadTsWarningMessage(method)) { + warnedAboutThreadTS = true; + break; + } + } + if (!warnedAboutThreadTS) { + assert.fail(`Expected a warning when thread_ts in ${method} is a float but got none`); + } + }); + } + + const threadTsPatterns = threadTsTestPatterns.reduce((acc, { method }) => { + const threadTs = [{ thread_ts: '1503435956.000247', text: 'text' }].map((v) => ({ + method, + args: v, + })); + return acc.concat(threadTs); + }, [] as MethodArgs[]); + for (const { method, args } of threadTsPatterns) { + it(`should not send warning to logs when thread_ts in ${method} arguments is a string`, async () => { + const warnClient = new WebClient(token, { logLevel: LogLevel.WARN, logger }); + await warnClient.apiCall(method, args); + for (const call of (logger.warn as sinon.SinonStub).getCalls()) { + assert.notEqual(call.args[0], buildThreadTsWarningMessage(method)); + } + }); + } + + it('warns when user is accessing the files.upload (legacy) method', async () => { + const client = new WebClient(token, { logLevel: LogLevel.INFO, logger }); + await client.apiCall('files.upload', {}); + + // both must be true to pass this test + let warnedAboutLegacyFilesUpload = false; + let infoAboutRecommendedFilesUploadV2 = false; + + // check the warn spy for whether it was called with the correct warning + for (const call of (logger.warn as sinon.SinonStub).getCalls()) { + if (call.args[0] === buildLegacyMethodWarning('files.upload')) { + warnedAboutLegacyFilesUpload = true; + } + } + // check the info spy for whether it was called with the correct warning + for (const call of (logger.info as sinon.SinonStub).getCalls()) { + if (call.args[0] === buildGeneralFilesUploadWarning()) { + infoAboutRecommendedFilesUploadV2 = true; + } + } + if (!warnedAboutLegacyFilesUpload || !infoAboutRecommendedFilesUploadV2) { + assert.fail('Should have logged a warning and info when files.upload is used'); + } + }); + }); + + describe('with OAuth scopes in the response headers', () => { + it('should expose a scopes and acceptedScopes properties on the result', async () => { + const scope = nock('https://slack.com').post(/api/).reply( + 200, + { ok: true }, + { + 'X-OAuth-Scopes': 'files:read, chat:write:bot', + 'X-Accepted-OAuth-Scopes': 'files:read', + }, + ); + const result = await client.apiCall('method'); + assert.deepNestedInclude(result.response_metadata, { scopes: ['files:read', 'chat:write:bot'] }); + assert.deepNestedInclude(result.response_metadata, { acceptedScopes: ['files:read'] }); + scope.done(); + }); + }); + + describe('when called with bad options', () => { + it('should reject its Promise with TypeError', async () => { + const results = await Promise.allSettled([ + // @ts-expect-error: api client should be passed an object + client.apiCall('method', 4), + // @ts-expect-error: api client should be passed an object + client.apiCall('method', 'a string'), + // @ts-expect-error: api client should be passed an object + client.apiCall('method', false), + ]); + for (const result of results) { + if (result.status === 'fulfilled') { + assert.fail('unexpected fulfilled promise when using API client with invalid arguments'); + } else { + assert.instanceOf(result.reason, TypeError); + } + } + }); + }); + + describe('when an API call fails', () => { + it('should return a Promise which rejects on error', async () => { + const client = new WebClient(undefined, { retryConfig: { retries: 0 } }); + + const scope = nock('https://slack.com').post(/api/).reply(500); + + try { + await client.apiCall('method'); + assert.fail('expected error to be thrown'); + } catch (error) { + assert.instanceOf(error, Error); + scope.done(); + } + }); + }); + + it('should fail with WebAPIPlatformError when the API response has an error', async () => { + const scope = nock('https://slack.com').post(/api/).reply(200, { ok: false, error: 'bad error' }); + try { + await client.apiCall('method'); + assert.fail('expected thrown exception'); + } catch (error) { + assert.instanceOf(error, Error); + assert.nestedPropertyVal(error, 'code', ErrorCode.PlatformError); + assert.nestedPropertyVal(error, 'data.ok', false); + assert.nestedPropertyVal(error, 'data.error', 'bad error'); + scope.done(); + } + }); + + it('should fail with WebAPIHTTPError when the API response has an unexpected status', async () => { + const body = { foo: 'bar' }; + const scope = nock('https://slack.com').post(/api/).reply(500, body); + const client = new WebClient(token, { retryConfig: { retries: 0 } }); + try { + await client.apiCall('method'); + assert.fail('expected error to be thrown'); + } catch (error) { + assert.nestedPropertyVal(error, 'code', ErrorCode.HTTPError); + assert.nestedPropertyVal(error, 'statusCode', 500); + // TODO: type this closer to the actual error we throw + const e = error as Record; + assert.exists(e.headers); + assert.deepEqual(e.body, body); + assert.instanceOf(error, Error); + scope.done(); + } + }); + + it('should fail with WebAPIRequestError when the API request fails', async () => { + // One known request error is when the node encounters an ECONNREFUSED. In order to simulate this, rather than + // using nock, we send the request to a host:port that is not listening. + const client = new WebClient(token, { slackApiUrl: 'https://localhost:8999/api/', retryConfig: { retries: 0 } }); + try { + await client.apiCall('method'); + assert.fail('expected error to be thrown'); + } catch (error) { + assert.nestedPropertyVal(error, 'code', ErrorCode.RequestError); + assert.instanceOf(error, Error); + assert.instanceOf((error as WebAPIRequestError).original, Error); + } + }); + + it('should properly serialize simple API arguments', async () => { + const scope = nock('https://slack.com') + // NOTE: this could create false negatives if the serialization order changes (it shouldn't matter) + .post(/api/, 'team_id=T12345678&foo=stringval&bar=42&baz=false') + .reply(200, { ok: true }); + await client.apiCall('method', { foo: 'stringval', bar: 42, baz: false, team_id: 'T12345678' }); + scope.done(); + }); + + it('should properly serialize complex API arguments', async () => { + const scope = nock('https://slack.com') + // NOTE: this could create false negatives if the serialization order changes (it shouldn't matter) + .post( + /api/, + 'arraything=%5B%7B%22foo%22%3A%22stringval%22%2C%22bar%22%3A42%2C%22baz%22%3Afalse%2C%22zup%22%3A%5B%22one%22%2C%22two%22%2C%22three%22%5D%7D%5D&objectthing=%7B%22foo%22%3A7%2C%22hum%22%3Afalse%7D', + ) + .reply(200, { ok: true }); + await client.apiCall('method', { + // TODO: include things like quotes and emojis + arraything: [ + { + foo: 'stringval', + bar: 42, + baz: false, + zup: ['one', 'two', 'three'], + }, + ], + objectthing: { + foo: 7, + hum: false, + }, + }); + scope.done(); + }); + + it('should remove undefined or null values from simple API arguments', async () => { + const scope = nock('https://slack.com').post(/api/, 'something=else').reply(200, { ok: true }); + await client.apiCall('method', { + something_undefined: undefined, + something_null: null, + something: 'else', + }); + scope.done(); + }); + + describe('metadata in the user agent', () => { + it('should set the user agent to contain package metadata', async () => { + const scope = nock('https://slack.com', { + reqheaders: { + 'User-Agent': (value) => { + const metadata = parseUserAgentIntoMetadata(value); + // NOTE: this assert isn't that strong and doesn't say anything about the values. at this time, there + // isn't a good way to test this without dupicating the logic of the code under test. + assert.containsAllKeys(metadata, ['node', '@slack:web-api']); + // NOTE: there's an assumption that if there's any keys besides these left at all, its the platform part + metadata.node = undefined; + metadata['@slack:client'] = undefined; + assert.isNotEmpty(metadata); + return true; + }, + }, + }) + .post(/api/) + .reply(200, { ok: true }); + await client.apiCall('method'); + scope.done(); + }); + + it('should set the user agent to contain application metadata', async () => { + const [name, version] = ['appmedataname', 'appmetadataversion']; + addAppMetadata({ name, version }); + const scope = nock('https://slack.com', { + reqheaders: { + 'User-Agent': (value) => { + const metadata = parseUserAgentIntoMetadata(value); + assert.propertyVal(metadata, name, version); + return true; + }, + }, + }) + .post(/api/) + .reply(200, { ok: true }); + // NOTE: appMetaData is only evalued on client construction, so we cannot use the client already created + const client = new WebClient(token, { retryConfig: rapidRetryPolicy }); + await client.apiCall('method'); + scope.done(); + }); + }); + + describe('with string response body for some reason', () => { + it('should try to parse the body', async () => { + const scope = nock('https://slack.com') + .post(/api/) + .reply(200, '{ "ok": true, "response_metadata": { "foo": "bar" } }', { + 'X-OAuth-Scopes': 'files:read, chat:write:bot', + 'X-Accepted-OAuth-Scopes': 'files:read', + }); + const result = await client.apiCall('method'); + assert.deepNestedInclude(result.response_metadata, { scopes: ['files:read', 'chat:write:bot'] }); + assert.deepNestedInclude(result.response_metadata, { acceptedScopes: ['files:read'] }); + assert.deepNestedInclude(result.response_metadata, { foo: 'bar' }); + scope.done(); + }); + it('should work even if the body is not a JSON data', async () => { + const scope = nock('https://slack.com').post(/api/).reply(200, 'something wrong!', { + 'X-OAuth-Scopes': 'files:read, chat:write:bot', + 'X-Accepted-OAuth-Scopes': 'files:read', + }); + try { + await client.apiCall('method'); + assert.fail('expected error to be thrown'); + } catch (err) { + assert.equal((err as Error).message, 'An API error occurred: something wrong!'); + scope.done(); + } + }); + }); + }); + + describe('apiCall() - without a token', () => { + it('should make successful api calls', async () => { + const client = new WebClient(undefined, { retryConfig: rapidRetryPolicy }); + + const scope = nock('https://slack.com') + // NOTE: this could create false negatives if the serialization order changes (it shouldn't matter) + .post(/api/, 'foo=stringval') + .reply(200, { ok: true }); + + await client.apiCall('method', { foo: 'stringval' }); + scope.done(); + }); + }); + + describe('apiCall() - when using static headers', () => { + it('should include static headers on api request', async () => { + const client = new WebClient(token, { headers: { 'X-XYZ': 'value' } }); + const scope = nock('https://slack.com', { + reqheaders: { + 'X-XYZ': 'value', + }, + }) + .post(/api/) + .reply(200, { ok: true }); + await client.apiCall('method'); + scope.done(); + }); + it('should override Authorization header if passed as an option to apiCall()', async () => { + const client = new WebClient(token, { headers: { 'X-XYZ': 'value' } }); + const scope = nock('https://slack.com', { + reqheaders: { + 'X-XYZ': 'value', + Authorization: 'Bearer xoxp-superfake', + }, + }) + .post(/api/) + .reply(200, { ok: true }); + await client.apiCall('method', { token: 'xoxp-superfake' }); + scope.done(); + }); + }); + + describe('named method aliases (facets)', () => { + beforeEach(() => { + client = new WebClient(token, { retryConfig: rapidRetryPolicy }); + }); + it('should properly mount methods as functions', async () => { + // This test doesn't exhaustively check all the method aliases, it just tries a couple. + // This should be enough since all methods are mounted in the exact same way. + const scope = nock('https://slack.com') + .post('/api/chat.postMessage', 'channel=c&text=t') + .reply(200, { ok: true }) + // Trying this method because its mounted one layer "deeper" + .post('/api/team.profile.get') + .reply(200, { ok: true }); + await Promise.all([client.chat.postMessage({ channel: 'c', text: 't' }), client.team.profile.get()]); + scope.done(); + }); + }); + + describe('paginate()', () => { + const method = 'conversations.list'; + beforeEach(() => { + client = new WebClient(token, { retryConfig: rapidRetryPolicy }); + }); + + describe('when not given shouldStop predicate', () => { + it('should return an AsyncIterator', () => { + const iterator = client.paginate(method); + assert.isOk(iterator[Symbol.asyncIterator]); + }); + it('can iterate multiple pages', async () => { + const scope = nock('https://slack.com') + .post(/api/) + .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR' } }) + .post(/api/, (body) => { + // NOTE: limit value is compared as a string because nock doesn't properly serialize the param into a number + return body.limit && body.limit === '200' && body.cursor && body.cursor === 'CURSOR'; + }) + .reply(200, { ok: true }); + const iterator = client.paginate(method); + + // @ts-expect-error TODO: the types do not line up here + const { value: firstPage, done: firstDone } = await iterator.next(); + assert.isOk(firstPage); + assert.isFalse(firstDone); + // @ts-expect-error TODO: the types do not line up here + const { value: secondPage, done: secondDone } = await iterator.next(); + assert.isOk(secondPage); + assert.isFalse(secondDone); + // @ts-expect-error TODO: the types do not line up here + const { value: thirdPage, done: thirdDone } = await iterator.next(); + assert.isNotOk(thirdPage); + assert.isTrue(thirdDone); + + scope.done(); + }); + it('can iterate multiple pages with limit items per page', async () => { + const limit = 4; + const scope = nock('https://slack.com') + .post(/api/, (body) => { + // NOTE: limit value is compared as a string because nock doesn't properly serialize the param into a number + return body.limit && body.limit === limit.toString(); + }) + .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR' } }) + .post(/api/, (body) => { + // NOTE: limit value is compared as a string because nock doesn't properly serialize the param into a number + return body.limit && body.limit === limit.toString() && body.cursor && body.cursor === 'CURSOR'; + }) + .reply(200, { ok: true }); + const iterator = client.paginate(method, { limit }); + + // @ts-expect-error TODO: the types do not line up here + const { value: firstPage, done: firstDone } = await iterator.next(); + assert.isOk(firstPage); + assert.isFalse(firstDone); + // @ts-expect-error TODO: the types do not line up here + const { value: secondPage, done: secondDone } = await iterator.next(); + assert.isOk(secondPage); + assert.isFalse(secondDone); + // @ts-expect-error TODO: the types do not line up here + const { value: thirdPage, done: thirdDone } = await iterator.next(); + assert.isNotOk(thirdPage); + assert.isTrue(thirdDone); + + scope.done(); + }); + it('can resume iteration from a result with an existing cursor', async () => { + const cursor = 'PRE_CURSOR'; + const scope = nock('https://slack.com') + .post(/api/, (body) => { + return body.cursor && body.cursor === cursor; + }) + .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR' } }) + .post(/api/, (body) => { + return body.cursor && body.cursor === 'CURSOR'; + }) + .reply(200, { ok: true }); + const iterator = client.paginate(method, { cursor }); + + // @ts-expect-error TODO: the types do not line up here + const { value: firstPage, done: firstDone } = await iterator.next(); + assert.isOk(firstPage); + assert.isFalse(firstDone); + // @ts-expect-error TODO: the types do not line up here + const { value: secondPage, done: secondDone } = await iterator.next(); + assert.isOk(secondPage); + assert.isFalse(secondDone); + // @ts-expect-error TODO: the types do not line up here + const { value: thirdPage, done: thirdDone } = await iterator.next(); + assert.isNotOk(thirdPage); + assert.isTrue(thirdDone); + + scope.done(); + }); + }); + + describe('when given shouldStop predicate', () => { + it('should iterate until the end when shouldStop always returns false', async () => { + const scope = nock('https://slack.com') + .post(/api/) + .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR' } }) + .post(/api/, (body) => { + // NOTE: limit value is compared as a string because nock doesn't properly serialize the param into a number + return body.limit && body.limit === '200' && body.cursor && body.cursor === 'CURSOR'; + }) + .reply(200, { ok: true }); + + const neverStop = sinon.fake.returns(false); + await client.paginate(method, {}, neverStop); + assert.equal(neverStop.callCount, 2); + + scope.done(); + }); + it('should only iterate once when shouldStop always returns true', async () => { + const scope = nock('https://slack.com') + .post(/api/) + .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR' } }); + + const neverStop = sinon.fake.returns(true); + await client.paginate(method, {}, neverStop); + assert.equal(neverStop.callCount, 1); + + scope.done(); + }); + it('should iterate twice when shouldStop always returns false then true', async () => { + const scope = nock('https://slack.com') + .post(/api/) + .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR_1' } }) + .post(/api/, (body) => { + return body.cursor && body.cursor === 'CURSOR_1'; + }) + .reply(200, { ok: true, response_metadata: { next_cursor: 'CURSOR_2' } }); + + const shouldStop = sinon.stub(); + shouldStop.onCall(0).returns(false); + shouldStop.onCall(1).returns(true); + await client.paginate(method, {}, shouldStop); + assert.equal(shouldStop.callCount, 2); + + scope.done(); + }); + + describe('when given a reduce function', () => { + it('should resolve for the accumulated value', async () => { + const scope = nock('https://slack.com') + .post(/api/) + .reply(200, { ok: true, v: 1, response_metadata: { next_cursor: 'CURSOR' } }) + .post(/api/, (body) => { + // NOTE: limit value is compared as a string because nock doesn't properly serialize the param into a number + return body.limit && body.limit === '200' && body.cursor && body.cursor === 'CURSOR'; + }) + .reply(200, { ok: true, v: 2 }); + + const sum = await client.paginate( + method, + {}, + () => false, + (acc, page) => { + const p = page as WebAPICallResult & { v: number }; + if (acc === undefined) { + // biome-ignore lint/style/noParameterAssign: TODO: dont reassign params + acc = 0; + } + if (p.v && typeof p.v === 'number') { + // biome-ignore lint/style/noParameterAssign: TODO: dont reassign params + acc += p.v; + } + return acc; + }, + ); + assert.equal(sum, 3); + + scope.done(); + }); + }); + }); + }); + + describe('has option to change slackApiUrl', () => { + it('should send requests to an alternative URL', async () => { + const alternativeUrl = 'http://12.34.56.78/api/'; + nock(alternativeUrl) + .post(/api\/method/) + .reply(200, { ok: true }); + const client = new WebClient(token, { slackApiUrl: alternativeUrl }); + await client.apiCall('method'); + }); + }); + + describe('has an option to set request concurrency', () => { + // TODO: factor out common logic into test helpers + const responseDelay = 100; // ms + let testStart: number; + let scope: nock.Scope; + + beforeEach(() => { + testStart = Date.now(); + scope = nock('https://slack.com') + .persist() + .post(/api/) + .delay(responseDelay) + .reply((_uri, _requestBody) => { + // NOTE: the assumption is that this function gets called right away when the request body is available, + // not after the delay + const diff = Date.now() - testStart; + return [200, JSON.stringify({ ok: true, diff })]; + }); + }); + + afterEach(() => { + scope.persist(false); + }); + + it('should have a default conncurrency of 100', async () => { + const client = new WebClient(token); + const requests = []; + for (let i = 0; i < 101; i++) { + requests.push(client.apiCall(`${i}`)); + } + const responses = (await Promise.all(requests)) as (WebAPICallResult & { diff: number })[]; + // verify all responses are present + assert.lengthOf(responses, 101); + + // verify that maxRequestConcurrency requests were all sent concurrently + const concurrentResponses = responses.slice(0, 100); // the first 100 responses + for (const r of concurrentResponses) { + assert.isBelow(r.diff, responseDelay); + } + + // verify that any requests after maxRequestConcurrency were delayed by the responseDelay + const queuedResponses = responses.slice(100); + const minDiff = concurrentResponses[concurrentResponses.length - 1].diff + responseDelay; + for (const r of queuedResponses) assert.isAtLeast(r.diff, minDiff); + }); + + it('should allow concurrency to be set', async () => { + const client = new WebClient(token, { maxRequestConcurrency: 1 }); + const requests = [client.apiCall('1'), client.apiCall('2')]; + const responses = (await Promise.all(requests)) as (WebAPICallResult & { diff: number })[]; + // verify all responses are present + assert.lengthOf(responses, 2); + + // verify that maxRequestConcurrency requets were all sent concurrently + const concurrentResponses = responses.slice(0, 1); // the first response + for (const r of concurrentResponses) assert.isBelow(r.diff, responseDelay); + + // verify that any requests after maxRequestConcurrency were delayed by the responseDelay + const queuedResponses = responses.slice(1); // the second response + const minDiff = concurrentResponses[concurrentResponses.length - 1].diff + responseDelay; + for (const r of queuedResponses) { + assert.isAtLeast(r.diff, minDiff); + } + }); + }); + + describe('has an option to set the retry policy ', () => { + it('retries a request which fails to get a response', async () => { + const scope = nock('https://slack.com') + .post(/api/) + .replyWithError('could be a ECONNREFUSED, ENOTFOUND, ETIMEDOUT, ECONNRESET') + .post(/api/) + .reply(200, { ok: true }); + const client = new WebClient(token, { retryConfig: rapidRetryPolicy }); + const resp = await client.apiCall('method'); + assert.propertyVal(resp, 'ok', true); + scope.done(); + }); + it('retries a request whose response has a status code that is not 200 nor 429 (rate limited)', async () => { + const scope = nock('https://slack.com').post(/api/).reply(500).post(/api/).reply(200, { ok: true }); + const client = new WebClient(token, { retryConfig: rapidRetryPolicy }); + const resp = await client.apiCall('method'); + assert.propertyVal(resp, 'ok', true); + scope.done(); + }); + }); + + describe('has rate limit handling', () => { + describe('when configured to reject rate-limited calls', () => { + beforeEach(() => { + client = new WebClient(token, { rejectRateLimitedCalls: true }); + }); + + it('should reject with a WebAPIRateLimitedError when a request fails due to rate-limiting', async () => { + const retryAfter = 5; + const scope = nock('https://slack.com') + .post(/api/) + .reply(429, '', { 'retry-after': String(retryAfter) }); + try { + await client.apiCall('method'); + assert.fail('expected error to be thrown'); + } catch (error) { + assert.propertyVal(error, 'code', ErrorCode.RateLimitedError); + assert.propertyVal(error, 'retryAfter', retryAfter); + assert.instanceOf(error, Error); + scope.done(); + } + }); + + it('should emit a rate_limited event on the client', async () => { + const spy = sinon.spy(); + const scope = nock('https://slack.com') + .post(/api/) + .reply(429, {}, { 'retry-after': String(0) }); + const client = new WebClient(token, { rejectRateLimitedCalls: true }); + client.on(WebClientEvent.RATE_LIMITED, spy); + try { + await client.apiCall('method', { foo: 'bar' }); + assert.fail('expected error to be thrown'); + } catch (_err) { + assert(spy.calledOnceWith(0, sinon.match({ url: 'method', body: { foo: 'bar' } }))); + scope.done(); + } + }); + }); + + it('should automatically retry the request after the specified timeout', async () => { + const retryAfter = 1; + const scope = nock('https://slack.com') + .post(/api/) + .reply(429, '', { 'retry-after': String(retryAfter) }) + .post(/api/) + .reply(200, { ok: true }); + const client = new WebClient(token, { retryConfig: rapidRetryPolicy }); + const startTime = Date.now(); + await client.apiCall('method'); + const diff = Date.now() - startTime; + assert.isAtLeast(diff, retryAfter * 1000, 'elapsed time is at least a second'); + scope.done(); + }); + + it('should include retryAfter metadata if the response has retry info', async () => { + const scope = nock('https://slack.com') + .post(/api/) + .reply(200, { ok: true }, { 'retry-after': String(100) }); + const client = new WebClient(token); + const data = await client.apiCall('method'); + assert(data.response_metadata?.retryAfter === 100); + scope.done(); + }); + + it('should pause the remaining requests in queue', async () => { + const startTime = Date.now(); + const retryAfter = 1; + const scope = nock('https://slack.com') + .post(/api/) + .reply(429, '', { 'retry-after': String(retryAfter) }) + .post(/api/) + .reply(200, (_uri, _requestBody) => JSON.stringify({ ok: true, diff: Date.now() - startTime })) + .post(/api/) + .reply(200, (_uri, _requestBody) => JSON.stringify({ ok: true, diff: Date.now() - startTime })); + const client = new WebClient(token, { retryConfig: rapidRetryPolicy, maxRequestConcurrency: 1 }); + const firstCall = client.apiCall('method'); + const secondCall = client.apiCall('method'); + const [firstResult, secondResult] = (await Promise.all([firstCall, secondCall])) as (WebAPICallResult & { + diff: number; + })[]; + assert.isAtLeast(firstResult.diff, retryAfter * 1000); + assert.isAtLeast(secondResult.diff, retryAfter * 1000); + scope.done(); + }); + + it('should emit a rate_limited event on the client', async () => { + const spy = sinon.spy(); + const scope = nock('https://slack.com') + .post(/api/) + .reply(429, {}, { 'retry-after': String(0) }); + const client = new WebClient(token, { retryConfig: { retries: 0 } }); + client.on(WebClientEvent.RATE_LIMITED, spy); + try { + await client.apiCall('method', { foo: 'bar' }); + assert.fail('expected error to be thrown'); + } catch (_err) { + assert(spy.calledOnceWith(0, sinon.match({ url: 'method', body: { foo: 'bar' } }))); + scope.done(); + } + }); + }); + + it('should throw an error if the response has no retry info', async () => { + // @ts-expect-error header values cannot be undefined + const scope = nock('https://slack.com').post(/api/).reply(429, {}, { 'retry-after': undefined }); + const client = new WebClient(token); + try { + await client.apiCall('method'); + assert.fail('expected error to be thrown'); + } catch (err) { + assert.instanceOf(err, Error); + scope.done(); + } + }); + + it('should throw an error if the response has an invalid retry-after header', async () => { + const scope = nock('https://slack.com').post(/api/).reply(429, {}, { 'retry-after': 'notanumber' }); + const client = new WebClient(token); + try { + await client.apiCall('method'); + assert.fail('expected error to be thrown'); + } catch (err) { + assert.instanceOf(err, Error); + assert.include(err.message, 'retry-after header: notanumber', 'Raw retry-after header value included in error'); + scope.done(); + } + }); + + describe('apps.event.authorizations.list API', () => { + it('should not send the token in the body if token is passed as a method argument', async () => { + const client = new WebClient(); + const scope = nock('https://slack.com') + .post(/api/) + .reply(200, (_uri, body) => { + assert.notInclude(body, token); + console.log('body is', body); + return { ok: true }; + }); + await client.apps.event.authorizations.list({ + token, + event_context: 'foo', + }); + scope.done(); + }); + it('should not send the token in the body if token passed as client constructor', async () => { + const client = new WebClient(token); + const scope = nock('https://slack.com') + .post(/api/) + .reply(200, (_uri, body) => { + assert.notInclude(body, token); + return { ok: true }; + }); + await client.apps.event.authorizations.list({ event_context: 'foo' }); + scope.done(); + }); + }); + + describe('getAllFileUploads', () => { + const client = new WebClient(token); + it('adds a single file data to uploads with content supplied', async () => { + const testWithContent = { + content: 'Happiness!', // test string + filename: 'happiness.txt', + title: 'Testing Happiness', + channels: 'C1234', + }; + + // returns exactly one file upload + // @ts-expect-error getAllFileUploads is a private method, TODO: refactor into own function/module that is more easily testable + const res = await client.getAllFileUploads(testWithContent); + assert.equal(res.length, 1); + }); + it('adds a single file data to uploads with file supplied', async () => { + const testWithFile = { + file: './test/fixtures/test-txt.txt', // test string + filename: 'test.txt', + title: 'Test file', + channels: 'C1234', + }; + + // @ts-expect-error getAllFileUploads is a private method, TODO: refactor into own function/module that is more easily testable + const res = await client.getAllFileUploads(testWithFile); + assert.equal(res.length, 1); + }); + it('adds multiple files data to an upload', async () => { + const files = ['txt', 'jpg', 'svg', 'png']; + const fileUploads = files.map((ext) => { + const filename = `test-${ext}.${ext}`; + return { + file: fs.createReadStream(`./test/fixtures/${filename}`), + filename, + }; + }); + const entryWithFileUploads = { + channel_id: 'C1234', + initial_comment: 'Here is a single comment wit many files attached', + title: 'Many files', + file_uploads: fileUploads, + }; + // 4 entries added + // @ts-expect-error getAllFileUploads is a private method, TODO: refactor into own function/module that is more easily testable + const res = await client.getAllFileUploads(entryWithFileUploads); + assert.equal(res.length, 4); + + // check the filename of each entry matches + files.forEach((ext, idx) => { + const filename = `test-${ext}.${ext}`; + assert.equal(res[idx].filename, filename); + }); + }); + it('adds single and multiple files data to uploads', async () => { + const files = ['txt', 'jpg', 'svg', 'png']; + const fileUploads = files.map((ext) => { + const filename = `test-${ext}.${ext}`; + return { + file: fs.createReadStream(`./test/fixtures/${filename}`), + filename, + }; + }); + const entryWithFileUploadsAndSingleFile = { + file_uploads: fileUploads, + file: './test/fixtures/test-txt.txt', // test string + filename: 'test.txt', + title: 'Test file', + channels: 'C1234', + }; + // 1 entry at the top level + 4 jobs from files in files_uploads + // @ts-expect-error getAllFileUploads is a private method, TODO: refactor into own function/module that is more easily testable + const res = await client.getAllFileUploads(entryWithFileUploadsAndSingleFile); + assert.equal(res.length, 5); + }); + it('handles multiple files with a single channel_id, initial_comment and/or thread_ts', async () => { + const validPattern = { + initial_comment: 'Here are the files!', + thread_ts: '1223313423434.131321', + channel_id: 'C123', + file_uploads: [ + { + file: './test/fixtures/test-txt.txt', + filename: 'test-txt.txt', + }, + { + file: './test/fixtures/test-png.png', + filename: 'test-png.png', + }, + ], + }; + const invalidPattern = { + file_uploads: [ + { + file: './test/fixtures/test-txt.txt', + filename: 'test-txt.txt', + initial_comment: 'Here are the files!', + thread_ts: '1223313423434.131321', + channel_id: 'C123', + }, + { + file: './test/fixtures/test-png.png', + filename: 'test-png.png', + initial_comment: 'Here are the files!', + thread_ts: '1223313423434.131321', + channel_id: 'C123', + }, + ], + }; + // in this case the two file uploads should be sent along with a single + // message corresponding to initial_comment + // @ts-expect-error getAllFileUploads is a private method, TODO: refactor into own function/module that is more easily testable + const res = await client.getAllFileUploads(validPattern); + for (const entry of res) { + assert.equal(entry.initial_comment, validPattern.initial_comment); + assert.equal(entry.thread_ts, validPattern.thread_ts); + assert.equal(entry.channel_id, validPattern.channel_id); + } + + // in this case, there should be an error + try { + // @ts-expect-error getAllFileUploads is a private method, TODO: refactor into own function/module that is more easily testable + await client.getAllFileUploads(invalidPattern); + assert.fail('Should have thrown an error for invalid arguments but didnt'); + } catch (error) { + assert.equal((error as Error).message, buildInvalidFilesUploadParamError()); + } + }); + }); + + describe('fetchAllUploadURLExternal', () => { + beforeEach(() => { + client = new WebClient(token); + }); + it('makes calls to files.getUploadURLExternal for each fileUpload', async () => { + const testFileUploads = [ + { + channel_id: 'C1234', + filename: 'test-txt.txt', + initial_comment: 'Doo ba doo here is the: test-txt.txt', + title: 'Spaghetti test-txt.txt', + data: Buffer.from('Here is a txt file'), + length: 18, + }, + ]; + + const spy = sinon.spy(); + client.files.getUploadURLExternal = spy; + // @ts-expect-error fetchAllFileUploadURLExternal is a private method, TODO: refactor into own function/module that is more easily testable + await client.fetchAllUploadURLExternal(testFileUploads); + assert.isTrue(spy.calledOnce); + }); + it('honours overriden token provided as an argument', async () => { + const tokenOverride = 'overriden-token'; + const testFileUploads = [ + { + channel_id: 'C1234', + filename: 'test-txt.txt', + initial_comment: 'Doo ba doo here is the: test-txt.txt', + title: 'Spaghetti test-txt.txt', + data: Buffer.from('Here is a txt file'), + length: 18, + token: tokenOverride, + }, + ]; + + const spy = sinon.spy(); + client.files.getUploadURLExternal = spy; + // @ts-expect-error fetchAllFileUploadURLExternal is a private method, TODO: refactor into own function/module that is more easily testable + await client.fetchAllUploadURLExternal(testFileUploads); + assert.isTrue( + spy.calledWith(sinon.match({ token: tokenOverride })), + 'token override not passed through to underlying `files.getUploadURLExternal` API method', + ); + }); + }); + + describe('completeFileUploads', () => { + beforeEach(() => { + client = new WebClient(token); + }); + it('rejects with an error when missing required file id', async () => { + const invalidTestFileUploadsToComplete = [ + { + channel_id: 'C1234', + // missing file_id field + filename: 'test-txt.txt', + initial_comment: 'Doo ba doo here is the: test-txt.txt', + title: 'Spaghetti test-txt.txt', + }, + ]; + + // should reject because of missing file_id + try { + // @ts-expect-error completeFileUploads is a private method, TODO: refactor into own function/module that is more easily testable + await client.completeFileUploads(invalidTestFileUploadsToComplete); + assert.fail('Should have errored but did not'); + } catch (err) { + assert.equal((err as Error).message, 'Missing required file id for file upload completion'); + } + }); + it('makes calls to files.completeUploadExternal for each fileUpload', async () => { + const testFileUploadsToComplete = [ + { + channel_id: 'C1234', + file_id: 'test', + filename: 'test-txt.txt', + initial_comment: 'Doo ba doo here is the: test-txt.txt', + title: 'Spaghetti test-txt.txt', + }, + ]; + + const spy = sinon.spy(); + client.files.completeUploadExternal = spy; + // @ts-expect-error completeFileUploads is a private method, TODO: refactor into own function/module that is more easily testable + await client.completeFileUploads(testFileUploadsToComplete); + assert.isTrue(spy.calledOnce); + }); + it('honours overriden token provided as an argument', async () => { + const tokenOverride = 'overriden-token'; + const testFileUploadsToComplete = [ + { + channel_id: 'C1234', + file_id: 'test', + filename: 'test-txt.txt', + initial_comment: 'Doo ba doo here is the: test-txt.txt', + title: 'Spaghetti test-txt.txt', + token: tokenOverride, + }, + ]; + + const spy = sinon.spy(); + client.files.completeUploadExternal = spy; + // @ts-expect-error completeFileUploads is a private method, TODO: refactor into own function/module that is more easily testable + await client.completeFileUploads(testFileUploadsToComplete); + assert.isTrue( + spy.calledWith(sinon.match({ token: tokenOverride })), + 'token override not passed through to underlying `files.completeUploadExternal` API method', + ); + }); + }); + + describe('postFileUploadsToExternalURL', () => { + const client = new WebClient(token); + + it('rejects with an error when missing required upload_url', async () => { + const invalidTestFileUploadsToComplete = [ + { + channel_id: 'C1234', + // missing upload_url field + filename: 'test-txt.txt', + initial_comment: 'Doo ba doo here is the: test-txt.txt', + title: 'Spaghetti test-txt.txt', + }, + ]; + + // should reject because of missing upload_url + try { + // @ts-expect-error postFileUploadsToExternalURL is a private method, TODO: refactor into own function/module that is more easily testable + await client.postFileUploadsToExternalURL(invalidTestFileUploadsToComplete); + assert.fail('Should have rejected with an error but did not'); + } catch (error) { + assert.equal((error as Error).message.startsWith('No upload url found for file'), true); + } + }); + }); + + describe('has an option to suppress request error from Axios', () => { + let scope: nock.Scope; + beforeEach(() => { + scope = nock('https://slack.com').post(/api/).replyWithError('Request failed!!'); + }); + + it("the 'original' property is attached when the option, attachOriginalToWebAPIRequestError is absent", async () => { + const client = new WebClient(token, { + retryConfig: { retries: 0 }, + }); + + try { + await client.apiCall('conversations/list'); + } catch (error) { + expect(error).to.haveOwnProperty('original'); + scope.done(); + } + }); + + it("the 'original' property is attached when the option, attachOriginalToWebAPIRequestError is set to true", async () => { + const client = new WebClient(token, { + attachOriginalToWebAPIRequestError: true, + retryConfig: { retries: 0 }, + }); + + try { + await client.apiCall('conversations/list'); + } catch (error) { + expect(error).to.haveOwnProperty('original'); + scope.done(); + } + }); + + it("the 'original' property is not attached when the option, attachOriginalToWebAPIRequestError is set to false", async () => { + const client = new WebClient(token, { + attachOriginalToWebAPIRequestError: false, + retryConfig: { retries: 0 }, + }); + + try { + await client.apiCall('conversations/list'); + } catch (error) { + expect(error).not.to.haveOwnProperty('original'); + scope.done(); + } + }); + }); +}); + +// Helpers +function parseUserAgentIntoMetadata(userAgent: string) { + // naive implementation, this might break on platforms whose names or version numbers have spaces or slashes in them, + // and that if app metadata keys or values have spaces or slashes in them. + const parts = userAgent.split(' '); + return parts.reduce( + (digest, part) => { + const [key, val] = part.split('/'); + digest[key] = val; + return digest; + }, + {} as Record, + ); +} diff --git a/packages/web-api/src/WebClient.ts b/packages/web-api/src/WebClient.ts index 07a0d7609..7728f59c7 100644 --- a/packages/web-api/src/WebClient.ts +++ b/packages/web-api/src/WebClient.ts @@ -1,12 +1,12 @@ -import { Agent } from 'http'; -import { basename } from 'path'; -import { stringify as qsStringify } from 'querystring'; -import { Readable } from 'stream'; -import { SecureContextOptions } from 'tls'; -import { TextDecoder } from 'util'; -import zlib from 'zlib'; - -import axios, { AxiosHeaderValue, AxiosInstance, AxiosResponse } from 'axios'; +import type { Agent } from 'node:http'; +import { basename } from 'node:path'; +import { stringify as qsStringify } from 'node:querystring'; +import type { Readable } from 'node:stream'; +import type { SecureContextOptions } from 'node:tls'; +import { TextDecoder } from 'node:util'; +import zlib from 'node:zlib'; + +import axios, { type AxiosHeaderValue, type AxiosInstance, type AxiosResponse } from 'axios'; import FormData from 'form-data'; import isElectron from 'is-electron'; import isStream from 'is-stream'; @@ -27,10 +27,10 @@ import { } from './file-upload'; import delay from './helpers'; import { getUserAgent } from './instrument'; -import { LogLevel, Logger, getLogger } from './logger'; +import { LogLevel, type Logger, getLogger } from './logger'; import { Methods } from './methods'; -import { RetryOptions, tenRetriesInAboutThirtyMinutes } from './retry-policies'; -import { CursorPaginationEnabled } from './types/request/common'; +import { type RetryOptions, tenRetriesInAboutThirtyMinutes } from './retry-policies'; +import type { CursorPaginationEnabled } from './types/request/common'; import type { FileUploadV2Job, @@ -50,7 +50,19 @@ import type { * Helpers */ // Props on axios default headers object to ignore when retrieving full list of actual headers sent in any HTTP requests -const axiosHeaderPropsToIgnore = ['delete', 'common', 'get', 'put', 'head', 'post', 'link', 'patch', 'purge', 'unlink', 'options']; +const axiosHeaderPropsToIgnore = [ + 'delete', + 'common', + 'get', + 'put', + 'head', + 'post', + 'link', + 'patch', + 'purge', + 'unlink', + 'options', +]; const defaultFilename = 'Untitled'; const defaultPageSize = 200; const noopPageReducer: PageReducer = () => undefined; @@ -72,19 +84,18 @@ export interface WebClientOptions { headers?: Record; teamId?: string; /** - * Indicates whether to attach the original error to a Web API request error. - * When set to true, the original error object will be attached to the Web API request error. - * @type {boolean} - * @default true - */ - attachOriginalToWebAPIRequestError?: boolean, + * Indicates whether to attach the original error to a Web API request error. + * When set to true, the original error object will be attached to the Web API request error. + * @type {boolean} + * @default true + */ + attachOriginalToWebAPIRequestError?: boolean; } export type TLSOptions = Pick; export enum WebClientEvent { // TODO: safe to rename this to conform to PascalCase enum type naming convention? - // eslint-disable-next-line @typescript-eslint/naming-convention RATE_LIMITED = 'rate_limited', } @@ -105,17 +116,19 @@ export interface WebAPICallResult { } // NOTE: should there be an async predicate? -export interface PaginatePredicate { - (page: WebAPICallResult): boolean | undefined | void; -} +export type PaginatePredicate = (page: WebAPICallResult) => boolean | undefined | undefined; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export interface PageReducer { - (accumulator: A | undefined, page: WebAPICallResult, index: number): A; -} +// biome-ignore lint/suspicious/noExplicitAny: reduce accumulator can be anything +export type PageReducer = (accumulator: A | undefined, page: WebAPICallResult, index: number) => A; -export type PageAccumulator = - R extends (accumulator: (infer A) | undefined, page: WebAPICallResult, index: number) => infer A ? A : never; +export type PageAccumulator = R extends ( + accumulator: infer A | undefined, + page: WebAPICallResult, + index: number, + // biome-ignore lint/suspicious/noRedeclare: TODO: what is being redeclared here? +) => infer A + ? A + : never; /** * A client for Slack's Web API @@ -184,27 +197,29 @@ export class WebClient extends Methods { /** * @param token - An API token to authenticate/authorize with Slack (usually start with `xoxp`, `xoxb`) */ - public constructor(token?: string, { - slackApiUrl = 'https://slack.com/api/', - logger = undefined, - logLevel = undefined, - maxRequestConcurrency = 100, - retryConfig = tenRetriesInAboutThirtyMinutes, - agent = undefined, - tls = undefined, - timeout = 0, - rejectRateLimitedCalls = false, - headers = {}, - teamId = undefined, - attachOriginalToWebAPIRequestError = true, - }: WebClientOptions = {}) { + public constructor( + token?: string, + { + slackApiUrl = 'https://slack.com/api/', + logger = undefined, + logLevel = undefined, + maxRequestConcurrency = 100, + retryConfig = tenRetriesInAboutThirtyMinutes, + agent = undefined, + tls = undefined, + timeout = 0, + rejectRateLimitedCalls = false, + headers = {}, + teamId = undefined, + attachOriginalToWebAPIRequestError = true, + }: WebClientOptions = {}, + ) { super(); this.token = token; this.slackApiUrl = slackApiUrl; this.retryConfig = retryConfig; - // eslint-disable-next-line new-cap this.requestQueue = new pQueue({ concurrency: maxRequestConcurrency }); // NOTE: may want to filter the keys to only those acceptable for TLS options this.tlsConfig = tls !== undefined ? tls : {}; @@ -222,13 +237,11 @@ export class WebClient extends Methods { this.logger = getLogger(WebClient.loggerName, logLevel ?? LogLevel.INFO, logger); } - // eslint-disable-next-line no-param-reassign if (this.token && !headers.Authorization) headers.Authorization = `Bearer ${this.token}`; this.axios = axios.create({ timeout, baseURL: slackApiUrl, - // eslint-disable-next-line @typescript-eslint/naming-convention headers: isElectron() ? headers : { 'User-Agent': getUserAgent(), ...headers }, httpAgent: agent, httpsAgent: agent, @@ -242,7 +255,7 @@ export class WebClient extends Methods { proxy: false, }); // serializeApiCallOptions will always determine the appropriate content-type - delete this.axios.defaults.headers.post['Content-Type']; + this.axios.defaults.headers.post['Content-Type'] = undefined; this.logger.debug('initialized'); } @@ -264,17 +277,20 @@ 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); + // @ts-expect-error insufficient overlap between Record and FilesUploadV2Arguments + if (method === 'files.uploadV2') return this.filesUploadV2(options as FilesUploadV2Arguments); const headers: Record = {}; if (options.token) headers.Authorization = `Bearer ${options.token}`; - const response = await this.makeRequest(method, { - team_id: this.teamId, - ...options, - }, headers); + const response = await this.makeRequest( + method, + { + team_id: this.teamId, + ...options, + }, + headers, + ); const result = await this.buildResult(response); this.logger.debug(`http request result: ${JSON.stringify(result)}`); @@ -286,7 +302,7 @@ export class WebClient extends Methods { // log warnings and errors in response metadata messages // related to https://api.slack.com/changelog/2016-09-28-response-metadata-is-on-the-way if (result.response_metadata !== undefined && result.response_metadata.messages !== undefined) { - result.response_metadata.messages.forEach((msg) => { + for (const msg of result.response_metadata.messages) { const errReg: RegExp = /\[ERROR\](.*)/; const warnReg: RegExp = /\[WARN\](.*)/; if (errReg.test(msg)) { @@ -300,16 +316,17 @@ export class WebClient extends Methods { this.logger.warn(warnMatch[1].trim()); } } - }); + } } // If result's content is gzip, "ok" property is not returned with successful response // TODO: look into simplifying this code block to only check for the second condition // if an { ok: false } body applies for all API errors - if (!result.ok && (response.headers['content-type'] !== 'application/gzip')) { - throw platformErrorFromResult(result as (WebAPICallResult & { error: string; })); - } else if ('ok' in result && result.ok === false) { - throw platformErrorFromResult(result as (WebAPICallResult & { error: string; })); + if (!result.ok && response.headers['content-type'] !== 'application/gzip') { + throw platformErrorFromResult(result as WebAPICallResult & { error: string }); + } + if ('ok' in result && result.ok === false) { + throw platformErrorFromResult(result as WebAPICallResult & { error: string }); } this.logger.debug(`apiCall('${method}') end`); return result; @@ -335,11 +352,7 @@ export class WebClient extends Methods { * @param reduce - a callback that can be used to accumulate a value that the return promise is resolved to */ public paginate(method: string, options?: Record): AsyncIterable; - public paginate( - method: string, - options: Record, - shouldStop: PaginatePredicate, - ): Promise; + public paginate(method: string, options: Record, shouldStop: PaginatePredicate): Promise; public paginate>( method: string, options: Record, @@ -351,12 +364,11 @@ export class WebClient extends Methods { options?: Record, shouldStop?: PaginatePredicate, reduce?: PageReducer, - ): (Promise | AsyncIterable) { + ): Promise | AsyncIterable { const pageSize = (() => { if (options !== undefined && typeof options.limit === 'number') { const { limit } = options; - // eslint-disable-next-line no-param-reassign - delete options.limit; + options.limit = undefined; return limit; } return defaultPageSize; @@ -376,7 +388,6 @@ export class WebClient extends Methods { // NOTE: test for the situation where you're resuming a pagination using and existing cursor while (result === undefined || paginationOptions !== undefined) { - // eslint-disable-next-line no-await-in-loop result = await this.apiCall(method, Object.assign(options !== undefined ? options : {}, paginationOptions)); yield result; paginationOptions = paginationOptionsForNextPage(result, pageSize); @@ -387,7 +398,7 @@ export class WebClient extends Methods { return generatePages.call(this); } - const pageReducer: PageReducer = (reduce !== undefined) ? reduce : noopPageReducer; + const pageReducer: PageReducer = reduce !== undefined ? reduce : noopPageReducer; let index = 0; return (async () => { @@ -408,7 +419,6 @@ export class WebClient extends Methods { } // Continue iteration - // eslint-disable-next-line no-restricted-syntax for await (const page of pageIterator) { accumulator = pageReducer(accumulator, page, index); if (shouldStop(page)) { @@ -433,9 +443,9 @@ export class WebClient extends Methods { * **#3**: Complete uploads {@link https://api.slack.com/methods/files.completeUploadExternal files.completeUploadExternal} * @param options */ - public async filesUploadV2(options: FilesUploadV2Arguments): Promise< - WebAPICallResult & { files: FilesCompleteUploadExternalResponse[] } - > { + public async filesUploadV2( + options: FilesUploadV2Arguments, + ): Promise { this.logger.debug('files.uploadV2() start'); // 1 const fileUploads = await this.getAllFileUploads(options); @@ -461,22 +471,24 @@ export class WebClient extends Methods { * which to send the file data to and an id for the file * @param fileUploads */ - private async fetchAllUploadURLExternal(fileUploads: FileUploadV2Job[]): - Promise> { - return Promise.all(fileUploads.map((upload: FileUploadV2Job) => { - /* eslint-disable @typescript-eslint/consistent-type-assertions */ - const options = { - filename: upload.filename, - length: upload.length, - alt_text: upload.alt_text, - snippet_type: upload.snippet_type, - } as FilesGetUploadURLExternalArguments; - if ('token' in upload) { - options.token = upload.token; - } + private async fetchAllUploadURLExternal( + fileUploads: FileUploadV2Job[], + ): Promise> { + return Promise.all( + fileUploads.map((upload: FileUploadV2Job) => { + const options = { + filename: upload.filename, + length: upload.length, + alt_text: upload.alt_text, + snippet_type: upload.snippet_type, + } as FilesGetUploadURLExternalArguments; + if ('token' in upload) { + options.token = upload.token; + } - return this.files.getUploadURLExternal(options); - })); + return this.files.getUploadURLExternal(options); + }), + ); } /** @@ -484,12 +496,9 @@ export class WebClient extends Methods { * @param fileUploads * @returns */ - private async completeFileUploads(fileUploads: FileUploadV2Job[]): - Promise> { + private async completeFileUploads(fileUploads: FileUploadV2Job[]): Promise { const toComplete: FilesCompleteUploadExternalArguments[] = Object.values(getAllFileUploadsToComplete(fileUploads)); - return Promise.all( - toComplete.map((job: FilesCompleteUploadExternalArguments) => this.files.completeUploadExternal(job)), - ); + return Promise.all(toComplete.map((job) => this.files.completeUploadExternal(job))); } /** @@ -497,29 +506,37 @@ export class WebClient extends Methods { * @param fileUploads * @returns */ - private async postFileUploadsToExternalURL(fileUploads: FileUploadV2Job[], options: FilesUploadV2Arguments) - : Promise> { - return Promise.all(fileUploads.map(async (upload: FileUploadV2Job) => { - const { upload_url, file_id, filename, data } = upload; - // either file or content will be defined - const body = data; - - // try to post to external url - if (upload_url) { - const headers: Record = {}; - if (options.token) headers.Authorization = `Bearer ${options.token}`; - - const uploadRes = await this.makeRequest(upload_url, { - body, - }, headers); - if (uploadRes.status !== 200) { - return Promise.reject(Error(`Failed to upload file (id:${file_id}, filename: ${filename})`)); + private async postFileUploadsToExternalURL( + fileUploads: FileUploadV2Job[], + options: FilesUploadV2Arguments, + ): Promise> { + return Promise.all( + fileUploads.map(async (upload: FileUploadV2Job) => { + const { upload_url, file_id, filename, data } = upload; + // either file or content will be defined + const body = data; + + // try to post to external url + if (upload_url) { + const headers: Record = {}; + if (options.token) headers.Authorization = `Bearer ${options.token}`; + + const uploadRes = await this.makeRequest( + upload_url, + { + body, + }, + 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); } - 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}`)); - })); + return Promise.reject(Error(`No upload url found for file (id: ${file_id}, filename: ${filename}`)); + }), + ); } /** @@ -550,91 +567,98 @@ export class WebClient extends Methods { headers: Record = {}, ): Promise { // TODO: better input types - remove any - const task = () => this.requestQueue.add(async () => { - const requestURL = (url.startsWith('https' || 'http')) ? url : `${this.axios.getUri() + url}`; - - try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const config: any = { - headers, - ...this.tlsConfig, - }; - // admin.analytics.getFile returns a binary response - // To be able to parse it, it should be read as an ArrayBuffer - if (url.endsWith('admin.analytics.getFile')) { - config.responseType = 'arraybuffer'; - } - // apps.event.authorizations.list will reject HTTP requests that send token in the body - // TODO: consider applying this change to all methods - though that will require thorough integration testing - if (url.endsWith('apps.event.authorizations.list')) { - // eslint-disable-next-line no-param-reassign - delete body.token; - } - this.logger.debug(`http request url: ${requestURL}`); - this.logger.debug(`http request body: ${JSON.stringify(redact(body))}`); - // compile all headers - some set by default under the hood by axios - that will be sent along - let allHeaders: Record = Object.keys(this.axios.defaults.headers) - .reduce((acc, cur) => { - if (!axiosHeaderPropsToIgnore.includes(cur)) { - acc[cur] = this.axios.defaults.headers[cur]; - } - return acc; - }, {} as Record); - - allHeaders = { - ...this.axios.defaults.headers.common, - ...allHeaders, - ...headers, - }; - this.logger.debug(`http request headers: ${JSON.stringify(redact(allHeaders))}`); - const response = await this.axios.post(url, body, config); - this.logger.debug('http response received'); - - if (response.status === 429) { - const retrySec = parseRetryHeaders(response); - if (retrySec !== undefined) { - this.emit(WebClientEvent.RATE_LIMITED, retrySec, { url, body }); - if (this.rejectRateLimitedCalls) { - throw new AbortError(rateLimitedErrorWithDelay(retrySec)); + const task = () => + this.requestQueue.add(async () => { + const requestURL = url.startsWith('https' || 'http') ? url : `${this.axios.getUri() + url}`; + + try { + // biome-ignore lint/suspicious/noExplicitAny: TODO: type this + const config: any = { + headers, + ...this.tlsConfig, + }; + // admin.analytics.getFile returns a binary response + // To be able to parse it, it should be read as an ArrayBuffer + if (url.endsWith('admin.analytics.getFile')) { + config.responseType = 'arraybuffer'; + } + // apps.event.authorizations.list will reject HTTP requests that send token in the body + // TODO: consider applying this change to all methods - though that will require thorough integration testing + if (url.endsWith('apps.event.authorizations.list')) { + body.token = undefined; + } + this.logger.debug(`http request url: ${requestURL}`); + this.logger.debug(`http request body: ${JSON.stringify(redact(body))}`); + // compile all headers - some set by default under the hood by axios - that will be sent along + let allHeaders: Record = Object.keys( + this.axios.defaults.headers, + ).reduce( + (acc, cur) => { + if (!axiosHeaderPropsToIgnore.includes(cur)) { + acc[cur] = this.axios.defaults.headers[cur]; + } + return acc; + }, + {} as Record, + ); + + allHeaders = { + ...this.axios.defaults.headers.common, + ...allHeaders, + ...headers, + }; + this.logger.debug(`http request headers: ${JSON.stringify(redact(allHeaders))}`); + const response = await this.axios.post(url, body, config); + this.logger.debug('http response received'); + + if (response.status === 429) { + const retrySec = parseRetryHeaders(response); + if (retrySec !== undefined) { + this.emit(WebClientEvent.RATE_LIMITED, retrySec, { url, body }); + if (this.rejectRateLimitedCalls) { + throw new AbortError(rateLimitedErrorWithDelay(retrySec)); + } + this.logger.info(`API Call failed due to rate limiting. Will retry in ${retrySec} seconds.`); + // pause the request queue and then delay the rejection by the amount of time in the retry header + this.requestQueue.pause(); + // NOTE: if there was a way to introspect the current RetryOperation and know what the next timeout + // would be, then we could subtract that time from the following delay, knowing that it the next + // attempt still wouldn't occur until after the rate-limit header has specified. an even better + // solution would be to subtract the time from only the timeout of this next attempt of the + // RetryOperation. this would result in the staying paused for the entire duration specified in the + // header, yet this operation not having to pay the timeout cost in addition to that. + await delay(retrySec * 1000); + // resume the request queue and throw a non-abort error to signal a retry + this.requestQueue.start(); + // TODO: We may want to have more detailed info such as team_id, params except tokens, and so on. + throw new Error(`A rate limit was exceeded (url: ${url}, retry-after: ${retrySec})`); } - this.logger.info(`API Call failed due to rate limiting. Will retry in ${retrySec} seconds.`); - // pause the request queue and then delay the rejection by the amount of time in the retry header - this.requestQueue.pause(); - // NOTE: if there was a way to introspect the current RetryOperation and know what the next timeout - // would be, then we could subtract that time from the following delay, knowing that it the next - // attempt still wouldn't occur until after the rate-limit header has specified. an even better - // solution would be to subtract the time from only the timeout of this next attempt of the - // RetryOperation. this would result in the staying paused for the entire duration specified in the - // header, yet this operation not having to pay the timeout cost in addition to that. - await delay(retrySec * 1000); - // resume the request queue and throw a non-abort error to signal a retry - this.requestQueue.start(); - // TODO: We may want to have more detailed info such as team_id, params except tokens, and so on. - throw new Error(`A rate limit was exceeded (url: ${url}, retry-after: ${retrySec})`); - } else { // TODO: turn this into some CodedError - throw new AbortError(new Error(`Retry header did not contain a valid timeout (url: ${url}, retry-after header: ${response.headers['retry-after']})`)); + throw new AbortError( + new Error( + `Retry header did not contain a valid timeout (url: ${url}, retry-after header: ${response.headers['retry-after']})`, + ), + ); } - } - // Slack's Web API doesn't use meaningful status codes besides 429 and 200 - if (response.status !== 200) { - throw httpErrorFromResponse(response); - } + // Slack's Web API doesn't use meaningful status codes besides 429 and 200 + if (response.status !== 200) { + throw httpErrorFromResponse(response); + } - return response; - } catch (error) { - // To make this compatible with tsd, casting here instead of `catch (error: any)` - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const e = error as any; - this.logger.warn('http request failed', e.message); - if (e.request) { - throw requestErrorWithOriginal(e, this.attachOriginalToWebAPIRequestError); + return response; + } catch (error) { + // To make this compatible with tsd, casting here instead of `catch (error: any)` + // biome-ignore lint/suspicious/noExplicitAny: errors can be anything + const e = error as any; + this.logger.warn('http request failed', e.message); + if (e.request) { + throw requestErrorWithOriginal(e, this.attachOriginalToWebAPIRequestError); + } + throw error; } - throw error; - } - }); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + }); + // biome-ignore lint/suspicious/noExplicitAny: http responses can be anything return pRetry(task, this.retryConfig) as Promise>; } @@ -646,12 +670,14 @@ 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 */ - private serializeApiCallOptions(options: Record, headers?: Record): 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; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + let containsBinaryData = false; + // biome-ignore lint/suspicious/noExplicitAny: call options can be anything const flattened = Object.entries(options).map<[string, any] | []>(([key, value]) => { if (value === undefined || value === null) { return []; @@ -673,58 +699,52 @@ export class WebClient extends Methods { // A body with binary content should be serialized as multipart/form-data if (containsBinaryData) { this.logger.debug('Request arguments contain binary data'); - const form = flattened.reduce( - (frm, [key, value]) => { - if (Buffer.isBuffer(value) || isStream(value)) { - const opts: FormData.AppendOptions = {}; - opts.filename = (() => { - // attempt to find filename from `value`. adapted from: - // https://github.com/form-data/form-data/blob/028c21e0f93c5fefa46a7bbf1ba753e4f627ab7a/lib/form_data.js#L227-L230 - // formidable and the browser add a name property - // fs- and request- streams have path property - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const streamOrBuffer: any = (value as any); - if (typeof streamOrBuffer.name === 'string') { - return basename(streamOrBuffer.name); - } - if (typeof streamOrBuffer.path === 'string') { - return basename(streamOrBuffer.path); - } - return defaultFilename; - })(); - frm.append(key as string, value, opts); - } else if (key !== undefined && value !== undefined) { - frm.append(key, value); - } - return frm; - }, - new FormData(), - ); + const form = flattened.reduce((frm, [key, value]) => { + if (Buffer.isBuffer(value) || isStream(value)) { + const opts: FormData.AppendOptions = {}; + opts.filename = (() => { + // attempt to find filename from `value`. adapted from: + // https://github.com/form-data/form-data/blob/028c21e0f93c5fefa46a7bbf1ba753e4f627ab7a/lib/form_data.js#L227-L230 + // formidable and the browser add a name property + // fs- and request- streams have path property + // biome-ignore lint/suspicious/noExplicitAny: form values can be anything + const streamOrBuffer: any = value as any; + if (typeof streamOrBuffer.name === 'string') { + return basename(streamOrBuffer.name); + } + if (typeof streamOrBuffer.path === 'string') { + return basename(streamOrBuffer.path); + } + return defaultFilename; + })(); + frm.append(key as string, value, opts); + } else if (key !== undefined && value !== undefined) { + frm.append(key, value); + } + return frm; + }, new FormData()); 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 + for (const [header, value] of Object.entries(form.getHeaders())) { headers[header] = value; - }); + } } return form; } // Otherwise, a simple key-value object is returned - // eslint-disable-next-line no-param-reassign 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( - (accumulator, [key, value]) => { + // biome-ignore lint/suspicious/noExplicitAny: form values can be anything + const initialValue: { [key: string]: any } = {}; + return qsStringify( + flattened.reduce((accumulator, [key, value]) => { if (key !== undefined && value !== undefined) { accumulator[key] = value; } return accumulator; - }, - initialValue, - )); + }, initialValue), + ); } /** @@ -732,7 +752,6 @@ export class WebClient extends Methods { * HTTP headers into the object. * @param response - an http response */ - // eslint-disable-next-line class-methods-use-this private async buildResult(response: AxiosResponse): Promise { let { data } = response; const isGzipResponse = response.headers['content-type'] === 'application/gzip'; @@ -748,19 +767,20 @@ export class WebClient extends Methods { } return resolve(buf.toString().split('\n')); }); - }).then((res) => res) + }) + .then((res) => res) .catch((err) => { throw err; }); - const fileData: Array = []; + const fileData: Array< + AdminAnalyticsMemberDetails | AdminAnalyticsPublicChannelDetails | AdminAnalyticsPublicChannelMetadataDetails + > = []; if (Array.isArray(unzippedData)) { - unzippedData.forEach((dataset) => { + for (const dataset of unzippedData) { if (dataset && dataset.length > 0) { fileData.push(JSON.parse(dataset)); } - }); + } } data = { file_data: fileData }; } catch (err) { @@ -791,7 +811,9 @@ export class WebClient extends Methods { data.response_metadata.scopes = (response.headers['x-oauth-scopes'] as string).trim().split(/\s*,\s*/); } if (response.headers['x-accepted-oauth-scopes'] !== undefined) { - data.response_metadata.acceptedScopes = (response.headers['x-accepted-oauth-scopes'] as string).trim().split(/\s*,\s*/); + data.response_metadata.acceptedScopes = (response.headers['x-accepted-oauth-scopes'] as string) + .trim() + .split(/\s*,\s*/); } // add retry metadata from headers @@ -835,7 +857,7 @@ function paginationOptionsForNextPage( */ function parseRetryHeaders(response: AxiosResponse): number | undefined { if (response.headers['retry-after'] !== undefined) { - const retryAfter = parseInt((response.headers['retry-after'] as string), 10); + const retryAfter = Number.parseInt(response.headers['retry-after'] as string, 10); if (!Number.isNaN(retryAfter)) { return retryAfter; @@ -874,19 +896,18 @@ function warnIfFallbackIsMissing(method: string, logger: Logger, options?: Recor const hasAttachments = (args: Record) => Array.isArray(args.attachments) && args.attachments.length; - const missingAttachmentFallbackDetected = (args: Record) => Array.isArray(args.attachments) && + const missingAttachmentFallbackDetected = (args: Record) => + Array.isArray(args.attachments) && args.attachments.some((attachment) => !attachment.fallback || attachment.fallback.trim() === ''); - const isEmptyText = (args: Record) => 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. ' + - 'The `text` is used in places where the content cannot be rendered such as: ' + - 'system push notifications, assistive technology such as screen readers, etc.'; + 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. The \`text\` is used in places where the content cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.`; - const buildMissingFallbackWarning = () => `Additionally, the attachment-level \`fallback\` argument is missing in the request payload for a ${method} call - ` + - 'To avoid this warning, it is recommended to always provide a top-level `text` argument when posting a message. ' + - 'Alternatively, you can provide an attachment-level `fallback` argument, though this is now considered a legacy field (see https://api.slack.com/reference/messaging/attachments#legacy_fields for more details).'; + const buildMissingFallbackWarning = () => + `Additionally, the attachment-level \`fallback\` argument is missing in the request payload for a ${method} call - To avoid this warning, it is recommended to always provide a top-level \`text\` argument when posting a message. Alternatively, you can provide an attachment-level \`fallback\` argument, though this is now considered a legacy field (see https://api.slack.com/reference/messaging/attachments#legacy_fields for more details).`; if (isTargetMethod && typeof options === 'object') { if (hasAttachments(options)) { if (missingAttachmentFallbackDetected(options) && isEmptyText(options)) { @@ -924,7 +945,7 @@ export function buildThreadTsWarningMessage(method: string): string { * @returns */ function redact(body: Record): Record { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: objects can be anything const flattened = Object.entries(body).map<[string, any] | []>(([key, value]) => { // no value provided if (value === undefined || value === null) { @@ -948,14 +969,11 @@ function redact(body: Record): Record { }); // return as object - const initialValue: { [key: string]: unknown; } = {}; - return flattened.reduce( - (accumulator, [key, value]) => { - if (key !== undefined && value !== undefined) { - accumulator[key] = value; - } - return accumulator; - }, - initialValue, - ); + const initialValue: { [key: string]: unknown } = {}; + return flattened.reduce((accumulator, [key, value]) => { + if (key !== undefined && value !== undefined) { + accumulator[key] = value; + } + return accumulator; + }, initialValue); } diff --git a/packages/web-api/src/errors.ts b/packages/web-api/src/errors.ts index 13213ee9e..c6698acf6 100644 --- a/packages/web-api/src/errors.ts +++ b/packages/web-api/src/errors.ts @@ -1,8 +1,8 @@ -import { IncomingHttpHeaders } from 'http'; +import type { IncomingHttpHeaders } from 'node:http'; -import { AxiosResponse } from 'axios'; +import type { AxiosResponse } from 'axios'; -import { WebAPICallResult } from './WebClient'; +import type { WebAPICallResult } from './WebClient'; /** * All errors produced by this package adhere to this interface @@ -33,7 +33,7 @@ export interface WebAPIFileUploadInvalidArgumentsError extends CodedError { code: ErrorCode.FileUploadInvalidArgumentsError; data: WebAPICallResult & { error: string; - } + }; } export interface WebAPIPlatformError extends CodedError { @@ -53,7 +53,7 @@ export interface WebAPIHTTPError extends CodedError { statusCode: number; statusMessage: string; headers: IncomingHttpHeaders; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: HTTP response bodies might be anything body?: any; } @@ -85,7 +85,7 @@ export function requestErrorWithOriginal(original: Error, attachOriginal: boolea if (attachOriginal) { error.original = original; } - return (error as WebAPIRequestError); + return error as WebAPIRequestError; } /** @@ -100,27 +100,27 @@ export function httpErrorFromResponse(response: AxiosResponse): WebAPIHTTPError error.statusCode = response.status; error.statusMessage = response.statusText; const nonNullHeaders: Record = {}; - Object.keys(response.headers).forEach((k) => { + for (const k of Object.keys(response.headers)) { if (k && response.headers[k]) { nonNullHeaders[k] = response.headers[k]; } - }); + } error.headers = nonNullHeaders; error.body = response.data; - return (error as WebAPIHTTPError); + return error as WebAPIHTTPError; } /** * A factory to create WebAPIPlatformError objects * @param result - Web API call result */ -export function platformErrorFromResult(result: WebAPICallResult & { error: string; }): WebAPIPlatformError { +export function platformErrorFromResult(result: WebAPICallResult & { error: string }): WebAPIPlatformError { const error = errorWithCode( new Error(`An API error occurred: ${result.error}`), ErrorCode.PlatformError, ) as Partial; error.data = result; - return (error as WebAPIPlatformError); + return error as WebAPIPlatformError; } /** @@ -133,5 +133,5 @@ export function rateLimitedErrorWithDelay(retrySec: number): WebAPIRateLimitedEr ErrorCode.RateLimitedError, ) as Partial; error.retryAfter = retrySec; - return (error as WebAPIRateLimitedError); + return error as WebAPIRateLimitedError; } diff --git a/packages/web-api/src/file-upload.spec.js b/packages/web-api/src/file-upload.spec.ts similarity index 70% rename from packages/web-api/src/file-upload.spec.js rename to packages/web-api/src/file-upload.spec.ts index 5be64e77a..10fe3275f 100644 --- a/packages/web-api/src/file-upload.spec.js +++ b/packages/web-api/src/file-upload.spec.ts @@ -1,24 +1,41 @@ -require('mocha'); -const { assert } = require('chai'); -const sinon = require('sinon'); -const { createReadStream, statSync, writeFileSync, unlinkSync } = require('fs'); -const { ErrorCode } = require('./errors'); -const { - getFileDataAsStream, - getFileDataLength, - getFileData, - getFileUploadJob, - getAllFileUploadsToComplete, - getMultipleFileUploadJobs, +import { createReadStream, statSync, unlinkSync, writeFileSync } from 'node:fs'; +import { assert } from 'chai'; +import sinon from 'sinon'; +import { ErrorCode } from './errors'; +import { + buildChannelsWarning, buildLegacyFileTypeWarning, buildMissingExtensionWarning, - buildMissingFileNameWarning, buildMissingFileIdError, - buildChannelsWarning, + buildMissingFileNameWarning, buildMultipleChannelsErrorMsg, -} = require('./file-upload'); + getAllFileUploadsToComplete, + getFileData, + getFileDataAsStream, + getFileDataLength, + getFileUploadJob, + getMultipleFileUploadJobs, +} from './file-upload'; +import type { Logger } from './logger'; +import type { FileUploadBinaryContents, FileUploadStringContents } from './types/request/files'; describe('file-upload', () => { + const sandbox = sinon.createSandbox(); + let logger: Logger; + beforeEach(() => { + logger = { + debug: sinon.spy(), + info: sinon.spy(), + warn: sinon.spy(), + error: sinon.spy(), + getLevel: sinon.spy(), + setLevel: sinon.spy(), + setName: sinon.spy(), + }; + }); + afterEach(() => { + sandbox.restore(); + }); describe('getFileUploadJob', () => { it('returns a fileUploadEntry', async () => { const valid = { @@ -28,7 +45,7 @@ describe('file-upload', () => { alt_text: 'an image of a thing', initial_comment: 'lorem ipsum', }; - const res = await getFileUploadJob(valid); + const res = await getFileUploadJob(valid, logger); // supplied values assert.equal(valid.initial_comment, res.initial_comment); assert.equal(valid.alt_text, res.alt_text); @@ -40,62 +57,50 @@ describe('file-upload', () => { assert.isDefined(res.length); }); it('warns if legacy filetype', async () => { - this.logger = { - warn: sinon.spy(), - }; const containsFileType = { filename: 'test.txt', file: Buffer.from('test'), filetype: 'txt', }; - await getFileUploadJob(containsFileType, this.logger); - assert.isTrue(this.logger.warn.calledOnceWith(buildLegacyFileTypeWarning())); + await getFileUploadJob(containsFileType, logger); + assert.isTrue((logger.warn as sinon.SinonSpy).calledOnceWith(buildLegacyFileTypeWarning())); }); it('warns when missing or invalid filename', async () => { - this.logger = { - warn: sinon.spy(), - }; const missingFileName = { file: Buffer.from('test'), }; - await getFileUploadJob(missingFileName, this.logger); - assert.isTrue(this.logger.warn.calledOnceWith(buildMissingFileNameWarning())); + await getFileUploadJob(missingFileName, logger); + assert.isTrue((logger.warn as sinon.SinonSpy).calledOnceWith(buildMissingFileNameWarning())); }); it('warns when possibly missing a file extension in filename supplied', async () => { - this.logger = { - warn: sinon.spy(), - }; const filename = 'should-have-extension'; const missingFileNameExtension = { file: Buffer.from('test'), filename, }; - await getFileUploadJob(missingFileNameExtension, this.logger); - assert.isTrue(this.logger.warn.calledOnceWith(buildMissingExtensionWarning(filename))); + await getFileUploadJob(missingFileNameExtension, logger); + assert.isTrue((logger.warn as sinon.SinonSpy).calledOnceWith(buildMissingExtensionWarning(filename))); }); it('warns when channels is supplied', async () => { - this.logger = { - warn: sinon.spy(), - }; const channelsSupplied = { file: Buffer.from('test'), filename: 'test', - channels: 'C1234' + channels: 'C1234', }; - await getFileUploadJob(channelsSupplied, this.logger); - assert.isTrue(this.logger.warn.calledWith(buildChannelsWarning())); + await getFileUploadJob(channelsSupplied, logger); + assert.isTrue((logger.warn as sinon.SinonSpy).calledWith(buildChannelsWarning())); }); it('errors when channels is supplied with csv value, aka multiple channels', async () => { const multipleChannelsSuppliedAsCsv = { file: Buffer.from('test'), filename: 'test', - channels: 'C1234,C5678' // multiple chnanel + channels: 'C1234,C5678', // multiple chnanel }; try { - await getFileUploadJob(multipleChannelsSuppliedAsCsv, this.logger); + await getFileUploadJob(multipleChannelsSuppliedAsCsv, logger); assert.fail('Should have errored out but didnt'); } catch (error) { - assert.equal(error.message, buildMultipleChannelsErrorMsg()); + assert.equal((error as Error).message, buildMultipleChannelsErrorMsg()); } }); }); @@ -118,10 +123,7 @@ describe('file-upload', () => { }, ], }; - this.logger = { - warn: sinon.spy(), - }; - const res = await getMultipleFileUploadJobs(valid, this.logger); + const res = await getMultipleFileUploadJobs(valid, logger); // supplied values assert.equal(valid.initial_comment, res[0].initial_comment); assert.equal(valid.initial_comment, res[1].initial_comment); @@ -131,10 +133,10 @@ describe('file-upload', () => { assert.equal(valid.channel_id, res[1].channel_id); assert.equal(valid.token, res[0].token); assert.equal(valid.token, res[1].token); - assert.equal(valid.file_uploads[0].file, res[0].file); + assert.equal(valid.file_uploads[0].file, (res[0] as FileUploadBinaryContents).file); assert.equal(valid.file_uploads[0].filename, res[0].filename); assert.equal(valid.file_uploads[0].alt_text, res[0].alt_text); - assert.equal(valid.file_uploads[1].content, res[1].content); + assert.equal(valid.file_uploads[1].content, (res[1] as FileUploadStringContents).content); assert.equal(valid.file_uploads[1].filename, res[1].filename); // calculated values @@ -149,63 +151,75 @@ describe('file-upload', () => { const invalidFileUpload = {}; // this call to getFileData should error try { + // @ts-expect-error passing invalid arguments const res = await getFileData(invalidFileUpload); // if we get here this test is failed - assert.fail(res, "an error", "Expected an error but got an output"); + assert.fail(res.toString(), 'an error', 'Expected an error but got an output'); } catch (err) { - assert.equal(err.message, 'Either a file or content field is required for valid file upload. You cannot supply both'); - assert.equal(err.code, ErrorCode.FileUploadInvalidArgumentsError); + assert.propertyVal( + err, + 'message', + 'Either a file or content field is required for valid file upload. You cannot supply both', + ); + assert.propertyVal(err, 'code', ErrorCode.FileUploadInvalidArgumentsError); } }); it('handles invalid input for file or content or when both supplied', async () => { // both content and file supplied - let invalidFileUpload = { + const invalidFileUpload = { file: 50, content: 50, - filename: 'Test File' + filename: 'Test File', }; try { + // @ts-expect-error passing invalid arguments const res = await getFileData(invalidFileUpload); - assert.fail(res, "an error", "Was expecting an error, but got a result"); + assert.fail(res.toString(), 'an error', 'Was expecting an error, but got a result'); } catch (err) { - assert.equal(err.message, 'Either a file or content field is required for valid file upload. You cannot supply both'); - assert.equal(err.code, ErrorCode.FileUploadInvalidArgumentsError); + assert.propertyVal( + err, + 'message', + 'Either a file or content field is required for valid file upload. You cannot supply both', + ); + assert.propertyVal(err, 'code', ErrorCode.FileUploadInvalidArgumentsError); } // file supplied invalid type of valid - invalidFileUpload = { + const invalidFileUpload2 = { file: 50, - filename: 'Test File' - } + filename: 'Test File', + }; try { - const res = await getFileData(invalidFileUpload); - assert.fail(res, "an error", "Was expecting an error, but got a result"); + // @ts-expect-error passing invalid arguments + const res = await getFileData(invalidFileUpload2); + assert.fail(res.toString(), 'an error', 'Was expecting an error, but got a result'); } catch (err) { - assert.equal(err.message, 'file must be a valid string path, buffer or Readable'); - assert.equal(err.code, ErrorCode.FileUploadInvalidArgumentsError); + assert.propertyVal(err, 'message', 'file must be a valid string path, buffer or Readable'); + assert.propertyVal(err, 'code', ErrorCode.FileUploadInvalidArgumentsError); } // content supplied invalid type of field - invalidFileUpload = { + const invalidFileUpload3 = { content: 50, - filename: 'Test File' - } + filename: 'Test File', + }; try { - const res = await getFileData(invalidFileUpload); - assert.fail(res, "an error", "Was expecting an error, but got a result"); + // @ts-expect-error passing invalid arguments + const res = await getFileData(invalidFileUpload3); + assert.fail(res.toString(), 'an error', 'Was expecting an error, but got a result'); } catch (err) { - assert.equal(err.message, 'content must be a string'); - assert.equal(err.code, ErrorCode.FileUploadInvalidArgumentsError); + assert.propertyVal(err, 'message', 'content must be a string'); + assert.propertyVal(err, 'code', ErrorCode.FileUploadInvalidArgumentsError); } }); it('handles file as buffer', async () => { const fileUpload = { file: Buffer.from('Hello'), - filename: 'It\'s me', + filename: "It's me", }; const res = await getFileData(fileUpload); res.forEach((int, idx) => { - assert.equal(int, fileUpload.file[idx]) + assert.equal(int, fileUpload.file[idx]); }); }); it('handles file as string when valid path', async () => { @@ -214,13 +228,9 @@ describe('file-upload', () => { filename: 'Test File', }; - try { - const res = await getFileData(fileUpload); - // should return a buffer - assert.equal(Buffer.isBuffer(res), true); - } catch (err) { - assert.fail(err, "no error"); - } + const res = await getFileData(fileUpload); + // should return a buffer + assert.equal(Buffer.isBuffer(res), true); }); it('handles file as string when invalid path', async () => { const fileUpload = { @@ -229,10 +239,14 @@ describe('file-upload', () => { }; try { const res = await getFileData(fileUpload); - assert.fail(res, "no error", "Expected no error, but got one"); + assert.fail(res.toString(), 'no error', 'Expected no error, but got one'); } catch (err) { - assert.equal(err.message, `Unable to resolve file data for ${fileUpload.file}. Please supply a filepath string, or binary data Buffer or String directly.`); - assert.equal(err.code, ErrorCode.FileUploadInvalidArgumentsError); + assert.propertyVal( + err, + 'message', + `Unable to resolve file data for ${fileUpload.file}. Please supply a filepath string, or binary data Buffer or String directly.`, + ); + assert.propertyVal(err, 'code', ErrorCode.FileUploadInvalidArgumentsError); } }); it('handles file as ReadStream', async () => { @@ -241,30 +255,22 @@ describe('file-upload', () => { filename: 'Test File', }; // should not error - try { - const res = await getFileData(fileUpload); - // should return file data from the stream - assert.equal(Buffer.isBuffer(res), true); - } catch (err) { - assert.fail(err, "no error", "Expected no error here, but got one"); - } - + const res = await getFileData(fileUpload); + // should return file data from the stream + assert.equal(Buffer.isBuffer(res), true); }); it('handles content as string', async () => { - let validFileUpload = { + const validFileUpload = { content: 'Happiness', - filename: 'Test File' + filename: 'Test File', }; - try { - const res = await getFileData(validFileUpload); - assert.equal(Buffer.isBuffer(res), true); - } catch (err) { - assert.fail(res, "a buffer file data", "Was expecting no error, but got one"); - } + const res = await getFileData(validFileUpload); + assert.equal(Buffer.isBuffer(res), true); }); }); describe('getFileDataLength', () => { it('errors when data is undefined', () => { + // @ts-expect-error calling method in a forbidden way assert.throws(() => getFileDataLength()); }); it('returns correct byte length', () => { @@ -274,29 +280,31 @@ describe('file-upload', () => { }); describe('getFileDataAsStream', () => { it('reads file data in from a stream', async () => { - const shouldNotThrow = async () => await getFileDataAsStream(await createReadStream('./test/fixtures/test-txt.txt')); + const shouldNotThrow = async () => await getFileDataAsStream(createReadStream('./test/fixtures/test-txt.txt')); assert.doesNotThrow(shouldNotThrow); }); it('errors if file is empty', async () => { try { - const res = await getFileDataAsStream(await createReadStream('./test/fixtures/test-txt-empty.txt')); + await getFileDataAsStream(createReadStream('./test/fixtures/test-txt-empty.txt')); + assert.fail('expected exception to be thrown but was not'); } catch (err) { - assert.equal(err.message, 'No data in supplied file'); + assert.propertyVal(err, 'message', 'No data in supplied file'); } }); it('ensures complete file is uploaded', async () => { try { // create a large file - let largeBuffer = Buffer.alloc(100000, '0123456789876543210\n'); + const largeBuffer = Buffer.alloc(100000, '0123456789876543210\n'); writeFileSync('./test/fixtures/test-txt-large.txt', largeBuffer); const res = await getFileDataAsStream(createReadStream('./test/fixtures/test-txt-large.txt')); // assert file size of the res is the same as the file size of the buffer - const expectedSize = statSync('./test/fixtures/test-txt-large.txt').size - const actualSize = Buffer.byteLength(res) + const expectedSize = statSync('./test/fixtures/test-txt-large.txt').size; + const actualSize = Buffer.byteLength(res); assert.equal(actualSize, expectedSize); - + } catch (e) { + assert.fail('exception thrown!', e); } finally { // cleanup large file unlinkSync('./test/fixtures/test-txt-large.txt'); @@ -314,8 +322,8 @@ describe('file-upload', () => { // same as below in fileUploadJob2 channel_id: '1', initial_comment: 'Hi', - thread_ts: '1.0' - } + thread_ts: '1.0', + }; const fileUploadJob2 = { file: Buffer.from('test'), filename: 'test.txt', @@ -324,15 +332,15 @@ describe('file-upload', () => { // same as above in fileUploadJob1 channel_id: '1', initial_comment: 'Hi', - thread_ts: '1.0' - } + thread_ts: '1.0', + }; const fileUploadJobs = [fileUploadJob1, fileUploadJob2]; const toComplete = getAllFileUploadsToComplete(fileUploadJobs); - // there should be one job to complete + // there should be one job to complete assert.equal(Object.keys(toComplete).length, 1); - // that job should contain two file uploads + // that job should contain two file uploads // we can verity this by checking files const job = Object.values(toComplete)[0]; assert.equal(job.files.length, 2); @@ -356,7 +364,7 @@ describe('file-upload', () => { thread_ts: '1.0', // different from fileUploadJob2 initial_comment: 'Hi', - } + }; const fileUploadJob2 = { file: Buffer.from('test'), filename: 'test.txt', @@ -367,11 +375,11 @@ describe('file-upload', () => { thread_ts: '1.0', // different from fileUploadJob1 initial_comment: 'Bye', - } + }; const fileUploadJobs = [fileUploadJob1, fileUploadJob2]; const toComplete = getAllFileUploadsToComplete(fileUploadJobs); - // there should be two jobs to complete + // there should be two jobs to complete assert.equal(Object.keys(toComplete).length, 2); // each job should contain one file upload @@ -383,7 +391,7 @@ describe('file-upload', () => { // checks that this upload matches the original fileUploadJobs entry assert.equal(fileUploadJobs[idx].file_id, job.files[0].id); assert.equal(fileUploadJobs[idx].title, job.files[0].title); - }) + }); }); it('should group uploads with non matching thread_ts separately regardless of whether initial_comments match', () => { const fileUploadJob1 = { @@ -396,7 +404,7 @@ describe('file-upload', () => { initial_comment: 'Hi', // different from fileUploadJob2 thread_ts: '1.0', - } + }; const fileUploadJob2 = { file: Buffer.from('test'), filename: 'test.txt', @@ -407,11 +415,11 @@ describe('file-upload', () => { initial_comment: 'Hi', // different from fileUploadJob1 thread_ts: '2.0', - } + }; const fileUploadJobs = [fileUploadJob1, fileUploadJob2]; const toComplete = getAllFileUploadsToComplete(fileUploadJobs); - // there should be two jobs to complete + // there should be two jobs to complete assert.equal(Object.keys(toComplete).length, 2); // each job should contain one file upload @@ -423,9 +431,9 @@ describe('file-upload', () => { // checks that this upload matches the original fileUploadJobs entry assert.equal(fileUploadJobs[idx].file_id, job.files[0].id); assert.equal(fileUploadJobs[idx].title, job.files[0].title); - }) + }); }); - }) + }); describe('when channel_id is different', () => { it('should not group uploads', () => { // even if all other details are the same, it should never group uploads if the channel_id doesn't match @@ -437,8 +445,8 @@ describe('file-upload', () => { initial_comment: 'Hi', thread_ts: '1.0', - channel_id: '1' - } + channel_id: '1', + }; const fileUploadJob2 = { file: Buffer.from('test'), filename: 'test.txt', @@ -447,17 +455,17 @@ describe('file-upload', () => { initial_comment: 'Hi', thread_ts: '1.0', - channel_id: 'Not 1' - } + channel_id: 'Not 1', + }; const fileUploadJobs = [fileUploadJob1, fileUploadJob2]; const toComplete = getAllFileUploadsToComplete(fileUploadJobs); - // there should be 2 jobs to complete + // there should be 2 jobs to complete assert.equal(Object.keys(toComplete).length, 2); }); }); it('should correctly group entries with matching channel_ids, non-matching channel_ids, missing, channel_id', () => { - // fileUploadJob1 and 2 should be grouped together in one job because their channel_id and initial comment match + // fileUploadJob1 and 2 should be grouped together in one job because their channel_id and initial comment match const fileUploadJob1 = { file: Buffer.from('test'), filename: 'test.txt', @@ -466,7 +474,7 @@ describe('file-upload', () => { channel_id: '1', initial_comment: 'Hi', - } + }; const fileUploadJob2 = { file: Buffer.from('test'), filename: 'test.txt', @@ -475,7 +483,7 @@ describe('file-upload', () => { channel_id: '1', initial_comment: 'Hi', - } + }; // should be it's own job even though the channel id matches because it's missing thread_ts and initial_comment const fileUploadJob3 = { file: Buffer.from('test'), @@ -484,7 +492,7 @@ describe('file-upload', () => { title: 'test3', channel_id: '1', - } + }; // should be it's own job, it's missing a channel id, so its private and cant be grouped in a message const fileUploadJob4 = { file: Buffer.from('test'), @@ -494,13 +502,14 @@ describe('file-upload', () => { thread_ts: '1.0', initial_comment: 'Bye', - } + }; const fileUploadJobs = [fileUploadJob1, fileUploadJob2, fileUploadJob3, fileUploadJob4]; + // @ts-expect-error TODO: unions of function parameters must apply to intersection of them, too const toComplete = getAllFileUploadsToComplete(fileUploadJobs); - // there should be 3 total jobs to complete + // there should be 3 total jobs to complete assert.equal(Object.keys(toComplete).length, 3); - }) + }); it('should error if a file_id is missing from any fileUpload entry', () => { const fileUploadJob1 = { file: Buffer.from('test'), @@ -508,16 +517,16 @@ describe('file-upload', () => { title: 'test1', initial_comment: 'Hi', thread_ts: '1.0', - channel_id: '1' - } + channel_id: '1', + }; const fileUploadJobs = [fileUploadJob1]; try { - const toComplete = getAllFileUploadsToComplete(fileUploadJobs); + getAllFileUploadsToComplete(fileUploadJobs); assert.fail('Should fail with error because of missing file_id but did not'); } catch (error) { - assert.equal(error.message, buildMissingFileIdError()); + assert.propertyVal(error, 'message', buildMissingFileIdError()); } - }) + }); it('should correctly group entries with no channel_ids', () => { const fileUploadJob1 = { file: Buffer.from('test'), @@ -525,20 +534,19 @@ describe('file-upload', () => { file_id: 'id1', title: 'test1', initial_comment: 'Hi', - } + }; const fileUploadJob2 = { file: Buffer.from('test'), filename: 'test.txt', file_id: 'id2', title: 'test2', initial_comment: 'Hi', - } + }; const fileUploadJobs = [fileUploadJob1, fileUploadJob2]; const toComplete = getAllFileUploadsToComplete(fileUploadJobs); - // there should be 1 total jobs to complete assert.equal(Object.keys(toComplete).length, 1); - }) + }); }); }); diff --git a/packages/web-api/src/file-upload.ts b/packages/web-api/src/file-upload.ts index 78e26f3fd..09ff422ee 100644 --- a/packages/web-api/src/file-upload.ts +++ b/packages/web-api/src/file-upload.ts @@ -1,10 +1,10 @@ -import { readFileSync } from 'fs'; -import { Readable } from 'stream'; +import { readFileSync } from 'node:fs'; +import { Readable } from 'node:stream'; -import { Logger } from '@slack/logger'; +import type { Logger } from '@slack/logger'; import { ErrorCode, errorWithCode } from './errors'; -import { +import type { FileUploadV2, FileUploadV2Job, FilesCompleteUploadExternalArguments, @@ -30,7 +30,7 @@ export async function getFileUploadJob( filename: options.filename ?? fileName, initial_comment: options.initial_comment, snippet_type: options.snippet_type, - title: options.title ?? (options.filename ?? fileName), // default title to filename unless otherwise specified + title: options.title ?? options.filename ?? fileName, // default title to filename unless otherwise specified // calculated data: fileData, length: fileDataBytesLength, @@ -83,55 +83,63 @@ export async function getFileUploadJob( * }); * ``` * @param options provided by user -*/ + */ export async function getMultipleFileUploadJobs( options: FilesUploadV2Arguments, logger: Logger, ): Promise { if ('file_uploads' in options) { // go through each file_upload and create a job for it - return Promise.all(options.file_uploads.map((upload) => { - // ensure no omitted properties included in files_upload entry - // these properties are valid only at the top-level, not - // inside file_uploads. - const { channel_id, channels, initial_comment, thread_ts } = upload as FileUploadV2; - if (channel_id || channels || initial_comment || thread_ts) { + return Promise.all( + options.file_uploads.map((upload) => { + // ensure no omitted properties included in files_upload entry + // these properties are valid only at the top-level, not + // inside file_uploads. + const { channel_id, channels, initial_comment, thread_ts } = upload as FileUploadV2; + if (channel_id || channels || initial_comment || thread_ts) { + throw errorWithCode( + new Error(buildInvalidFilesUploadParamError()), + ErrorCode.FileUploadInvalidArgumentsError, + ); + } + // takes any channel_id, initial_comment and thread_ts + // supplied at the top level. + const uploadJobArgs: Record = { + ...upload, + channels: options.channels, + channel_id: options.channel_id, + initial_comment: options.initial_comment, + }; + if ('thread_ts' in options) { + uploadJobArgs.thread_ts = options.thread_ts; + } + if ('token' in options) { + uploadJobArgs.token = options.token; + } + if ('content' in upload) { + return getFileUploadJob( + { + content: upload.content, + ...uploadJobArgs, + }, + logger, + ); + } + if ('file' in upload) { + return getFileUploadJob( + { + file: upload.file, + ...uploadJobArgs, + }, + logger, + ); + } throw errorWithCode( - new Error(buildInvalidFilesUploadParamError()), + new Error('Either a file or content field is required for valid file upload. You must supply one'), ErrorCode.FileUploadInvalidArgumentsError, ); - } - // takes any channel_id, initial_comment and thread_ts - // supplied at the top level. - const uploadJobArgs: Record = { - ...upload, - channels: options.channels, - channel_id: options.channel_id, - initial_comment: options.initial_comment, - }; - if ('thread_ts' in options) { - uploadJobArgs.thread_ts = options.thread_ts; - } - if ('token' in options) { - uploadJobArgs.token = options.token; - } - if ('content' in upload) { - return getFileUploadJob({ - content: upload.content, - ...uploadJobArgs, - }, logger); - } - if ('file' in upload) { - return getFileUploadJob({ - file: upload.file, - ...uploadJobArgs, - }, logger); - } - throw errorWithCode( - new Error('Either a file or content field is required for valid file upload. You must supply one'), - ErrorCode.FileUploadInvalidArgumentsError, - ); - })); + }), + ); } throw new Error(buildFilesUploadMissingMessage()); } @@ -159,7 +167,9 @@ export async function getFileData(options: FilesUploadV2Arguments | FileUploadV2 return dataBuffer; } catch (error) { throw errorWithCode( - new Error(`Unable to resolve file data for ${file}. Please supply a filepath string, or binary data Buffer or String directly.`), + new Error( + `Unable to resolve file data for ${file}. Please supply a filepath string, or binary data Buffer or String directly.`, + ), ErrorCode.FileUploadInvalidArgumentsError, ); } @@ -182,10 +192,7 @@ export function getFileDataLength(data: Buffer): number { if (data) { return Buffer.byteLength(data, 'utf8'); } - throw errorWithCode( - new Error(buildFileSizeErrorMsg()), - ErrorCode.FileUploadReadFileDataError, - ); + throw errorWithCode(new Error(buildFileSizeErrorMsg()), ErrorCode.FileUploadReadFileDataError); } export async function getFileDataAsStream(readable: Readable): Promise { @@ -194,7 +201,7 @@ export async function getFileDataAsStream(readable: Readable): Promise { return new Promise((resolve, reject) => { readable.on('readable', () => { let chunk: Buffer; - /* eslint-disable no-cond-assign */ + // biome-ignore lint/suspicious/noAssignInExpressions: being terse, this is OK while ((chunk = readable.read()) !== null) { chunks.push(chunk); } @@ -219,10 +226,11 @@ export async function getFileDataAsStream(readable: Readable): Promise { * @param fileUploads * @returns */ -export function getAllFileUploadsToComplete(fileUploads: FileUploadV2Job[]): -Record { +export function getAllFileUploadsToComplete( + fileUploads: FileUploadV2Job[], +): Record { const toComplete: Record = {}; - fileUploads.forEach((upload) => { + for (const upload of fileUploads) { const { channel_id, thread_ts, initial_comment, file_id, title } = upload; if (file_id) { const compareString = `:::${channel_id}:::${thread_ts}:::${initial_comment}`; @@ -247,7 +255,7 @@ Record { } else { throw new Error(buildMissingFileIdError()); } - }); + } return toComplete; } @@ -257,7 +265,7 @@ Record { * lower-level utilities. * @param method * @param logger -*/ + */ export function warnIfNotUsingFilesUploadV2(method: string, logger: Logger): void { const targetMethods = ['files.upload']; const isTargetMethod = targetMethods.includes(method); @@ -284,10 +292,7 @@ export function warnIfChannels(options: FilesUploadV2Arguments | FileUploadV2, l export function errorIfChannelsCsv(options: FilesUploadV2Arguments | FileUploadV2): void { const channels = options.channels ? options.channels.split(',') : []; if (channels.length > 1) { - throw errorWithCode( - new Error(buildMultipleChannelsErrorMsg()), - ErrorCode.FileUploadInvalidArgumentsError, - ); + throw errorWithCode(new Error(buildMultipleChannelsErrorMsg()), ErrorCode.FileUploadInvalidArgumentsError); } } @@ -305,10 +310,9 @@ export function errorIfInvalidOrMissingFileData(options: FilesUploadV2Arguments ErrorCode.FileUploadInvalidArgumentsError, ); } - /* eslint-disable @typescript-eslint/no-explicit-any */ if ('file' in options) { const { file } = options; - if (file && !(typeof file === 'string' || Buffer.isBuffer(file) || (file as any) instanceof Readable)) { + if (file && !(typeof file === 'string' || Buffer.isBuffer(file) || file instanceof Readable)) { throw errorWithCode( new Error('file must be a valid string path, buffer or Readable'), ErrorCode.FileUploadInvalidArgumentsError, @@ -316,10 +320,7 @@ export function errorIfInvalidOrMissingFileData(options: FilesUploadV2Arguments } } if ('content' in options && options.content && typeof options.content !== 'string') { - throw errorWithCode( - new Error('content must be a string'), - ErrorCode.FileUploadInvalidArgumentsError, - ); + throw errorWithCode(new Error('content must be a string'), ErrorCode.FileUploadInvalidArgumentsError); } } @@ -369,15 +370,19 @@ export function buildFileSizeErrorMsg(): string { } export function buildLegacyFileTypeWarning(): string { - return 'filetype is no longer a supported field in files.uploadV2.' + + return ( + 'filetype is no longer a supported field in files.uploadV2.' + ' \nPlease remove this field. To indicate file type, please do so via the required filename property' + - ' using the appropriate file extension, e.g. image.png, text.txt'; + ' using the appropriate file extension, e.g. image.png, text.txt' + ); } export function buildMissingFileNameWarning(): string { - return 'filename is a required field for files.uploadV2. \n For backwards compatibility and ease of migration, ' + + return ( + 'filename is a required field for files.uploadV2. \n For backwards compatibility and ease of migration, ' + 'defaulting the filename. For best experience and consistent unfurl behavior, you' + - ' should set the filename property with correct file extension, e.g. image.png, text.txt'; + ' should set the filename property with correct file extension, e.g. image.png, text.txt' + ); } export function buildMissingExtensionWarning(filename: string): string { @@ -389,8 +394,10 @@ export function buildLegacyMethodWarning(method: string): string { } export function buildGeneralFilesUploadWarning(): string { - return 'Our latest recommendation is to use client.files.uploadV2() method, ' + - 'which is mostly compatible and much stabler, instead.'; + return ( + 'Our latest recommendation is to use client.files.uploadV2() method, ' + + 'which is mostly compatible and much stabler, instead.' + ); } export function buildFilesUploadMissingMessage(): string { @@ -398,8 +405,10 @@ export function buildFilesUploadMissingMessage(): string { } export function buildChannelsWarning(): string { - return 'Although the \'channels\' parameter is still supported for smoother migration from legacy files.upload, ' + - 'we recommend using the new channel_id parameter with a single str value instead (e.g. \'C12345\').'; + return ( + "Although the 'channels' parameter is still supported for smoother migration from legacy files.upload, " + + "we recommend using the new channel_id parameter with a single str value instead (e.g. 'C12345')." + ); } export function buildMultipleChannelsErrorMsg(): string { @@ -407,6 +416,8 @@ export function buildMultipleChannelsErrorMsg(): string { } export function buildInvalidFilesUploadParamError(): string { - return 'You may supply file_uploads only for a single channel, comment, thread respectively. ' + - 'Therefore, please supply any channel_id, initial_comment, thread_ts in the top-layer.'; + return ( + 'You may supply file_uploads only for a single channel, comment, thread respectively. ' + + 'Therefore, please supply any channel_id, initial_comment, thread_ts in the top-layer.' + ); } diff --git a/packages/web-api/src/instrument.ts b/packages/web-api/src/instrument.ts index d47f30eea..02a26d11f 100644 --- a/packages/web-api/src/instrument.ts +++ b/packages/web-api/src/instrument.ts @@ -1,7 +1,6 @@ -import * as os from 'os'; -import { basename } from 'path'; +import * as os from 'node:os'; +import { basename } from 'node:path'; -// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-commonjs const packageJson = require('../package.json'); /** @@ -17,9 +16,10 @@ function replaceSlashes(s: string): string { // v1.16.2 and use of the --unstable flag. Once support for this exists without the --unstable flag, we can improve // the `os` module deno shim to correctly report operating system from a deno runtime. Until then, the below `os`- // based code will report "browser/undefined" from a deno runtime. -const baseUserAgent = `${replaceSlashes(packageJson.name)}/${packageJson.version} ` + - `${basename(process.title)}/${process.version.replace('v', '')} ` + - `${os.platform()}/${os.release()}`; +const baseUserAgent = + `${replaceSlashes(packageJson.name)}/${packageJson.version} ` + + `${basename(process.title)}/${process.version.replace('v', '')} ` + + `${os.platform()}/${os.release()}`; const appMetadata: { [key: string]: string } = {}; @@ -28,7 +28,7 @@ const appMetadata: { [key: string]: string } = {}; * @param appMetadata.name - name of tool to be counted in instrumentation * @param appMetadata.version - version of tool to be counted in instrumentation */ -export function addAppMetadata({ name, version }: { name: string, version: string }): void { +export function addAppMetadata({ name, version }: { name: string; version: string }): void { appMetadata[replaceSlashes(name)] = version; } @@ -36,7 +36,9 @@ export function addAppMetadata({ name, version }: { name: string, version: strin * Returns the current User-Agent value for instrumentation */ export function getUserAgent(): string { - const appIdentifier = Object.entries(appMetadata).map(([name, version]) => `${name}/${version}`).join(' '); + const appIdentifier = Object.entries(appMetadata) + .map(([name, version]) => `${name}/${version}`) + .join(' '); // only prepend the appIdentifier when its not empty - return ((appIdentifier.length > 0) ? `${appIdentifier} ` : '') + baseUserAgent; + return (appIdentifier.length > 0 ? `${appIdentifier} ` : '') + baseUserAgent; } diff --git a/packages/web-api/src/logger.ts b/packages/web-api/src/logger.ts index e9509fdb8..6cbe25a35 100644 --- a/packages/web-api/src/logger.ts +++ b/packages/web-api/src/logger.ts @@ -1,4 +1,4 @@ -import { ConsoleLogger, LogLevel, Logger } from '@slack/logger'; +import { ConsoleLogger, type LogLevel, type Logger } from '@slack/logger'; export { Logger, LogLevel } from '@slack/logger'; @@ -14,7 +14,9 @@ export function getLogger(name: string, level: LogLevel, existingLogger?: Logger // Set up the logger. const logger: Logger = (() => { - if (existingLogger !== undefined) { return existingLogger; } + if (existingLogger !== undefined) { + return existingLogger; + } return new ConsoleLogger(); })(); logger.setName(`web-api:${name}:${instanceId}`); diff --git a/packages/web-api/src/methods.ts b/packages/web-api/src/methods.ts index a8a92df49..7d42d151a 100644 --- a/packages/web-api/src/methods.ts +++ b/packages/web-api/src/methods.ts @@ -1,6 +1,6 @@ import { EventEmitter } from 'eventemitter3'; -import { WebAPICallResult, WebClient, WebClientEvent } from './WebClient'; +import { type WebAPICallResult, WebClient, type WebClientEvent } from './WebClient'; // Request, followed by response, types import type { @@ -501,29 +501,41 @@ import type { /** * Generic method definition */ -export default interface Method< - MethodArguments, - MethodResult extends WebAPICallResult = WebAPICallResult, -> { - (options: MethodArguments): Promise; -} +type MethodWithRequiredArgument = ( + options: MethodArguments, +) => Promise; +type MethodWithOptionalArgument = ( + options?: MethodArguments, +) => Promise; + +export default MethodWithOptionalArgument; /** - * Binds a certain `method` and its arguments and result types to the `apiCall` method in `WebClient`. + * Binds a certain `method` and its (required) arguments and result types to the `apiCall` method in `WebClient`. */ function bindApiCall( self: Methods, method: string, -): Method { - // We have to 'assert' that the bound method does indeed return the more specific `Result` type instead of just - // `WebAPICallResult` - return self.apiCall.bind(self, method) as Method; +): MethodWithRequiredArgument { + const apiMethod = self.apiCall.bind(self, method); + return apiMethod as MethodWithRequiredArgument; +} + +/** + * Binds a certain `method` and its (required) arguments and result types to the `apiCall` method in `WebClient`. + */ +function bindApiCallWithOptionalArgument( + self: Methods, + method: string, +): MethodWithOptionalArgument { + const apiMethod = self.apiCall.bind(self, method); + return apiMethod as MethodWithOptionalArgument; } function bindFilesUploadV2( self: Methods, -): Method { - return self.filesUploadV2.bind(self) as unknown as Method; +): MethodWithRequiredArgument { + return self.filesUploadV2.bind(self) as unknown as MethodWithRequiredArgument; } /** @@ -549,7 +561,10 @@ export abstract class Methods extends EventEmitter { * @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'), + getFile: bindApiCall( + this, + 'admin.analytics.getFile', + ), }, apps: { activities: { @@ -557,7 +572,10 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument( + this, + 'admin.apps.activities.list', + ), }, /** * @description Approve an app for installation on a workspace. @@ -569,19 +587,28 @@ export abstract class Methods extends EventEmitter { * @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'), + 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'), + 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'), + 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}. @@ -593,12 +620,18 @@ export abstract class Methods extends EventEmitter { * @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'), + 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'), + list: bindApiCall( + this, + 'admin.apps.requests.list', + ), }, /** * @description Restrict an app for installation on a workspace. @@ -610,8 +643,10 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCall( + this, + 'admin.apps.restricted.list', + ), }, /** * @description Uninstall an app from one or many workspaces, or an entire enterprise organization. @@ -625,17 +660,26 @@ export abstract class Methods extends EventEmitter { * @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'), + 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'), + 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'), + removeEntities: bindApiCall( + this, + 'admin.auth.policy.removeEntities', + ), }, }, barriers: { @@ -653,7 +697,10 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument( + 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}. @@ -665,90 +712,101 @@ export abstract class Methods extends EventEmitter { * @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'), + 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'), + 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'), + 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'), + 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', - ), + convertToPrivate: bindApiCall< + AdminConversationsConvertToPrivateArguments, + AdminConversationsConvertToPrivateResponse + >(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', - ), + convertToPublic: bindApiCall< + AdminConversationsConvertToPublicArguments, + AdminConversationsConvertToPublicResponse + >(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'), + 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'), + 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', - ), + disconnectShared: bindApiCall< + AdminConversationsDisconnectSharedArguments, + AdminConversationsDisconnectSharedResponse + >(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( - this, - 'admin.conversations.ekm.listOriginalConnectedChannelInfo', - ), + listOriginalConnectedChannelInfo: bindApiCallWithOptionalArgument< + AdminConversationsEKMListOriginalConnectedChannelInfoArguments, + AdminConversationsEkmListOriginalConnectedChannelInfoResponse + >(this, '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', - ), + getConversationPrefs: bindApiCall< + AdminConversationsGetConversationPrefsArguments, + AdminConversationsGetConversationPrefsResponse + >(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', - ), + getCustomRetention: bindApiCall< + AdminConversationsGetCustomRetentionArguments, + AdminConversationsGetCustomRetentionResponse + >(this, 'admin.conversations.getCustomRetention'), /** * @description Get all the workspaces a given public or private channel is connected to within * this Enterprise org. @@ -762,80 +820,84 @@ export abstract class Methods extends EventEmitter { * @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'), + 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'), + 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', - ), + removeCustomRetention: bindApiCall< + AdminConversationsRemoveCustomRetentionArguments, + AdminConversationsRemoveCustomRetentionResponse + >(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'), + 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', - ), + addGroup: bindApiCall< + AdminConversationsRestrictAccessAddGroupArguments, + AdminConversationsRestrictAccessAddGroupResponse + >(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', - ), + listGroups: bindApiCall< + AdminConversationsRestrictAccessListGroupsArguments, + AdminConversationsRestrictAccessListGroupsResponse + >(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( - this, - 'admin.conversations.restrictAccess.removeGroup', - ), + removeGroup: bindApiCall< + AdminConversationsRestrictAccessRemoveGroupArguments, + AdminConversationsRestrictAccessRemoveGroupResponse + >(this, 'admin.conversations.restrictAccess.removeGroup'), }, /** * @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'), + search: bindApiCallWithOptionalArgument( + 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.setConversationPrefs', - ), + setConversationPrefs: bindApiCall< + AdminConversationsSetConversationPrefsArguments, + AdminConversationsSetConversationPrefsResponse + >(this, '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', - ), + setCustomRetention: bindApiCall< + AdminConversationsSetCustomRetentionArguments, + AdminConversationsSetCustomRetentionResponse + >(this, 'admin.conversations.setCustomRetention'), /** * @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}. @@ -868,7 +930,7 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument(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}. @@ -892,13 +954,19 @@ export abstract class Methods extends EventEmitter { * 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'), + 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'), + set: bindApiCall( + this, + 'admin.functions.permissions.set', + ), }, }, inviteRequests: { @@ -934,30 +1002,45 @@ export abstract class Methods extends EventEmitter { * @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'), + 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'), + 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'), + 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'), + listAssignments: bindApiCallWithOptionalArgument< + AdminRolesListAssignmentsArguments, + AdminRolesListAssignmentsResponse + >(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'), + removeAssignments: bindApiCall( + this, + 'admin.roles.removeAssignments', + ), }, teams: { admins: { @@ -976,7 +1059,7 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument(this, 'admin.teams.list'), owners: { /** * @description List all of the owners on a given workspace. @@ -989,35 +1072,34 @@ export abstract class Methods extends EventEmitter { * @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'), + 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', - ), + setDefaultChannels: bindApiCall< + AdminTeamsSettingsSetDefaultChannelsArguments, + AdminTeamsSettingsSetDefaultChannelsResponse + >(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', - ), + setDescription: bindApiCall< + AdminTeamsSettingsSetDescriptionArguments, + AdminTeamsSettingsSetDescriptionResponse + >(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', - ), + setDiscoverability: bindApiCall< + AdminTeamsSettingsSetDiscoverabilityArguments, + AdminTeamsSettingsSetDiscoverabilityResponse + >(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}. @@ -1085,7 +1167,7 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument(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}. @@ -1122,17 +1204,26 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument( + 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'), + 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'), + 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. @@ -1152,19 +1243,15 @@ export abstract class Methods extends EventEmitter { * @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', - ), + 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', - ), + 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}. @@ -1191,30 +1278,45 @@ export abstract class Methods extends EventEmitter { * @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'), + 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'), + 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'), + 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'), + search: bindApiCallWithOptionalArgument( + 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'), + unpublish: bindApiCall( + this, + 'admin.workflows.unpublish', + ), }, }; @@ -1223,7 +1325,7 @@ export abstract class Methods extends EventEmitter { * @description Checks API calling code. * @see {@link https://api.slack.com/methods/api.test `api.test` API reference}. */ - test: bindApiCall(this, 'api.test'), + test: bindApiCallWithOptionalArgument(this, 'api.test'), }; public readonly apps = { @@ -1233,7 +1335,10 @@ export abstract class Methods extends EventEmitter { * 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'), + open: bindApiCallWithOptionalArgument( + this, + 'apps.connections.open', + ), }, event: { authorizations: { @@ -1273,7 +1378,10 @@ export abstract class Methods extends EventEmitter { * @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'), + validate: bindApiCall( + this, + 'apps.manifest.validate', + ), }, /** * @description Uninstalls your app from a workspace. @@ -1287,15 +1395,15 @@ export abstract class Methods extends EventEmitter { * @description Revokes a token. * @see {@link https://api.slack.com/methods/auth.revoke `auth.revoke` API reference}. */ - revoke: bindApiCall(this, 'auth.revoke'), + revoke: bindApiCallWithOptionalArgument(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'), + list: bindApiCallWithOptionalArgument(this, 'auth.teams.list'), }, - test: bindApiCall(this, 'auth.test'), + test: bindApiCallWithOptionalArgument(this, 'auth.test'), }; public readonly bookmarks = { @@ -1326,7 +1434,7 @@ export abstract class Methods extends EventEmitter { * @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'), + info: bindApiCallWithOptionalArgument(this, 'bots.info'), }; public readonly calls = { @@ -1356,7 +1464,10 @@ export abstract class Methods extends EventEmitter { * @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'), + remove: bindApiCall( + this, + 'calls.participants.remove', + ), }, }; @@ -1377,7 +1488,7 @@ export abstract class Methods extends EventEmitter { * @description Create Canvas for a user. * @see {@link https://api.slack.com/methods/canvases.create `canvases.create` API reference}. */ - create: bindApiCall(this, 'canvases.create'), + create: bindApiCallWithOptionalArgument(this, 'canvases.create'), /** * @description Deletes a canvas. * @see {@link https://api.slack.com/methods/canvases.delete `canvases.delete` API reference}. @@ -1393,7 +1504,10 @@ export abstract class Methods extends EventEmitter { * @description Find sections matching the provided criteria. * @see {@link https://api.slack.com/methods/canvases.sections.lookup `canvases.sections.lookup` API reference}. */ - lookup: bindApiCall(this, 'canvases.sections.lookup'), + lookup: bindApiCall( + this, + 'canvases.sections.lookup', + ), }, }; @@ -1407,8 +1521,10 @@ export abstract class Methods extends EventEmitter { * @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'), + 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}. @@ -1442,11 +1558,10 @@ export abstract class Methods extends EventEmitter { * @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', - ), + list: bindApiCallWithOptionalArgument( + this, + 'chat.scheduledMessages.list', + ), }, /** * @description Provide custom unfurl behavior for user-posted URLs. @@ -1473,11 +1588,10 @@ export abstract class Methods extends EventEmitter { * @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', - ), + approveSharedInvite: bindApiCall< + ConversationsApproveSharedInviteArguments, + ConversationsApproveSharedInviteResponse + >(this, 'conversations.approveSharedInvite'), /** * @description Archives a conversation. * @see {@link https://api.slack.com/methods/conversations.archive `conversations.archive` API reference}. @@ -1488,7 +1602,10 @@ export abstract class Methods extends EventEmitter { * @description Create a Channel Canvas for a channel. * @see {@link https://api.slack.com/methods/conversations.canvases.create `conversations.canvases.create` API reference}. */ - create: bindApiCall(this, 'conversations.canvases.create'), + create: bindApiCall( + this, + 'conversations.canvases.create', + ), }, /** * @description Closes a direct message or multi-person direct message. @@ -1504,18 +1621,20 @@ export abstract class Methods extends EventEmitter { * @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', - ), + declineSharedInvite: bindApiCall< + ConversationsDeclineSharedInviteArguments, + ConversationsDeclineSharedInviteResponse + >(this, 'conversations.declineSharedInvite'), externalInvitePermissions: { /** * @description Convert a team in a shared channel from an External Limited channel to a fully shared Slack * Connect channel or vice versa. * @see {@link https://api.slack.com/methods/conversations.externalInvitePermissions.set `conversations.externalInvitePermissions.set` API reference}. */ - set: bindApiCall(this, 'conversations.externalInvitePermissions.set'), + set: bindApiCall< + ConversationsExternalInvitePermissionsSetArguments, + ConversationsExternalInvitePermissionsSetResponse + >(this, 'conversations.externalInvitePermissions.set'), }, /** * @description Fetches a conversation's history of messages and events. @@ -1559,17 +1678,19 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument( + 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', - ), + listConnectInvites: bindApiCallWithOptionalArgument< + ConversationsListConnectInvitesArguments, + ConversationsListConnectInvitesResponse + >(this, 'conversations.listConnectInvites'), /** * @description Sets the read cursor in a channel. * @see {@link https://api.slack.com/methods/conversations.mark `conversations.mark` API reference}. @@ -1599,8 +1720,10 @@ export abstract class Methods extends EventEmitter { * @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'), + 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}. @@ -1632,17 +1755,17 @@ export abstract class Methods extends EventEmitter { * @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'), + endDnd: bindApiCallWithOptionalArgument(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'), + endSnooze: bindApiCallWithOptionalArgument(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'), + info: bindApiCallWithOptionalArgument(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}. @@ -1660,7 +1783,7 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument(this, 'emoji.list'), }; public readonly files = { @@ -1668,8 +1791,10 @@ export abstract class Methods extends EventEmitter { * @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'), + completeUploadExternal: bindApiCall( + this, + 'files.completeUploadExternal', + ), /** * @description Deletes a file. * @see {@link https://api.slack.com/methods/files.delete `files.delete` API reference}. @@ -1679,8 +1804,10 @@ export abstract class Methods extends EventEmitter { * @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'), + getUploadURLExternal: bindApiCall( + this, + 'files.getUploadURLExternal', + ), /** * @description Gets information about a file. * @see {@link https://api.slack.com/methods/files.info `files.info` API reference}. @@ -1695,14 +1822,18 @@ export abstract class Methods extends EventEmitter { * @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'), + 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'), + sharedPublicURL: bindApiCall( + this, + 'files.sharedPublicURL', + ), /** * @description Uploads or creates a file. * @deprecated Use `uploadV2` instead. See {@link https://api.slack.com/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay our post on retiring `files.upload`}. @@ -1721,7 +1852,7 @@ export abstract class Methods extends EventEmitter { * 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), comments: { /** @@ -1769,7 +1900,10 @@ export abstract class Methods extends EventEmitter { * @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'), + 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}. @@ -1820,7 +1954,10 @@ export abstract class Methods extends EventEmitter { * @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'), + userInfo: bindApiCallWithOptionalArgument( + this, + 'openid.connect.userInfo', + ), }, }; @@ -1857,7 +1994,7 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument(this, 'reactions.list'), /** * @description Removes a reaction from an item. * @see {@link https://api.slack.com/methods/reactions.remove `reactions.remove` API reference}. @@ -1892,7 +2029,7 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument(this, 'reminders.list'), }; public readonly rtm = { @@ -1900,13 +2037,13 @@ export abstract class Methods extends EventEmitter { * @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'), + connect: bindApiCallWithOptionalArgument(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'), + start: bindApiCallWithOptionalArgument(this, 'rtm.start'), }; public readonly search = { @@ -1932,12 +2069,18 @@ export abstract class Methods extends EventEmitter { * @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'), + accessLogs: bindApiCallWithOptionalArgument( + 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'), + billableInfo: bindApiCallWithOptionalArgument( + this, + 'team.billableInfo', + ), billing: { /** * @description Reads a workspace's billing plan information. @@ -1950,7 +2093,10 @@ export abstract class Methods extends EventEmitter { * @description Disconnect an external organization. * @see {@link https://api.slack.com/methods/team.externalTeams.disconnect `team.externalTeams.disconnect` API reference}. */ - disconnect: bindApiCall(this, 'team.externalTeams.disconnect'), + disconnect: bindApiCall( + this, + 'team.externalTeams.disconnect', + ), /** * @description Returns a list of all the external teams connected and details about the connection. * @see {@link https://api.slack.com/methods/team.externalTeams.list `team.externalTeams.list` API reference}. @@ -1961,26 +2107,31 @@ export abstract class Methods extends EventEmitter { * @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'), + info: bindApiCallWithOptionalArgument(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'), + integrationLogs: bindApiCallWithOptionalArgument( + 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'), + list: bindApiCallWithOptionalArgument( + 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'), + get: bindApiCallWithOptionalArgument(this, 'team.profile.get'), }, }; @@ -2014,7 +2165,7 @@ export abstract class Methods extends EventEmitter { * @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'), + list: bindApiCallWithOptionalArgument(this, 'usergroups.list'), /** * @description Update an existing User Group. * @see {@link https://api.slack.com/methods/usergroups.update `usergroups.update` API reference}. @@ -2025,10 +2176,7 @@ export abstract class Methods extends EventEmitter { * @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', - ), + 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}. @@ -2056,7 +2204,10 @@ export abstract class Methods extends EventEmitter { * @description Lookup an email address to see if someone is on Slack. * @see {@link https://api.slack.com/methods/users.discoverableContacts.lookup `users.discoverableContacts.lookup` API reference}. */ - lookup: bindApiCall(this, 'users.discoverableContacts.lookup'), + lookup: bindApiCall( + this, + 'users.discoverableContacts.lookup', + ), }, /** * @description Gets user presence information. diff --git a/packages/web-api/src/retry-policies.ts b/packages/web-api/src/retry-policies.ts index 9e511e5d7..8d3111dc7 100644 --- a/packages/web-api/src/retry-policies.ts +++ b/packages/web-api/src/retry-policies.ts @@ -1,11 +1,9 @@ -import { OperationOptions } from 'retry'; +import type { OperationOptions } from 'retry'; /** * Options to create retry policies. Extends from https://github.com/tim-kos/node-retry. */ -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface RetryOptions extends OperationOptions { -} +export interface RetryOptions extends OperationOptions { } /** * The default retry policy. Retry up to 10 times, over the span of about 30 minutes. It's not exact because diff --git a/packages/web-api/src/types/helpers.ts b/packages/web-api/src/types/helpers.ts index d49aefdfc..2ed361985 100644 --- a/packages/web-api/src/types/helpers.ts +++ b/packages/web-api/src/types/helpers.ts @@ -1,4 +1,4 @@ /** Omit all keys K from possible union types T */ export type ExcludeFromUnion = T extends T ? Omit : never; /** Allows to explicitly declare a function parameter as optional */ -export type OptionalArgument = T | void; +export type OptionalArgument = T | undefined; diff --git a/packages/web-api/src/types/request/admin/analytics.ts b/packages/web-api/src/types/request/admin/analytics.ts index 5229ff446..1e0ed463c 100644 --- a/packages/web-api/src/types/request/admin/analytics.ts +++ b/packages/web-api/src/types/request/admin/analytics.ts @@ -7,7 +7,7 @@ interface Date { */ date: string; } -interface MemberArgs extends Date { +export 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). @@ -21,7 +21,7 @@ interface TypeChannel { */ type: 'public_channel'; } -interface PublicChannelWithDate extends TypeChannel, Date { +export 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`. @@ -29,7 +29,7 @@ interface PublicChannelWithDate extends TypeChannel, Date { */ metadata_only?: false; } -interface PublicChannelWithMetadata extends TypeChannel { +export 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`. diff --git a/packages/web-api/src/types/request/admin/apps.ts b/packages/web-api/src/types/request/admin/apps.ts index ec4e2052f..1e52a0349 100644 --- a/packages/web-api/src/types/request/admin/apps.ts +++ b/packages/web-api/src/types/request/admin/apps.ts @@ -1,24 +1,20 @@ -import { OptionalArgument } from '../../helpers'; +import type { OptionalArgument } from '../../helpers'; -import type { AppID, CursorPaginationEnabled, TokenOverridable } from '../common'; +import type { AppID, CursorPaginationEnabled, TeamID, TokenOverridable } from '../common'; -interface RequestID { +export 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 { +type AppOrRequestID = (AppID & { request_id?: never }) | (RequestID & { app_id?: never }); +export 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 { +type TeamOrEnterpriseID = (EnterpriseID & { team_id?: never }) | (TeamID & { enterprise_id?: never }); +export interface Certified { /** * @description Include certified apps. Defaults to `false`. */ @@ -26,37 +22,43 @@ interface Certified { } // https://api.slack.com/methods/admin.apps.activities.list -export type AdminAppsActivitiesListArguments = OptionalArgument & 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; -}>; +export type AdminAppsActivitiesListArguments = OptionalArgument< + 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; +export type AdminAppsApprovedListArguments = Partial & + TokenOverridable & + CursorPaginationEnabled & + Certified; // https://api.slack.com/methods/admin.apps.clearResolution export type AdminAppsClearResolutionArguments = AppID & TeamOrEnterpriseID & TokenOverridable; @@ -84,15 +86,19 @@ export interface AdminAppsConfigSetArguments extends AppID, TokenOverridable { export type AdminAppsRequestsCancelArguments = RequestID & TeamOrEnterpriseID & TokenOverridable; // https://api.slack.com/methods/admin.apps.requests.list -export type AdminAppsRequestsListArguments = TeamOrEnterpriseID & Certified & TokenOverridable -& CursorPaginationEnabled; +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; +export type AdminAppsRestrictedListArguments = TeamOrEnterpriseID & + Certified & + TokenOverridable & + CursorPaginationEnabled; // https://api.slack.com/methods/admin.apps.uninstall export type AdminAppsUninstallArguments = AppID & TeamOrEnterpriseID & TokenOverridable; diff --git a/packages/web-api/src/types/request/admin/auth.ts b/packages/web-api/src/types/request/admin/auth.ts index 6291c1e44..91646bf0b 100644 --- a/packages/web-api/src/types/request/admin/auth.ts +++ b/packages/web-api/src/types/request/admin/auth.ts @@ -17,8 +17,11 @@ interface PolicyName { 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 {} +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 index 0b12aac27..b892da21e 100644 --- a/packages/web-api/src/types/request/admin/barriers.ts +++ b/packages/web-api/src/types/request/admin/barriers.ts @@ -1,4 +1,4 @@ -import { OptionalArgument } from '../../helpers'; +import type { OptionalArgument } from '../../helpers'; import type { CursorPaginationEnabled, TokenOverridable } from '../common'; diff --git a/packages/web-api/src/types/request/admin/conversations.ts b/packages/web-api/src/types/request/admin/conversations.ts index a4700bacb..b7815fe6c 100644 --- a/packages/web-api/src/types/request/admin/conversations.ts +++ b/packages/web-api/src/types/request/admin/conversations.ts @@ -1,30 +1,34 @@ -import { OptionalArgument } from '../../helpers'; +import type { OptionalArgument } from '../../helpers'; import type { + ChannelID, ChannelIDs, CursorPaginationEnabled, SortDir, + TeamIDs, 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'; +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 { /** @@ -58,12 +62,12 @@ export interface AdminConversationsConvertToPrivateArguments extends ChannelID, // https://api.slack.com/methods/admin.conversations.convertToPublic export interface AdminConversationsConvertToPublicArguments extends ChannelID, TokenOverridable {} -interface OrgWide { +export interface OrgWide { /** @description When `true`, the channel will be available org-wide. */ org_wide: true; team_id?: never; } -interface SpecificTeam { +export interface SpecificTeam { /** * @description When `false` (the default), the channel will be available to only * the workspace specified by `team_id`. @@ -78,14 +82,15 @@ interface SpecificTeam { 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; -}; +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 {} @@ -97,11 +102,14 @@ export interface AdminConversationsDisconnectSharedArguments extends ChannelID, } // https://api.slack.com/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo -export type AdminConversationsEKMListOriginalConnectedChannelInfoArguments = OptionalArgument & -TokenOverridable & CursorPaginationEnabled & { - /** @description A comma-separated list of channels to filter to. */ - channel_ids?: string[]; -}>; +export type AdminConversationsEKMListOriginalConnectedChannelInfoArguments = OptionalArgument< + 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 {} @@ -110,15 +118,13 @@ export interface AdminConversationsGetConversationPrefsArguments extends Channel export interface AdminConversationsGetCustomRetentionArguments extends ChannelID, TokenOverridable {} // https://api.slack.com/methods/admin.conversations.getTeams -export interface AdminConversationsGetTeamsArguments - extends ChannelID, TokenOverridable, CursorPaginationEnabled {} +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 { +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. @@ -138,46 +144,58 @@ export interface AdminConversationsRenameArguments extends ChannelID, TokenOverr } // https://api.slack.com/methods/admin.conversations.restrictAccess.addGroup -export interface AdminConversationsRestrictAccessAddGroupArguments extends ChannelID, GroupID, - RestrictAccessTeamID, TokenOverridable {} +export interface AdminConversationsRestrictAccessAddGroupArguments + extends ChannelID, + GroupID, + RestrictAccessTeamID, + TokenOverridable {} // https://api.slack.com/methods/admin.conversations.restrictAccess.listGroups -export interface AdminConversationsRestrictAccessListGroupsArguments extends ChannelID, RestrictAccessTeamID, - TokenOverridable {} +export interface AdminConversationsRestrictAccessListGroupsArguments + extends ChannelID, + RestrictAccessTeamID, + TokenOverridable {} // https://api.slack.com/methods/admin.conversations.restrictAccess.removeGroup -export interface AdminConversationsRestrictAccessRemoveGroupArguments extends ChannelID, GroupID, - RestrictAccessTeamID, TokenOverridable {} +export interface AdminConversationsRestrictAccessRemoveGroupArguments + extends ChannelID, + GroupID, + RestrictAccessTeamID, + TokenOverridable {} // https://api.slack.com/methods/admin.conversations.search -export type AdminConversationsSearchArguments = OptionalArgument & 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; -}>; +export type AdminConversationsSearchArguments = OptionalArgument< + 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 { diff --git a/packages/web-api/src/types/request/admin/emoji.ts b/packages/web-api/src/types/request/admin/emoji.ts index f56f799a9..d133a499f 100644 --- a/packages/web-api/src/types/request/admin/emoji.ts +++ b/packages/web-api/src/types/request/admin/emoji.ts @@ -1,4 +1,4 @@ -import { OptionalArgument } from '../../helpers'; +import type { OptionalArgument } from '../../helpers'; import type { CursorPaginationEnabled, TokenOverridable } from '../common'; diff --git a/packages/web-api/src/types/request/admin/functions.ts b/packages/web-api/src/types/request/admin/functions.ts index 95d09bf62..ab1321fc7 100644 --- a/packages/web-api/src/types/request/admin/functions.ts +++ b/packages/web-api/src/types/request/admin/functions.ts @@ -9,8 +9,7 @@ export interface AdminFunctionsListArguments extends TokenOverridable, CursorPag } // https://api.slack.com/methods/admin.functions.permissions.lookup -export interface AdminFunctionsPermissionsLookupArguments - extends TokenOverridable { +export interface AdminFunctionsPermissionsLookupArguments extends TokenOverridable { /** @description An array of function IDs to get permissions for. */ function_ids: [string, ...string[]]; } diff --git a/packages/web-api/src/types/request/admin/inviteRequests.ts b/packages/web-api/src/types/request/admin/inviteRequests.ts index 9ed4c5e86..0dc155240 100644 --- a/packages/web-api/src/types/request/admin/inviteRequests.ts +++ b/packages/web-api/src/types/request/admin/inviteRequests.ts @@ -6,21 +6,31 @@ interface InviteRequestID { } // https://api.slack.com/methods/admin.inviteRequests.approve -export interface AdminInviteRequestsApproveArguments extends InviteRequestID, Required, - TokenOverridable {} +export interface AdminInviteRequestsApproveArguments + extends InviteRequestID, + Required, + TokenOverridable {} // https://api.slack.com/methods/admin.inviteRequests.approved.list -export interface AdminInviteRequestsApprovedListArguments extends Required, TokenOverridable, - CursorPaginationEnabled {} +export interface AdminInviteRequestsApprovedListArguments + extends Required, + TokenOverridable, + CursorPaginationEnabled {} // https://api.slack.com/methods/admin.inviteRequests.denied.list -export interface AdminInviteRequestsDeniedListArguments extends Required, TokenOverridable, - CursorPaginationEnabled {} +export interface AdminInviteRequestsDeniedListArguments + extends Required, + TokenOverridable, + CursorPaginationEnabled {} // https://api.slack.com/methods/admin.inviteRequests.deny -export interface AdminInviteRequestsDenyArguments extends InviteRequestID, Required, - TokenOverridable {} +export interface AdminInviteRequestsDenyArguments + extends InviteRequestID, + Required, + TokenOverridable {} // https://api.slack.com/methods/admin.inviteRequests.list -export interface AdminInviteRequestsListArguments extends Required, TokenOverridable, - CursorPaginationEnabled {} +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 index 64a00affa..06de727b1 100644 --- a/packages/web-api/src/types/request/admin/roles.ts +++ b/packages/web-api/src/types/request/admin/roles.ts @@ -1,8 +1,8 @@ -import { OptionalArgument } from '../../helpers'; +import type { OptionalArgument } from '../../helpers'; import type { CursorPaginationEnabled, SortDir, TokenOverridable, UserIDs } from '../common'; -interface EntityIDs { +export 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). @@ -22,14 +22,18 @@ interface RoleID { export interface AdminRolesAddAssignmentsArguments extends EntityIDs, RoleID, UserIDs, TokenOverridable {} // https://api.slack.com/methods/admin.roles.listAssignments -export type AdminRolesListAssignmentsArguments = OptionalArgument & 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[]; -}>; +export type AdminRolesListAssignmentsArguments = OptionalArgument< + 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 index 85569ef89..4f916774a 100644 --- a/packages/web-api/src/types/request/admin/teams.ts +++ b/packages/web-api/src/types/request/admin/teams.ts @@ -1,4 +1,4 @@ -import { OptionalArgument } from '../../helpers'; +import type { OptionalArgument } from '../../helpers'; import type { ChannelIDs, CursorPaginationEnabled, TeamID, TokenOverridable } from '../common'; diff --git a/packages/web-api/src/types/request/admin/usergroups.ts b/packages/web-api/src/types/request/admin/usergroups.ts index b424dea54..c9d0aa142 100644 --- a/packages/web-api/src/types/request/admin/usergroups.ts +++ b/packages/web-api/src/types/request/admin/usergroups.ts @@ -11,8 +11,11 @@ interface UsergroupID { } // https://api.slack.com/methods/admin.usergroups.addChannels -export interface AdminUsergroupsAddChannelsArguments extends ChannelIDs, UsergroupID, OptionalTeamAssignable, - TokenOverridable {} +export interface AdminUsergroupsAddChannelsArguments + extends ChannelIDs, + UsergroupID, + OptionalTeamAssignable, + TokenOverridable {} // https://api.slack.com/methods/admin.usergroups.addTeams export interface AdminUsergroupsAddTeamsArguments extends UsergroupID, TokenOverridable { diff --git a/packages/web-api/src/types/request/admin/users.ts b/packages/web-api/src/types/request/admin/users.ts index e72604dcf..7b4ce10ac 100644 --- a/packages/web-api/src/types/request/admin/users.ts +++ b/packages/web-api/src/types/request/admin/users.ts @@ -1,4 +1,4 @@ -import { OptionalArgument } from '../../helpers'; +import type { OptionalArgument } from '../../helpers'; import type { ChannelIDs, @@ -31,10 +31,10 @@ interface SessionExpirationTarget { web_only?: boolean; } -interface TeamIDWithoutDeactivatedWorkspaces extends TeamID { +export interface TeamIDWithoutDeactivatedWorkspaces extends TeamID { include_deactivated_user_workspaces?: false; } -interface DeactivatedWorkspacesWithoutTeamID { +export interface DeactivatedWorkspacesWithoutTeamID { team_id?: never; /** * @description Only applies when using an org token and when no `team_id` is provided. If `true`, return workspaces @@ -46,8 +46,8 @@ interface DeactivatedWorkspacesWithoutTeamID { // `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 { +export interface BothTeamAndUserID extends TeamID, UserID {} +export interface NeitherTeamNorUserID { team_id?: never; user_id?: never; } @@ -55,12 +55,21 @@ interface NeitherTeamNorUserID { type EitherTeamAndUserIDOrNeither = BothTeamAndUserID | NeitherTeamNorUserID; // https://api.slack.com/methods/admin.users.assign -export interface AdminUsersAssignArguments extends TeamID, UserID, Partial, IsRestricted, - IsUltraRestricted, TokenOverridable {} +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 { +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. */ @@ -80,19 +89,22 @@ export interface AdminUsersInviteArguments extends ChannelIDs, TeamID, IsRestric /** * @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 = OptionalArgument; +export type AdminUsersListArguments = OptionalArgument< + 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 {} @@ -110,8 +122,9 @@ export interface AdminUsersSessionInvalidateArguments extends TeamID, TokenOverr } // https://api.slack.com/methods/admin.users.session.list -export type AdminUsersSessionListArguments = OptionalArgument; +export type AdminUsersSessionListArguments = OptionalArgument< + EitherTeamAndUserIDOrNeither & TokenOverridable & CursorPaginationEnabled +>; // https://api.slack.com/methods/admin.users.session.reset export interface AdminUsersSessionResetArguments extends UserID, SessionExpirationTarget, TokenOverridable {} diff --git a/packages/web-api/src/types/request/admin/workflows.ts b/packages/web-api/src/types/request/admin/workflows.ts index 23a9c11b4..674160335 100644 --- a/packages/web-api/src/types/request/admin/workflows.ts +++ b/packages/web-api/src/types/request/admin/workflows.ts @@ -1,8 +1,8 @@ -import { OptionalArgument } from '../../helpers'; +import type { OptionalArgument } from '../../helpers'; import type { AppID, CursorPaginationEnabled, SortDir, TokenOverridable } from '../common'; -interface CollaboratorIDs { +export interface CollaboratorIDs { /** @description Array of collaborators (encoded user IDs) - maximum of 50 items. */ collaborator_ids: [string, ...string[]]; } @@ -28,19 +28,24 @@ export interface AdminWorkflowsPermissionsLookupArguments extends WorkflowIDs, T } // https://api.slack.com/methods/admin.workflows.search -export type AdminWorkflowsSearchArguments = OptionalArgument & 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'; -}>; +export type AdminWorkflowsSearchArguments = OptionalArgument< + 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 index 4405b1abc..d800dba76 100644 --- a/packages/web-api/src/types/request/api.ts +++ b/packages/web-api/src/types/request/api.ts @@ -1,5 +1,5 @@ // https://api.slack.com/methods/api.test -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; export type APITestArguments = OptionalArgument<{ /** @description Error response to return. */ diff --git a/packages/web-api/src/types/request/apps.ts b/packages/web-api/src/types/request/apps.ts index 901f1ca91..2ea1ab398 100644 --- a/packages/web-api/src/types/request/apps.ts +++ b/packages/web-api/src/types/request/apps.ts @@ -1,4 +1,4 @@ -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; import type { AppID, CursorPaginationEnabled, OAuthCredentials, TokenOverridable } from './common'; import type { Manifest } from './manifest'; @@ -7,8 +7,7 @@ import type { Manifest } from './manifest'; export type AppsConnectionsOpenArguments = OptionalArgument; // https://api.slack.com/methods/apps.event.authorizations.list -export interface AppsEventAuthorizationsListArguments - extends TokenOverridable, CursorPaginationEnabled { +export interface AppsEventAuthorizationsListArguments extends TokenOverridable, CursorPaginationEnabled { event_context: string; } @@ -34,4 +33,6 @@ export interface AppsManifestValidateArguments extends Partial, TokenOver } // https://api.slack.com/methods/apps.uninstall -export interface AppsUninstallArguments extends Pick, TokenOverridable {} +export interface AppsUninstallArguments + extends Pick, + TokenOverridable {} diff --git a/packages/web-api/src/types/request/auth.ts b/packages/web-api/src/types/request/auth.ts index 3da910fe3..6d0def198 100644 --- a/packages/web-api/src/types/request/auth.ts +++ b/packages/web-api/src/types/request/auth.ts @@ -1,24 +1,29 @@ -import type { CursorPaginationEnabled, TokenOverridable } from './common'; import type { OptionalArgument } from '../helpers'; +import type { CursorPaginationEnabled, TokenOverridable } from './common'; // https://api.slack.com/methods/auth.revoke -export type AuthRevokeArguments = OptionalArgument; +export type AuthRevokeArguments = OptionalArgument< + 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 type AuthTeamsListArguments = OptionalArgument; +export type AuthTeamsListArguments = OptionalArgument< + 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 type AuthTestArguments = OptionalArgument; diff --git a/packages/web-api/src/types/request/bots.ts b/packages/web-api/src/types/request/bots.ts index f49b512b1..2b639ac7e 100644 --- a/packages/web-api/src/types/request/bots.ts +++ b/packages/web-api/src/types/request/bots.ts @@ -1,9 +1,12 @@ -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; import type { OptionalTeamAssignable, TokenOverridable } from './common'; // https://api.slack.com/methods/bots.info -export type BotsInfoArguments = OptionalArgument; +export type BotsInfoArguments = OptionalArgument< + 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 index 93097635d..d388a8420 100644 --- a/packages/web-api/src/types/request/calls.ts +++ b/packages/web-api/src/types/request/calls.ts @@ -1,5 +1,5 @@ -import type { TokenOverridable } from './common'; 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. */ diff --git a/packages/web-api/src/types/request/canvas.ts b/packages/web-api/src/types/request/canvas.ts index 38cd5ceea..5b5da6f13 100644 --- a/packages/web-api/src/types/request/canvas.ts +++ b/packages/web-api/src/types/request/canvas.ts @@ -1,11 +1,11 @@ -import type { ChannelIDs, TokenOverridable, UserIDs } from './common'; import type { OptionalArgument } from '../helpers'; +import type { ChannelIDs, TokenOverridable, UserIDs } from './common'; interface CanvasID { /** @description Encoded ID of the canvas. */ canvas_id: string; } -interface DocumentContent { +export interface DocumentContent { /** @description The type of content used to describe Canvas content. Always is `markdown`. */ type: 'markdown'; /** @description The markdown defining the Canvas content. */ @@ -33,16 +33,17 @@ interface BaseChange { } type ChangeWithSectionAndContent = Required & { /** @description The operation to perform on the canvas. */ - operation: 'insert_after' | 'insert_before' + operation: 'insert_after' | 'insert_before'; }; type ChangeWithContent = Required> & { /** @description The operation to perform on the canvas. */ operation: 'insert_at_start' | 'insert_at_end'; }; -type ChangeWithContentAndOptionalSection = BaseChange & Required> & { - /** @description The operation to perform on the canvas. */ - operation: 'replace'; -}; +type ChangeWithContentAndOptionalSection = BaseChange & + Required> & { + /** @description The operation to perform on the canvas. */ + operation: 'replace'; + }; type ChangeWithSection = Required> & { /** @description The operation to perform on the canvas. */ operation: 'delete'; @@ -50,8 +51,11 @@ type ChangeWithSection = Required> & { type Change = ChangeWithSection | ChangeWithContent | ChangeWithSectionAndContent | ChangeWithContentAndOptionalSection; // https://api.slack.com/methods/canvases.access.delete -export interface CanvasesAccessDeleteArguments extends CanvasID, Partial, TokenOverridable, - Partial {} +export interface CanvasesAccessDeleteArguments + extends CanvasID, + Partial, + TokenOverridable, + Partial {} // https://api.slack.com/methods/canvases.access.set export interface CanvasesAccessSetArguments extends CanvasID, Partial, TokenOverridable, Partial { @@ -60,12 +64,14 @@ export interface CanvasesAccessSetArguments extends CanvasID, Partial; +export type CanvasesCreateArguments = OptionalArgument< + TokenOverridable & { + /** @description Title of the newly created canvas. */ + title?: string; + /** @description Structure describing the type and contents of the Canvas being created. */ + document_content?: DocumentContent; + } +>; // https://api.slack.com/methods/canvases.sections.lookup export interface CanvasesSectionsLookupArguments extends CanvasID, TokenOverridable { diff --git a/packages/web-api/src/types/request/chat.ts b/packages/web-api/src/types/request/chat.ts index fff7ccf9a..e234f2df6 100644 --- a/packages/web-api/src/types/request/chat.ts +++ b/packages/web-api/src/types/request/chat.ts @@ -1,11 +1,5 @@ -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; -import type { - CursorPaginationEnabled, - OptionalTeamAssignable, - TimelinePaginationEnabled, - TokenOverridable, -} from './common'; import type { Block, // TODO: these will be combined into one in a new types release KnownBlock, @@ -13,12 +7,18 @@ import type { MessageAttachment, MessageMetadata, } from '@slack/types'; +import type { + CursorPaginationEnabled, + OptionalTeamAssignable, + TimelinePaginationEnabled, + TokenOverridable, +} from './common'; -interface Channel { +export interface Channel { /** @description Channel ID for the message. */ channel: string; } -interface ChannelAndTS extends Channel { +export interface ChannelAndTS extends Channel { /** @description Timestamp of the message. */ ts: string; } @@ -26,7 +26,7 @@ interface ChannelAndMessageTS extends Channel { /** @description Timestamp of the message. */ message_ts: string; } -interface AsUser { +export 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 @@ -34,11 +34,11 @@ interface AsUser { */ as_user?: boolean; } -interface LinkNames { +export interface LinkNames { /** @description Find and link channel names and usernames. */ link_names?: boolean; } -interface Parse { +export 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}. @@ -52,15 +52,15 @@ interface Text { */ text: string; } -interface ChannelAndText extends Channel, Text {} -interface ChannelAndBlocks extends Channel, Partial { +export interface ChannelAndText extends Channel, Text {} +export 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 { +export interface ChannelAndAttachments extends Channel, Partial { /** * @description An array of structured attachments. * @see {@link https://api.slack.com/messaging/composing/layouts#attachments Adding secondary attachments}. @@ -72,21 +72,21 @@ interface ChannelAndAttachments extends Channel, Partial { // 2. channel and blocks // 3. channel and attachments type MessageContents = ChannelAndText | ChannelAndBlocks | ChannelAndAttachments; -interface ThreadTS { +export 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 { +export 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 { +export interface BroadcastedThreadReply extends ThreadTS { /** @description Used in conjunction with `thread_ts`, when set to `true` will broadcast the reply to the channel. */ reply_broadcast: boolean; } @@ -94,11 +94,11 @@ interface BroadcastedThreadReply extends ThreadTS { // or not broadcasted. Broadcasted replies are necessarily threaded, so `thread_ts` becomes required. type ReplyInThread = WithinThreadReply | BroadcastedThreadReply; -interface Metadata { +export interface Metadata { /** @description Object representing message metadata, which will be made accessible to any user or app. */ metadata?: MessageMetadata; } -interface IconEmoji { +export interface IconEmoji { as_user?: false; icon_url?: never; /** @@ -107,7 +107,7 @@ interface IconEmoji { */ icon_emoji?: string; } -interface IconURL { +export interface IconURL { as_user?: false; icon_emoji?: never; /** @@ -118,24 +118,26 @@ interface IconURL { } // Can only specify message icon via predefined authorship using one of emoji or URL, but not both. type Icon = IconEmoji | IconURL; -interface Username { +export 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 { +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; + }; +export 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. */ @@ -158,32 +160,53 @@ export interface ChatGetPermalinkArguments extends ChannelAndMessageTS, TokenOve 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; +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; -}; +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; +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 type ChatScheduledMessagesListArguments = OptionalArgument & Partial>; +export type ChatScheduledMessagesListArguments = OptionalArgument< + TokenOverridable & + CursorPaginationEnabled & + OptionalTeamAssignable & + Pick & + Partial +>; -interface SourceAndUnfurlID { +export 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. @@ -204,37 +227,41 @@ export type ChatUnfurlArguments = { * 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)[]; -}; +} & 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; -}; +} & 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 index 2a7cf7f6e..74b3d3f4b 100644 --- a/packages/web-api/src/types/request/common.ts +++ b/packages/web-api/src/types/request/common.ts @@ -60,6 +60,11 @@ export interface TeamID { /** @description The encoded team ID. */ team_id: string; } +export interface TeamIDs { + /** @description A list of team IDs (must include at least one ID). */ + team_ids: [string, ...string[]]; +} + export interface OptionalTeamAssignable { /** @description If using an org token, `team_id` is required. */ team_id?: string; @@ -75,6 +80,10 @@ export interface ChannelIDs { /** @description An array of channel IDs (must include at least one ID). */ channel_ids: [string, ...string[]]; } +export interface ChannelID { + /** @description Encoded channel ID. */ + channel_id: string; +} // Same for user IDs diff --git a/packages/web-api/src/types/request/conversations.ts b/packages/web-api/src/types/request/conversations.ts index b7b05bd44..396ab7dca 100644 --- a/packages/web-api/src/types/request/conversations.ts +++ b/packages/web-api/src/types/request/conversations.ts @@ -1,6 +1,7 @@ -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; import type { + ChannelID, CursorPaginationEnabled, LocaleAware, OptionalTeamAssignable, @@ -9,15 +10,11 @@ import type { TokenOverridable, } from './common'; -interface Channel { +export 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 { +export interface Emails { /** @description List of emails to receive this invite. Either `emails` or `user_ids` must be provided. */ emails: string[]; user_ids?: never; @@ -26,11 +23,11 @@ interface IncludeAllMetadata { /** @description Return all metadata associated with messages. Defaults to `false`. */ include_all_metadata?: boolean; } -interface InviteID { +export interface InviteID { /** @description ID of the invite. */ invite_id: string; } -interface IsPrivate { +export interface IsPrivate { /** @description Whether the channel should be private. */ is_private?: boolean; } @@ -38,26 +35,28 @@ interface Message extends Channel { /** @description Unique identifier of message. */ ts: string; } -interface UserIDs { +export 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 { +export 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; -}; +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 {} @@ -78,15 +77,21 @@ export interface ConversationsCreateArguments extends IsPrivate, TokenOverridabl export interface ConversationsDeclineSharedInviteArguments extends InviteID, TargetTeam, TokenOverridable {} // https://api.slack.com/methods/conversations.externalInvitePermissions.set -export interface ConversationsExternalInvitePermissionsSetArguments extends Channel, Required, - TokenOverridable { +export interface ConversationsExternalInvitePermissionsSetArguments + extends Channel, + Required, + TokenOverridable { /** @description The type of action be taken: `upgrade` or `downgrade`. */ action: 'downgrade' | 'upgrade'; } // https://api.slack.com/methods/conversations.history -export interface ConversationsHistoryArguments extends Channel, IncludeAllMetadata, TokenOverridable, - CursorPaginationEnabled, TimelinePaginationEnabled {} +export interface ConversationsHistoryArguments + extends Channel, + IncludeAllMetadata, + TokenOverridable, + CursorPaginationEnabled, + TimelinePaginationEnabled {} // https://api.slack.com/methods/conversations.info export interface ConversationsInfoArguments extends Channel, TokenOverridable, LocaleAware { @@ -106,10 +111,12 @@ export interface ConversationsInviteArguments extends Channel, Users, TokenOverr } // 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; -}; +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 {} @@ -123,41 +130,48 @@ export interface ConversationsKickArguments extends Channel, TokenOverridable { export interface ConversationsLeaveArguments extends Channel, TokenOverridable {} // https://api.slack.com/methods/conversations.list -export type ConversationsListArguments = OptionalArgument; +export type ConversationsListArguments = OptionalArgument< + 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 type ConversationsListConnectInvitesArguments = OptionalArgument; +export type ConversationsListConnectInvitesArguments = OptionalArgument< + 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 { } +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; -}; +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 { @@ -166,8 +180,12 @@ export interface ConversationsRenameArguments extends Channel, TokenOverridable } // https://api.slack.com/methods/conversations.replies -export interface ConversationsRepliesArguments extends Message, IncludeAllMetadata, TokenOverridable, - CursorPaginationEnabled, TimelinePaginationEnabled {} +export interface ConversationsRepliesArguments + extends Message, + IncludeAllMetadata, + TokenOverridable, + CursorPaginationEnabled, + TimelinePaginationEnabled {} // https://api.slack.com/methods/conversations.setPurpose export interface ConversationsSetPurposeArguments extends Channel, TokenOverridable { diff --git a/packages/web-api/src/types/request/dialog.ts b/packages/web-api/src/types/request/dialog.ts index 1282fca88..ec9e33f26 100644 --- a/packages/web-api/src/types/request/dialog.ts +++ b/packages/web-api/src/types/request/dialog.ts @@ -1,5 +1,5 @@ -import type { TokenOverridable } from './common'; import type { Dialog } from '@slack/types'; +import type { TokenOverridable } from './common'; // https://api.slack.com/methods/dialog.open export interface DialogOpenArguments extends TokenOverridable { diff --git a/packages/web-api/src/types/request/dnd.ts b/packages/web-api/src/types/request/dnd.ts index a530f7167..1d4b0933c 100644 --- a/packages/web-api/src/types/request/dnd.ts +++ b/packages/web-api/src/types/request/dnd.ts @@ -1,15 +1,18 @@ -import { OptionalTeamAssignable, TokenOverridable } from './common'; -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; +import type { OptionalTeamAssignable, TokenOverridable } from './common'; // https://api.slack.com/methods/dnd.endDnd export type DndEndDndArguments = OptionalArgument; // https://api.slack.com/methods/dnd.endSnooze export type DndEndSnoozeArguments = OptionalArgument; // https://api.slack.com/methods/dnd.info -export type DndInfoArguments = OptionalArgument; +export type DndInfoArguments = OptionalArgument< + 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. */ diff --git a/packages/web-api/src/types/request/emoji.ts b/packages/web-api/src/types/request/emoji.ts index f63b0c515..f62e741b8 100644 --- a/packages/web-api/src/types/request/emoji.ts +++ b/packages/web-api/src/types/request/emoji.ts @@ -1,7 +1,9 @@ -import { TokenOverridable } from './common'; -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; +import type { TokenOverridable } from './common'; // https://api.slack.com/methods/emoji.list -export type EmojiListArguments = OptionalArgument; +export type EmojiListArguments = OptionalArgument< + 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 index b4e7fa68e..40dc26134 100644 --- a/packages/web-api/src/types/request/files.ts +++ b/packages/web-api/src/types/request/files.ts @@ -1,48 +1,48 @@ +import type { Stream } from 'node:stream'; +import type { ExcludeFromUnion } from '../helpers'; +import type { FilesGetUploadURLExternalResponse } from '../response/index'; import type { CursorPaginationEnabled, OptionalTeamAssignable, TokenOverridable, TraditionalPagingEnabled, } from './common'; -import type { ExcludeFromUnion } from '../helpers'; -import type { FilesGetUploadURLExternalResponse } from '../response/index'; -import type { Stream } from 'node:stream'; -interface FileArgument { +export interface FileArgument { /** @description Encoded file ID. */ file: string; } -interface ExternalIDArgument { +export interface ExternalIDArgument { /** @description Creator defined GUID for the file. */ external_id: string; } -interface ChannelsArgument { +export 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 { +export 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 { +export interface FileUploadComplete { /** @description Encoded file ID. */ id: string; /** @description File title. */ title?: string; } -interface FileChannelDestinationArgument { +export 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 { +export 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. */ @@ -51,10 +51,10 @@ interface FileThreadDestinationArgument { // 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 { +export interface FileChannelDestinationArgumentChannels extends ChannelsArgument { thread_ts?: never; } -interface FileThreadDestinationArgumentChannels extends Required { +export interface FileThreadDestinationArgumentChannels extends Required { /** @description Provide another message's `ts` value to upload this file as a reply. */ thread_ts: string; } @@ -62,12 +62,13 @@ interface FileThreadDestinationArgumentChannels extends Required[]; } // https://slack.dev/node-slack-sdk/web-api#upload-a-file -export type FilesUploadV2Arguments = TokenOverridable & ( - | FileUploadV2 - | (Omit & FilesUploadV2ArgumentsMultipleFiles) -); +export type FilesUploadV2Arguments = TokenOverridable & + (FileUploadV2 | (Omit & FilesUploadV2ArgumentsMultipleFiles)); // 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 & TokenOverridable & -Pick & { - length?: number; - data?: Buffer; -}; +export type FileUploadV2Job = FileUploadV2 & + TokenOverridable & + 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 { +export interface SharedFile { /** @description Title of the file being shared. */ title: string; /** @description URL of the remote file. */ @@ -190,7 +195,7 @@ interface SharedFile { // 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; }); +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 diff --git a/packages/web-api/src/types/request/index.ts b/packages/web-api/src/types/request/index.ts index 275877ce4..44fee11e6 100644 --- a/packages/web-api/src/types/request/index.ts +++ b/packages/web-api/src/types/request/index.ts @@ -1,42 +1,282 @@ -export type { WorkflowsStepCompletedArguments, WorkflowsStepFailedArguments, WorkflowsUpdateStepArguments } from './workflows'; +export type { + WorkflowsStepCompletedArguments, + WorkflowsStepFailedArguments, + WorkflowsUpdateStepArguments, +} from './workflows'; export type { ViewsUpdateArguments, ViewsOpenArguments, ViewsPushArguments, ViewsPublishArguments } from './views'; -export type { UsersConversationsArguments, UsersDiscoverableContactsLookupArguments, UsersInfoArguments, UsersListArguments, UsersIdentityArguments, UsersSetPhotoArguments, UsersProfileGetArguments, UsersProfileSetArguments, UsersDeletePhotoArguments, UsersGetPresenceArguments, UsersSetPresenceArguments, UsersLookupByEmailArguments } from './users'; +export type { + UsersConversationsArguments, + UsersDiscoverableContactsLookupArguments, + UsersInfoArguments, + UsersListArguments, + UsersIdentityArguments, + UsersSetPhotoArguments, + UsersProfileGetArguments, + UsersProfileSetArguments, + UsersDeletePhotoArguments, + UsersGetPresenceArguments, + UsersSetPresenceArguments, + UsersLookupByEmailArguments, +} from './users'; export type { ToolingTokensRotateArguments } from './tooling'; export type { SearchAllArguments, SearchFilesArguments, SearchMessagesArguments } from './search'; -export type { UsergroupsCreateArguments, UsergroupsDisableArguments, UsergroupsEnableArguments, UsergroupsListArguments, UsergroupsUpdateArguments, UsergroupsUsersListArguments, UsergroupsUsersUpdateArguments } from './usergroups'; -export type { TeamAccessLogsArguments, TeamBillableInfoArguments, TeamBillingInfoArguments, TeamExternalTeamsDisconnectArguments, TeamExternalTeamsListArguments, TeamInfoArguments, TeamIntegrationLogsArguments, TeamPreferencesListArguments, TeamProfileGetArguments } from './team'; +export type { + UsergroupsCreateArguments, + UsergroupsDisableArguments, + UsergroupsEnableArguments, + UsergroupsListArguments, + UsergroupsUpdateArguments, + UsergroupsUsersListArguments, + UsergroupsUsersUpdateArguments, +} from './usergroups'; +export type { + TeamAccessLogsArguments, + TeamBillableInfoArguments, + TeamBillingInfoArguments, + TeamExternalTeamsDisconnectArguments, + TeamExternalTeamsListArguments, + TeamInfoArguments, + TeamIntegrationLogsArguments, + TeamPreferencesListArguments, + TeamProfileGetArguments, +} from './team'; export type { StarsAddRemoveArguments, StarsListArguments } from './stars'; export type { RTMConnectArguments, RTMStartArguments } from './rtm'; -export type { RemindersAddArguments, RemindersInfoArguments, RemindersListArguments, RemindersDeleteArguments, RemindersCompleteArguments } from './reminders'; -export type { ReactionsAddArguments, ReactionsGetArguments, ReactionsListArguments, ReactionsRemoveArguments } from './reactions'; +export type { + RemindersAddArguments, + RemindersInfoArguments, + RemindersListArguments, + RemindersDeleteArguments, + RemindersCompleteArguments, +} from './reminders'; +export type { + ReactionsAddArguments, + ReactionsGetArguments, + ReactionsListArguments, + ReactionsRemoveArguments, +} from './reactions'; export type { PinsAddArguments, PinsListArguments, PinsRemoveArguments } from './pins'; export type { OpenIDConnectTokenArguments, OpenIDConnectUserInfoArguments } from './openid'; export type { OAuthAccessArguments, OAuthV2AccessArguments, OAuthV2ExchangeArguments } from './oauth'; export type { MigrationExchangeArguments } from './migration'; -export type { FilesDeleteArguments, FilesInfoArguments, FilesListArguments, FilesRevokePublicURLArguments, FilesSharedPublicURLArguments, FilesUploadArguments, FilesUploadV2Arguments, FilesCompleteUploadExternalArguments, FilesGetUploadURLExternalArguments, FilesCommentsDeleteArguments, FilesRemoteUpdateArguments, FilesRemoteRemoveArguments, FilesRemoteShareArguments, FilesRemoteListArguments, FilesRemoteInfoArguments, FilesRemoteAddArguments } from './files'; +export type { + FilesDeleteArguments, + FilesInfoArguments, + FilesListArguments, + FilesRevokePublicURLArguments, + FilesSharedPublicURLArguments, + FilesUploadArguments, + FilesUploadV2Arguments, + FilesCompleteUploadExternalArguments, + FilesGetUploadURLExternalArguments, + FilesCommentsDeleteArguments, + FilesRemoteUpdateArguments, + FilesRemoteRemoveArguments, + FilesRemoteShareArguments, + FilesRemoteListArguments, + FilesRemoteInfoArguments, + FilesRemoteAddArguments, +} from './files'; export type { EmojiListArguments } from './emoji'; -export type { DndEndDndArguments, DndEndSnoozeArguments, DndInfoArguments, DndSetSnoozeArguments, DndTeamInfoArguments } from './dnd'; +export type { + DndEndDndArguments, + DndEndSnoozeArguments, + DndInfoArguments, + DndSetSnoozeArguments, + DndTeamInfoArguments, +} from './dnd'; export type { DialogOpenArguments } from './dialog'; -export type { ConversationsAcceptSharedInviteArguments, ConversationsApproveSharedInviteArguments, ConversationsArchiveArguments, ConversationsCloseArguments, ConversationsCreateArguments, ConversationsDeclineSharedInviteArguments, ConversationsExternalInvitePermissionsSetArguments, ConversationsHistoryArguments, ConversationsInfoArguments, ConversationsInviteArguments, ConversationsInviteSharedArguments, ConversationsJoinArguments, ConversationsKickArguments, ConversationsLeaveArguments, ConversationsListArguments, ConversationsListConnectInvitesArguments, ConversationsMarkArguments, ConversationsMembersArguments, ConversationsOpenArguments, ConversationsRenameArguments, ConversationsRepliesArguments, ConversationsSetPurposeArguments, ConversationsSetTopicArguments, ConversationsUnarchiveArguments } from './conversations'; -export type { ChatDeleteArguments, ChatDeleteScheduledMessageArguments, ChatGetPermalinkArguments, ChatMeMessageArguments, ChatPostEphemeralArguments, ChatPostMessageArguments, ChatScheduleMessageArguments, ChatScheduledMessagesListArguments, ChatUnfurlArguments, ChatUpdateArguments } from './chat'; -export type { CanvasesAccessDeleteArguments, CanvasesAccessSetArguments, CanvasesCreateArguments, CanvasesDeleteArguments, CanvasesEditArguments, CanvasesSectionsLookupArguments, ConversationsCanvasesCreateArguments } from './canvas'; -export type { CallsAddArguments, CallsEndArguments, CallsInfoArguments, CallsUpdateArguments, CallsParticipantsAddArguments, CallsParticipantsRemoveArguments } from './calls'; +export type { + ConversationsAcceptSharedInviteArguments, + ConversationsApproveSharedInviteArguments, + ConversationsArchiveArguments, + ConversationsCloseArguments, + ConversationsCreateArguments, + ConversationsDeclineSharedInviteArguments, + ConversationsExternalInvitePermissionsSetArguments, + ConversationsHistoryArguments, + ConversationsInfoArguments, + ConversationsInviteArguments, + ConversationsInviteSharedArguments, + ConversationsJoinArguments, + ConversationsKickArguments, + ConversationsLeaveArguments, + ConversationsListArguments, + ConversationsListConnectInvitesArguments, + ConversationsMarkArguments, + ConversationsMembersArguments, + ConversationsOpenArguments, + ConversationsRenameArguments, + ConversationsRepliesArguments, + ConversationsSetPurposeArguments, + ConversationsSetTopicArguments, + ConversationsUnarchiveArguments, +} from './conversations'; +export type { + ChatDeleteArguments, + ChatDeleteScheduledMessageArguments, + ChatGetPermalinkArguments, + ChatMeMessageArguments, + ChatPostEphemeralArguments, + ChatPostMessageArguments, + ChatScheduleMessageArguments, + ChatScheduledMessagesListArguments, + ChatUnfurlArguments, + ChatUpdateArguments, +} from './chat'; +export type { + CanvasesAccessDeleteArguments, + CanvasesAccessSetArguments, + CanvasesCreateArguments, + CanvasesDeleteArguments, + CanvasesEditArguments, + CanvasesSectionsLookupArguments, + ConversationsCanvasesCreateArguments, +} from './canvas'; +export type { + CallsAddArguments, + CallsEndArguments, + CallsInfoArguments, + CallsUpdateArguments, + CallsParticipantsAddArguments, + CallsParticipantsRemoveArguments, +} from './calls'; export type { BotsInfoArguments } from './bots'; -export type { BookmarksAddArguments, BookmarksEditArguments, BookmarksListArguments, BookmarksRemoveArguments } from './bookmarks'; +export type { + BookmarksAddArguments, + BookmarksEditArguments, + BookmarksListArguments, + BookmarksRemoveArguments, +} from './bookmarks'; export type { AuthRevokeArguments, AuthTestArguments, AuthTeamsListArguments } from './auth'; -export type { AppsConnectionsOpenArguments, AppsEventAuthorizationsListArguments, AppsManifestCreateArguments, AppsManifestDeleteArguments, AppsManifestExportArguments, AppsManifestUpdateArguments, AppsManifestValidateArguments, AppsUninstallArguments } from './apps'; +export type { + AppsConnectionsOpenArguments, + AppsEventAuthorizationsListArguments, + AppsManifestCreateArguments, + AppsManifestDeleteArguments, + AppsManifestExportArguments, + AppsManifestUpdateArguments, + AppsManifestValidateArguments, + AppsUninstallArguments, +} from './apps'; export type { APITestArguments } from './api'; export type { AdminAnalyticsGetFileArguments } from './admin/analytics'; -export type { AdminAppsActivitiesListArguments, AdminAppsApproveArguments, AdminAppsApprovedListArguments, AdminAppsClearResolutionArguments, AdminAppsConfigLookupArguments, AdminAppsConfigSetArguments, AdminAppsRequestsCancelArguments, AdminAppsRequestsListArguments, AdminAppsRestrictArguments, AdminAppsRestrictedListArguments, AdminAppsUninstallArguments } from './admin/apps'; -export type { AdminAuthPolicyAssignEntitiesArguments, AdminAuthPolicyGetEntitiesArguments, AdminAuthPolicyRemoveEntitiesArguments } from './admin/auth'; -export type { AdminBarriersCreateArguments, AdminBarriersDeleteArguments, AdminBarriersListArguments, AdminBarriersUpdateArguments } from './admin/barriers'; -export 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 './admin/conversations'; -export type { AdminEmojiAddArguments, AdminEmojiAddAliasArguments, AdminEmojiListArguments, AdminEmojiRemoveArguments, AdminEmojiRenameArguments } from './admin/emoji'; -export type { AdminFunctionsListArguments, AdminFunctionsPermissionsLookupArguments, AdminFunctionsPermissionsSetArguments } from './admin/functions'; +export type { + AdminAppsActivitiesListArguments, + AdminAppsApproveArguments, + AdminAppsApprovedListArguments, + AdminAppsClearResolutionArguments, + AdminAppsConfigLookupArguments, + AdminAppsConfigSetArguments, + AdminAppsRequestsCancelArguments, + AdminAppsRequestsListArguments, + AdminAppsRestrictArguments, + AdminAppsRestrictedListArguments, + AdminAppsUninstallArguments, +} from './admin/apps'; +export type { + AdminAuthPolicyAssignEntitiesArguments, + AdminAuthPolicyGetEntitiesArguments, + AdminAuthPolicyRemoveEntitiesArguments, +} from './admin/auth'; +export type { + AdminBarriersCreateArguments, + AdminBarriersDeleteArguments, + AdminBarriersListArguments, + AdminBarriersUpdateArguments, +} from './admin/barriers'; +export 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 './admin/conversations'; +export type { + AdminEmojiAddArguments, + AdminEmojiAddAliasArguments, + AdminEmojiListArguments, + AdminEmojiRemoveArguments, + AdminEmojiRenameArguments, +} from './admin/emoji'; +export type { + AdminFunctionsListArguments, + AdminFunctionsPermissionsLookupArguments, + AdminFunctionsPermissionsSetArguments, +} from './admin/functions'; export type { FunctionsCompleteErrorArguments, FunctionsCompleteSuccessArguments } from './functions'; -export type { AdminInviteRequestsApproveArguments, AdminInviteRequestsApprovedListArguments, AdminInviteRequestsDeniedListArguments, AdminInviteRequestsDenyArguments, AdminInviteRequestsListArguments } from './admin/inviteRequests'; -export type { AdminRolesAddAssignmentsArguments, AdminRolesListAssignmentsArguments, AdminRolesRemoveAssignmentsArguments } from './admin/roles'; -export type { AdminTeamsAdminsListArguments, AdminTeamsCreateArguments, AdminTeamsListArguments, AdminTeamsOwnersListArguments, AdminTeamsSettingsInfoArguments, AdminTeamsSettingsSetDefaultChannelsArguments, AdminTeamsSettingsSetDescriptionArguments, AdminTeamsSettingsSetDiscoverabilityArguments, AdminTeamsSettingsSetIconArguments, AdminTeamsSettingsSetNameArguments } from './admin/teams'; -export type { AdminUsergroupsAddChannelsArguments, AdminUsergroupsAddTeamsArguments, AdminUsergroupsListChannelsArguments, AdminUsergroupsRemoveChannelsArguments } from './admin/usergroups'; -export type { AdminUsersAssignArguments, AdminUsersInviteArguments, AdminUsersListArguments, AdminUsersRemoveArguments, AdminUsersSessionListArguments, AdminUsersSessionClearSettingsArguments, AdminUsersSessionGetSettingsArguments, AdminUsersSessionInvalidateArguments, AdminUsersSessionResetArguments, AdminUsersSessionResetBulkArguments, AdminUsersSessionSetSettingsArguments, AdminUsersSetAdminArguments, AdminUsersSetExpirationArguments, AdminUsersSetOwnerArguments, AdminUsersSetRegularArguments, AdminUsersUnsupportedVersionsExportArguments } from './admin/users'; -export type { AdminWorkflowsCollaboratorsAddArguments, AdminWorkflowsCollaboratorsRemoveArguments, AdminWorkflowsPermissionsLookupArguments, AdminWorkflowsSearchArguments, AdminWorkflowsUnpublishArguments } from './admin/workflows'; +export type { + AdminInviteRequestsApproveArguments, + AdminInviteRequestsApprovedListArguments, + AdminInviteRequestsDeniedListArguments, + AdminInviteRequestsDenyArguments, + AdminInviteRequestsListArguments, +} from './admin/inviteRequests'; +export type { + AdminRolesAddAssignmentsArguments, + AdminRolesListAssignmentsArguments, + AdminRolesRemoveAssignmentsArguments, +} from './admin/roles'; +export type { + AdminTeamsAdminsListArguments, + AdminTeamsCreateArguments, + AdminTeamsListArguments, + AdminTeamsOwnersListArguments, + AdminTeamsSettingsInfoArguments, + AdminTeamsSettingsSetDefaultChannelsArguments, + AdminTeamsSettingsSetDescriptionArguments, + AdminTeamsSettingsSetDiscoverabilityArguments, + AdminTeamsSettingsSetIconArguments, + AdminTeamsSettingsSetNameArguments, +} from './admin/teams'; +export type { + AdminUsergroupsAddChannelsArguments, + AdminUsergroupsAddTeamsArguments, + AdminUsergroupsListChannelsArguments, + AdminUsergroupsRemoveChannelsArguments, +} from './admin/usergroups'; +export type { + AdminUsersAssignArguments, + AdminUsersInviteArguments, + AdminUsersListArguments, + AdminUsersRemoveArguments, + AdminUsersSessionListArguments, + AdminUsersSessionClearSettingsArguments, + AdminUsersSessionGetSettingsArguments, + AdminUsersSessionInvalidateArguments, + AdminUsersSessionResetArguments, + AdminUsersSessionResetBulkArguments, + AdminUsersSessionSetSettingsArguments, + AdminUsersSetAdminArguments, + AdminUsersSetExpirationArguments, + AdminUsersSetOwnerArguments, + AdminUsersSetRegularArguments, + AdminUsersUnsupportedVersionsExportArguments, +} from './admin/users'; +export type { + AdminWorkflowsCollaboratorsAddArguments, + AdminWorkflowsCollaboratorsRemoveArguments, + AdminWorkflowsPermissionsLookupArguments, + AdminWorkflowsSearchArguments, + AdminWorkflowsUnpublishArguments, +} from './admin/workflows'; diff --git a/packages/web-api/src/types/request/manifest.ts b/packages/web-api/src/types/request/manifest.ts index abae3f15e..ee7c7030f 100644 --- a/packages/web-api/src/types/request/manifest.ts +++ b/packages/web-api/src/types/request/manifest.ts @@ -1,6 +1,6 @@ export interface Manifest extends Record { /** @description A group of settings that describe the manifest. */ - _metadata?: ManifestMetadata; // eslint-disable-line @typescript-eslint/naming-convention + _metadata?: ManifestMetadata; /** * @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. @@ -439,13 +439,9 @@ type UserScope = // 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 AnyManifestConfigurationScope = 'app_configurations:read' | 'app_configurations:write'; -export type AppManifestLevelScopes = - | 'authorizations:read' - | 'connections:write'; +export type AppManifestLevelScopes = 'authorizations:read' | 'connections:write'; // https://api.slack.com/events?filter=Events // var events = [].slice.call(document.getElementsByClassName('apiReferenceFilterableList__listItemLink')) diff --git a/packages/web-api/src/types/request/openid.ts b/packages/web-api/src/types/request/openid.ts index b813a30fc..7b605f81b 100644 --- a/packages/web-api/src/types/request/openid.ts +++ b/packages/web-api/src/types/request/openid.ts @@ -1,4 +1,4 @@ -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; import type { OAuthCredentials, OAuthGrantRefresh } from './common'; diff --git a/packages/web-api/src/types/request/pins.ts b/packages/web-api/src/types/request/pins.ts index 721667141..9027ade03 100644 --- a/packages/web-api/src/types/request/pins.ts +++ b/packages/web-api/src/types/request/pins.ts @@ -1,4 +1,4 @@ -import { MessageArgument, TokenOverridable } from './common'; +import type { MessageArgument, TokenOverridable } from './common'; // https://api.slack.com/methods/pins.add export interface PinsAddArguments extends MessageArgument, TokenOverridable {} diff --git a/packages/web-api/src/types/request/reactions.ts b/packages/web-api/src/types/request/reactions.ts index 10225bf33..bd7555f96 100644 --- a/packages/web-api/src/types/request/reactions.ts +++ b/packages/web-api/src/types/request/reactions.ts @@ -1,4 +1,5 @@ -import { +import type { OptionalArgument } from '../helpers'; +import type { CursorPaginationEnabled, FileArgument, FileCommentArgument, @@ -7,28 +8,34 @@ import { TokenOverridable, TraditionalPagingEnabled, } from './common'; -import { OptionalArgument } from '../helpers'; -interface ReactionsFull { +export interface ReactionsFull { /** @description If `true`, return the complete reaction list. */ full?: boolean; } -interface ReactionName { +export 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); +export type ReactionsGetArguments = ReactionsFull & + TokenOverridable & + (MessageArgument | FileArgument | FileCommentArgument); // https://api.slack.com/methods/reactions.list -export type ReactionsListArguments = OptionalArgument; +export type ReactionsListArguments = OptionalArgument< + 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); +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 index 1ad0d5868..a2cd87801 100644 --- a/packages/web-api/src/types/request/reminders.ts +++ b/packages/web-api/src/types/request/reminders.ts @@ -1,5 +1,5 @@ -import { OptionalTeamAssignable, TokenOverridable } from './common'; -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; +import type { OptionalTeamAssignable, TokenOverridable } from './common'; interface ReminderRecurrenceDailyMonthlyYearly { /** @description Specifies the repeating behavior of a reminder. */ @@ -10,7 +10,7 @@ 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[]] + weekdays: [DaysOfTheWeek, ...DaysOfTheWeek[]]; } type ReminderRecurrence = ReminderRecurrenceWeekly | ReminderRecurrenceDailyMonthlyYearly; // https://api.slack.com/methods/reminders.add diff --git a/packages/web-api/src/types/request/rtm.ts b/packages/web-api/src/types/request/rtm.ts index 26e5ea92a..157e7bf2a 100644 --- a/packages/web-api/src/types/request/rtm.ts +++ b/packages/web-api/src/types/request/rtm.ts @@ -1,30 +1,35 @@ -import { LocaleAware, TokenOverridable } from './common'; -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; +import type { LocaleAware, TokenOverridable } from './common'; // https://api.slack.com/methods/rtm.connect -export type RTMConnectArguments = OptionalArgument; +export type RTMConnectArguments = OptionalArgument< + 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 type RTMStartArguments = OptionalArgument; +export type RTMStartArguments = OptionalArgument< + 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 index e7264b845..cdf92063e 100644 --- a/packages/web-api/src/types/request/search.ts +++ b/packages/web-api/src/types/request/search.ts @@ -1,4 +1,4 @@ -import { OptionalTeamAssignable, SortDir, TokenOverridable, TraditionalPagingEnabled } from './common'; +import type { OptionalTeamAssignable, SortDir, TokenOverridable, TraditionalPagingEnabled } from './common'; interface Searchable extends OptionalTeamAssignable, SortDir { /** @description Search query. */ @@ -13,11 +13,8 @@ interface Searchable extends OptionalTeamAssignable, SortDir { } // https://api.slack.com/methods/search.all -export interface SearchAllArguments extends TokenOverridable, TraditionalPagingEnabled, - Searchable { } +export interface SearchAllArguments extends TokenOverridable, TraditionalPagingEnabled, Searchable {} // https://api.slack.com/methods/search.files -export interface SearchFilesArguments extends TokenOverridable, TraditionalPagingEnabled, - Searchable { } +export interface SearchFilesArguments extends TokenOverridable, TraditionalPagingEnabled, Searchable {} // https://api.slack.com/methods/search.messages -export interface SearchMessagesArguments extends TokenOverridable, TraditionalPagingEnabled, - Searchable { } +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 index dc580853c..1c15d9070 100644 --- a/packages/web-api/src/types/request/stars.ts +++ b/packages/web-api/src/types/request/stars.ts @@ -1,4 +1,4 @@ -import { +import type { CursorPaginationEnabled, FileArgument, FileCommentArgument, @@ -9,13 +9,16 @@ import { } from './common'; /** @description When starring something, it can be starred _to_ a channel. */ -interface StarsChannelDestination { +export 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); + (StarsChannelDestination | MessageArgument | FileArgument | FileCommentArgument); // https://api.slack.com/methods/stars.list -export interface StarsListArguments extends TokenOverridable, TraditionalPagingEnabled, - CursorPaginationEnabled, OptionalTeamAssignable { } +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 index b6bb5ca53..de80daac3 100644 --- a/packages/web-api/src/types/request/team.ts +++ b/packages/web-api/src/types/request/team.ts @@ -1,4 +1,5 @@ -import { +import type { OptionalArgument } from '../helpers'; +import type { AppID, CursorPaginationEnabled, OptionalTeamAssignable, @@ -7,65 +8,90 @@ import { TokenOverridable, TraditionalPagingEnabled, } from './common'; -import { OptionalArgument } from '../helpers'; // https://api.slack.com/methods/team.accessLogs -export type TeamAccessLogsArguments = OptionalArgument; +export type TeamAccessLogsArguments = OptionalArgument< + 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 type TeamBillableInfoArguments = OptionalArgument; +export type TeamBillableInfoArguments = OptionalArgument< + 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 type TeamBillingInfoArguments = OptionalArgument; // https://api.slack.com/methods/team.externalTeams.disconnect export type TeamExternalTeamsDisconnectArguments = TokenOverridable & Required; // https://api.slack.com/methods/team.externalTeams.list -export type TeamExternalTeamsListArguments = OptionalArgument; +export type TeamExternalTeamsListArguments = OptionalArgument< + TokenOverridable & + CursorPaginationEnabled & { + /** @description Status of the connected team. */ + connection_status_filter?: 'CONNECTED' | 'DISCONNECTED' | 'BLOCKED' | 'IN_REVIEW'; + /** @description Filters connected orgs by Slack Connect pref override(s) */ + slack_connect_pref_filter?: + | 'approved_orgs_only' + | 'allow_sc_file_uploads' + | 'profile_visibility' + | 'away_team_sc_invite_permissions' + | 'accept_sc_invites' + | 'sc_mpdm_to_private' + | 'require_sc_channel_for_sc_dm' + | 'external_awareness_context_bar'; + /** @description Direction to sort in asc or desc. */ + sort_direction?: SortDir['sort_dir']; + /** @description Name of the parameter that we are sorting by. Defaults to `team_name`. */ + sort_field?: 'team_name' | 'last_active_timestamp' | 'connection_status'; + /** @description Shows connected orgs which are connected on a specified encoded workspace ID. */ + workspace_filter?: string[]; + } +>; // https://api.slack.com/methods/team.info -export type TeamInfoArguments = OptionalArgument; +export type TeamInfoArguments = OptionalArgument< + 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 type TeamIntegrationLogsArguments = OptionalArgument & 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; -}>; +export type TeamIntegrationLogsArguments = OptionalArgument< + 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 type TeamProfileGetArguments = OptionalArgument; +export type TeamProfileGetArguments = OptionalArgument< + TokenOverridable & { + /** @description Filter by visibility. */ + visibility?: 'all' | 'visible' | 'hidden'; + } +>; // https://api.slack.com/methods/team.preferences.list export type TeamPreferencesListArguments = OptionalArgument; diff --git a/packages/web-api/src/types/request/usergroups.ts b/packages/web-api/src/types/request/usergroups.ts index 9b26e4c9e..d7f915d08 100644 --- a/packages/web-api/src/types/request/usergroups.ts +++ b/packages/web-api/src/types/request/usergroups.ts @@ -1,7 +1,7 @@ -import { OptionalTeamAssignable, TokenOverridable } from './common'; -import { OptionalArgument } from '../helpers'; +import type { OptionalArgument } from '../helpers'; +import type { OptionalTeamAssignable, TokenOverridable } from './common'; -interface UsergroupsIncludeCount { +export interface UsergroupsIncludeCount { /** @description Include the number of users in each User Group. */ include_count?: boolean; } @@ -28,17 +28,22 @@ export interface UsergroupsEnableArguments extends TokenOverridable, OptionalTea usergroup: string; } // https://api.slack.com/methods/usergroups.list -export type UsergroupsListArguments = OptionalArgument; +export type UsergroupsListArguments = OptionalArgument< + 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 { +export interface UsergroupsUpdateArguments + extends TokenOverridable, + OptionalTeamAssignable, + Partial { /** @description The encoded ID of the User Group to update. */ usergroup: string; } @@ -50,8 +55,10 @@ export interface UsergroupsUsersListArguments extends TokenOverridable, Optional include_disabled?: boolean; } // https://api.slack.com/methods/usergroups.users.update -export interface UsergroupsUsersUpdateArguments extends TokenOverridable, OptionalTeamAssignable, - UsergroupsIncludeCount { +export interface UsergroupsUsersUpdateArguments + extends TokenOverridable, + OptionalTeamAssignable, + UsergroupsIncludeCount { /** @description The encoded ID of the User Group to update users for. */ usergroup: string; /** diff --git a/packages/web-api/src/types/request/users.ts b/packages/web-api/src/types/request/users.ts index 3762e09b2..b591ceec7 100644 --- a/packages/web-api/src/types/request/users.ts +++ b/packages/web-api/src/types/request/users.ts @@ -1,6 +1,6 @@ -import { Stream } from 'node:stream'; +import type { Stream } from 'node:stream'; -import { CursorPaginationEnabled, LocaleAware, OptionalTeamAssignable, TokenOverridable } from './common'; +import type { CursorPaginationEnabled, LocaleAware, OptionalTeamAssignable, TokenOverridable } from './common'; interface Email { /** @description An email address belonging to a user in the workspace */ @@ -23,24 +23,27 @@ export interface UsersConversationsArguments extends TokenOverridable, CursorPag user?: string; } // https://api.slack.com/methods/users.deletePhoto -export interface UsersDeletePhotoArguments extends TokenOverridable { } +export interface UsersDeletePhotoArguments extends TokenOverridable {} // https://api.slack.com/methods/users.discoverableContacts.lookup -export interface UsersDiscoverableContactsLookupArguments extends Email, TokenOverridable { } +export interface UsersDiscoverableContactsLookupArguments extends Email, 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 { } +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 { } +export interface UsersListArguments + extends TokenOverridable, + CursorPaginationEnabled, + LocaleAware, + OptionalTeamAssignable {} // https://api.slack.com/methods/users.lookupByEmail export interface UsersLookupByEmailArguments extends Email, TokenOverridable {} // https://api.slack.com/methods/users.setPhoto diff --git a/packages/web-api/src/types/request/views.ts b/packages/web-api/src/types/request/views.ts index dea7d00f5..2039329c7 100644 --- a/packages/web-api/src/types/request/views.ts +++ b/packages/web-api/src/types/request/views.ts @@ -1,20 +1,20 @@ -import { View } from '@slack/types'; +import type { View } from '@slack/types'; -import { TokenOverridable } from './common'; +import type { TokenOverridable } from './common'; -interface BaseViewsArguments { +export interface BaseViewsArguments { /** @description A {@link https://api.slack.com/reference/surfaces/views view payload}. */ view: View; } -interface ViewTriggerId { +export 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 { +export 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. @@ -28,7 +28,7 @@ export type ViewsOpenArguments = BaseViewsArguments & TokenOverridable & (ViewTr // https://api.slack.com/methods/views.push export type ViewsPushArguments = BaseViewsArguments & TokenOverridable & (ViewTriggerId | ViewInteractivityPointer); -interface ViewHash { +export 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}. @@ -42,14 +42,14 @@ export interface ViewsPublishArguments extends BaseViewsArguments, TokenOverrida user_id: string; } -interface ViewExternalId { +export 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 { +export interface ViewViewId { /** * @description A unique identifier of the view to be updated. Either `view_id` or `external_id` is required. */ diff --git a/packages/web-api/src/types/request/workflows.ts b/packages/web-api/src/types/request/workflows.ts index 6fc387c7c..49f661026 100644 --- a/packages/web-api/src/types/request/workflows.ts +++ b/packages/web-api/src/types/request/workflows.ts @@ -1,4 +1,4 @@ -import { TokenOverridable } from './common'; +import type { 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 @@ -22,14 +22,14 @@ export interface WorkflowsUpdateStepArguments extends TokenOverridable { step_name?: string; inputs?: { [name: string]: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: steps from apps inputs are untyped value: any; skip_variable_replacement?: boolean; variables?: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: steps from apps inputs are untyped [key: string]: any; }; - }, + }; }; outputs?: { type: string; diff --git a/packages/web-api/src/types/response/AdminAnalyticsGetFileResponse.ts b/packages/web-api/src/types/response/AdminAnalyticsGetFileResponse.ts index 45bdc77f1..e33b954f9 100644 --- a/packages/web-api/src/types/response/AdminAnalyticsGetFileResponse.ts +++ b/packages/web-api/src/types/response/AdminAnalyticsGetFileResponse.ts @@ -1,12 +1,16 @@ /* eslint-disable no-multi-spaces,max-len */ -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAnalyticsGetFileResponse = WebAPICallResult & { - file_data?: (AdminAnalyticsMemberDetails | AdminAnalyticsPublicChannelDetails | AdminAnalyticsPublicChannelMetadataDetails)[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + file_data?: ( + | AdminAnalyticsMemberDetails + | AdminAnalyticsPublicChannelDetails + | AdminAnalyticsPublicChannelMetadataDetails + )[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; @@ -15,72 +19,72 @@ export interface ResponseMetadata { } export interface AdminAnalyticsMemberDetails { - enterprise_id: string; - team_id: string; - date: string; - user_id: string; - email_address: string; - is_guest: boolean; - is_billable_seat: boolean; - is_active: boolean; - is_active_ios: boolean; - is_active_android: boolean; - is_active_desktop: boolean; - reactions_added_count: number; - messages_posted_count: number; + enterprise_id: string; + team_id: string; + date: string; + user_id: string; + email_address: string; + is_guest: boolean; + is_billable_seat: boolean; + is_active: boolean; + is_active_ios: boolean; + is_active_android: boolean; + is_active_desktop: boolean; + reactions_added_count: number; + messages_posted_count: number; channel_messages_posted_count: number; - files_added_count: number; - is_active_apps: boolean; - is_active_workflows: boolean; - is_active_slack_connect: boolean; - total_calls_count: number; - slack_calls_count: number; - slack_huddles_count: number; - search_count: number; - date_claimed: number; + files_added_count: number; + is_active_apps: boolean; + is_active_workflows: boolean; + is_active_slack_connect: boolean; + total_calls_count: number; + slack_calls_count: number; + slack_huddles_count: number; + search_count: number; + date_claimed: number; } export interface AdminAnalyticsPublicChannelDetails { - enterprise_id: string; - originating_team: AdminAnalyticsOriginatingTeamDetails; - channel_id: string; - date_created: number; - date_last_active: number; - total_members_count: number; - full_members_count: number; - guest_member_count: number; - messages_posted_count: number; - messages_posted_by_members_count: number; - members_who_viewed_count: number; - members_who_posted_count: number; - reactions_added_count: number; - visibility: string; - channel_type: string; - is_shared_externally: boolean; - shared_with: AdminAnalyticsSharedWithDetails[]; + enterprise_id: string; + originating_team: AdminAnalyticsOriginatingTeamDetails; + channel_id: string; + date_created: number; + date_last_active: number; + total_members_count: number; + full_members_count: number; + guest_member_count: number; + messages_posted_count: number; + messages_posted_by_members_count: number; + members_who_viewed_count: number; + members_who_posted_count: number; + reactions_added_count: number; + visibility: string; + channel_type: string; + is_shared_externally: boolean; + shared_with: AdminAnalyticsSharedWithDetails[]; externally_shared_with_organizations: AdminAnalyticsExternallySharedWithOrganizationsDetails[]; - date: string; + date: string; } export interface AdminAnalyticsPublicChannelMetadataDetails { - channel_id: string; - name: string; - topic: string; + channel_id: string; + name: string; + topic: string; description: string; - date: string; + date: string; } export interface AdminAnalyticsOriginatingTeamDetails { team_id: string; - name: string; + name: string; } export interface AdminAnalyticsSharedWithDetails { team_id: string; - name: string; + name: string; } export interface AdminAnalyticsExternallySharedWithOrganizationsDetails { - name: string; - domain: string; + name: string; + domain: string; } diff --git a/packages/web-api/src/types/response/AdminAppsActivitiesListResponse.ts b/packages/web-api/src/types/response/AdminAppsActivitiesListResponse.ts index cb8c0ff25..5e91160e7 100644 --- a/packages/web-api/src/types/response/AdminAppsActivitiesListResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsActivitiesListResponse.ts @@ -8,81 +8,80 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsActivitiesListResponse = WebAPICallResult & { - activities?: Activity[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + activities?: Activity[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Activity { - app_id?: string; - component_id?: string; + app_id?: string; + component_id?: string; component_type?: string; - created?: number; - enterprise_id?: string; - event_type?: string; - level?: string; - payload?: Payload; - source?: string; - team_id?: string; - trace_id?: string; + created?: number; + enterprise_id?: string; + event_type?: string; + level?: string; + payload?: Payload; + source?: string; + team_id?: string; + trace_id?: string; } export interface Payload { - action?: string; - actor?: string; - billing_reason?: string[]; - bot_user_id?: string; - bundle_size_kb?: number; - channel_id?: string; - current_step?: number; - datastore_name?: string; - details?: string; - error?: string; - exec_outcome?: string; + action?: string; + actor?: string; + billing_reason?: string[]; + bot_user_id?: string; + bundle_size_kb?: number; + channel_id?: string; + current_step?: number; + datastore_name?: string; + details?: string; + error?: string; + exec_outcome?: string; function_execution_id?: string; - function_id?: string; - function_name?: string; - function_type?: string; - inputs?: Inputs; - is_billing_excluded?: boolean; - log?: string; - request_type?: string; - team_id?: string; - total_steps?: number; - trigger?: Trigger; - type?: string; - user_id?: string; - workflow_name?: string; + function_id?: string; + function_name?: string; + function_type?: string; + inputs?: Inputs; + is_billing_excluded?: boolean; + log?: string; + request_type?: string; + team_id?: string; + total_steps?: number; + trigger?: Trigger; + type?: string; + user_id?: string; + workflow_name?: string; } -export interface Inputs { -} +export type Inputs = {}; export interface Trigger { - config?: Config; - id?: string; + config?: Config; + id?: string; trip_information?: TripInformation; - type?: string; + type?: string; } export interface Config { description?: string; - event_type?: string; - name?: string; - schema?: Inputs; + event_type?: string; + name?: string; + schema?: Inputs; } export interface TripInformation { channel_id?: string; - list_id?: string; + list_id?: string; message_ts?: string; - reaction?: string; - user_id?: string; + reaction?: string; + user_id?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminAppsApproveResponse.ts b/packages/web-api/src/types/response/AdminAppsApproveResponse.ts index 0cf8c7d11..26c8aabb6 100644 --- a/packages/web-api/src/types/response/AdminAppsApproveResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsApproveResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsApproveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - warning?: string; + warning?: string; }; diff --git a/packages/web-api/src/types/response/AdminAppsApprovedListResponse.ts b/packages/web-api/src/types/response/AdminAppsApprovedListResponse.ts index a55adddff..65a1ab773 100644 --- a/packages/web-api/src/types/response/AdminAppsApprovedListResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsApprovedListResponse.ts @@ -8,66 +8,66 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsApprovedListResponse = WebAPICallResult & { - approved_apps?: ApprovedApp[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + approved_apps?: ApprovedApp[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ApprovedApp { - app?: App; - date_updated?: number; + app?: App; + date_updated?: number; last_resolved_by?: LastResolvedBy; - scopes?: Scope[]; + scopes?: Scope[]; } export interface App { - additional_info?: string; - app_directory_url?: string; - app_homepage_url?: string; - description?: string; - help_url?: string; - icons?: Icons; - id?: string; + additional_info?: string; + app_directory_url?: string; + app_homepage_url?: string; + description?: string; + help_url?: string; + icons?: Icons; + id?: string; is_app_directory_approved?: boolean; - is_internal?: boolean; - name?: string; - privacy_policy_url?: string; + is_internal?: boolean; + name?: string; + privacy_policy_url?: string; } export interface Icons { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface LastResolvedBy { - actor_id?: string; + actor_id?: string; actor_type?: string; } export interface Scope { - description?: string; + description?: string; is_sensitive?: boolean; - name?: string; - token_type?: string; + name?: string; + token_type?: string; } export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; - warnings?: string[]; + warnings?: string[]; } diff --git a/packages/web-api/src/types/response/AdminAppsClearResolutionResponse.ts b/packages/web-api/src/types/response/AdminAppsClearResolutionResponse.ts index 8b93a3442..9969d3391 100644 --- a/packages/web-api/src/types/response/AdminAppsClearResolutionResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsClearResolutionResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsClearResolutionResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - warning?: string; + warning?: string; }; diff --git a/packages/web-api/src/types/response/AdminAppsConfigLookupResponse.ts b/packages/web-api/src/types/response/AdminAppsConfigLookupResponse.ts index 7f7ff871a..7688f0a37 100644 --- a/packages/web-api/src/types/response/AdminAppsConfigLookupResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsConfigLookupResponse.ts @@ -8,25 +8,25 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsConfigLookupResponse = WebAPICallResult & { - configs?: Config[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + configs?: Config[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Config { - app_id?: string; - domain_restrictions?: DomainRestrictions; + app_id?: string; + domain_restrictions?: DomainRestrictions; workflow_auth_strategy?: string; } export interface DomainRestrictions { emails?: string[]; - urls?: string[]; + urls?: string[]; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminAppsConfigSetResponse.ts b/packages/web-api/src/types/response/AdminAppsConfigSetResponse.ts index e6644768b..dfbd7ee1f 100644 --- a/packages/web-api/src/types/response/AdminAppsConfigSetResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsConfigSetResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsConfigSetResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminAppsRequestsCancelResponse.ts b/packages/web-api/src/types/response/AdminAppsRequestsCancelResponse.ts index 482f4a7a5..d502b399c 100644 --- a/packages/web-api/src/types/response/AdminAppsRequestsCancelResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsRequestsCancelResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsRequestsCancelResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminAppsRequestsListResponse.ts b/packages/web-api/src/types/response/AdminAppsRequestsListResponse.ts index a6789f520..842301a5e 100644 --- a/packages/web-api/src/types/response/AdminAppsRequestsListResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsRequestsListResponse.ts @@ -8,54 +8,54 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsRequestsListResponse = WebAPICallResult & { - app_requests?: AppRequest[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + app_requests?: AppRequest[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface AppRequest { - app?: App; - date_created?: number; - id?: string; + app?: App; + date_created?: number; + id?: string; is_user_app_collaborator?: boolean; - message?: string; - previous_resolution?: PreviousResolution; - scopes?: any[]; - team?: Team; - user?: User; + message?: string; + previous_resolution?: PreviousResolution; + scopes?: any[]; + team?: Team; + user?: User; } export interface App { - additional_info?: string; - app_directory_url?: string; - app_homepage_url?: string; - description?: string; - help_url?: string; - icons?: Icons; - id?: string; + additional_info?: string; + app_directory_url?: string; + app_homepage_url?: string; + description?: string; + help_url?: string; + icons?: Icons; + id?: string; is_app_directory_approved?: boolean; - is_internal?: boolean; - name?: string; - privacy_policy_url?: string; + is_internal?: boolean; + name?: string; + privacy_policy_url?: string; } export interface Icons { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } @@ -66,18 +66,18 @@ export interface PreviousResolution { export interface Team { domain?: string; - id?: string; - name?: string; + id?: string; + name?: string; } export interface User { email?: string; - id?: string; - name?: string; + id?: string; + name?: string; } export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; - warnings?: string[]; + warnings?: string[]; } diff --git a/packages/web-api/src/types/response/AdminAppsRestrictResponse.ts b/packages/web-api/src/types/response/AdminAppsRestrictResponse.ts index 421941cd3..7593761b4 100644 --- a/packages/web-api/src/types/response/AdminAppsRestrictResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsRestrictResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsRestrictResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - warning?: string; + warning?: string; }; diff --git a/packages/web-api/src/types/response/AdminAppsRestrictedListResponse.ts b/packages/web-api/src/types/response/AdminAppsRestrictedListResponse.ts index da9cbe5e3..e98131e47 100644 --- a/packages/web-api/src/types/response/AdminAppsRestrictedListResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsRestrictedListResponse.ts @@ -8,66 +8,66 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsRestrictedListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - restricted_apps?: RestrictedApp[]; - warning?: string; + restricted_apps?: RestrictedApp[]; + warning?: string; }; export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; - warnings?: string[]; + warnings?: string[]; } export interface RestrictedApp { - app?: App; - date_updated?: number; + app?: App; + date_updated?: number; last_resolved_by?: LastResolvedBy; - scopes?: Scope[]; + scopes?: Scope[]; } export interface App { - additional_info?: string; - app_directory_url?: string; - app_homepage_url?: string; - description?: string; - help_url?: string; - icons?: Icons; - id?: string; + additional_info?: string; + app_directory_url?: string; + app_homepage_url?: string; + description?: string; + help_url?: string; + icons?: Icons; + id?: string; is_app_directory_approved?: boolean; - is_internal?: boolean; - name?: string; - privacy_policy_url?: string; + is_internal?: boolean; + name?: string; + privacy_policy_url?: string; } export interface Icons { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface LastResolvedBy { - actor_id?: string; + actor_id?: string; actor_type?: string; } export interface Scope { - description?: string; + description?: string; is_sensitive?: boolean; - name?: string; - token_type?: string; + name?: string; + token_type?: string; } diff --git a/packages/web-api/src/types/response/AdminAppsUninstallResponse.ts b/packages/web-api/src/types/response/AdminAppsUninstallResponse.ts index 1d255b306..a770b4500 100644 --- a/packages/web-api/src/types/response/AdminAppsUninstallResponse.ts +++ b/packages/web-api/src/types/response/AdminAppsUninstallResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAppsUninstallResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - warning?: string; + warning?: string; }; diff --git a/packages/web-api/src/types/response/AdminAuthPolicyAssignEntitiesResponse.ts b/packages/web-api/src/types/response/AdminAuthPolicyAssignEntitiesResponse.ts index cc060ee19..9ae00b34a 100644 --- a/packages/web-api/src/types/response/AdminAuthPolicyAssignEntitiesResponse.ts +++ b/packages/web-api/src/types/response/AdminAuthPolicyAssignEntitiesResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAuthPolicyAssignEntitiesResponse = WebAPICallResult & { entity_total_count?: number; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminAuthPolicyGetEntitiesResponse.ts b/packages/web-api/src/types/response/AdminAuthPolicyGetEntitiesResponse.ts index 38379751b..b578126fb 100644 --- a/packages/web-api/src/types/response/AdminAuthPolicyGetEntitiesResponse.ts +++ b/packages/web-api/src/types/response/AdminAuthPolicyGetEntitiesResponse.ts @@ -8,18 +8,18 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAuthPolicyGetEntitiesResponse = WebAPICallResult & { - entities?: Entity[]; + entities?: Entity[]; entity_total_count?: number; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; }; export interface Entity { - date_added?: number; - entity_id?: string; + date_added?: number; + entity_id?: string; entity_type?: string; } diff --git a/packages/web-api/src/types/response/AdminAuthPolicyRemoveEntitiesResponse.ts b/packages/web-api/src/types/response/AdminAuthPolicyRemoveEntitiesResponse.ts index 0ffb418c1..9cf735dde 100644 --- a/packages/web-api/src/types/response/AdminAuthPolicyRemoveEntitiesResponse.ts +++ b/packages/web-api/src/types/response/AdminAuthPolicyRemoveEntitiesResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminAuthPolicyRemoveEntitiesResponse = WebAPICallResult & { entity_total_count?: number; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminBarriersCreateResponse.ts b/packages/web-api/src/types/response/AdminBarriersCreateResponse.ts index 9d89f1870..5f1b60750 100644 --- a/packages/web-api/src/types/response/AdminBarriersCreateResponse.ts +++ b/packages/web-api/src/types/response/AdminBarriersCreateResponse.ts @@ -8,27 +8,27 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminBarriersCreateResponse = WebAPICallResult & { - barrier?: Barrier; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + barrier?: Barrier; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Barrier { barriered_from_usergroups?: Usergroup[]; - date_update?: number; - enterprise_id?: string; - id?: string; - primary_usergroup?: Usergroup; - restricted_subjects?: string[]; + date_update?: number; + enterprise_id?: string; + id?: string; + primary_usergroup?: Usergroup; + restricted_subjects?: string[]; } export interface Usergroup { - id?: string; + id?: string; name?: string; } diff --git a/packages/web-api/src/types/response/AdminBarriersDeleteResponse.ts b/packages/web-api/src/types/response/AdminBarriersDeleteResponse.ts index 43f889e0a..139889ddc 100644 --- a/packages/web-api/src/types/response/AdminBarriersDeleteResponse.ts +++ b/packages/web-api/src/types/response/AdminBarriersDeleteResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminBarriersDeleteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminBarriersListResponse.ts b/packages/web-api/src/types/response/AdminBarriersListResponse.ts index c6b22ef97..ae1028f71 100644 --- a/packages/web-api/src/types/response/AdminBarriersListResponse.ts +++ b/packages/web-api/src/types/response/AdminBarriersListResponse.ts @@ -8,25 +8,25 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminBarriersListResponse = WebAPICallResult & { barriers?: Barrier[]; - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Barrier { barriered_from_usergroups?: Usergroup[]; - date_update?: number; - enterprise_id?: string; - id?: string; - primary_usergroup?: Usergroup; - restricted_subjects?: string[]; + date_update?: number; + enterprise_id?: string; + id?: string; + primary_usergroup?: Usergroup; + restricted_subjects?: string[]; } export interface Usergroup { - id?: string; + id?: string; name?: string; } diff --git a/packages/web-api/src/types/response/AdminBarriersUpdateResponse.ts b/packages/web-api/src/types/response/AdminBarriersUpdateResponse.ts index 2a78ebd1a..5dba23010 100644 --- a/packages/web-api/src/types/response/AdminBarriersUpdateResponse.ts +++ b/packages/web-api/src/types/response/AdminBarriersUpdateResponse.ts @@ -8,25 +8,25 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminBarriersUpdateResponse = WebAPICallResult & { - barrier?: Barrier; - error?: string; - needed?: string; - ok?: boolean; + barrier?: Barrier; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Barrier { barriered_from_usergroups?: Usergroup[]; - date_update?: number; - enterprise_id?: string; - id?: string; - primary_usergroup?: Usergroup; - restricted_subjects?: string[]; + date_update?: number; + enterprise_id?: string; + id?: string; + primary_usergroup?: Usergroup; + restricted_subjects?: string[]; } export interface Usergroup { - id?: string; + id?: string; name?: string; } diff --git a/packages/web-api/src/types/response/AdminConversationsArchiveResponse.ts b/packages/web-api/src/types/response/AdminConversationsArchiveResponse.ts index 28894add2..612c36ea8 100644 --- a/packages/web-api/src/types/response/AdminConversationsArchiveResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsArchiveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsArchiveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsBulkArchiveResponse.ts b/packages/web-api/src/types/response/AdminConversationsBulkArchiveResponse.ts index c8e892450..e48bac324 100644 --- a/packages/web-api/src/types/response/AdminConversationsBulkArchiveResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsBulkArchiveResponse.ts @@ -8,20 +8,20 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsBulkArchiveResponse = WebAPICallResult & { - bulk_action_id?: string; - error?: string; - needed?: string; - not_added?: NotAdded[]; - ok?: boolean; - provided?: string; + bulk_action_id?: string; + error?: string; + needed?: string; + not_added?: NotAdded[]; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface NotAdded { channel_id?: string; - errors?: string[]; + errors?: string[]; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminConversationsBulkDeleteResponse.ts b/packages/web-api/src/types/response/AdminConversationsBulkDeleteResponse.ts index 4adf68ece..269bedfcf 100644 --- a/packages/web-api/src/types/response/AdminConversationsBulkDeleteResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsBulkDeleteResponse.ts @@ -8,20 +8,20 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsBulkDeleteResponse = WebAPICallResult & { - bulk_action_id?: string; - error?: string; - needed?: string; - not_added?: NotAdded[]; - ok?: boolean; - provided?: string; + bulk_action_id?: string; + error?: string; + needed?: string; + not_added?: NotAdded[]; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface NotAdded { channel_id?: string; - errors?: string[]; + errors?: string[]; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminConversationsBulkMoveResponse.ts b/packages/web-api/src/types/response/AdminConversationsBulkMoveResponse.ts index 2be45b703..2c445ba9f 100644 --- a/packages/web-api/src/types/response/AdminConversationsBulkMoveResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsBulkMoveResponse.ts @@ -8,20 +8,20 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsBulkMoveResponse = WebAPICallResult & { - bulk_action_id?: string; - error?: string; - needed?: string; - not_added?: NotAdded[]; - ok?: boolean; - provided?: string; + bulk_action_id?: string; + error?: string; + needed?: string; + not_added?: NotAdded[]; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface NotAdded { channel_id?: string; - errors?: string[]; + errors?: string[]; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminConversationsConvertToPrivateResponse.ts b/packages/web-api/src/types/response/AdminConversationsConvertToPrivateResponse.ts index 28085a659..9a48cd1a4 100644 --- a/packages/web-api/src/types/response/AdminConversationsConvertToPrivateResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsConvertToPrivateResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsConvertToPrivateResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsConvertToPublicResponse.ts b/packages/web-api/src/types/response/AdminConversationsConvertToPublicResponse.ts index 9a7b9523f..7ae0e22a5 100644 --- a/packages/web-api/src/types/response/AdminConversationsConvertToPublicResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsConvertToPublicResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsConvertToPublicResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminConversationsCreateResponse.ts b/packages/web-api/src/types/response/AdminConversationsCreateResponse.ts index fdaa5141d..51add775a 100644 --- a/packages/web-api/src/types/response/AdminConversationsCreateResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsCreateResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsCreateResponse = WebAPICallResult & { - channel_id?: string; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + channel_id?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminConversationsDeleteResponse.ts b/packages/web-api/src/types/response/AdminConversationsDeleteResponse.ts index 0f5d58e67..ad9174537 100644 --- a/packages/web-api/src/types/response/AdminConversationsDeleteResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsDeleteResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsDeleteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsDisconnectSharedResponse.ts b/packages/web-api/src/types/response/AdminConversationsDisconnectSharedResponse.ts index 9315d6bff..02df35a5b 100644 --- a/packages/web-api/src/types/response/AdminConversationsDisconnectSharedResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsDisconnectSharedResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsDisconnectSharedResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts b/packages/web-api/src/types/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts index 0155f5cb0..ded6cdf1f 100644 --- a/packages/web-api/src/types/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsEkmListOriginalConnectedChannelInfoResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsEkmListOriginalConnectedChannelInfoResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsGetConversationPrefsResponse.ts b/packages/web-api/src/types/response/AdminConversationsGetConversationPrefsResponse.ts index 82e944eab..bc9f69cc4 100644 --- a/packages/web-api/src/types/response/AdminConversationsGetConversationPrefsResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsGetConversationPrefsResponse.ts @@ -8,22 +8,22 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsGetConversationPrefsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - prefs?: Prefs; + error?: string; + needed?: string; + ok?: boolean; + prefs?: Prefs; provided?: string; }; export interface Prefs { - can_huddle?: CanHuddle; - can_thread?: CanThread; + can_huddle?: CanHuddle; + can_thread?: CanThread; enable_at_channel?: CanHuddle; - enable_at_here?: CanHuddle; - membership_limit?: MembershipLimit; - who_can_post?: CanThread; + enable_at_here?: CanHuddle; + membership_limit?: MembershipLimit; + who_can_post?: CanThread; } export interface CanHuddle { diff --git a/packages/web-api/src/types/response/AdminConversationsGetCustomRetentionResponse.ts b/packages/web-api/src/types/response/AdminConversationsGetCustomRetentionResponse.ts index 88ca02175..f13113736 100644 --- a/packages/web-api/src/types/response/AdminConversationsGetCustomRetentionResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsGetCustomRetentionResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsGetCustomRetentionResponse = WebAPICallResult & { - duration_days?: number; - error?: string; + duration_days?: number; + error?: string; is_policy_enabled?: boolean; - needed?: string; - ok?: boolean; - provided?: string; + needed?: string; + ok?: boolean; + provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsGetTeamsResponse.ts b/packages/web-api/src/types/response/AdminConversationsGetTeamsResponse.ts index 514a6714f..5a0391143 100644 --- a/packages/web-api/src/types/response/AdminConversationsGetTeamsResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsGetTeamsResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsGetTeamsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; team_ids?: string[]; }; diff --git a/packages/web-api/src/types/response/AdminConversationsInviteResponse.ts b/packages/web-api/src/types/response/AdminConversationsInviteResponse.ts index b9c41cca3..c319d4b38 100644 --- a/packages/web-api/src/types/response/AdminConversationsInviteResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsInviteResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsInviteResponse = WebAPICallResult & { - error?: string; + error?: string; failed_user_ids?: FailedUserids; - needed?: string; - ok?: boolean; - provided?: string; + needed?: string; + ok?: boolean; + provided?: string; }; export interface FailedUserids { diff --git a/packages/web-api/src/types/response/AdminConversationsLookupResponse.ts b/packages/web-api/src/types/response/AdminConversationsLookupResponse.ts index b005c8a1c..e6a2619ed 100644 --- a/packages/web-api/src/types/response/AdminConversationsLookupResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsLookupResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsLookupResponse = WebAPICallResult & { - channel_ids?: string[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + channel_ids?: string[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminConversationsRemoveCustomRetentionResponse.ts b/packages/web-api/src/types/response/AdminConversationsRemoveCustomRetentionResponse.ts index 061c1982c..251cdadeb 100644 --- a/packages/web-api/src/types/response/AdminConversationsRemoveCustomRetentionResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsRemoveCustomRetentionResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsRemoveCustomRetentionResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsRenameResponse.ts b/packages/web-api/src/types/response/AdminConversationsRenameResponse.ts index 96a112652..416ad3ad8 100644 --- a/packages/web-api/src/types/response/AdminConversationsRenameResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsRenameResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsRenameResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsRestrictAccessAddGroupResponse.ts b/packages/web-api/src/types/response/AdminConversationsRestrictAccessAddGroupResponse.ts index 84ee9d5aa..846c969d7 100644 --- a/packages/web-api/src/types/response/AdminConversationsRestrictAccessAddGroupResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsRestrictAccessAddGroupResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsRestrictAccessAddGroupResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminConversationsRestrictAccessListGroupsResponse.ts b/packages/web-api/src/types/response/AdminConversationsRestrictAccessListGroupsResponse.ts index 3c329d2e6..13c39f8d7 100644 --- a/packages/web-api/src/types/response/AdminConversationsRestrictAccessListGroupsResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsRestrictAccessListGroupsResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsRestrictAccessListGroupsResponse = WebAPICallResult & { - error?: string; - group_ids?: string[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + group_ids?: string[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts b/packages/web-api/src/types/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts index b4037cd20..d3369691a 100644 --- a/packages/web-api/src/types/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsRestrictAccessRemoveGroupResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsRestrictAccessRemoveGroupResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminConversationsSearchResponse.ts b/packages/web-api/src/types/response/AdminConversationsSearchResponse.ts index 9c32bff2f..5b59cf233 100644 --- a/packages/web-api/src/types/response/AdminConversationsSearchResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsSearchResponse.ts @@ -8,71 +8,71 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsSearchResponse = WebAPICallResult & { - conversations?: Conversation[]; - error?: string; - needed?: string; - next_cursor?: string; - ok?: boolean; - provided?: string; + conversations?: Conversation[]; + error?: string; + needed?: string; + next_cursor?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - total_count?: number; + total_count?: number; }; export interface Conversation { - canvas?: ListsClass; - channel_email_addresses?: ChannelEmailAddress[]; - channel_manager_count?: number; - connected_limited_team_ids?: string[]; - connected_team_ids?: string[]; - context_team_id?: string; - conversation_host_id?: string; - created?: number; - creator_id?: string; - external_user_count?: number; - id?: string; - internal_team_ids?: string[]; - internal_team_ids_count?: number; + canvas?: ListsClass; + channel_email_addresses?: ChannelEmailAddress[]; + channel_manager_count?: number; + connected_limited_team_ids?: string[]; + connected_team_ids?: string[]; + context_team_id?: string; + conversation_host_id?: string; + created?: number; + creator_id?: string; + external_user_count?: number; + id?: string; + internal_team_ids?: string[]; + internal_team_ids_count?: number; internal_team_ids_sample_team?: string; - is_archived?: boolean; - is_disconnect_in_progress?: boolean; - is_ext_shared?: boolean; - is_frozen?: boolean; - is_general?: boolean; - is_global_shared?: boolean; - is_org_default?: boolean; - is_org_mandatory?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - last_activity_ts?: number; - lists?: ListsClass; - member_count?: number; - name?: string; - pending_connected_team_ids?: string[]; - properties?: Properties; - purpose?: string; + is_archived?: boolean; + is_disconnect_in_progress?: boolean; + is_ext_shared?: boolean; + is_frozen?: boolean; + is_general?: boolean; + is_global_shared?: boolean; + is_org_default?: boolean; + is_org_mandatory?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + last_activity_ts?: number; + lists?: ListsClass; + member_count?: number; + name?: string; + pending_connected_team_ids?: string[]; + properties?: Properties; + purpose?: string; } export interface ListsClass { ownership_details?: OwnershipDetail[]; - total_count?: number; + total_count?: number; } export interface OwnershipDetail { - count?: number; + count?: number; team_id?: string; } export interface ChannelEmailAddress { - address?: string; + address?: string; conversation_id?: string; - date_created?: number; - icons?: Icons; - name?: string; - team_id?: string; - user_id?: string; + date_created?: number; + icons?: Icons; + name?: string; + team_id?: string; + user_id?: string; } export interface Icons { @@ -83,17 +83,17 @@ export interface Icons { export interface Properties { at_channel_restricted?: boolean; - at_here_restricted?: boolean; - canvas?: PropertiesCanvas; - huddles_restricted?: boolean; + at_here_restricted?: boolean; + canvas?: PropertiesCanvas; + huddles_restricted?: boolean; posting_restricted_to?: PostingRestrictedTo; - tabs?: Tab[]; + tabs?: Tab[]; threads_restricted_to?: ThreadsRestrictedTo; } export interface PropertiesCanvas { - file_id?: string; - is_empty?: boolean; + file_id?: string; + is_empty?: boolean; quip_thread_id?: string; } @@ -103,9 +103,9 @@ export interface PostingRestrictedTo { } export interface Tab { - id?: string; + id?: string; label?: string; - type?: string; + type?: string; } export interface ThreadsRestrictedTo { diff --git a/packages/web-api/src/types/response/AdminConversationsSetConversationPrefsResponse.ts b/packages/web-api/src/types/response/AdminConversationsSetConversationPrefsResponse.ts index b766006c3..2500fb022 100644 --- a/packages/web-api/src/types/response/AdminConversationsSetConversationPrefsResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsSetConversationPrefsResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsSetConversationPrefsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsSetCustomRetentionResponse.ts b/packages/web-api/src/types/response/AdminConversationsSetCustomRetentionResponse.ts index 386770bea..b647b1228 100644 --- a/packages/web-api/src/types/response/AdminConversationsSetCustomRetentionResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsSetCustomRetentionResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsSetCustomRetentionResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsSetTeamsResponse.ts b/packages/web-api/src/types/response/AdminConversationsSetTeamsResponse.ts index 14d142362..19355c55f 100644 --- a/packages/web-api/src/types/response/AdminConversationsSetTeamsResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsSetTeamsResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsSetTeamsResponse = WebAPICallResult & { - channel?: string; - error?: string; - needed?: string; - ok?: boolean; + channel?: string; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsUnarchiveResponse.ts b/packages/web-api/src/types/response/AdminConversationsUnarchiveResponse.ts index ec47e149c..4f35a1c24 100644 --- a/packages/web-api/src/types/response/AdminConversationsUnarchiveResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsUnarchiveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsUnarchiveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminConversationsWhitelistAddResponse.ts b/packages/web-api/src/types/response/AdminConversationsWhitelistAddResponse.ts index 3dd0d1f9a..8d0c267b7 100644 --- a/packages/web-api/src/types/response/AdminConversationsWhitelistAddResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsWhitelistAddResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsWhitelistAddResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts b/packages/web-api/src/types/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts index 6178e38e6..66847eec6 100644 --- a/packages/web-api/src/types/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsWhitelistListGroupsLinkedToChannelResponse.ts @@ -8,15 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsWhitelistListGroupsLinkedToChannelResponse = WebAPICallResult & { - error?: string; - group_ids?: string[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + group_ids?: string[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminConversationsWhitelistRemoveResponse.ts b/packages/web-api/src/types/response/AdminConversationsWhitelistRemoveResponse.ts index 58d02add2..b0f5bc74c 100644 --- a/packages/web-api/src/types/response/AdminConversationsWhitelistRemoveResponse.ts +++ b/packages/web-api/src/types/response/AdminConversationsWhitelistRemoveResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminConversationsWhitelistRemoveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminEmojiAddAliasResponse.ts b/packages/web-api/src/types/response/AdminEmojiAddAliasResponse.ts index c9c4e73d9..8a9bf8a08 100644 --- a/packages/web-api/src/types/response/AdminEmojiAddAliasResponse.ts +++ b/packages/web-api/src/types/response/AdminEmojiAddAliasResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminEmojiAddAliasResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminEmojiAddResponse.ts b/packages/web-api/src/types/response/AdminEmojiAddResponse.ts index b78e3118b..e6b39beda 100644 --- a/packages/web-api/src/types/response/AdminEmojiAddResponse.ts +++ b/packages/web-api/src/types/response/AdminEmojiAddResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminEmojiAddResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminEmojiListResponse.ts b/packages/web-api/src/types/response/AdminEmojiListResponse.ts index d6cae5fe1..99841e58b 100644 --- a/packages/web-api/src/types/response/AdminEmojiListResponse.ts +++ b/packages/web-api/src/types/response/AdminEmojiListResponse.ts @@ -8,20 +8,20 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminEmojiListResponse = WebAPICallResult & { - emoji?: { [key: string]: Emoji }; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + emoji?: { [key: string]: Emoji }; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Emoji { date_created?: number; - uploaded_by?: string; - url?: string; + uploaded_by?: string; + url?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminEmojiRemoveResponse.ts b/packages/web-api/src/types/response/AdminEmojiRemoveResponse.ts index 550948e3f..99518ea39 100644 --- a/packages/web-api/src/types/response/AdminEmojiRemoveResponse.ts +++ b/packages/web-api/src/types/response/AdminEmojiRemoveResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminEmojiRemoveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminEmojiRenameResponse.ts b/packages/web-api/src/types/response/AdminEmojiRenameResponse.ts index a296a2577..e01cb8703 100644 --- a/packages/web-api/src/types/response/AdminEmojiRenameResponse.ts +++ b/packages/web-api/src/types/response/AdminEmojiRenameResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminEmojiRenameResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminFunctionsListResponse.ts b/packages/web-api/src/types/response/AdminFunctionsListResponse.ts index 12312052d..5f05f614d 100644 --- a/packages/web-api/src/types/response/AdminFunctionsListResponse.ts +++ b/packages/web-api/src/types/response/AdminFunctionsListResponse.ts @@ -8,41 +8,41 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminFunctionsListResponse = WebAPICallResult & { - error?: string; - functions?: Function[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + functions?: Function[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Function { - app_id?: string; - callback_id?: string; - date_created?: number; - date_deleted?: number; - date_released?: number; - date_updated?: number; - description?: string; - form_enabled?: boolean; - id?: string; - input_parameters?: PutParameter[]; + app_id?: string; + callback_id?: string; + date_created?: number; + date_deleted?: number; + date_released?: number; + date_updated?: number; + description?: string; + form_enabled?: boolean; + id?: string; + input_parameters?: PutParameter[]; output_parameters?: PutParameter[]; - title?: string; - type?: string; + title?: string; + type?: string; } export interface PutParameter { description?: string; is_required?: boolean; - name?: string; - title?: string; - type?: string; + name?: string; + title?: string; + type?: string; } export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; } diff --git a/packages/web-api/src/types/response/AdminFunctionsPermissionsLookupResponse.ts b/packages/web-api/src/types/response/AdminFunctionsPermissionsLookupResponse.ts index fb3eb75fc..ba667606d 100644 --- a/packages/web-api/src/types/response/AdminFunctionsPermissionsLookupResponse.ts +++ b/packages/web-api/src/types/response/AdminFunctionsPermissionsLookupResponse.ts @@ -8,37 +8,36 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminFunctionsPermissionsLookupResponse = WebAPICallResult & { - error?: string; - errors?: Errors; - needed?: string; - ok?: boolean; - permissions?: { [key: string]: Permission }; - provided?: string; + error?: string; + errors?: Errors; + needed?: string; + ok?: boolean; + permissions?: { [key: string]: Permission }; + provided?: string; response_metadata?: ResponseMetadata; }; -export interface Errors { -} +export type Errors = {}; export interface Permission { allowed_by_admin?: AllowedByAdmin; allowed_entities?: AllowedEntities; - distribution?: AllowedByAdmin; + distribution?: AllowedByAdmin; } export interface AllowedByAdmin { - type?: string; + type?: string; user_ids?: string[]; } export interface AllowedEntities { channel_ids?: string[]; - org_ids?: string[]; - team_ids?: string[]; - type?: string; - user_ids?: string[]; + org_ids?: string[]; + team_ids?: string[]; + type?: string; + user_ids?: string[]; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminFunctionsPermissionsSetResponse.ts b/packages/web-api/src/types/response/AdminFunctionsPermissionsSetResponse.ts index 0e7ed2c80..0a892b975 100644 --- a/packages/web-api/src/types/response/AdminFunctionsPermissionsSetResponse.ts +++ b/packages/web-api/src/types/response/AdminFunctionsPermissionsSetResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminFunctionsPermissionsSetResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminInviteRequestsApproveResponse.ts b/packages/web-api/src/types/response/AdminInviteRequestsApproveResponse.ts index 2052e0f0c..be799baac 100644 --- a/packages/web-api/src/types/response/AdminInviteRequestsApproveResponse.ts +++ b/packages/web-api/src/types/response/AdminInviteRequestsApproveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminInviteRequestsApproveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminInviteRequestsApprovedListResponse.ts b/packages/web-api/src/types/response/AdminInviteRequestsApprovedListResponse.ts index 67e161dec..9c8245e1a 100644 --- a/packages/web-api/src/types/response/AdminInviteRequestsApprovedListResponse.ts +++ b/packages/web-api/src/types/response/AdminInviteRequestsApprovedListResponse.ts @@ -8,49 +8,49 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminInviteRequestsApprovedListResponse = WebAPICallResult & { approved_requests?: ApprovedRequest[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface ApprovedRequest { - approved_by?: ApprovedBy; - invite?: Invite; + approved_by?: ApprovedBy; + invite?: Invite; invite_request?: InviteRequest; } export interface ApprovedBy { - actor_id?: string; + actor_id?: string; actor_type?: string; } export interface Invite { - date_created?: number; - email?: string; - id?: string; + date_created?: number; + email?: string; + id?: string; invite_preferences?: InvitePreferences; - inviter_id?: string; - is_bouncing?: boolean; + inviter_id?: string; + is_bouncing?: boolean; } export interface InvitePreferences { - channel_ids?: string[]; - is_domain_matched?: boolean; - is_restricted?: boolean; + channel_ids?: string[]; + is_domain_matched?: boolean; + is_restricted?: boolean; is_ultra_restricted?: boolean; } export interface InviteRequest { - channel_ids?: string[]; - date_created?: number; - email?: string; - id?: string; - invite_type?: string; + channel_ids?: string[]; + date_created?: number; + email?: string; + id?: string; + invite_type?: string; requester_ids?: string[]; } diff --git a/packages/web-api/src/types/response/AdminInviteRequestsDeniedListResponse.ts b/packages/web-api/src/types/response/AdminInviteRequestsDeniedListResponse.ts index e9cc93bc9..5639f6a91 100644 --- a/packages/web-api/src/types/response/AdminInviteRequestsDeniedListResponse.ts +++ b/packages/web-api/src/types/response/AdminInviteRequestsDeniedListResponse.ts @@ -8,34 +8,34 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminInviteRequestsDeniedListResponse = WebAPICallResult & { - denied_requests?: DeniedRequest[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + denied_requests?: DeniedRequest[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface DeniedRequest { - denied_by?: DeniedBy; + denied_by?: DeniedBy; invite_request?: InviteRequest; } export interface DeniedBy { - actor_id?: string; + actor_id?: string; actor_type?: string; } export interface InviteRequest { - channel_ids?: string[]; - date_created?: number; - email?: string; - id?: string; - invite_type?: string; + channel_ids?: string[]; + date_created?: number; + email?: string; + id?: string; + invite_type?: string; request_reason?: string; - requester_ids?: string[]; + requester_ids?: string[]; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminInviteRequestsDenyResponse.ts b/packages/web-api/src/types/response/AdminInviteRequestsDenyResponse.ts index 5a99fdc89..2948970b9 100644 --- a/packages/web-api/src/types/response/AdminInviteRequestsDenyResponse.ts +++ b/packages/web-api/src/types/response/AdminInviteRequestsDenyResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminInviteRequestsDenyResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminInviteRequestsListResponse.ts b/packages/web-api/src/types/response/AdminInviteRequestsListResponse.ts index 1db38b1ca..949a33229 100644 --- a/packages/web-api/src/types/response/AdminInviteRequestsListResponse.ts +++ b/packages/web-api/src/types/response/AdminInviteRequestsListResponse.ts @@ -8,25 +8,25 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminInviteRequestsListResponse = WebAPICallResult & { - error?: string; - invite_requests?: InviteRequest[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + invite_requests?: InviteRequest[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface InviteRequest { - channel_ids?: string[]; - date_created?: number; - date_expire?: number; - email?: string; - id?: string; - invite_type?: string; + channel_ids?: string[]; + date_created?: number; + date_expire?: number; + email?: string; + id?: string; + invite_type?: string; request_reason?: string; - requester_ids?: string[]; + requester_ids?: string[]; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminRolesAddAssignmentsResponse.ts b/packages/web-api/src/types/response/AdminRolesAddAssignmentsResponse.ts index a4ce1d0b2..dfb93cc17 100644 --- a/packages/web-api/src/types/response/AdminRolesAddAssignmentsResponse.ts +++ b/packages/web-api/src/types/response/AdminRolesAddAssignmentsResponse.ts @@ -8,16 +8,16 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminRolesAddAssignmentsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; rejected_users?: RejectedUser[]; }; export interface RejectedUser { error?: string; - id?: string; + id?: string; } diff --git a/packages/web-api/src/types/response/AdminRolesListAssignmentsResponse.ts b/packages/web-api/src/types/response/AdminRolesListAssignmentsResponse.ts index 995cac37a..36a6f3272 100644 --- a/packages/web-api/src/types/response/AdminRolesListAssignmentsResponse.ts +++ b/packages/web-api/src/types/response/AdminRolesListAssignmentsResponse.ts @@ -8,24 +8,24 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminRolesListAssignmentsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - role_assignments?: RoleAssignment[]; + role_assignments?: RoleAssignment[]; }; export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; } export interface RoleAssignment { date_create?: number; - entity_id?: string; - role_id?: string; - user_id?: string; + entity_id?: string; + role_id?: string; + user_id?: string; } diff --git a/packages/web-api/src/types/response/AdminRolesRemoveAssignmentsResponse.ts b/packages/web-api/src/types/response/AdminRolesRemoveAssignmentsResponse.ts index 34fdfe08f..b3064d003 100644 --- a/packages/web-api/src/types/response/AdminRolesRemoveAssignmentsResponse.ts +++ b/packages/web-api/src/types/response/AdminRolesRemoveAssignmentsResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminRolesRemoveAssignmentsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminTeamsAdminsListResponse.ts b/packages/web-api/src/types/response/AdminTeamsAdminsListResponse.ts index 32eb6e58c..4a45c1a97 100644 --- a/packages/web-api/src/types/response/AdminTeamsAdminsListResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsAdminsListResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminTeamsAdminsListResponse = WebAPICallResult & { - admin_ids?: string[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + admin_ids?: string[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminTeamsCreateResponse.ts b/packages/web-api/src/types/response/AdminTeamsCreateResponse.ts index e72883553..3875d9028 100644 --- a/packages/web-api/src/types/response/AdminTeamsCreateResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsCreateResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminTeamsCreateResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - team?: string; + team?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/AdminTeamsListResponse.ts b/packages/web-api/src/types/response/AdminTeamsListResponse.ts index be065d101..358d62683 100644 --- a/packages/web-api/src/types/response/AdminTeamsListResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsListResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminTeamsListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - teams?: Team[]; + teams?: Team[]; }; export interface ResponseMetadata { @@ -24,13 +24,13 @@ export interface ResponseMetadata { export interface Team { discoverability?: string; - id?: string; - name?: string; - primary_owner?: PrimaryOwner; - team_url?: string; + id?: string; + name?: string; + primary_owner?: PrimaryOwner; + team_url?: string; } export interface PrimaryOwner { - email?: string; + email?: string; user_id?: string; } diff --git a/packages/web-api/src/types/response/AdminTeamsOwnersListResponse.ts b/packages/web-api/src/types/response/AdminTeamsOwnersListResponse.ts index 3290fe2ea..153273dfc 100644 --- a/packages/web-api/src/types/response/AdminTeamsOwnersListResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsOwnersListResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminTeamsOwnersListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - owner_ids?: string[]; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + owner_ids?: string[]; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminTeamsSettingsInfoResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsInfoResponse.ts index ceca46eba..1c6f7041a 100644 --- a/packages/web-api/src/types/response/AdminTeamsSettingsInfoResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsInfoResponse.ts @@ -8,38 +8,38 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsInfoResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - team?: Team; + team?: Team; }; export interface Team { - avatar_base_url?: string; - default_channels?: string[]; - domain?: string; - email_domain?: string; + avatar_base_url?: string; + default_channels?: string[]; + domain?: string; + email_domain?: string; enterprise_domain?: string; - enterprise_id?: string; - enterprise_name?: string; - icon?: Icon; - id?: string; - is_verified?: boolean; - name?: string; - url?: string; + enterprise_id?: string; + enterprise_name?: string; + icon?: Icon; + id?: string; + is_verified?: boolean; + name?: string; + url?: string; } export interface Icon { - image_102?: string; - image_132?: string; - image_230?: string; - image_34?: string; - image_44?: string; - image_68?: string; - image_88?: string; - image_default?: boolean; + image_102?: string; + image_132?: string; + image_230?: string; + image_34?: string; + image_44?: string; + image_68?: string; + image_88?: string; + image_default?: boolean; image_original?: string; } diff --git a/packages/web-api/src/types/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts index 2890c8709..c8973cb99 100644 --- a/packages/web-api/src/types/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsSetDefaultChannelsResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsSetDefaultChannelsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminTeamsSettingsSetDescriptionResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsSetDescriptionResponse.ts index 141c2337a..2db89c5cc 100644 --- a/packages/web-api/src/types/response/AdminTeamsSettingsSetDescriptionResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsSetDescriptionResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsSetDescriptionResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts index fbdb00319..3a5789f0b 100644 --- a/packages/web-api/src/types/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsSetDiscoverabilityResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsSetDiscoverabilityResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminTeamsSettingsSetIconResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsSetIconResponse.ts index c0f258d14..03e4977a6 100644 --- a/packages/web-api/src/types/response/AdminTeamsSettingsSetIconResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsSetIconResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsSetIconResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminTeamsSettingsSetNameResponse.ts b/packages/web-api/src/types/response/AdminTeamsSettingsSetNameResponse.ts index 9a11beda4..c9651235f 100644 --- a/packages/web-api/src/types/response/AdminTeamsSettingsSetNameResponse.ts +++ b/packages/web-api/src/types/response/AdminTeamsSettingsSetNameResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminTeamsSettingsSetNameResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsergroupsAddChannelsResponse.ts b/packages/web-api/src/types/response/AdminUsergroupsAddChannelsResponse.ts index 02547b181..ba7f9a63a 100644 --- a/packages/web-api/src/types/response/AdminUsergroupsAddChannelsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsergroupsAddChannelsResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsergroupsAddChannelsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsergroupsAddTeamsResponse.ts b/packages/web-api/src/types/response/AdminUsergroupsAddTeamsResponse.ts index 8c41a2b08..657954303 100644 --- a/packages/web-api/src/types/response/AdminUsergroupsAddTeamsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsergroupsAddTeamsResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsergroupsAddTeamsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsergroupsListChannelsResponse.ts b/packages/web-api/src/types/response/AdminUsergroupsListChannelsResponse.ts index d5999f4ee..3ada32177 100644 --- a/packages/web-api/src/types/response/AdminUsergroupsListChannelsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsergroupsListChannelsResponse.ts @@ -8,48 +8,48 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsergroupsListChannelsResponse = WebAPICallResult & { channels?: Channel[]; - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - context_team_id?: string; - created?: number; - creator?: string; - date_connected?: number; - enterprise_id?: string; - id?: string; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_global_shared?: boolean; - is_group?: boolean; - is_im?: boolean; - is_member?: boolean; - is_moved?: number; - is_mpim?: boolean; - is_org_default?: boolean; - is_org_mandatory?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - name?: string; - name_normalized?: string; + context_team_id?: string; + created?: number; + creator?: string; + date_connected?: number; + enterprise_id?: string; + id?: string; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_global_shared?: boolean; + is_group?: boolean; + is_im?: boolean; + is_member?: boolean; + is_moved?: number; + is_mpim?: boolean; + is_org_default?: boolean; + is_org_mandatory?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + name?: string; + name_normalized?: string; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - properties?: Properties; - purpose?: Purpose; - topic?: Purpose; - unlinked?: number; - updated?: number; + pending_shared?: string[]; + previous_names?: string[]; + properties?: Properties; + purpose?: Purpose; + topic?: Purpose; + unlinked?: number; + updated?: number; } export interface Properties { @@ -62,7 +62,7 @@ export interface RestrictedTo { } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/AdminUsergroupsRemoveChannelsResponse.ts b/packages/web-api/src/types/response/AdminUsergroupsRemoveChannelsResponse.ts index b7f30080c..62d4b4b71 100644 --- a/packages/web-api/src/types/response/AdminUsergroupsRemoveChannelsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsergroupsRemoveChannelsResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsergroupsRemoveChannelsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersAssignResponse.ts b/packages/web-api/src/types/response/AdminUsersAssignResponse.ts index 58c1ba8ed..3f7562c42 100644 --- a/packages/web-api/src/types/response/AdminUsersAssignResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersAssignResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersAssignResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersInviteResponse.ts b/packages/web-api/src/types/response/AdminUsersInviteResponse.ts index 12390cd45..fe364686e 100644 --- a/packages/web-api/src/types/response/AdminUsersInviteResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersInviteResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersInviteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminUsersListResponse.ts b/packages/web-api/src/types/response/AdminUsersListResponse.ts index ae951592b..7e515812e 100644 --- a/packages/web-api/src/types/response/AdminUsersListResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersListResponse.ts @@ -8,37 +8,37 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - users?: User[]; + users?: User[]; }; export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; } export interface User { - date_created?: number; - email?: string; - expiration_ts?: number; - full_name?: string; - has_2fa?: boolean; - has_sso?: boolean; - id?: string; - is_active?: boolean; - is_admin?: boolean; - is_bot?: boolean; - is_owner?: boolean; - is_primary_owner?: boolean; - is_restricted?: boolean; + date_created?: number; + email?: string; + expiration_ts?: number; + full_name?: string; + has_2fa?: boolean; + has_sso?: boolean; + id?: string; + is_active?: boolean; + is_admin?: boolean; + is_bot?: boolean; + is_owner?: boolean; + is_primary_owner?: boolean; + is_restricted?: boolean; is_ultra_restricted?: boolean; - roles?: string[]; - username?: string; - workspaces?: string[]; + roles?: string[]; + username?: string; + workspaces?: string[]; } diff --git a/packages/web-api/src/types/response/AdminUsersRemoveResponse.ts b/packages/web-api/src/types/response/AdminUsersRemoveResponse.ts index b7d10c31b..ce75ed672 100644 --- a/packages/web-api/src/types/response/AdminUsersRemoveResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersRemoveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersRemoveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersSessionClearSettingsResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionClearSettingsResponse.ts index 87e20c7d1..fa47de786 100644 --- a/packages/web-api/src/types/response/AdminUsersSessionClearSettingsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionClearSettingsResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionClearSettingsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersSessionGetSettingsResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionGetSettingsResponse.ts index 5d45bfd6f..f431b07d3 100644 --- a/packages/web-api/src/types/response/AdminUsersSessionGetSettingsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionGetSettingsResponse.ts @@ -8,18 +8,18 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionGetSettingsResponse = WebAPICallResult & { - error?: string; - needed?: string; + error?: string; + needed?: string; no_settings_applied?: string[]; - ok?: boolean; - provided?: string; - session_settings?: SessionSetting[]; + ok?: boolean; + provided?: string; + session_settings?: SessionSetting[]; }; export interface SessionSetting { desktop_app_browser_quit?: boolean; - duration?: number; - user_id?: string; + duration?: number; + user_id?: string; } diff --git a/packages/web-api/src/types/response/AdminUsersSessionInvalidateResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionInvalidateResponse.ts index 1f192f9c7..a799f8afe 100644 --- a/packages/web-api/src/types/response/AdminUsersSessionInvalidateResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionInvalidateResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionInvalidateResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AdminUsersSessionListResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionListResponse.ts index 22b7c9e52..6fbeb2998 100644 --- a/packages/web-api/src/types/response/AdminUsersSessionListResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionListResponse.ts @@ -8,29 +8,29 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionListResponse = WebAPICallResult & { - active_sessions?: ActiveSession[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + active_sessions?: ActiveSession[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface ActiveSession { - created?: Created; - recent?: Created; + created?: Created; + recent?: Created; session_id?: number; - team_id?: string; - user_id?: string; + team_id?: string; + user_id?: string; } export interface Created { - device_hardware?: string; - ip?: string; - os?: string; - os_version?: string; + device_hardware?: string; + ip?: string; + os?: string; + os_version?: string; slack_client_version?: string; } diff --git a/packages/web-api/src/types/response/AdminUsersSessionResetBulkResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionResetBulkResponse.ts index 92fb5b17b..3396d9bd4 100644 --- a/packages/web-api/src/types/response/AdminUsersSessionResetBulkResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionResetBulkResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionResetBulkResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersSessionResetResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionResetResponse.ts index 5226cf9ff..275023cda 100644 --- a/packages/web-api/src/types/response/AdminUsersSessionResetResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionResetResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionResetResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersSessionSetSettingsResponse.ts b/packages/web-api/src/types/response/AdminUsersSessionSetSettingsResponse.ts index b07a8f7f7..843b9a325 100644 --- a/packages/web-api/src/types/response/AdminUsersSessionSetSettingsResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSessionSetSettingsResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSessionSetSettingsResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersSetAdminResponse.ts b/packages/web-api/src/types/response/AdminUsersSetAdminResponse.ts index 7ee8f342a..c4241c804 100644 --- a/packages/web-api/src/types/response/AdminUsersSetAdminResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSetAdminResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSetAdminResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersSetExpirationResponse.ts b/packages/web-api/src/types/response/AdminUsersSetExpirationResponse.ts index c5ef87cf1..cc49cd5d4 100644 --- a/packages/web-api/src/types/response/AdminUsersSetExpirationResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSetExpirationResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSetExpirationResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersSetOwnerResponse.ts b/packages/web-api/src/types/response/AdminUsersSetOwnerResponse.ts index 9654efc70..093a181af 100644 --- a/packages/web-api/src/types/response/AdminUsersSetOwnerResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSetOwnerResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSetOwnerResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersSetRegularResponse.ts b/packages/web-api/src/types/response/AdminUsersSetRegularResponse.ts index 27dc5601b..a02e7b39e 100644 --- a/packages/web-api/src/types/response/AdminUsersSetRegularResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersSetRegularResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersSetRegularResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminUsersUnsupportedVersionsExportResponse.ts b/packages/web-api/src/types/response/AdminUsersUnsupportedVersionsExportResponse.ts index ea679d0f1..2ff942ec9 100644 --- a/packages/web-api/src/types/response/AdminUsersUnsupportedVersionsExportResponse.ts +++ b/packages/web-api/src/types/response/AdminUsersUnsupportedVersionsExportResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminUsersUnsupportedVersionsExportResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsAddResponse.ts b/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsAddResponse.ts index a3359544e..57872f59b 100644 --- a/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsAddResponse.ts +++ b/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsAddResponse.ts @@ -8,19 +8,19 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminWorkflowsCollaboratorsAddResponse = WebAPICallResult & { - error?: string; - errors?: Error[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + errors?: Error[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Error { - message?: string; - user?: string; + message?: string; + user?: string; workflow?: string; } diff --git a/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsRemoveResponse.ts b/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsRemoveResponse.ts index 41f9a586f..8624b1556 100644 --- a/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsRemoveResponse.ts +++ b/packages/web-api/src/types/response/AdminWorkflowsCollaboratorsRemoveResponse.ts @@ -8,17 +8,17 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminWorkflowsCollaboratorsRemoveResponse = WebAPICallResult & { - error?: string; - errors?: Error[]; - needed?: string; - ok?: boolean; + error?: string; + errors?: Error[]; + needed?: string; + ok?: boolean; provided?: string; }; export interface Error { - message?: string; - user?: string; + message?: string; + user?: string; workflow?: string; } diff --git a/packages/web-api/src/types/response/AdminWorkflowsPermissionsLookupResponse.ts b/packages/web-api/src/types/response/AdminWorkflowsPermissionsLookupResponse.ts index eea08db2a..826e245eb 100644 --- a/packages/web-api/src/types/response/AdminWorkflowsPermissionsLookupResponse.ts +++ b/packages/web-api/src/types/response/AdminWorkflowsPermissionsLookupResponse.ts @@ -8,24 +8,24 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminWorkflowsPermissionsLookupResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; permissions?: { [key: string]: Permission }; - provided?: string; + provided?: string; }; export interface Permission { - complete?: boolean; + complete?: boolean; who_can_run?: WhoCanRun; } export interface WhoCanRun { - channel_ids?: string[]; - org_ids?: string[]; + channel_ids?: string[]; + org_ids?: string[]; permission_type?: string; - team_ids?: string[]; - user_ids?: string[]; + team_ids?: string[]; + user_ids?: string[]; } diff --git a/packages/web-api/src/types/response/AdminWorkflowsSearchResponse.ts b/packages/web-api/src/types/response/AdminWorkflowsSearchResponse.ts index 6d27875be..8a93a335b 100644 --- a/packages/web-api/src/types/response/AdminWorkflowsSearchResponse.ts +++ b/packages/web-api/src/types/response/AdminWorkflowsSearchResponse.ts @@ -8,65 +8,65 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminWorkflowsSearchResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - total_found?: number; - workflows?: Workflow[]; + total_found?: number; + workflows?: Workflow[]; }; export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; } export interface Workflow { - app_id?: string; - billing_type?: string; - callback_id?: string; - collaborators?: string[]; - date_updated?: number; - description?: string; - icons?: Icons; - id?: string; - input_parameters?: { [key: string]: InputParameter }; - is_billable?: boolean; - is_published?: boolean; - is_sales_home_workflow?: boolean; - last_published_date?: string; + app_id?: string; + billing_type?: string; + callback_id?: string; + collaborators?: string[]; + date_updated?: number; + description?: string; + icons?: Icons; + id?: string; + input_parameters?: { [key: string]: InputParameter }; + is_billable?: boolean; + is_published?: boolean; + is_sales_home_workflow?: boolean; + last_published_date?: string; last_published_version_id?: string; - last_updated_by?: string; - source?: string; - steps?: Step[]; - team_id?: string; - title?: string; - trigger_ids?: string[]; - unpublished_change_count?: number; - workflow_function_id?: string; + last_updated_by?: string; + source?: string; + steps?: Step[]; + team_id?: string; + title?: string; + trigger_ids?: string[]; + unpublished_change_count?: number; + workflow_function_id?: string; } export interface Icons { image_192?: string; - image_96?: string; + image_96?: string; } export interface InputParameter { description?: string; - is_hidden?: boolean; + is_hidden?: boolean; is_required?: boolean; - name?: string; - title?: string; - type?: string; + name?: string; + title?: string; + type?: string; } export interface Step { function_id?: string; - id?: string; - inputs?: { [key: string]: Input }; + id?: string; + inputs?: { [key: string]: Input }; is_pristine?: boolean; } diff --git a/packages/web-api/src/types/response/AdminWorkflowsUnpublishResponse.ts b/packages/web-api/src/types/response/AdminWorkflowsUnpublishResponse.ts index 2996ff6aa..84d671166 100644 --- a/packages/web-api/src/types/response/AdminWorkflowsUnpublishResponse.ts +++ b/packages/web-api/src/types/response/AdminWorkflowsUnpublishResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AdminWorkflowsUnpublishResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/ApiTestResponse.ts b/packages/web-api/src/types/response/ApiTestResponse.ts index 5bbd5cc3b..ed1d9c1f8 100644 --- a/packages/web-api/src/types/response/ApiTestResponse.ts +++ b/packages/web-api/src/types/response/ApiTestResponse.ts @@ -8,16 +8,16 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ApiTestResponse = WebAPICallResult & { - args?: Args; - error?: string; - needed?: string; - ok?: boolean; + args?: Args; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Args { error?: string; - foo?: string; + foo?: string; } diff --git a/packages/web-api/src/types/response/AppsConnectionsOpenResponse.ts b/packages/web-api/src/types/response/AppsConnectionsOpenResponse.ts index e567c94f4..fcfc4064a 100644 --- a/packages/web-api/src/types/response/AppsConnectionsOpenResponse.ts +++ b/packages/web-api/src/types/response/AppsConnectionsOpenResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsConnectionsOpenResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - url?: string; + url?: string; }; diff --git a/packages/web-api/src/types/response/AppsEventAuthorizationsListResponse.ts b/packages/web-api/src/types/response/AppsEventAuthorizationsListResponse.ts index ad4c09b62..72e2b9cb9 100644 --- a/packages/web-api/src/types/response/AppsEventAuthorizationsListResponse.ts +++ b/packages/web-api/src/types/response/AppsEventAuthorizationsListResponse.ts @@ -8,19 +8,19 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsEventAuthorizationsListResponse = WebAPICallResult & { authorizations?: Authorization[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; }; export interface Authorization { - enterprise_id?: string; - is_bot?: boolean; + enterprise_id?: string; + is_bot?: boolean; is_enterprise_install?: boolean; - team_id?: string; - user_id?: string; + team_id?: string; + user_id?: string; } diff --git a/packages/web-api/src/types/response/AppsManifestCreateResponse.ts b/packages/web-api/src/types/response/AppsManifestCreateResponse.ts index 6d6c6e9ad..53fe91ee2 100644 --- a/packages/web-api/src/types/response/AppsManifestCreateResponse.ts +++ b/packages/web-api/src/types/response/AppsManifestCreateResponse.ts @@ -8,30 +8,30 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsManifestCreateResponse = WebAPICallResult & { - app_id?: string; - credentials?: Credentials; - error?: string; - errors?: Error[]; - needed?: string; + app_id?: string; + credentials?: Credentials; + error?: string; + errors?: Error[]; + needed?: string; oauth_authorize_url?: string; - ok?: boolean; - provided?: string; - response_metadata?: ResponseMetadata; + ok?: boolean; + provided?: string; + response_metadata?: ResponseMetadata; }; export interface Credentials { - client_id?: string; - client_secret?: string; - signing_secret?: string; + client_id?: string; + client_secret?: string; + signing_secret?: string; verification_token?: string; } export interface Error { - code?: string; - message?: string; - pointer?: string; + code?: string; + message?: string; + pointer?: string; related_component?: string; } diff --git a/packages/web-api/src/types/response/AppsManifestDeleteResponse.ts b/packages/web-api/src/types/response/AppsManifestDeleteResponse.ts index d6cd553d2..3e9159f69 100644 --- a/packages/web-api/src/types/response/AppsManifestDeleteResponse.ts +++ b/packages/web-api/src/types/response/AppsManifestDeleteResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsManifestDeleteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AppsManifestExportResponse.ts b/packages/web-api/src/types/response/AppsManifestExportResponse.ts index 7792c8606..fea8539bf 100644 --- a/packages/web-api/src/types/response/AppsManifestExportResponse.ts +++ b/packages/web-api/src/types/response/AppsManifestExportResponse.ts @@ -8,22 +8,22 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsManifestExportResponse = WebAPICallResult & { - error?: string; + error?: string; manifest?: Manifest; - needed?: string; - ok?: boolean; + needed?: string; + ok?: boolean; provided?: string; }; export interface Manifest { - _metadata?: Metadata; + _metadata?: Metadata; display_information?: DisplayInformation; - features?: Features; - functions?: { [key: string]: Function }; - oauth_config?: OauthConfig; - settings?: Settings; + features?: Features; + functions?: { [key: string]: Function }; + oauth_config?: OauthConfig; + settings?: Settings; } export interface Metadata { @@ -33,98 +33,98 @@ export interface Metadata { export interface DisplayInformation { background_color?: string; - description?: string; + description?: string; long_description?: string; - name?: string; + name?: string; } export interface Features { - app_home?: AppHome; - bot_user?: BotUser; - shortcuts?: Shortcut[]; + app_home?: AppHome; + bot_user?: BotUser; + shortcuts?: Shortcut[]; slash_commands?: SlashCommand[]; unfurl_domains?: string[]; } export interface AppHome { - home_tab_enabled?: boolean; - messages_tab_enabled?: boolean; + home_tab_enabled?: boolean; + messages_tab_enabled?: boolean; messages_tab_read_only_enabled?: boolean; } export interface BotUser { always_online?: boolean; - display_name?: string; + display_name?: string; } export interface Shortcut { callback_id?: string; description?: string; - name?: string; - type?: string; + name?: string; + type?: string; } export interface SlashCommand { - command?: string; - description?: string; + command?: string; + description?: string; should_escape?: boolean; - url?: string; - usage_hint?: string; + url?: string; + usage_hint?: string; } export interface Function { - description?: string; - input_parameters?: { [key: string]: PutParameter }; + description?: string; + input_parameters?: { [key: string]: PutParameter }; output_parameters?: { [key: string]: PutParameter }; - title?: string; + title?: string; } export interface PutParameter { description?: string; - hint?: string; + hint?: string; is_required?: boolean; - maxLength?: number; - maximum?: number; - minLength?: number; - minimum?: number; - name?: string; - title?: string; - type?: string; + maxLength?: number; + maximum?: number; + minLength?: number; + minimum?: number; + name?: string; + title?: string; + type?: string; } export interface OauthConfig { - redirect_urls?: string[]; - scopes?: Scopes; + redirect_urls?: string[]; + scopes?: Scopes; token_management_enabled?: boolean; } export interface Scopes { - bot?: string[]; + bot?: string[]; user?: string[]; } export interface Settings { allowed_ip_address_ranges?: string[]; - background_color?: string; - description?: string; - event_subscriptions?: EventSubscriptions; - function_runtime?: string; - hermes_app_type?: string; - interactivity?: Interactivity; - long_description?: string; - org_deploy_enabled?: boolean; - socket_mode_enabled?: boolean; - token_rotation_enabled?: boolean; + background_color?: string; + description?: string; + event_subscriptions?: EventSubscriptions; + function_runtime?: string; + hermes_app_type?: string; + interactivity?: Interactivity; + long_description?: string; + org_deploy_enabled?: boolean; + socket_mode_enabled?: boolean; + token_rotation_enabled?: boolean; } export interface EventSubscriptions { - bot_events?: string[]; + bot_events?: string[]; request_url?: string; user_events?: string[]; } export interface Interactivity { - is_enabled?: boolean; + is_enabled?: boolean; message_menu_options_url?: string; - request_url?: string; + request_url?: string; } diff --git a/packages/web-api/src/types/response/AppsManifestUpdateResponse.ts b/packages/web-api/src/types/response/AppsManifestUpdateResponse.ts index 14134a688..c6e198f3e 100644 --- a/packages/web-api/src/types/response/AppsManifestUpdateResponse.ts +++ b/packages/web-api/src/types/response/AppsManifestUpdateResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsManifestUpdateResponse = WebAPICallResult & { - app_id?: string; - error?: string; - needed?: string; - ok?: boolean; + app_id?: string; + error?: string; + needed?: string; + ok?: boolean; permissions_updated?: boolean; - provided?: string; + provided?: string; }; diff --git a/packages/web-api/src/types/response/AppsManifestValidateResponse.ts b/packages/web-api/src/types/response/AppsManifestValidateResponse.ts index 7b8c1ab00..e32053a3d 100644 --- a/packages/web-api/src/types/response/AppsManifestValidateResponse.ts +++ b/packages/web-api/src/types/response/AppsManifestValidateResponse.ts @@ -8,20 +8,20 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsManifestValidateResponse = WebAPICallResult & { - error?: string; - errors?: Error[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + errors?: Error[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Error { - code?: string; - message?: string; - pointer?: string; + code?: string; + message?: string; + pointer?: string; related_component?: string; } diff --git a/packages/web-api/src/types/response/AppsPermissionsInfoResponse.ts b/packages/web-api/src/types/response/AppsPermissionsInfoResponse.ts index 079f3b018..64c6355e5 100644 --- a/packages/web-api/src/types/response/AppsPermissionsInfoResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsInfoResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsInfoResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AppsPermissionsRequestResponse.ts b/packages/web-api/src/types/response/AppsPermissionsRequestResponse.ts index d64493413..50d9618af 100644 --- a/packages/web-api/src/types/response/AppsPermissionsRequestResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsRequestResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsRequestResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AppsPermissionsResourcesListResponse.ts b/packages/web-api/src/types/response/AppsPermissionsResourcesListResponse.ts index 2f4f0e8f4..4794fbe72 100644 --- a/packages/web-api/src/types/response/AppsPermissionsResourcesListResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsResourcesListResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsResourcesListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AppsPermissionsScopesListResponse.ts b/packages/web-api/src/types/response/AppsPermissionsScopesListResponse.ts index 11eeffc7f..7a8e0883b 100644 --- a/packages/web-api/src/types/response/AppsPermissionsScopesListResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsScopesListResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsScopesListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AppsPermissionsUsersListResponse.ts b/packages/web-api/src/types/response/AppsPermissionsUsersListResponse.ts index d675351a3..241df6d79 100644 --- a/packages/web-api/src/types/response/AppsPermissionsUsersListResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsUsersListResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsUsersListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AppsPermissionsUsersRequestResponse.ts b/packages/web-api/src/types/response/AppsPermissionsUsersRequestResponse.ts index f231ad950..dac179505 100644 --- a/packages/web-api/src/types/response/AppsPermissionsUsersRequestResponse.ts +++ b/packages/web-api/src/types/response/AppsPermissionsUsersRequestResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsPermissionsUsersRequestResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AppsUninstallResponse.ts b/packages/web-api/src/types/response/AppsUninstallResponse.ts index 956647391..704b645e8 100644 --- a/packages/web-api/src/types/response/AppsUninstallResponse.ts +++ b/packages/web-api/src/types/response/AppsUninstallResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AppsUninstallResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/AuthRevokeResponse.ts b/packages/web-api/src/types/response/AuthRevokeResponse.ts index 110808738..d85462076 100644 --- a/packages/web-api/src/types/response/AuthRevokeResponse.ts +++ b/packages/web-api/src/types/response/AuthRevokeResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AuthRevokeResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/AuthTeamsListResponse.ts b/packages/web-api/src/types/response/AuthTeamsListResponse.ts index b6a16aaed..2b4b4b1ba 100644 --- a/packages/web-api/src/types/response/AuthTeamsListResponse.ts +++ b/packages/web-api/src/types/response/AuthTeamsListResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AuthTeamsListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - teams?: Team[]; + teams?: Team[]; }; export interface ResponseMetadata { @@ -24,17 +24,17 @@ export interface ResponseMetadata { export interface Team { icon?: Icon; - id?: string; + id?: string; name?: string; } export interface Icon { - image_102?: string; - image_132?: string; - image_230?: string; - image_34?: string; - image_44?: string; - image_68?: string; - image_88?: string; + image_102?: string; + image_132?: string; + image_230?: string; + image_34?: string; + image_44?: string; + image_68?: string; + image_88?: string; image_default?: boolean; } diff --git a/packages/web-api/src/types/response/AuthTestResponse.ts b/packages/web-api/src/types/response/AuthTestResponse.ts index 9b158029e..5d4a92840 100644 --- a/packages/web-api/src/types/response/AuthTestResponse.ts +++ b/packages/web-api/src/types/response/AuthTestResponse.ts @@ -8,21 +8,21 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type AuthTestResponse = WebAPICallResult & { - app_id?: string; - app_name?: string; - bot_id?: string; - enterprise_id?: string; - error?: string; - expires_in?: number; + app_id?: string; + app_name?: string; + bot_id?: string; + enterprise_id?: string; + error?: string; + expires_in?: number; is_enterprise_install?: boolean; - needed?: string; - ok?: boolean; - provided?: string; - team?: string; - team_id?: string; - url?: string; - user?: string; - user_id?: string; + needed?: string; + ok?: boolean; + provided?: string; + team?: string; + team_id?: string; + url?: string; + user?: string; + user_id?: string; }; diff --git a/packages/web-api/src/types/response/BookmarksAddResponse.ts b/packages/web-api/src/types/response/BookmarksAddResponse.ts index d458b051b..771766a3f 100644 --- a/packages/web-api/src/types/response/BookmarksAddResponse.ts +++ b/packages/web-api/src/types/response/BookmarksAddResponse.ts @@ -8,33 +8,33 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type BookmarksAddResponse = WebAPICallResult & { - bookmark?: Bookmark; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + bookmark?: Bookmark; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Bookmark { - app_action_id?: string; - app_id?: string; - channel_id?: string; - date_created?: number; - date_updated?: number; - emoji?: string; - entity_id?: string; - icon_url?: string; - id?: string; + app_action_id?: string; + app_id?: string; + channel_id?: string; + date_created?: number; + date_updated?: number; + emoji?: string; + entity_id?: string; + icon_url?: string; + id?: string; last_updated_by_team_id?: string; last_updated_by_user_id?: string; - link?: string; - rank?: string; - shortcut_id?: string; - title?: string; - type?: string; + link?: string; + rank?: string; + shortcut_id?: string; + title?: string; + type?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/BookmarksEditResponse.ts b/packages/web-api/src/types/response/BookmarksEditResponse.ts index 1cd98060c..d4849cb0d 100644 --- a/packages/web-api/src/types/response/BookmarksEditResponse.ts +++ b/packages/web-api/src/types/response/BookmarksEditResponse.ts @@ -8,33 +8,33 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type BookmarksEditResponse = WebAPICallResult & { - bookmark?: Bookmark; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + bookmark?: Bookmark; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Bookmark { - app_action_id?: string; - app_id?: string; - channel_id?: string; - date_created?: number; - date_updated?: number; - emoji?: string; - entity_id?: string; - icon_url?: string; - id?: string; + app_action_id?: string; + app_id?: string; + channel_id?: string; + date_created?: number; + date_updated?: number; + emoji?: string; + entity_id?: string; + icon_url?: string; + id?: string; last_updated_by_team_id?: string; last_updated_by_user_id?: string; - link?: string; - rank?: string; - shortcut_id?: string; - title?: string; - type?: string; + link?: string; + rank?: string; + shortcut_id?: string; + title?: string; + type?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/BookmarksListResponse.ts b/packages/web-api/src/types/response/BookmarksListResponse.ts index 6fb4f5ce4..e840c8bc0 100644 --- a/packages/web-api/src/types/response/BookmarksListResponse.ts +++ b/packages/web-api/src/types/response/BookmarksListResponse.ts @@ -8,33 +8,33 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type BookmarksListResponse = WebAPICallResult & { - bookmarks?: Bookmark[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + bookmarks?: Bookmark[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Bookmark { - app_action_id?: string; - app_id?: string; - channel_id?: string; - date_created?: number; - date_updated?: number; - emoji?: string; - entity_id?: string; - icon_url?: string; - id?: string; + app_action_id?: string; + app_id?: string; + channel_id?: string; + date_created?: number; + date_updated?: number; + emoji?: string; + entity_id?: string; + icon_url?: string; + id?: string; last_updated_by_team_id?: string; last_updated_by_user_id?: string; - link?: string; - rank?: string; - shortcut_id?: string; - title?: string; - type?: string; + link?: string; + rank?: string; + shortcut_id?: string; + title?: string; + type?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/BookmarksRemoveResponse.ts b/packages/web-api/src/types/response/BookmarksRemoveResponse.ts index 01236f5cb..8be7594dd 100644 --- a/packages/web-api/src/types/response/BookmarksRemoveResponse.ts +++ b/packages/web-api/src/types/response/BookmarksRemoveResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type BookmarksRemoveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/BotsInfoResponse.ts b/packages/web-api/src/types/response/BotsInfoResponse.ts index 10665fc9c..fff20b635 100644 --- a/packages/web-api/src/types/response/BotsInfoResponse.ts +++ b/packages/web-api/src/types/response/BotsInfoResponse.ts @@ -8,21 +8,21 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type BotsInfoResponse = WebAPICallResult & { - bot?: Bot; - error?: string; - needed?: string; - ok?: boolean; + bot?: Bot; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Bot { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; updated?: number; user_id?: string; } diff --git a/packages/web-api/src/types/response/CallsAddResponse.ts b/packages/web-api/src/types/response/CallsAddResponse.ts index f88470755..8635d66ac 100644 --- a/packages/web-api/src/types/response/CallsAddResponse.ts +++ b/packages/web-api/src/types/response/CallsAddResponse.ts @@ -8,32 +8,32 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CallsAddResponse = WebAPICallResult & { - call?: Call; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + call?: Call; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Call { - date_start?: number; + date_start?: number; desktop_app_join_url?: string; - external_display_id?: string; - external_unique_id?: string; - id?: string; - join_url?: string; - title?: string; - users?: User[]; + external_display_id?: string; + external_unique_id?: string; + id?: string; + join_url?: string; + title?: string; + users?: User[]; } export interface User { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/CallsEndResponse.ts b/packages/web-api/src/types/response/CallsEndResponse.ts index a4c946dd6..ce1605c05 100644 --- a/packages/web-api/src/types/response/CallsEndResponse.ts +++ b/packages/web-api/src/types/response/CallsEndResponse.ts @@ -8,31 +8,31 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CallsEndResponse = WebAPICallResult & { - call?: Call; - error?: string; - needed?: string; - ok?: boolean; + call?: Call; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Call { - channels?: string[]; - date_end?: number; - date_start?: number; + channels?: string[]; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - external_display_id?: string; - external_unique_id?: string; - id?: string; - join_url?: string; - title?: string; - users?: User[]; + external_display_id?: string; + external_unique_id?: string; + id?: string; + join_url?: string; + title?: string; + users?: User[]; } export interface User { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } diff --git a/packages/web-api/src/types/response/CallsInfoResponse.ts b/packages/web-api/src/types/response/CallsInfoResponse.ts index 5d816165f..5e224247b 100644 --- a/packages/web-api/src/types/response/CallsInfoResponse.ts +++ b/packages/web-api/src/types/response/CallsInfoResponse.ts @@ -8,30 +8,30 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CallsInfoResponse = WebAPICallResult & { - call?: Call; - error?: string; - needed?: string; - ok?: boolean; + call?: Call; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Call { - channels?: string[]; - date_start?: number; + channels?: string[]; + date_start?: number; desktop_app_join_url?: string; - external_display_id?: string; - external_unique_id?: string; - id?: string; - join_url?: string; - title?: string; - users?: User[]; + external_display_id?: string; + external_unique_id?: string; + id?: string; + join_url?: string; + title?: string; + users?: User[]; } export interface User { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } diff --git a/packages/web-api/src/types/response/CallsParticipantsAddResponse.ts b/packages/web-api/src/types/response/CallsParticipantsAddResponse.ts index 8ffda7357..c742b2992 100644 --- a/packages/web-api/src/types/response/CallsParticipantsAddResponse.ts +++ b/packages/web-api/src/types/response/CallsParticipantsAddResponse.ts @@ -8,30 +8,30 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CallsParticipantsAddResponse = WebAPICallResult & { - call?: Call; - error?: string; - needed?: string; - ok?: boolean; + call?: Call; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Call { - channels?: string[]; - date_start?: number; + channels?: string[]; + date_start?: number; desktop_app_join_url?: string; - external_display_id?: string; - external_unique_id?: string; - id?: string; - join_url?: string; - title?: string; - users?: User[]; + external_display_id?: string; + external_unique_id?: string; + id?: string; + join_url?: string; + title?: string; + users?: User[]; } export interface User { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } diff --git a/packages/web-api/src/types/response/CallsParticipantsRemoveResponse.ts b/packages/web-api/src/types/response/CallsParticipantsRemoveResponse.ts index 098130763..5e0429b6e 100644 --- a/packages/web-api/src/types/response/CallsParticipantsRemoveResponse.ts +++ b/packages/web-api/src/types/response/CallsParticipantsRemoveResponse.ts @@ -8,30 +8,30 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CallsParticipantsRemoveResponse = WebAPICallResult & { - call?: Call; - error?: string; - needed?: string; - ok?: boolean; + call?: Call; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Call { - channels?: string[]; - date_start?: number; + channels?: string[]; + date_start?: number; desktop_app_join_url?: string; - external_display_id?: string; - external_unique_id?: string; - id?: string; - join_url?: string; - title?: string; - users?: User[]; + external_display_id?: string; + external_unique_id?: string; + id?: string; + join_url?: string; + title?: string; + users?: User[]; } export interface User { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } diff --git a/packages/web-api/src/types/response/CallsUpdateResponse.ts b/packages/web-api/src/types/response/CallsUpdateResponse.ts index 3d09eaa61..ab333357e 100644 --- a/packages/web-api/src/types/response/CallsUpdateResponse.ts +++ b/packages/web-api/src/types/response/CallsUpdateResponse.ts @@ -8,30 +8,30 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CallsUpdateResponse = WebAPICallResult & { - call?: Call; - error?: string; - needed?: string; - ok?: boolean; + call?: Call; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Call { - channels?: string[]; - date_start?: number; + channels?: string[]; + date_start?: number; desktop_app_join_url?: string; - external_display_id?: string; - external_unique_id?: string; - id?: string; - join_url?: string; - title?: string; - users?: User[]; + external_display_id?: string; + external_unique_id?: string; + id?: string; + join_url?: string; + title?: string; + users?: User[]; } export interface User { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } diff --git a/packages/web-api/src/types/response/CanvasesAccessDeleteResponse.ts b/packages/web-api/src/types/response/CanvasesAccessDeleteResponse.ts index 9acb0d134..e0d6538ff 100644 --- a/packages/web-api/src/types/response/CanvasesAccessDeleteResponse.ts +++ b/packages/web-api/src/types/response/CanvasesAccessDeleteResponse.ts @@ -8,16 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CanvasesAccessDeleteResponse = WebAPICallResult & { - error?: string; + error?: string; failed_to_update_channel_ids?: string[]; - failed_to_update_user_ids?: string[]; - needed?: string; - ok?: boolean; - provided?: string; - response_metadata?: ResponseMetadata; + failed_to_update_user_ids?: string[]; + needed?: string; + ok?: boolean; + provided?: string; + response_metadata?: ResponseMetadata; }; -export interface ResponseMetadata { -} +export type ResponseMetadata = {}; diff --git a/packages/web-api/src/types/response/CanvasesAccessSetResponse.ts b/packages/web-api/src/types/response/CanvasesAccessSetResponse.ts index 0220caf10..9bb5031f8 100644 --- a/packages/web-api/src/types/response/CanvasesAccessSetResponse.ts +++ b/packages/web-api/src/types/response/CanvasesAccessSetResponse.ts @@ -8,16 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CanvasesAccessSetResponse = WebAPICallResult & { - error?: string; + error?: string; failed_to_update_channel_ids?: string[]; - failed_to_update_user_ids?: string[]; - needed?: string; - ok?: boolean; - provided?: string; - response_metadata?: ResponseMetadata; + failed_to_update_user_ids?: string[]; + needed?: string; + ok?: boolean; + provided?: string; + response_metadata?: ResponseMetadata; }; -export interface ResponseMetadata { -} +export type ResponseMetadata = {}; diff --git a/packages/web-api/src/types/response/CanvasesCreateResponse.ts b/packages/web-api/src/types/response/CanvasesCreateResponse.ts index 34db7f10b..9fffa5c58 100644 --- a/packages/web-api/src/types/response/CanvasesCreateResponse.ts +++ b/packages/web-api/src/types/response/CanvasesCreateResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CanvasesCreateResponse = WebAPICallResult & { - canvas_id?: string; - detail?: string; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + canvas_id?: string; + detail?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/CanvasesDeleteResponse.ts b/packages/web-api/src/types/response/CanvasesDeleteResponse.ts index 5c0e1de81..f7ccdff63 100644 --- a/packages/web-api/src/types/response/CanvasesDeleteResponse.ts +++ b/packages/web-api/src/types/response/CanvasesDeleteResponse.ts @@ -8,14 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CanvasesDeleteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; -export interface ResponseMetadata { -} +export type ResponseMetadata = {}; diff --git a/packages/web-api/src/types/response/CanvasesEditResponse.ts b/packages/web-api/src/types/response/CanvasesEditResponse.ts index 686c38d8f..7e409e303 100644 --- a/packages/web-api/src/types/response/CanvasesEditResponse.ts +++ b/packages/web-api/src/types/response/CanvasesEditResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CanvasesEditResponse = WebAPICallResult & { - detail?: string; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + detail?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/CanvasesSectionsLookupResponse.ts b/packages/web-api/src/types/response/CanvasesSectionsLookupResponse.ts index 3e0d85e04..c70953d44 100644 --- a/packages/web-api/src/types/response/CanvasesSectionsLookupResponse.ts +++ b/packages/web-api/src/types/response/CanvasesSectionsLookupResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type CanvasesSectionsLookupResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - sections?: Section[]; + sections?: Section[]; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ChannelsArchiveResponse.ts b/packages/web-api/src/types/response/ChannelsArchiveResponse.ts index e80e0ad1e..2d00c89cb 100644 --- a/packages/web-api/src/types/response/ChannelsArchiveResponse.ts +++ b/packages/web-api/src/types/response/ChannelsArchiveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsArchiveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ChannelsCreateResponse.ts b/packages/web-api/src/types/response/ChannelsCreateResponse.ts index 6a146cb00..a27f94dae 100644 --- a/packages/web-api/src/types/response/ChannelsCreateResponse.ts +++ b/packages/web-api/src/types/response/ChannelsCreateResponse.ts @@ -8,42 +8,42 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsCreateResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_channel?: boolean; - is_general?: boolean; - is_member?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - last_read?: string; - members?: string[]; - name?: string; - name_normalized?: string; - previous_names?: string[]; - priority?: number; - purpose?: Purpose; - topic?: Purpose; - unlinked?: number; - unread_count?: number; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_channel?: boolean; + is_general?: boolean; + is_member?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + last_read?: string; + members?: string[]; + name?: string; + name_normalized?: string; + previous_names?: string[]; + priority?: number; + purpose?: Purpose; + topic?: Purpose; + unlinked?: number; + unread_count?: number; unread_count_display?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/ChannelsHistoryResponse.ts b/packages/web-api/src/types/response/ChannelsHistoryResponse.ts index 85b73447d..757b13a04 100644 --- a/packages/web-api/src/types/response/ChannelsHistoryResponse.ts +++ b/packages/web-api/src/types/response/ChannelsHistoryResponse.ts @@ -8,125 +8,125 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsHistoryResponse = WebAPICallResult & { channel_actions_count?: number; - channel_actions_ts?: number; - error?: string; - has_more?: boolean; - latest?: string; - messages?: Message[]; - needed?: string; - ok?: boolean; - provided?: string; - response_metadata?: ResponseMetadata; - warning?: string; + channel_actions_ts?: number; + error?: string; + has_more?: boolean; + latest?: string; + messages?: Message[]; + needed?: string; + ok?: boolean; + provided?: string; + response_metadata?: ResponseMetadata; + warning?: string; }; export interface Message { - attachments?: Attachment[]; - blocks?: Block[]; - bot_id?: string; - bot_profile?: BotProfile; - client_msg_id?: string; - display_as_bot?: boolean; - edited?: Edited; - files?: File[]; - icons?: MessageIcons; - inviter?: string; - latest_reply?: string; - parent_user_id?: string; - reactions?: Reaction[]; - reply_count?: number; - reply_users?: string[]; + attachments?: Attachment[]; + blocks?: Block[]; + bot_id?: string; + bot_profile?: BotProfile; + client_msg_id?: string; + display_as_bot?: boolean; + edited?: Edited; + files?: File[]; + icons?: MessageIcons; + inviter?: string; + latest_reply?: string; + parent_user_id?: string; + reactions?: Reaction[]; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - root?: Root; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - upload?: boolean; - user?: string; - username?: string; - x_files?: string[]; + root?: Root; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + upload?: boolean; + user?: string; + username?: string; + x_files?: string[]; } export interface Attachment { - actions?: Action[]; - app_unfurl_url?: string; - author_icon?: string; - author_id?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - color?: string; - fallback?: string; - fields?: Field[]; - filename?: string; - footer?: string; - footer_icon?: string; - from_url?: string; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_unfurl_url?: string; + author_icon?: string; + author_id?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + color?: string; + fallback?: string; + fields?: Field[]; + filename?: string; + footer?: string; + footer_icon?: string; + from_url?: string; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - metadata?: Metadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; + metadata?: Metadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: OptionGroup[]; - options?: Option[]; + name?: string; + option_groups?: OptionGroup[]; + options?: Option[]; selected_options?: Option[]; - style?: string; - text?: string; - type?: string; - url?: string; - value?: string; + style?: string; + text?: string; + type?: string; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface OptionGroup { @@ -134,7 +134,7 @@ export interface OptionGroup { } export interface Option { - text?: string; + text?: string; value?: string; } @@ -145,104 +145,104 @@ export interface Field { } export interface Metadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Block { - accessory?: Accessory; - alt_text?: string; - block_id?: string; - elements?: Element[]; - fallback?: string; - fields?: Text[]; - image_bytes?: number; + accessory?: Accessory; + alt_text?: string; + block_id?: string; + elements?: Element[]; + fallback?: string; + fields?: Text[]; + image_bytes?: number; image_height?: number; - image_url?: string; - image_width?: number; - text?: Text; - title?: Text; - type?: string; + image_url?: string; + image_width?: number; + text?: Text; + title?: Text; + type?: string; } export interface Accessory { - alt_text?: string; - fallback?: string; - image_bytes?: number; + alt_text?: string; + fallback?: string; + image_bytes?: number; image_height?: number; - image_url?: string; - image_width?: number; - type?: string; + image_url?: string; + image_width?: number; + type?: string; } export interface Element { - action_id?: string; - alt_text?: string; - confirm?: ElementConfirm; + action_id?: string; + alt_text?: string; + confirm?: ElementConfirm; default_to_current_conversation?: boolean; - fallback?: string; - filter?: Filter; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; - initial_conversation?: string; - initial_date?: string; - initial_option?: InitialOption; - initial_user?: string; - min_query_length?: number; - placeholder?: Text; - response_url_enabled?: boolean; - style?: string; - text?: Text; - type?: string; - url?: string; - value?: string; + fallback?: string; + filter?: Filter; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; + initial_conversation?: string; + initial_date?: string; + initial_option?: InitialOption; + initial_user?: string; + min_query_length?: number; + placeholder?: Text; + response_url_enabled?: boolean; + style?: string; + text?: Text; + type?: string; + url?: string; + value?: string; } export interface ElementConfirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: string; + emoji?: boolean; + text?: string; + type?: string; verbatim?: boolean; } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; } export interface InitialOption { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: BotProfileIcons; - id?: string; - name?: string; + icons?: BotProfileIcons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -254,100 +254,100 @@ export interface BotProfileIcons { } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface File { - created?: number; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_id?: string; - external_type?: string; - external_url?: string; - filetype?: string; - has_rich_preview?: boolean; - id?: string; - image_exif_rotation?: number; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - mimetype?: string; - mode?: string; - name?: string; - original_h?: number; - original_w?: number; - permalink?: string; - permalink_public?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + created?: number; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_id?: string; + external_type?: string; + external_url?: string; + filetype?: string; + has_rich_preview?: boolean; + id?: string; + image_exif_rotation?: number; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + mimetype?: string; + mode?: string; + name?: string; + original_h?: number; + original_w?: number; + permalink?: string; + permalink_public?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - size?: number; - thumb_1024?: string; - thumb_1024_h?: number; - thumb_1024_w?: number; - thumb_160?: string; - thumb_360?: string; - thumb_360_h?: number; - thumb_360_w?: number; - thumb_480?: string; - thumb_480_h?: number; - thumb_480_w?: number; - thumb_64?: string; - thumb_720?: string; - thumb_720_h?: number; - thumb_720_w?: number; - thumb_80?: string; - thumb_800?: string; - thumb_800_h?: number; - thumb_800_w?: number; - thumb_960?: string; - thumb_960_h?: number; - thumb_960_w?: number; - thumb_tiny?: string; - timestamp?: number; - title?: string; - url_private?: string; + public_url_shared?: boolean; + size?: number; + thumb_1024?: string; + thumb_1024_h?: number; + thumb_1024_w?: number; + thumb_160?: string; + thumb_360?: string; + thumb_360_h?: number; + thumb_360_w?: number; + thumb_480?: string; + thumb_480_h?: number; + thumb_480_w?: number; + thumb_64?: string; + thumb_720?: string; + thumb_720_h?: number; + thumb_720_w?: number; + thumb_80?: string; + thumb_800?: string; + thumb_800_h?: number; + thumb_800_w?: number; + thumb_960?: string; + thumb_960_h?: number; + thumb_960_w?: number; + thumb_tiny?: string; + timestamp?: number; + title?: string; + url_private?: string; url_private_download?: string; - user?: string; - username?: string; + user?: string; + username?: string; } export interface MessageIcons { - emoji?: string; + emoji?: string; image_64?: string; } export interface Reaction { count?: number; - name?: string; + name?: string; users?: string[]; } export interface Root { - bot_id?: string; - bot_profile?: BotProfile; - edited?: Edited; - icons?: MessageIcons; - latest_reply?: string; - parent_user_id?: string; - reply_count?: number; - reply_users?: string[]; + bot_id?: string; + bot_profile?: BotProfile; + edited?: Edited; + icons?: MessageIcons; + latest_reply?: string; + parent_user_id?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - user?: string; - username?: string; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + user?: string; + username?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ChannelsInfoResponse.ts b/packages/web-api/src/types/response/ChannelsInfoResponse.ts index 729e24720..37a788a21 100644 --- a/packages/web-api/src/types/response/ChannelsInfoResponse.ts +++ b/packages/web-api/src/types/response/ChannelsInfoResponse.ts @@ -8,129 +8,129 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsInfoResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_channel?: boolean; - is_general?: boolean; - is_member?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - last_read?: string; - latest?: Latest; - members?: string[]; - name?: string; - name_normalized?: string; - previous_names?: string[]; - purpose?: Purpose; - topic?: Purpose; - unlinked?: number; - unread_count?: number; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_channel?: boolean; + is_general?: boolean; + is_member?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + last_read?: string; + latest?: Latest; + members?: string[]; + name?: string; + name_normalized?: string; + previous_names?: string[]; + purpose?: Purpose; + topic?: Purpose; + unlinked?: number; + unread_count?: number; unread_count_display?: number; } export interface Latest { - attachments?: Attachment[]; - blocks?: Block[]; - bot_id?: string; + attachments?: Attachment[]; + blocks?: Block[]; + bot_id?: string; display_as_bot?: boolean; - edited?: Edited; - files?: File[]; - subtype?: string; - text?: string; - ts?: string; - type?: string; - upload?: boolean; - user?: string; - username?: string; - x_files?: string[]; + edited?: Edited; + files?: File[]; + subtype?: string; + text?: string; + ts?: string; + type?: string; + upload?: boolean; + user?: string; + username?: string; + x_files?: string[]; } export interface Attachment { - actions?: Action[]; - app_unfurl_url?: string; - author_icon?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - color?: string; - fallback?: string; - fields?: Field[]; - filename?: string; - footer?: string; - footer_icon?: string; - from_url?: string; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_unfurl_url?: string; + author_icon?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + color?: string; + fallback?: string; + fields?: Field[]; + filename?: string; + footer?: string; + footer_icon?: string; + from_url?: string; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - metadata?: Metadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; + metadata?: Metadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: OptionGroup[]; - options?: Option[]; + name?: string; + option_groups?: OptionGroup[]; + options?: Option[]; selected_options?: Option[]; - style?: string; - text?: string; - type?: string; - url?: string; - value?: string; + style?: string; + text?: string; + type?: string; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface OptionGroup { @@ -138,7 +138,7 @@ export interface OptionGroup { } export interface Option { - text?: string; + text?: string; value?: string; } @@ -149,129 +149,129 @@ export interface Field { } export interface Metadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Block { - accessory?: Accessory; - alt_text?: string; - block_id?: string; - elements?: Element[]; - fallback?: string; - fields?: Text[]; - image_bytes?: number; + accessory?: Accessory; + alt_text?: string; + block_id?: string; + elements?: Element[]; + fallback?: string; + fields?: Text[]; + image_bytes?: number; image_height?: number; - image_url?: string; - image_width?: number; - text?: Text; - title?: Text; - type?: string; + image_url?: string; + image_width?: number; + text?: Text; + title?: Text; + type?: string; } export interface Accessory { - alt_text?: string; - fallback?: string; - image_bytes?: number; + alt_text?: string; + fallback?: string; + image_bytes?: number; image_height?: number; - image_url?: string; - image_width?: number; - type?: string; + image_url?: string; + image_width?: number; + type?: string; } export interface Element { - action_id?: string; - alt_text?: string; - confirm?: ElementConfirm; - fallback?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; + action_id?: string; + alt_text?: string; + confirm?: ElementConfirm; + fallback?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; initial_conversation?: string; - initial_date?: string; - initial_option?: InitialOption; - initial_user?: string; - min_query_length?: number; - placeholder?: Text; - style?: string; - text?: Text; - type?: string; - url?: string; - value?: string; + initial_date?: string; + initial_option?: InitialOption; + initial_user?: string; + min_query_length?: number; + placeholder?: Text; + style?: string; + text?: Text; + type?: string; + url?: string; + value?: string; } export interface ElementConfirm { confirm?: Text; - deny?: Text; - text?: Text; - title?: Text; + deny?: Text; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: string; + emoji?: boolean; + text?: string; + type?: string; verbatim?: boolean; } export interface InitialOption { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface File { - created?: number; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_type?: string; - filetype?: string; - has_rich_preview?: boolean; - id?: string; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + created?: number; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_type?: string; + filetype?: string; + has_rich_preview?: boolean; + id?: string; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - size?: number; - timestamp?: number; - title?: string; - url_private?: string; + public_url_shared?: boolean; + size?: number; + timestamp?: number; + title?: string; + url_private?: string; url_private_download?: string; - user?: string; - username?: string; + user?: string; + username?: string; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/ChannelsInviteResponse.ts b/packages/web-api/src/types/response/ChannelsInviteResponse.ts index 8068e085b..a6f1549af 100644 --- a/packages/web-api/src/types/response/ChannelsInviteResponse.ts +++ b/packages/web-api/src/types/response/ChannelsInviteResponse.ts @@ -8,51 +8,51 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsInviteResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_channel?: boolean; - is_general?: boolean; - is_member?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - last_read?: string; - latest?: Latest; - members?: string[]; - name?: string; - name_normalized?: string; - previous_names?: string[]; - priority?: number; - purpose?: Purpose; - topic?: Purpose; - unlinked?: number; - unread_count?: number; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_channel?: boolean; + is_general?: boolean; + is_member?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + last_read?: string; + latest?: Latest; + members?: string[]; + name?: string; + name_normalized?: string; + previous_names?: string[]; + priority?: number; + purpose?: Purpose; + topic?: Purpose; + unlinked?: number; + unread_count?: number; unread_count_display?: number; } export interface Latest { subtype?: string; - text?: string; - ts?: string; - type?: string; - user?: string; + text?: string; + ts?: string; + type?: string; + user?: string; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/ChannelsJoinResponse.ts b/packages/web-api/src/types/response/ChannelsJoinResponse.ts index f9aaac9b3..ef3f85021 100644 --- a/packages/web-api/src/types/response/ChannelsJoinResponse.ts +++ b/packages/web-api/src/types/response/ChannelsJoinResponse.ts @@ -8,51 +8,51 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsJoinResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_channel?: boolean; - is_general?: boolean; - is_member?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - last_read?: string; - latest?: Latest; - members?: string[]; - name?: string; - name_normalized?: string; - previous_names?: string[]; - priority?: number; - purpose?: Purpose; - topic?: Purpose; - unlinked?: number; - unread_count?: number; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_channel?: boolean; + is_general?: boolean; + is_member?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + last_read?: string; + latest?: Latest; + members?: string[]; + name?: string; + name_normalized?: string; + previous_names?: string[]; + priority?: number; + purpose?: Purpose; + topic?: Purpose; + unlinked?: number; + unread_count?: number; unread_count_display?: number; } export interface Latest { subtype?: string; - text?: string; - ts?: string; - type?: string; - user?: string; + text?: string; + ts?: string; + type?: string; + user?: string; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/ChannelsKickResponse.ts b/packages/web-api/src/types/response/ChannelsKickResponse.ts index 6acfb07f5..fe1f27bdc 100644 --- a/packages/web-api/src/types/response/ChannelsKickResponse.ts +++ b/packages/web-api/src/types/response/ChannelsKickResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsKickResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ChannelsLeaveResponse.ts b/packages/web-api/src/types/response/ChannelsLeaveResponse.ts index 905bacdae..824776970 100644 --- a/packages/web-api/src/types/response/ChannelsLeaveResponse.ts +++ b/packages/web-api/src/types/response/ChannelsLeaveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsLeaveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ChannelsListResponse.ts b/packages/web-api/src/types/response/ChannelsListResponse.ts index a61766760..83a5e4701 100644 --- a/packages/web-api/src/types/response/ChannelsListResponse.ts +++ b/packages/web-api/src/types/response/ChannelsListResponse.ts @@ -8,47 +8,47 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsListResponse = WebAPICallResult & { - channels?: Channel[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + channels?: Channel[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Channel { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_channel?: boolean; - is_general?: boolean; - is_member?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - members?: string[]; - name?: string; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_channel?: boolean; + is_general?: boolean; + is_member?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + members?: string[]; + name?: string; name_normalized?: string; - num_members?: number; - previous_names?: string[]; - purpose?: Purpose; - topic?: Purpose; - unlinked?: number; + num_members?: number; + previous_names?: string[]; + purpose?: Purpose; + topic?: Purpose; + unlinked?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; - warnings?: string[]; + warnings?: string[]; } diff --git a/packages/web-api/src/types/response/ChannelsMarkResponse.ts b/packages/web-api/src/types/response/ChannelsMarkResponse.ts index 336d09521..bd40fb10b 100644 --- a/packages/web-api/src/types/response/ChannelsMarkResponse.ts +++ b/packages/web-api/src/types/response/ChannelsMarkResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsMarkResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ChannelsRenameResponse.ts b/packages/web-api/src/types/response/ChannelsRenameResponse.ts index dbaed13de..3c94373c0 100644 --- a/packages/web-api/src/types/response/ChannelsRenameResponse.ts +++ b/packages/web-api/src/types/response/ChannelsRenameResponse.ts @@ -8,38 +8,38 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsRenameResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_channel?: boolean; - is_general?: boolean; - is_member?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - members?: string[]; - name?: string; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_channel?: boolean; + is_general?: boolean; + is_member?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + members?: string[]; + name?: string; name_normalized?: string; - previous_names?: string[]; - purpose?: Purpose; - topic?: Purpose; - unlinked?: number; + previous_names?: string[]; + purpose?: Purpose; + topic?: Purpose; + unlinked?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/ChannelsRepliesResponse.ts b/packages/web-api/src/types/response/ChannelsRepliesResponse.ts index 722ef4482..2a988c788 100644 --- a/packages/web-api/src/types/response/ChannelsRepliesResponse.ts +++ b/packages/web-api/src/types/response/ChannelsRepliesResponse.ts @@ -8,41 +8,41 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsRepliesResponse = WebAPICallResult & { - error?: string; - has_more?: boolean; - messages?: Message[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + has_more?: boolean; + messages?: Message[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Message { - bot_id?: string; - bot_profile?: BotProfile; - latest_reply?: string; - parent_user_id?: string; - reply_count?: number; - reply_users?: string[]; + bot_id?: string; + bot_profile?: BotProfile; + latest_reply?: string; + parent_user_id?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - user?: string; + subscribed?: boolean; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + user?: string; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } diff --git a/packages/web-api/src/types/response/ChannelsSetPurposeResponse.ts b/packages/web-api/src/types/response/ChannelsSetPurposeResponse.ts index 6a37e607e..814736a90 100644 --- a/packages/web-api/src/types/response/ChannelsSetPurposeResponse.ts +++ b/packages/web-api/src/types/response/ChannelsSetPurposeResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsSetPurposeResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - purpose?: string; + purpose?: string; }; diff --git a/packages/web-api/src/types/response/ChannelsSetTopicResponse.ts b/packages/web-api/src/types/response/ChannelsSetTopicResponse.ts index 8507ae8ce..0218b1d71 100644 --- a/packages/web-api/src/types/response/ChannelsSetTopicResponse.ts +++ b/packages/web-api/src/types/response/ChannelsSetTopicResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsSetTopicResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - topic?: string; + topic?: string; }; diff --git a/packages/web-api/src/types/response/ChannelsUnarchiveResponse.ts b/packages/web-api/src/types/response/ChannelsUnarchiveResponse.ts index 78324f681..5f088382b 100644 --- a/packages/web-api/src/types/response/ChannelsUnarchiveResponse.ts +++ b/packages/web-api/src/types/response/ChannelsUnarchiveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChannelsUnarchiveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ChatDeleteResponse.ts b/packages/web-api/src/types/response/ChatDeleteResponse.ts index e48ff26bd..4484433f1 100644 --- a/packages/web-api/src/types/response/ChatDeleteResponse.ts +++ b/packages/web-api/src/types/response/ChatDeleteResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChatDeleteResponse = WebAPICallResult & { - channel?: string; - error?: string; - needed?: string; - ok?: boolean; + channel?: string; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - ts?: string; + ts?: string; }; diff --git a/packages/web-api/src/types/response/ChatDeleteScheduledMessageResponse.ts b/packages/web-api/src/types/response/ChatDeleteScheduledMessageResponse.ts index 17e061de0..a453f8d73 100644 --- a/packages/web-api/src/types/response/ChatDeleteScheduledMessageResponse.ts +++ b/packages/web-api/src/types/response/ChatDeleteScheduledMessageResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChatDeleteScheduledMessageResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ChatGetPermalinkResponse.ts b/packages/web-api/src/types/response/ChatGetPermalinkResponse.ts index 0a89af143..2251e7b17 100644 --- a/packages/web-api/src/types/response/ChatGetPermalinkResponse.ts +++ b/packages/web-api/src/types/response/ChatGetPermalinkResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChatGetPermalinkResponse = WebAPICallResult & { - channel?: string; - error?: string; - needed?: string; - ok?: boolean; + channel?: string; + error?: string; + needed?: string; + ok?: boolean; permalink?: string; - provided?: string; + provided?: string; }; diff --git a/packages/web-api/src/types/response/ChatMeMessageResponse.ts b/packages/web-api/src/types/response/ChatMeMessageResponse.ts index 7e742b5dc..5b074a108 100644 --- a/packages/web-api/src/types/response/ChatMeMessageResponse.ts +++ b/packages/web-api/src/types/response/ChatMeMessageResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChatMeMessageResponse = WebAPICallResult & { - channel?: string; - error?: string; - needed?: string; - ok?: boolean; + channel?: string; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - ts?: string; + ts?: string; }; diff --git a/packages/web-api/src/types/response/ChatPostEphemeralResponse.ts b/packages/web-api/src/types/response/ChatPostEphemeralResponse.ts index 03d41b14a..e8b5a5154 100644 --- a/packages/web-api/src/types/response/ChatPostEphemeralResponse.ts +++ b/packages/web-api/src/types/response/ChatPostEphemeralResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChatPostEphemeralResponse = WebAPICallResult & { - error?: string; + error?: string; message_ts?: string; - needed?: string; - ok?: boolean; - provided?: string; + needed?: string; + ok?: boolean; + provided?: string; }; diff --git a/packages/web-api/src/types/response/ChatPostMessageResponse.ts b/packages/web-api/src/types/response/ChatPostMessageResponse.ts index 28de80fbe..2fd73a2b9 100644 --- a/packages/web-api/src/types/response/ChatPostMessageResponse.ts +++ b/packages/web-api/src/types/response/ChatPostMessageResponse.ts @@ -8,239 +8,239 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChatPostMessageResponse = WebAPICallResult & { - channel?: string; + channel?: string; deprecated_argument?: string; - error?: string; - errors?: string[]; - message?: ChatPostMessageResponseMessage; - needed?: string; - ok?: boolean; - provided?: string; - response_metadata?: ResponseMetadata; - ts?: string; + error?: string; + errors?: string[]; + message?: ChatPostMessageResponseMessage; + needed?: string; + ok?: boolean; + provided?: string; + response_metadata?: ResponseMetadata; + ts?: string; }; export interface ChatPostMessageResponseMessage { - app_id?: string; - attachments?: Attachment[]; - blocks?: PurpleBlock[]; - bot_id?: string; - bot_profile?: BotProfile; - icons?: FluffyIcons; - metadata?: FluffyMetadata; + app_id?: string; + attachments?: Attachment[]; + blocks?: PurpleBlock[]; + bot_id?: string; + bot_profile?: BotProfile; + icons?: FluffyIcons; + metadata?: FluffyMetadata; parent_user_id?: string; - room?: Room; - root?: FluffyRoot; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - user?: string; - username?: string; + room?: Room; + root?: FluffyRoot; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + user?: string; + username?: string; } export interface Attachment { - actions?: Action[]; - app_id?: string; - app_unfurl_url?: string; - author_icon?: string; - author_id?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - blocks?: TitleBlockElement[]; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - channel_team?: string; - color?: string; - fallback?: string; - fields?: AttachmentField[]; - file_id?: string; - filename?: string; - files?: FileElement[]; - footer?: string; - footer_icon?: string; - from_url?: string; - hide_border?: boolean; - hide_color?: boolean; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_file_attachment?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_id?: string; + app_unfurl_url?: string; + author_icon?: string; + author_id?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + blocks?: TitleBlockElement[]; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + channel_team?: string; + color?: string; + fallback?: string; + fields?: AttachmentField[]; + file_id?: string; + filename?: string; + files?: FileElement[]; + footer?: string; + footer_icon?: string; + from_url?: string; + hide_border?: boolean; + hide_color?: boolean; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_file_attachment?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - list?: List; - list_record?: PurpleListRecord; - list_record_id?: string; - list_records?: ListRecordElement[]; - list_schema?: Schema[]; - list_view?: View; - list_view_id?: string; - message_blocks?: MessageBlock[]; - metadata?: AttachmentMetadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - preview?: Preview; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; - video_url?: string; + list?: List; + list_record?: PurpleListRecord; + list_record_id?: string; + list_records?: ListRecordElement[]; + list_schema?: Schema[]; + list_view?: View; + list_view_id?: string; + message_blocks?: MessageBlock[]; + metadata?: AttachmentMetadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + preview?: Preview; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; + video_url?: string; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: ActionOptionGroup[]; - options?: SelectedOptionElement[]; + name?: string; + option_groups?: ActionOptionGroup[]; + options?: SelectedOptionElement[]; selected_options?: SelectedOptionElement[]; - style?: string; - text?: string; - type?: string; - url?: string; - value?: string; + style?: string; + text?: string; + type?: string; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface ActionOptionGroup { options?: SelectedOptionElement[]; - text?: string; + text?: string; } export interface SelectedOptionElement { - text?: string; + text?: string; value?: string; } export interface TitleBlockElement { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: AccessoryConfirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: AccessoryConfirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: InitialOptionElement; - initial_options?: InitialOptionElement[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: AccessoryOptionGroup[]; - options?: InitialOptionElement[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: InitialOptionElement; + initial_options?: InitialOptionElement[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: AccessoryOptionGroup[]; + options?: InitialOptionElement[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface AccessoryConfirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -250,42 +250,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: FluffyType; + indent?: number; + offset?: number; + style?: string; + type?: FluffyType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -309,25 +309,25 @@ export enum FluffyType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface InitialOptionElement { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface AccessoryOptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: InitialOptionElement[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -337,11 +337,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } @@ -363,263 +363,263 @@ export interface AttachmentField { } export interface FileElement { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlockElement[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlockElement[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -634,64 +634,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -700,48 +700,47 @@ export interface Transcription { } export interface List { - channels?: string[]; - comments_count?: number; - created?: number; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - editable?: boolean; - external_type?: string; - file_access?: string; - filetype?: string; - groups?: string[]; - has_more_shares?: boolean; - has_rich_preview?: boolean; - id?: string; - ims?: string[]; - is_external?: boolean; - is_public?: boolean; - last_editor?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: string; - pretty_type?: string; + channels?: string[]; + comments_count?: number; + created?: number; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + editable?: boolean; + external_type?: string; + file_access?: string; + filetype?: string; + groups?: string[]; + has_more_shares?: boolean; + has_rich_preview?: boolean; + id?: string; + ims?: string[]; + is_external?: boolean; + is_public?: boolean; + last_editor?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: string; + pretty_type?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - shares?: EventPayload; - size?: number; - timestamp?: number; - title?: string; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + shares?: EventPayload; + size?: number; + timestamp?: number; + title?: string; + updated?: number; + url_private?: string; + url_private_download?: string; + user?: string; + user_team?: string; + username?: string; } -export interface EventPayload { -} +export type EventPayload = {}; export interface PurpleListRecord { record?: Record; @@ -749,90 +748,90 @@ export interface PurpleListRecord { } export interface Record { - fields?: RecordField[]; + fields?: RecordField[]; record_id?: string; } export interface RecordField { attachment?: any[]; - channel?: any[]; - checkbox?: boolean; - column_id?: string; - date?: any[]; - email?: any[]; - key?: string; - message?: FieldMessage; - number?: any[]; - phone?: any[]; - rating?: any[]; - rich_text?: any[]; - select?: any[]; - text?: string; - timestamp?: any[]; - user?: any[]; - value?: string; + channel?: any[]; + checkbox?: boolean; + column_id?: string; + date?: any[]; + email?: any[]; + key?: string; + message?: FieldMessage; + number?: any[]; + phone?: any[]; + rating?: any[]; + rich_text?: any[]; + select?: any[]; + text?: string; + timestamp?: any[]; + user?: any[]; + value?: string; } export interface FieldMessage { - app_id?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - bot_link?: string; - bot_profile?: BotProfile; - channel?: string; - client_msg_id?: string; - comment?: Comment; - display_as_bot?: boolean; - edited?: Edited; - file?: MessageFile; - files?: any[]; - hidden?: boolean; - icons?: PurpleIcons; - inviter?: string; - is_intro?: boolean; - is_locked?: boolean; - is_starred?: boolean; + app_id?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + bot_link?: string; + bot_profile?: BotProfile; + channel?: string; + client_msg_id?: string; + comment?: Comment; + display_as_bot?: boolean; + edited?: Edited; + file?: MessageFile; + files?: any[]; + hidden?: boolean; + icons?: PurpleIcons; + inviter?: string; + is_intro?: boolean; + is_locked?: boolean; + is_starred?: boolean; is_thread_broadcast?: boolean; - item?: Comment; - item_type?: string; - last_read?: string; - latest_reply?: string; - metadata?: PurpleMetadata; - no_notifications?: boolean; - parent_user_id?: string; - pinned_to?: any[]; - purpose?: string; - reactions?: any[]; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; - reply_users_count?: number; - room?: Room; - root?: PurpleRoot; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - topic?: string; - ts?: string; - type?: string; - unfurl_links?: boolean; - unfurl_media?: boolean; - upload?: boolean; - user?: string; - username?: string; - wibblr?: boolean; - x_files?: any[]; + item?: Comment; + item_type?: string; + last_read?: string; + latest_reply?: string; + metadata?: PurpleMetadata; + no_notifications?: boolean; + parent_user_id?: string; + pinned_to?: any[]; + purpose?: string; + reactions?: any[]; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; + reply_users_count?: number; + room?: Room; + root?: PurpleRoot; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + topic?: string; + ts?: string; + type?: string; + unfurl_links?: boolean; + unfurl_media?: boolean; + upload?: boolean; + user?: string; + username?: string; + wibblr?: boolean; + x_files?: any[]; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: BotProfileIcons; - id?: string; - name?: string; + icons?: BotProfileIcons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -844,208 +843,208 @@ export interface BotProfileIcons { } export interface Comment { - comment?: string; - created?: string; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_type?: string; - filetype?: string; - has_rich_preview?: boolean; - id?: string; - is_external?: boolean; - is_intro?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: boolean; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + comment?: string; + created?: string; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_type?: string; + filetype?: string; + has_rich_preview?: boolean; + id?: string; + is_external?: boolean; + is_intro?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: boolean; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - size?: number; - timestamp?: string; - title?: string; - url_private?: string; + public_url_shared?: boolean; + size?: number; + timestamp?: string; + title?: string; + url_private?: string; url_private_download?: boolean; - user?: string; - username?: string; + user?: string; + username?: string; } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface MessageFile { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: any[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: any[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: any[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: any[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: any[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: any[]; - file_access?: string; - filetype?: string; - from?: any[]; - groups?: any[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: any[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: any[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: any[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: any[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: any[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: any[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: any[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: any[]; + file_access?: string; + filetype?: string; + from?: any[]; + groups?: any[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: any[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: any[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: any[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: EventPayload; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: any[]; - to?: any[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: any[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: EventPayload; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: any[]; + to?: any[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface PurpleIcons { - emoji?: string; + emoji?: string; image_36?: string; image_48?: string; image_64?: string; @@ -1057,80 +1056,80 @@ export interface PurpleMetadata { } export interface Room { - app_id?: string; - attached_file_ids?: string[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - knocks?: EventPayload; - last_invite_status_by_user?: EventPayload; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: string[]; - participants?: string[]; - participants_camera_off?: string[]; - participants_camera_on?: string[]; + app_id?: string; + attached_file_ids?: string[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + knocks?: EventPayload; + last_invite_status_by_user?: EventPayload; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: string[]; + participants?: string[]; + participants_camera_off?: string[]; + participants_camera_on?: string[]; participants_screenshare_off?: string[]; - participants_screenshare_on?: string[]; - pending_invitees?: EventPayload; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: string[]; + pending_invitees?: EventPayload; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface PurpleRoot { - bot_id?: string; - bot_profile?: BotProfile; - edited?: Edited; - icons?: PurpleIcons; - last_read?: string; - latest_reply?: string; - mrkdwn?: boolean; - no_notifications?: boolean; - parent_user_id?: string; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; + bot_id?: string; + bot_profile?: BotProfile; + edited?: Edited; + icons?: PurpleIcons; + last_read?: string; + latest_reply?: string; + mrkdwn?: boolean; + no_notifications?: boolean; + parent_user_id?: string; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; reply_users_count?: number; - room?: Room; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - unread_count?: number; - user?: string; - username?: string; + room?: Room; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + unread_count?: number; + user?: string; + username?: string; } export interface ListRecordElement { - created_by?: string; - date_created?: number; - fields?: RecordField[]; - id?: string; - is_subscribed?: boolean; - list_id?: string; - platform_refs?: PlatformRefs; - position?: string; - saved?: Saved; - thread_ts?: string; - updated_by?: string; + created_by?: string; + date_created?: number; + fields?: RecordField[]; + id?: string; + is_subscribed?: boolean; + list_id?: string; + platform_refs?: PlatformRefs; + position?: string; + saved?: Saved; + thread_ts?: string; + updated_by?: string; updated_timestamp?: string; } @@ -1143,155 +1142,155 @@ export interface PlatformRefs { export interface MessageBlock { channel?: string; message?: FieldMessage; - team?: string; - ts?: string; + team?: string; + ts?: string; } export interface AttachmentMetadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Preview { can_remove?: boolean; - icon_url?: string; - subtitle?: DescriptionElement; - title?: DescriptionElement; - type?: string; + icon_url?: string; + subtitle?: DescriptionElement; + title?: DescriptionElement; + type?: string; } export interface PurpleBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: FileElement; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: FileElement; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface FluffyIcons { - emoji?: string; + emoji?: string; image_64?: string; } export interface FluffyMetadata { event_payload?: EventPayload; - event_type?: string; + event_type?: string; } export interface FluffyRoot { - bot_id?: string; - icons?: FluffyIcons; - latest_reply?: string; - parent_user_id?: string; - reply_count?: number; - reply_users?: string[]; + bot_id?: string; + icons?: FluffyIcons; + latest_reply?: string; + parent_user_id?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - subtype?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - username?: string; + subscribed?: boolean; + subtype?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + username?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ChatScheduleMessageResponse.ts b/packages/web-api/src/types/response/ChatScheduleMessageResponse.ts index 33e7d2e8e..ca906d779 100644 --- a/packages/web-api/src/types/response/ChatScheduleMessageResponse.ts +++ b/packages/web-api/src/types/response/ChatScheduleMessageResponse.ts @@ -8,139 +8,139 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChatScheduleMessageResponse = WebAPICallResult & { - channel?: string; - error?: string; - message?: Message; - needed?: string; - ok?: boolean; - post_at?: number; - provided?: string; - response_metadata?: ResponseMetadata; + channel?: string; + error?: string; + message?: Message; + needed?: string; + ok?: boolean; + post_at?: number; + provided?: string; + response_metadata?: ResponseMetadata; scheduled_message_id?: string; }; export interface Message { - app_id?: string; - blocks?: MessageBlock[]; - bot_id?: string; + app_id?: string; + blocks?: MessageBlock[]; + bot_id?: string; bot_profile?: BotProfile; - metadata?: Metadata; - room?: Room; - team?: string; - text?: string; - type?: string; - user?: string; + metadata?: Metadata; + room?: Room; + team?: string; + text?: string; + type?: string; + user?: string; } export interface MessageBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: File; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: File; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -150,42 +150,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: FluffyType; + indent?: number; + offset?: number; + style?: string; + type?: FluffyType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -209,25 +209,25 @@ export enum FluffyType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface OptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -237,358 +237,358 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlockElement[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlockElement[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface TitleBlockElement { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -603,64 +603,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -669,11 +669,11 @@ export interface Transcription { } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -686,46 +686,45 @@ export interface Icons { export interface Metadata { event_payload?: EventPayload; - event_type?: string; + event_type?: string; } -export interface EventPayload { -} +export type EventPayload = {}; export interface Room { - app_id?: string; - attached_file_ids?: string[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - knocks?: EventPayload; - last_invite_status_by_user?: EventPayload; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: string[]; - participants?: string[]; - participants_camera_off?: string[]; - participants_camera_on?: string[]; + app_id?: string; + attached_file_ids?: string[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + knocks?: EventPayload; + last_invite_status_by_user?: EventPayload; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: string[]; + participants?: string[]; + participants_camera_off?: string[]; + participants_camera_on?: string[]; participants_screenshare_off?: string[]; - participants_screenshare_on?: string[]; - pending_invitees?: EventPayload; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: string[]; + pending_invitees?: EventPayload; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ChatScheduledMessagesListResponse.ts b/packages/web-api/src/types/response/ChatScheduledMessagesListResponse.ts index 6fe95f0a5..9d4591c26 100644 --- a/packages/web-api/src/types/response/ChatScheduledMessagesListResponse.ts +++ b/packages/web-api/src/types/response/ChatScheduledMessagesListResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChatScheduledMessagesListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; - response_metadata?: ResponseMetadata; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; + response_metadata?: ResponseMetadata; scheduled_messages?: ScheduledMessage[]; }; @@ -23,9 +23,9 @@ export interface ResponseMetadata { } export interface ScheduledMessage { - channel_id?: string; + channel_id?: string; date_created?: number; - id?: string; - post_at?: number; - text?: string; + id?: string; + post_at?: number; + text?: string; } diff --git a/packages/web-api/src/types/response/ChatUnfurlResponse.ts b/packages/web-api/src/types/response/ChatUnfurlResponse.ts index d2d21f9ed..98d7eaf5a 100644 --- a/packages/web-api/src/types/response/ChatUnfurlResponse.ts +++ b/packages/web-api/src/types/response/ChatUnfurlResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChatUnfurlResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ChatUpdateResponse.ts b/packages/web-api/src/types/response/ChatUpdateResponse.ts index a3421605c..fff0b2227 100644 --- a/packages/web-api/src/types/response/ChatUpdateResponse.ts +++ b/packages/web-api/src/types/response/ChatUpdateResponse.ts @@ -8,144 +8,144 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ChatUpdateResponse = WebAPICallResult & { - channel?: string; - error?: string; - message?: Message; - needed?: string; - ok?: boolean; - provided?: string; + channel?: string; + error?: string; + message?: Message; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - text?: string; - ts?: string; + text?: string; + ts?: string; }; export interface Message { - app_id?: string; - blocks?: MessageBlock[]; - bot_id?: string; - bot_profile?: BotProfile; + app_id?: string; + blocks?: MessageBlock[]; + bot_id?: string; + bot_profile?: BotProfile; display_as_bot?: boolean; - edited?: Edited; - files?: File[]; - metadata?: Metadata; - room?: Room; - team?: string; - text?: string; - type?: string; - upload?: boolean; - user?: string; - x_files?: string[]; + edited?: Edited; + files?: File[]; + metadata?: Metadata; + room?: Room; + team?: string; + text?: string; + type?: string; + upload?: boolean; + user?: string; + x_files?: string[]; } export interface MessageBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: File; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: File; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -155,42 +155,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: FluffyType; + indent?: number; + offset?: number; + style?: string; + type?: FluffyType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -214,25 +214,25 @@ export enum FluffyType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface OptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -242,258 +242,258 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlockElement[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlockElement[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface TitleBlockElement { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export enum BlockType { @@ -508,103 +508,103 @@ export enum BlockType { } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -619,64 +619,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -685,11 +685,11 @@ export interface Transcription { } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -701,52 +701,51 @@ export interface Icons { } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface Metadata { event_payload?: EventPayload; - event_type?: string; + event_type?: string; } -export interface EventPayload { -} +export type EventPayload = {}; export interface Room { - app_id?: string; - attached_file_ids?: string[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - knocks?: EventPayload; - last_invite_status_by_user?: EventPayload; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: string[]; - participants?: string[]; - participants_camera_off?: string[]; - participants_camera_on?: string[]; + app_id?: string; + attached_file_ids?: string[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + knocks?: EventPayload; + last_invite_status_by_user?: EventPayload; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: string[]; + participants?: string[]; + participants_camera_off?: string[]; + participants_camera_on?: string[]; participants_screenshare_off?: string[]; - participants_screenshare_on?: string[]; - pending_invitees?: EventPayload; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: string[]; + pending_invitees?: EventPayload; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ConversationsAcceptSharedInviteResponse.ts b/packages/web-api/src/types/response/ConversationsAcceptSharedInviteResponse.ts index 64436cb53..af8194284 100644 --- a/packages/web-api/src/types/response/ConversationsAcceptSharedInviteResponse.ts +++ b/packages/web-api/src/types/response/ConversationsAcceptSharedInviteResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsAcceptSharedInviteResponse = WebAPICallResult & { - can_open_scdm?: boolean; - channel_id?: string; - error?: string; + can_open_scdm?: boolean; + channel_id?: string; + error?: string; implicit_approval?: boolean; - invite_id?: string; - needed?: string; - ok?: boolean; - provided?: string; + invite_id?: string; + needed?: string; + ok?: boolean; + provided?: string; }; diff --git a/packages/web-api/src/types/response/ConversationsApproveSharedInviteResponse.ts b/packages/web-api/src/types/response/ConversationsApproveSharedInviteResponse.ts index ad52f553f..a23d00463 100644 --- a/packages/web-api/src/types/response/ConversationsApproveSharedInviteResponse.ts +++ b/packages/web-api/src/types/response/ConversationsApproveSharedInviteResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsApproveSharedInviteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ConversationsArchiveResponse.ts b/packages/web-api/src/types/response/ConversationsArchiveResponse.ts index c2ff760c5..0785835b9 100644 --- a/packages/web-api/src/types/response/ConversationsArchiveResponse.ts +++ b/packages/web-api/src/types/response/ConversationsArchiveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsArchiveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ConversationsCanvasesCreateResponse.ts b/packages/web-api/src/types/response/ConversationsCanvasesCreateResponse.ts index 3455dc652..3e3e6c249 100644 --- a/packages/web-api/src/types/response/ConversationsCanvasesCreateResponse.ts +++ b/packages/web-api/src/types/response/ConversationsCanvasesCreateResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsCanvasesCreateResponse = WebAPICallResult & { - canvas_id?: string; - detail?: string; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + canvas_id?: string; + detail?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/ConversationsCloseResponse.ts b/packages/web-api/src/types/response/ConversationsCloseResponse.ts index 12da711b3..cd335b2f0 100644 --- a/packages/web-api/src/types/response/ConversationsCloseResponse.ts +++ b/packages/web-api/src/types/response/ConversationsCloseResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsCloseResponse = WebAPICallResult & { already_closed?: boolean; - error?: string; - needed?: string; - no_op?: boolean; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + no_op?: boolean; + ok?: boolean; + provided?: string; }; diff --git a/packages/web-api/src/types/response/ConversationsCreateResponse.ts b/packages/web-api/src/types/response/ConversationsCreateResponse.ts index 0141f32a6..13fa83102 100644 --- a/packages/web-api/src/types/response/ConversationsCreateResponse.ts +++ b/packages/web-api/src/types/response/ConversationsCreateResponse.ts @@ -8,52 +8,52 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsCreateResponse = WebAPICallResult & { - channel?: Channel; - detail?: string; - error?: string; - needed?: string; - ok?: boolean; + channel?: Channel; + detail?: string; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - context_team_id?: string; - created?: number; - creator?: string; - id?: string; - internal_team_ids?: string[]; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_group?: boolean; - is_im?: boolean; - is_member?: boolean; - is_moved?: number; - is_mpim?: boolean; - is_open?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - last_read?: string; - name?: string; - name_normalized?: string; + context_team_id?: string; + created?: number; + creator?: string; + id?: string; + internal_team_ids?: string[]; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_group?: boolean; + is_im?: boolean; + is_member?: boolean; + is_moved?: number; + is_mpim?: boolean; + is_open?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + last_read?: string; + name?: string; + name_normalized?: string; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - priority?: number; - purpose?: Purpose; - shared_team_ids?: string[]; - topic?: Purpose; - unlinked?: number; - updated?: number; + pending_shared?: string[]; + previous_names?: string[]; + priority?: number; + purpose?: Purpose; + shared_team_ids?: string[]; + topic?: Purpose; + unlinked?: number; + updated?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/ConversationsDeclineSharedInviteResponse.ts b/packages/web-api/src/types/response/ConversationsDeclineSharedInviteResponse.ts index 424f9ce71..7b713a9b8 100644 --- a/packages/web-api/src/types/response/ConversationsDeclineSharedInviteResponse.ts +++ b/packages/web-api/src/types/response/ConversationsDeclineSharedInviteResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsDeclineSharedInviteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ConversationsExternalInvitePermissionsSetResponse.ts b/packages/web-api/src/types/response/ConversationsExternalInvitePermissionsSetResponse.ts index a233089de..355938abf 100644 --- a/packages/web-api/src/types/response/ConversationsExternalInvitePermissionsSetResponse.ts +++ b/packages/web-api/src/types/response/ConversationsExternalInvitePermissionsSetResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsExternalInvitePermissionsSetResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ConversationsHistoryResponse.ts b/packages/web-api/src/types/response/ConversationsHistoryResponse.ts index bd43b4695..81f499520 100644 --- a/packages/web-api/src/types/response/ConversationsHistoryResponse.ts +++ b/packages/web-api/src/types/response/ConversationsHistoryResponse.ts @@ -8,255 +8,255 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsHistoryResponse = WebAPICallResult & { channel_actions_count?: number; - channel_actions_ts?: number; - error?: string; - has_more?: boolean; - messages?: MessageElement[]; - needed?: string; - ok?: boolean; - oldest?: string; - pin_count?: number; - provided?: string; - response_metadata?: ResponseMetadata; + channel_actions_ts?: number; + error?: string; + has_more?: boolean; + messages?: MessageElement[]; + needed?: string; + ok?: boolean; + oldest?: string; + pin_count?: number; + provided?: string; + response_metadata?: ResponseMetadata; }; export interface MessageElement { - app_id?: string; - attachments?: Attachment[]; - blocks?: PurpleBlock[]; - bot_id?: string; - bot_profile?: BotProfile; - client_msg_id?: string; - display_as_bot?: boolean; - edited?: Edited; - files?: FileElement[]; - icons?: MessageIcons; - inviter?: string; - is_locked?: boolean; - latest_reply?: string; - metadata?: FluffyMetadata; - parent_user_id?: string; - purpose?: string; - reactions?: Reaction[]; - reply_count?: number; - reply_users?: string[]; + app_id?: string; + attachments?: Attachment[]; + blocks?: PurpleBlock[]; + bot_id?: string; + bot_profile?: BotProfile; + client_msg_id?: string; + display_as_bot?: boolean; + edited?: Edited; + files?: FileElement[]; + icons?: MessageIcons; + inviter?: string; + is_locked?: boolean; + latest_reply?: string; + metadata?: FluffyMetadata; + parent_user_id?: string; + purpose?: string; + reactions?: Reaction[]; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - root?: FluffyRoot; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - topic?: string; - ts?: string; - type?: string; - upload?: boolean; - user?: string; - username?: string; - x_files?: string[]; + root?: FluffyRoot; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + topic?: string; + ts?: string; + type?: string; + upload?: boolean; + user?: string; + username?: string; + x_files?: string[]; } export interface Attachment { - actions?: Action[]; - app_id?: string; - app_unfurl_url?: string; - author_icon?: string; - author_id?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - blocks?: TitleBlockElement[]; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - channel_team?: string; - color?: string; - fallback?: string; - fields?: AttachmentField[]; - file_id?: string; - filename?: string; - files?: FileElement[]; - footer?: string; - footer_icon?: string; - from_url?: string; - hide_border?: boolean; - hide_color?: boolean; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_file_attachment?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_id?: string; + app_unfurl_url?: string; + author_icon?: string; + author_id?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + blocks?: TitleBlockElement[]; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + channel_team?: string; + color?: string; + fallback?: string; + fields?: AttachmentField[]; + file_id?: string; + filename?: string; + files?: FileElement[]; + footer?: string; + footer_icon?: string; + from_url?: string; + hide_border?: boolean; + hide_color?: boolean; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_file_attachment?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - list?: List; - list_record?: PurpleListRecord; - list_record_id?: string; - list_records?: ListRecordElement[]; - list_schema?: Schema[]; - list_view?: View; - list_view_id?: string; - message_blocks?: MessageBlock[]; - metadata?: AttachmentMetadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - preview?: Preview; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; - video_url?: string; + list?: List; + list_record?: PurpleListRecord; + list_record_id?: string; + list_records?: ListRecordElement[]; + list_schema?: Schema[]; + list_view?: View; + list_view_id?: string; + message_blocks?: MessageBlock[]; + metadata?: AttachmentMetadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + preview?: Preview; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; + video_url?: string; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: ActionOptionGroup[]; - options?: SelectedOptionElement[]; + name?: string; + option_groups?: ActionOptionGroup[]; + options?: SelectedOptionElement[]; selected_options?: SelectedOptionElement[]; - style?: string; - text?: string; - type?: string; - url?: string; - value?: string; + style?: string; + text?: string; + type?: string; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface ActionOptionGroup { options?: SelectedOptionElement[]; - text?: string; + text?: string; } export interface SelectedOptionElement { - text?: string; + text?: string; value?: string; } export interface TitleBlockElement { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: AccessoryConfirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: AccessoryConfirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: InitialOptionElement; - initial_options?: InitialOptionElement[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: AccessoryOptionGroup[]; - options?: InitialOptionElement[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: InitialOptionElement; + initial_options?: InitialOptionElement[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: AccessoryOptionGroup[]; + options?: InitialOptionElement[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface AccessoryConfirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -266,42 +266,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: FluffyType; + indent?: number; + offset?: number; + style?: string; + type?: FluffyType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -325,25 +325,25 @@ export enum FluffyType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface InitialOptionElement { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface AccessoryOptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: InitialOptionElement[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -353,11 +353,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } @@ -379,263 +379,263 @@ export interface AttachmentField { } export interface FileElement { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlockElement[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlockElement[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -650,64 +650,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -716,48 +716,47 @@ export interface Transcription { } export interface List { - channels?: string[]; - comments_count?: number; - created?: number; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - editable?: boolean; - external_type?: string; - file_access?: string; - filetype?: string; - groups?: string[]; - has_more_shares?: boolean; - has_rich_preview?: boolean; - id?: string; - ims?: string[]; - is_external?: boolean; - is_public?: boolean; - last_editor?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: string; - pretty_type?: string; + channels?: string[]; + comments_count?: number; + created?: number; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + editable?: boolean; + external_type?: string; + file_access?: string; + filetype?: string; + groups?: string[]; + has_more_shares?: boolean; + has_rich_preview?: boolean; + id?: string; + ims?: string[]; + is_external?: boolean; + is_public?: boolean; + last_editor?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: string; + pretty_type?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - shares?: EventPayload; - size?: number; - timestamp?: number; - title?: string; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + shares?: EventPayload; + size?: number; + timestamp?: number; + title?: string; + updated?: number; + url_private?: string; + url_private_download?: string; + user?: string; + user_team?: string; + username?: string; } -export interface EventPayload { -} +export type EventPayload = {}; export interface PurpleListRecord { record?: Record; @@ -765,90 +764,90 @@ export interface PurpleListRecord { } export interface Record { - fields?: RecordField[]; + fields?: RecordField[]; record_id?: string; } export interface RecordField { attachment?: any[]; - channel?: any[]; - checkbox?: boolean; - column_id?: string; - date?: any[]; - email?: any[]; - key?: string; - message?: FieldMessage; - number?: any[]; - phone?: any[]; - rating?: any[]; - rich_text?: any[]; - select?: any[]; - text?: string; - timestamp?: any[]; - user?: any[]; - value?: string; + channel?: any[]; + checkbox?: boolean; + column_id?: string; + date?: any[]; + email?: any[]; + key?: string; + message?: FieldMessage; + number?: any[]; + phone?: any[]; + rating?: any[]; + rich_text?: any[]; + select?: any[]; + text?: string; + timestamp?: any[]; + user?: any[]; + value?: string; } export interface FieldMessage { - app_id?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - bot_link?: string; - bot_profile?: BotProfile; - channel?: string; - client_msg_id?: string; - comment?: Comment; - display_as_bot?: boolean; - edited?: Edited; - file?: PurpleFile; - files?: any[]; - hidden?: boolean; - icons?: MessageIcons; - inviter?: string; - is_intro?: boolean; - is_locked?: boolean; - is_starred?: boolean; + app_id?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + bot_link?: string; + bot_profile?: BotProfile; + channel?: string; + client_msg_id?: string; + comment?: Comment; + display_as_bot?: boolean; + edited?: Edited; + file?: PurpleFile; + files?: any[]; + hidden?: boolean; + icons?: MessageIcons; + inviter?: string; + is_intro?: boolean; + is_locked?: boolean; + is_starred?: boolean; is_thread_broadcast?: boolean; - item?: Comment; - item_type?: string; - last_read?: string; - latest_reply?: string; - metadata?: PurpleMetadata; - no_notifications?: boolean; - parent_user_id?: string; - pinned_to?: any[]; - purpose?: string; - reactions?: any[]; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; - reply_users_count?: number; - room?: Room; - root?: PurpleRoot; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - topic?: string; - ts?: string; - type?: string; - unfurl_links?: boolean; - unfurl_media?: boolean; - upload?: boolean; - user?: string; - username?: string; - wibblr?: boolean; - x_files?: any[]; + item?: Comment; + item_type?: string; + last_read?: string; + latest_reply?: string; + metadata?: PurpleMetadata; + no_notifications?: boolean; + parent_user_id?: string; + pinned_to?: any[]; + purpose?: string; + reactions?: any[]; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; + reply_users_count?: number; + room?: Room; + root?: PurpleRoot; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + topic?: string; + ts?: string; + type?: string; + unfurl_links?: boolean; + unfurl_media?: boolean; + upload?: boolean; + user?: string; + username?: string; + wibblr?: boolean; + x_files?: any[]; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: BotProfileIcons; - id?: string; - name?: string; + icons?: BotProfileIcons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -860,208 +859,208 @@ export interface BotProfileIcons { } export interface Comment { - comment?: string; - created?: string; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_type?: string; - filetype?: string; - has_rich_preview?: boolean; - id?: string; - is_external?: boolean; - is_intro?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: boolean; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + comment?: string; + created?: string; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_type?: string; + filetype?: string; + has_rich_preview?: boolean; + id?: string; + is_external?: boolean; + is_intro?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: boolean; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - size?: number; - timestamp?: string; - title?: string; - url_private?: string; + public_url_shared?: boolean; + size?: number; + timestamp?: string; + title?: string; + url_private?: string; url_private_download?: boolean; - user?: string; - username?: string; + user?: string; + username?: string; } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface PurpleFile { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: any[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: any[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: any[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: any[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: any[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: any[]; - file_access?: string; - filetype?: string; - from?: any[]; - groups?: any[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: any[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: any[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: any[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: any[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: any[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: any[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: any[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: any[]; + file_access?: string; + filetype?: string; + from?: any[]; + groups?: any[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: any[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: any[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: any[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: EventPayload; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: any[]; - to?: any[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: any[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: EventPayload; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: any[]; + to?: any[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface MessageIcons { - emoji?: string; + emoji?: string; image_36?: string; image_48?: string; image_64?: string; @@ -1073,77 +1072,77 @@ export interface PurpleMetadata { } export interface Room { - app_id?: string; - attached_file_ids?: any[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: any[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: any[]; - participants?: any[]; - participants_camera_off?: any[]; - participants_camera_on?: any[]; + app_id?: string; + attached_file_ids?: any[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: any[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: any[]; + participants?: any[]; + participants_camera_off?: any[]; + participants_camera_on?: any[]; participants_screenshare_off?: any[]; - participants_screenshare_on?: any[]; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: any[]; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface PurpleRoot { - bot_id?: string; - bot_profile?: BotProfile; - edited?: Edited; - icons?: MessageIcons; - last_read?: string; - latest_reply?: string; - mrkdwn?: boolean; - no_notifications?: boolean; - parent_user_id?: string; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; + bot_id?: string; + bot_profile?: BotProfile; + edited?: Edited; + icons?: MessageIcons; + last_read?: string; + latest_reply?: string; + mrkdwn?: boolean; + no_notifications?: boolean; + parent_user_id?: string; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; reply_users_count?: number; - room?: Room; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - unread_count?: number; - user?: string; - username?: string; + room?: Room; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + unread_count?: number; + user?: string; + username?: string; } export interface ListRecordElement { - created_by?: string; - date_created?: number; - fields?: RecordField[]; - id?: string; - is_subscribed?: boolean; - list_id?: string; - platform_refs?: PlatformRefs; - position?: string; - saved?: Saved; - thread_ts?: string; - updated_by?: string; + created_by?: string; + date_created?: number; + fields?: RecordField[]; + id?: string; + is_subscribed?: boolean; + list_id?: string; + platform_refs?: PlatformRefs; + position?: string; + saved?: Saved; + thread_ts?: string; + updated_by?: string; updated_timestamp?: string; } @@ -1156,154 +1155,154 @@ export interface PlatformRefs { export interface MessageBlock { channel?: string; message?: FieldMessage; - team?: string; - ts?: string; + team?: string; + ts?: string; } export interface AttachmentMetadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Preview { can_remove?: boolean; - icon_url?: string; - subtitle?: DescriptionElement; - title?: DescriptionElement; - type?: string; + icon_url?: string; + subtitle?: DescriptionElement; + title?: DescriptionElement; + type?: string; } export interface PurpleBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: FileElement; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: FileElement; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface FluffyMetadata { event_payload?: EventPayload; - event_type?: string; + event_type?: string; } export interface FluffyRoot { - bot_id?: string; - icons?: PurpleIcons; - latest_reply?: string; - parent_user_id?: string; - reply_count?: number; - reply_users?: string[]; + bot_id?: string; + icons?: PurpleIcons; + latest_reply?: string; + parent_user_id?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - subtype?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - username?: string; + subscribed?: boolean; + subtype?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + username?: string; } export interface PurpleIcons { - emoji?: string; + emoji?: string; image_64?: string; } diff --git a/packages/web-api/src/types/response/ConversationsInfoResponse.ts b/packages/web-api/src/types/response/ConversationsInfoResponse.ts index 3b8950cfa..ccaa461a2 100644 --- a/packages/web-api/src/types/response/ConversationsInfoResponse.ts +++ b/packages/web-api/src/types/response/ConversationsInfoResponse.ts @@ -8,60 +8,60 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsInfoResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { connected_limited_team_ids?: string[]; - connected_team_ids?: string[]; - context_team_id?: string; - conversation_host_id?: string; - created?: number; - creator?: string; - id?: string; - internal_team_ids?: string[]; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_global_shared?: boolean; - is_group?: boolean; - is_im?: boolean; - is_member?: boolean; - is_moved?: number; - is_mpim?: boolean; - is_non_threadable?: boolean; - is_org_default?: boolean; - is_org_mandatory?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_read_only?: boolean; - is_shared?: boolean; - is_thread_only?: boolean; - last_read?: string; - locale?: string; - name?: string; - name_normalized?: string; - num_members?: number; + connected_team_ids?: string[]; + context_team_id?: string; + conversation_host_id?: string; + created?: number; + creator?: string; + id?: string; + internal_team_ids?: string[]; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_global_shared?: boolean; + is_group?: boolean; + is_im?: boolean; + is_member?: boolean; + is_moved?: number; + is_mpim?: boolean; + is_non_threadable?: boolean; + is_org_default?: boolean; + is_org_mandatory?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_read_only?: boolean; + is_shared?: boolean; + is_thread_only?: boolean; + last_read?: string; + locale?: string; + name?: string; + name_normalized?: string; + num_members?: number; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - purpose?: Purpose; - shared_team_ids?: string[]; - topic?: Purpose; - unlinked?: number; - updated?: number; + pending_shared?: string[]; + previous_names?: string[]; + purpose?: Purpose; + shared_team_ids?: string[]; + topic?: Purpose; + unlinked?: number; + updated?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/ConversationsInviteResponse.ts b/packages/web-api/src/types/response/ConversationsInviteResponse.ts index 15a9c2384..632455e12 100644 --- a/packages/web-api/src/types/response/ConversationsInviteResponse.ts +++ b/packages/web-api/src/types/response/ConversationsInviteResponse.ts @@ -8,57 +8,57 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsInviteResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - errors?: Error[]; - needed?: string; - ok?: boolean; + channel?: Channel; + error?: string; + errors?: Error[]; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - context_team_id?: string; - created?: number; - creator?: string; - id?: string; - internal_team_ids?: string[]; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_group?: boolean; - is_im?: boolean; - is_member?: boolean; - is_moved?: number; - is_mpim?: boolean; - is_open?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - last_read?: string; - name?: string; - name_normalized?: string; + context_team_id?: string; + created?: number; + creator?: string; + id?: string; + internal_team_ids?: string[]; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_group?: boolean; + is_im?: boolean; + is_member?: boolean; + is_moved?: number; + is_mpim?: boolean; + is_open?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + last_read?: string; + name?: string; + name_normalized?: string; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - purpose?: Purpose; - shared_team_ids?: string[]; - topic?: Purpose; - unlinked?: number; - updated?: number; + pending_shared?: string[]; + previous_names?: string[]; + purpose?: Purpose; + shared_team_ids?: string[]; + topic?: Purpose; + unlinked?: number; + updated?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface Error { error?: string; - ok?: boolean; - user?: string; + ok?: boolean; + user?: string; } diff --git a/packages/web-api/src/types/response/ConversationsInviteSharedResponse.ts b/packages/web-api/src/types/response/ConversationsInviteSharedResponse.ts index 1e089be05..ef5c9523b 100644 --- a/packages/web-api/src/types/response/ConversationsInviteSharedResponse.ts +++ b/packages/web-api/src/types/response/ConversationsInviteSharedResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsInviteSharedResponse = WebAPICallResult & { - conf_code?: string; - error?: string; - invite_id?: string; + conf_code?: string; + error?: string; + invite_id?: string; is_legacy_shared_channel?: boolean; - needed?: string; - ok?: boolean; - provided?: string; - url?: string; + needed?: string; + ok?: boolean; + provided?: string; + url?: string; }; diff --git a/packages/web-api/src/types/response/ConversationsJoinResponse.ts b/packages/web-api/src/types/response/ConversationsJoinResponse.ts index 9c6165627..76f856c01 100644 --- a/packages/web-api/src/types/response/ConversationsJoinResponse.ts +++ b/packages/web-api/src/types/response/ConversationsJoinResponse.ts @@ -8,73 +8,73 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsJoinResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Channel { - context_team_id?: string; - created?: number; - creator?: string; - id?: string; - internal_team_ids?: string[]; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_group?: boolean; - is_im?: boolean; - is_member?: boolean; - is_moved?: number; - is_mpim?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - is_starred?: boolean; - last_read?: string; - name?: string; - name_normalized?: string; + context_team_id?: string; + created?: number; + creator?: string; + id?: string; + internal_team_ids?: string[]; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_group?: boolean; + is_im?: boolean; + is_member?: boolean; + is_moved?: number; + is_mpim?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + is_starred?: boolean; + last_read?: string; + name?: string; + name_normalized?: string; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - priority?: number; - properties?: Properties; - purpose?: Purpose; - shared_team_ids?: string[]; - topic?: Purpose; - unlinked?: number; - updated?: number; + pending_shared?: string[]; + previous_names?: string[]; + priority?: number; + properties?: Properties; + purpose?: Purpose; + shared_team_ids?: string[]; + topic?: Purpose; + unlinked?: number; + updated?: number; } export interface Properties { canvas?: Canvas; - tabs?: Tab[]; + tabs?: Tab[]; } export interface Canvas { - file_id?: string; - is_empty?: boolean; + file_id?: string; + is_empty?: boolean; quip_thread_id?: string; } export interface Tab { - id?: string; + id?: string; label?: string; - type?: string; + type?: string; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ConversationsKickResponse.ts b/packages/web-api/src/types/response/ConversationsKickResponse.ts index 4986d8916..18510ca0a 100644 --- a/packages/web-api/src/types/response/ConversationsKickResponse.ts +++ b/packages/web-api/src/types/response/ConversationsKickResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsKickResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ConversationsLeaveResponse.ts b/packages/web-api/src/types/response/ConversationsLeaveResponse.ts index 5d97618b1..db6acb1f0 100644 --- a/packages/web-api/src/types/response/ConversationsLeaveResponse.ts +++ b/packages/web-api/src/types/response/ConversationsLeaveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsLeaveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ConversationsListConnectInvitesResponse.ts b/packages/web-api/src/types/response/ConversationsListConnectInvitesResponse.ts index f4590ae07..77f252277 100644 --- a/packages/web-api/src/types/response/ConversationsListConnectInvitesResponse.ts +++ b/packages/web-api/src/types/response/ConversationsListConnectInvitesResponse.ts @@ -8,112 +8,112 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsListConnectInvitesResponse = WebAPICallResult & { - arg?: string; - error?: string; - invites?: InviteElement[]; - needed?: string; - ok?: boolean; - provided?: string; + arg?: string; + error?: string; + invites?: InviteElement[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface InviteElement { - acceptances?: Acceptance[]; - channel?: Channel; + acceptances?: Acceptance[]; + channel?: Channel; date_last_updated?: number; - direction?: string; - invite?: InviteInvite; - invite_type?: string; - status?: string; + direction?: string; + invite?: InviteInvite; + invite_type?: string; + status?: string; } export interface Acceptance { - accepting_team?: IngTeam; - accepting_user?: TingUser; - approval_status?: string; - date_accepted?: number; - date_invalid?: number; + accepting_team?: IngTeam; + accepting_user?: TingUser; + approval_status?: string; + date_accepted?: number; + date_invalid?: number; date_last_updated?: number; - reviews?: Review[]; + reviews?: Review[]; } export interface IngTeam { avatar_base_url?: string; - date_created?: number; - domain?: string; - icon?: Icon; - id?: string; - is_verified?: boolean; - name?: string; + date_created?: number; + domain?: string; + icon?: Icon; + id?: string; + is_verified?: boolean; + name?: string; } export interface Icon { - image_102?: string; - image_132?: string; - image_230?: string; - image_34?: string; - image_44?: string; - image_68?: string; - image_88?: string; - image_default?: boolean; + image_102?: string; + image_132?: string; + image_230?: string; + image_34?: string; + image_44?: string; + image_68?: string; + image_88?: string; + image_default?: boolean; image_original?: string; } export interface TingUser { - id?: string; - name?: string; - profile?: Profile; - team_id?: string; - updated?: number; + id?: string; + name?: string; + profile?: Profile; + team_id?: string; + updated?: number; who_can_share_contact_card?: string; } export interface Profile { - avatar_hash?: string; - display_name?: string; + avatar_hash?: string; + display_name?: string; display_name_normalized?: string; - email?: string; - image_1024?: string; - image_192?: string; - image_24?: string; - image_32?: string; - image_48?: string; - image_512?: string; - image_72?: string; - image_original?: string; - is_custom_image?: boolean; - real_name?: string; - real_name_normalized?: string; - team?: string; + email?: string; + image_1024?: string; + image_192?: string; + image_24?: string; + image_32?: string; + image_48?: string; + image_512?: string; + image_72?: string; + image_original?: string; + is_custom_image?: boolean; + real_name?: string; + real_name_normalized?: string; + team?: string; } export interface Review { - date_review?: number; + date_review?: number; reviewing_team?: IngTeam; - type?: string; + type?: string; } export interface Channel { - id?: string; - is_im?: boolean; + id?: string; + is_im?: boolean; is_private?: boolean; - name?: string; + name?: string; } export interface InviteInvite { - date_created?: number; - date_invalid?: number; - id?: string; - inviting_team?: IngTeam; - inviting_user?: TingUser; - link?: string; - recipient_email?: string; + date_created?: number; + date_invalid?: number; + id?: string; + inviting_team?: IngTeam; + inviting_user?: TingUser; + link?: string; + recipient_email?: string; recipient_user_id?: string; } export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; } diff --git a/packages/web-api/src/types/response/ConversationsListResponse.ts b/packages/web-api/src/types/response/ConversationsListResponse.ts index 61ac4534e..135967fdb 100644 --- a/packages/web-api/src/types/response/ConversationsListResponse.ts +++ b/packages/web-api/src/types/response/ConversationsListResponse.ts @@ -8,66 +8,66 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsListResponse = WebAPICallResult & { - channels?: Channel[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + channels?: Channel[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Channel { - context_team_id?: string; - conversation_host_id?: string; - created?: number; - creator?: string; - id?: string; - internal_team_ids?: string[]; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_global_shared?: boolean; - is_group?: boolean; - is_im?: boolean; - is_member?: boolean; - is_moved?: number; - is_mpim?: boolean; - is_org_default?: boolean; - is_org_mandatory?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - is_user_deleted?: boolean; - name?: string; - name_normalized?: string; - num_members?: number; + context_team_id?: string; + conversation_host_id?: string; + created?: number; + creator?: string; + id?: string; + internal_team_ids?: string[]; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_global_shared?: boolean; + is_group?: boolean; + is_im?: boolean; + is_member?: boolean; + is_moved?: number; + is_mpim?: boolean; + is_org_default?: boolean; + is_org_mandatory?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + is_user_deleted?: boolean; + name?: string; + name_normalized?: string; + num_members?: number; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - priority?: number; - properties?: Properties; - purpose?: Purpose; - shared_team_ids?: string[]; - topic?: Purpose; - unlinked?: number; - updated?: number; - user?: string; + pending_shared?: string[]; + previous_names?: string[]; + priority?: number; + properties?: Properties; + purpose?: Purpose; + shared_team_ids?: string[]; + topic?: Purpose; + unlinked?: number; + updated?: number; + user?: string; } export interface Properties { - canvas?: Canvas; + canvas?: Canvas; posting_restricted_to?: RestrictedTo; - tabs?: Tab[]; + tabs?: Tab[]; threads_restricted_to?: RestrictedTo; } export interface Canvas { - file_id?: string; - is_empty?: boolean; + file_id?: string; + is_empty?: boolean; quip_thread_id?: string; } @@ -77,15 +77,15 @@ export interface RestrictedTo { } export interface Tab { - id?: string; + id?: string; label?: string; - type?: string; + type?: string; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ConversationsMarkResponse.ts b/packages/web-api/src/types/response/ConversationsMarkResponse.ts index 9fbffa74d..160d5dde2 100644 --- a/packages/web-api/src/types/response/ConversationsMarkResponse.ts +++ b/packages/web-api/src/types/response/ConversationsMarkResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsMarkResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ConversationsMembersResponse.ts b/packages/web-api/src/types/response/ConversationsMembersResponse.ts index b39ebfdc3..1681230c7 100644 --- a/packages/web-api/src/types/response/ConversationsMembersResponse.ts +++ b/packages/web-api/src/types/response/ConversationsMembersResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsMembersResponse = WebAPICallResult & { - error?: string; - members?: string[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + members?: string[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/ConversationsOpenResponse.ts b/packages/web-api/src/types/response/ConversationsOpenResponse.ts index 69622f3e0..660e3debf 100644 --- a/packages/web-api/src/types/response/ConversationsOpenResponse.ts +++ b/packages/web-api/src/types/response/ConversationsOpenResponse.ts @@ -8,155 +8,155 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsOpenResponse = WebAPICallResult & { already_open?: boolean; - channel?: Channel; - error?: string; - needed?: string; - no_op?: boolean; - ok?: boolean; - provided?: string; + channel?: Channel; + error?: string; + needed?: string; + no_op?: boolean; + ok?: boolean; + provided?: string; }; export interface Channel { - context_team_id?: string; - created?: number; - id?: string; - is_archived?: boolean; - is_im?: boolean; - is_open?: boolean; - is_org_shared?: boolean; - last_read?: string; - latest?: Latest; - priority?: number; - unread_count?: number; + context_team_id?: string; + created?: number; + id?: string; + is_archived?: boolean; + is_im?: boolean; + is_open?: boolean; + is_org_shared?: boolean; + last_read?: string; + latest?: Latest; + priority?: number; + unread_count?: number; unread_count_display?: number; - updated?: number; - user?: string; + updated?: number; + user?: string; } export interface Latest { - app_id?: string; - blocks?: LatestBlock[]; - bot_id?: string; - bot_profile?: BotProfile; + app_id?: string; + blocks?: LatestBlock[]; + bot_id?: string; + bot_profile?: BotProfile; client_msg_id?: string; - subtype?: string; - team?: string; - text?: string; - ts?: string; - type?: string; - user?: string; + subtype?: string; + team?: string; + text?: string; + ts?: string; + type?: string; + user?: string; } export interface LatestBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: File; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: File; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -166,42 +166,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: FluffyType; + indent?: number; + offset?: number; + style?: string; + type?: FluffyType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -225,25 +225,25 @@ export enum FluffyType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface OptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -253,358 +253,358 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlockElement[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlockElement[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface TitleBlockElement { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -619,64 +619,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -685,11 +685,11 @@ export interface Transcription { } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } diff --git a/packages/web-api/src/types/response/ConversationsRenameResponse.ts b/packages/web-api/src/types/response/ConversationsRenameResponse.ts index 246146bce..3ff4d9eee 100644 --- a/packages/web-api/src/types/response/ConversationsRenameResponse.ts +++ b/packages/web-api/src/types/response/ConversationsRenameResponse.ts @@ -8,50 +8,50 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsRenameResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - context_team_id?: string; - created?: number; - creator?: string; - id?: string; - internal_team_ids?: string[]; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_group?: boolean; - is_im?: boolean; - is_member?: boolean; - is_moved?: number; - is_mpim?: boolean; - is_open?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - last_read?: string; - name?: string; - name_normalized?: string; + context_team_id?: string; + created?: number; + creator?: string; + id?: string; + internal_team_ids?: string[]; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_group?: boolean; + is_im?: boolean; + is_member?: boolean; + is_moved?: number; + is_mpim?: boolean; + is_open?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + last_read?: string; + name?: string; + name_normalized?: string; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - purpose?: Purpose; - shared_team_ids?: string[]; - topic?: Purpose; - unlinked?: number; - updated?: number; + pending_shared?: string[]; + previous_names?: string[]; + purpose?: Purpose; + shared_team_ids?: string[]; + topic?: Purpose; + unlinked?: number; + updated?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/ConversationsRepliesResponse.ts b/packages/web-api/src/types/response/ConversationsRepliesResponse.ts index 735be9788..cc7c7ff92 100644 --- a/packages/web-api/src/types/response/ConversationsRepliesResponse.ts +++ b/packages/web-api/src/types/response/ConversationsRepliesResponse.ts @@ -8,244 +8,244 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsRepliesResponse = WebAPICallResult & { - error?: string; - has_more?: boolean; - messages?: MessageElement[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + has_more?: boolean; + messages?: MessageElement[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface MessageElement { - app_id?: string; - attachments?: Attachment[]; - blocks?: PurpleBlock[]; - bot_id?: string; - bot_profile?: BotProfile; - display_as_bot?: boolean; - edited?: Edited; - files?: FileElement[]; - is_locked?: boolean; - last_read?: string; - latest_reply?: string; - metadata?: FluffyMetadata; - parent_user_id?: string; - reactions?: Reaction[]; - reply_count?: number; - reply_users?: string[]; + app_id?: string; + attachments?: Attachment[]; + blocks?: PurpleBlock[]; + bot_id?: string; + bot_profile?: BotProfile; + display_as_bot?: boolean; + edited?: Edited; + files?: FileElement[]; + is_locked?: boolean; + last_read?: string; + latest_reply?: string; + metadata?: FluffyMetadata; + parent_user_id?: string; + reactions?: Reaction[]; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - upload?: boolean; - user?: string; - x_files?: string[]; + subscribed?: boolean; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + upload?: boolean; + user?: string; + x_files?: string[]; } export interface Attachment { - actions?: Action[]; - app_id?: string; - app_unfurl_url?: string; - author_icon?: string; - author_id?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - blocks?: TitleBlockElement[]; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - channel_team?: string; - color?: string; - fallback?: string; - fields?: AttachmentField[]; - file_id?: string; - filename?: string; - files?: FileElement[]; - footer?: string; - footer_icon?: string; - from_url?: string; - hide_border?: boolean; - hide_color?: boolean; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_file_attachment?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_id?: string; + app_unfurl_url?: string; + author_icon?: string; + author_id?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + blocks?: TitleBlockElement[]; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + channel_team?: string; + color?: string; + fallback?: string; + fields?: AttachmentField[]; + file_id?: string; + filename?: string; + files?: FileElement[]; + footer?: string; + footer_icon?: string; + from_url?: string; + hide_border?: boolean; + hide_color?: boolean; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_file_attachment?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - list?: List; - list_record?: PurpleListRecord; - list_record_id?: string; - list_records?: ListRecordElement[]; - list_schema?: Schema[]; - list_view?: View; - list_view_id?: string; - message_blocks?: MessageBlock[]; - metadata?: AttachmentMetadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - preview?: Preview; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; - video_url?: string; + list?: List; + list_record?: PurpleListRecord; + list_record_id?: string; + list_records?: ListRecordElement[]; + list_schema?: Schema[]; + list_view?: View; + list_view_id?: string; + message_blocks?: MessageBlock[]; + metadata?: AttachmentMetadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + preview?: Preview; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; + video_url?: string; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: ActionOptionGroup[]; - options?: SelectedOptionElement[]; + name?: string; + option_groups?: ActionOptionGroup[]; + options?: SelectedOptionElement[]; selected_options?: SelectedOptionElement[]; - style?: string; - text?: string; - type?: string; - url?: string; - value?: string; + style?: string; + text?: string; + type?: string; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface ActionOptionGroup { options?: SelectedOptionElement[]; - text?: string; + text?: string; } export interface SelectedOptionElement { - text?: string; + text?: string; value?: string; } export interface TitleBlockElement { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: AccessoryConfirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: AccessoryConfirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: InitialOptionElement; - initial_options?: InitialOptionElement[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: AccessoryOptionGroup[]; - options?: InitialOptionElement[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: InitialOptionElement; + initial_options?: InitialOptionElement[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: AccessoryOptionGroup[]; + options?: InitialOptionElement[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface AccessoryConfirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -255,42 +255,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: FluffyType; + indent?: number; + offset?: number; + style?: string; + type?: FluffyType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -314,25 +314,25 @@ export enum FluffyType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface InitialOptionElement { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface AccessoryOptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: InitialOptionElement[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -342,11 +342,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } @@ -368,263 +368,263 @@ export interface AttachmentField { } export interface FileElement { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlockElement[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlockElement[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -639,64 +639,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -705,48 +705,47 @@ export interface Transcription { } export interface List { - channels?: string[]; - comments_count?: number; - created?: number; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - editable?: boolean; - external_type?: string; - file_access?: string; - filetype?: string; - groups?: string[]; - has_more_shares?: boolean; - has_rich_preview?: boolean; - id?: string; - ims?: string[]; - is_external?: boolean; - is_public?: boolean; - last_editor?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: string; - pretty_type?: string; + channels?: string[]; + comments_count?: number; + created?: number; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + editable?: boolean; + external_type?: string; + file_access?: string; + filetype?: string; + groups?: string[]; + has_more_shares?: boolean; + has_rich_preview?: boolean; + id?: string; + ims?: string[]; + is_external?: boolean; + is_public?: boolean; + last_editor?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: string; + pretty_type?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - shares?: EventPayload; - size?: number; - timestamp?: number; - title?: string; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + shares?: EventPayload; + size?: number; + timestamp?: number; + title?: string; + updated?: number; + url_private?: string; + url_private_download?: string; + user?: string; + user_team?: string; + username?: string; } -export interface EventPayload { -} +export type EventPayload = {}; export interface PurpleListRecord { record?: Record; @@ -754,90 +753,90 @@ export interface PurpleListRecord { } export interface Record { - fields?: RecordField[]; + fields?: RecordField[]; record_id?: string; } export interface RecordField { attachment?: any[]; - channel?: any[]; - checkbox?: boolean; - column_id?: string; - date?: any[]; - email?: any[]; - key?: string; - message?: FieldMessage; - number?: any[]; - phone?: any[]; - rating?: any[]; - rich_text?: any[]; - select?: any[]; - text?: string; - timestamp?: any[]; - user?: any[]; - value?: string; + channel?: any[]; + checkbox?: boolean; + column_id?: string; + date?: any[]; + email?: any[]; + key?: string; + message?: FieldMessage; + number?: any[]; + phone?: any[]; + rating?: any[]; + rich_text?: any[]; + select?: any[]; + text?: string; + timestamp?: any[]; + user?: any[]; + value?: string; } export interface FieldMessage { - app_id?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - bot_link?: string; - bot_profile?: BotProfile; - channel?: string; - client_msg_id?: string; - comment?: Comment; - display_as_bot?: boolean; - edited?: Edited; - file?: PurpleFile; - files?: any[]; - hidden?: boolean; - icons?: MessageIcons; - inviter?: string; - is_intro?: boolean; - is_locked?: boolean; - is_starred?: boolean; + app_id?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + bot_link?: string; + bot_profile?: BotProfile; + channel?: string; + client_msg_id?: string; + comment?: Comment; + display_as_bot?: boolean; + edited?: Edited; + file?: PurpleFile; + files?: any[]; + hidden?: boolean; + icons?: MessageIcons; + inviter?: string; + is_intro?: boolean; + is_locked?: boolean; + is_starred?: boolean; is_thread_broadcast?: boolean; - item?: Comment; - item_type?: string; - last_read?: string; - latest_reply?: string; - metadata?: PurpleMetadata; - no_notifications?: boolean; - parent_user_id?: string; - pinned_to?: any[]; - purpose?: string; - reactions?: any[]; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; - reply_users_count?: number; - room?: Room; - root?: Root; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - topic?: string; - ts?: string; - type?: string; - unfurl_links?: boolean; - unfurl_media?: boolean; - upload?: boolean; - user?: string; - username?: string; - wibblr?: boolean; - x_files?: any[]; + item?: Comment; + item_type?: string; + last_read?: string; + latest_reply?: string; + metadata?: PurpleMetadata; + no_notifications?: boolean; + parent_user_id?: string; + pinned_to?: any[]; + purpose?: string; + reactions?: any[]; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; + reply_users_count?: number; + room?: Room; + root?: Root; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + topic?: string; + ts?: string; + type?: string; + unfurl_links?: boolean; + unfurl_media?: boolean; + upload?: boolean; + user?: string; + username?: string; + wibblr?: boolean; + x_files?: any[]; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: BotProfileIcons; - id?: string; - name?: string; + icons?: BotProfileIcons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -849,208 +848,208 @@ export interface BotProfileIcons { } export interface Comment { - comment?: string; - created?: string; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_type?: string; - filetype?: string; - has_rich_preview?: boolean; - id?: string; - is_external?: boolean; - is_intro?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: boolean; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + comment?: string; + created?: string; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_type?: string; + filetype?: string; + has_rich_preview?: boolean; + id?: string; + is_external?: boolean; + is_intro?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: boolean; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - size?: number; - timestamp?: string; - title?: string; - url_private?: string; + public_url_shared?: boolean; + size?: number; + timestamp?: string; + title?: string; + url_private?: string; url_private_download?: boolean; - user?: string; - username?: string; + user?: string; + username?: string; } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface PurpleFile { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: any[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: any[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: any[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: any[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: any[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: any[]; - file_access?: string; - filetype?: string; - from?: any[]; - groups?: any[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: any[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: any[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: any[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: any[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: any[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: any[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: any[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: any[]; + file_access?: string; + filetype?: string; + from?: any[]; + groups?: any[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: any[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: any[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: any[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: EventPayload; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: any[]; - to?: any[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: any[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: EventPayload; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: any[]; + to?: any[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface MessageIcons { - emoji?: string; + emoji?: string; image_36?: string; image_48?: string; image_64?: string; @@ -1062,77 +1061,77 @@ export interface PurpleMetadata { } export interface Room { - app_id?: string; - attached_file_ids?: any[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: any[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: any[]; - participants?: any[]; - participants_camera_off?: any[]; - participants_camera_on?: any[]; + app_id?: string; + attached_file_ids?: any[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: any[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: any[]; + participants?: any[]; + participants_camera_off?: any[]; + participants_camera_on?: any[]; participants_screenshare_off?: any[]; - participants_screenshare_on?: any[]; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: any[]; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Root { - bot_id?: string; - bot_profile?: BotProfile; - edited?: Edited; - icons?: MessageIcons; - last_read?: string; - latest_reply?: string; - mrkdwn?: boolean; - no_notifications?: boolean; - parent_user_id?: string; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; + bot_id?: string; + bot_profile?: BotProfile; + edited?: Edited; + icons?: MessageIcons; + last_read?: string; + latest_reply?: string; + mrkdwn?: boolean; + no_notifications?: boolean; + parent_user_id?: string; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; reply_users_count?: number; - room?: Room; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - unread_count?: number; - user?: string; - username?: string; + room?: Room; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + unread_count?: number; + user?: string; + username?: string; } export interface ListRecordElement { - created_by?: string; - date_created?: number; - fields?: RecordField[]; - id?: string; - is_subscribed?: boolean; - list_id?: string; - platform_refs?: PlatformRefs; - position?: string; - saved?: Saved; - thread_ts?: string; - updated_by?: string; + created_by?: string; + date_created?: number; + fields?: RecordField[]; + id?: string; + is_subscribed?: boolean; + list_id?: string; + platform_refs?: PlatformRefs; + position?: string; + saved?: Saved; + thread_ts?: string; + updated_by?: string; updated_timestamp?: string; } @@ -1145,133 +1144,133 @@ export interface PlatformRefs { export interface MessageBlock { channel?: string; message?: FieldMessage; - team?: string; - ts?: string; + team?: string; + ts?: string; } export interface AttachmentMetadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Preview { can_remove?: boolean; - icon_url?: string; - subtitle?: DescriptionElement; - title?: DescriptionElement; - type?: string; + icon_url?: string; + subtitle?: DescriptionElement; + title?: DescriptionElement; + type?: string; } export interface PurpleBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: FileElement; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: FileElement; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface FluffyMetadata { event_payload?: EventPayload; - event_type?: string; + event_type?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ConversationsSetPurposeResponse.ts b/packages/web-api/src/types/response/ConversationsSetPurposeResponse.ts index 2ea93449e..e81281ad6 100644 --- a/packages/web-api/src/types/response/ConversationsSetPurposeResponse.ts +++ b/packages/web-api/src/types/response/ConversationsSetPurposeResponse.ts @@ -8,47 +8,47 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsSetPurposeResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - context_team_id?: string; - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_group?: boolean; - is_im?: boolean; - is_member?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - last_read?: string; - name?: string; - name_normalized?: string; + context_team_id?: string; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_group?: boolean; + is_im?: boolean; + is_member?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + last_read?: string; + name?: string; + name_normalized?: string; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - purpose?: Purpose; - shared_team_ids?: string[]; - topic?: Purpose; - unlinked?: number; - updated?: number; + pending_shared?: string[]; + previous_names?: string[]; + purpose?: Purpose; + shared_team_ids?: string[]; + topic?: Purpose; + unlinked?: number; + updated?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/ConversationsSetTopicResponse.ts b/packages/web-api/src/types/response/ConversationsSetTopicResponse.ts index e663b00bf..dcfb28ead 100644 --- a/packages/web-api/src/types/response/ConversationsSetTopicResponse.ts +++ b/packages/web-api/src/types/response/ConversationsSetTopicResponse.ts @@ -8,47 +8,47 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsSetTopicResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Channel { - context_team_id?: string; - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_group?: boolean; - is_im?: boolean; - is_member?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - last_read?: string; - name?: string; - name_normalized?: string; + context_team_id?: string; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_group?: boolean; + is_im?: boolean; + is_member?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + last_read?: string; + name?: string; + name_normalized?: string; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - purpose?: Purpose; - shared_team_ids?: string[]; - topic?: Purpose; - unlinked?: number; - updated?: number; + pending_shared?: string[]; + previous_names?: string[]; + purpose?: Purpose; + shared_team_ids?: string[]; + topic?: Purpose; + unlinked?: number; + updated?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } diff --git a/packages/web-api/src/types/response/ConversationsUnarchiveResponse.ts b/packages/web-api/src/types/response/ConversationsUnarchiveResponse.ts index 5b5365f29..8651cbac2 100644 --- a/packages/web-api/src/types/response/ConversationsUnarchiveResponse.ts +++ b/packages/web-api/src/types/response/ConversationsUnarchiveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ConversationsUnarchiveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/DialogOpenResponse.ts b/packages/web-api/src/types/response/DialogOpenResponse.ts index 9be2b79e7..14b2a79aa 100644 --- a/packages/web-api/src/types/response/DialogOpenResponse.ts +++ b/packages/web-api/src/types/response/DialogOpenResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type DialogOpenResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/DndEndDndResponse.ts b/packages/web-api/src/types/response/DndEndDndResponse.ts index 756d5b758..0ba686df9 100644 --- a/packages/web-api/src/types/response/DndEndDndResponse.ts +++ b/packages/web-api/src/types/response/DndEndDndResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type DndEndDndResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/DndEndSnoozeResponse.ts b/packages/web-api/src/types/response/DndEndSnoozeResponse.ts index 83e21ba98..5c8fe4545 100644 --- a/packages/web-api/src/types/response/DndEndSnoozeResponse.ts +++ b/packages/web-api/src/types/response/DndEndSnoozeResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type DndEndSnoozeResponse = WebAPICallResult & { - dnd_enabled?: boolean; - error?: string; - needed?: string; - next_dnd_end_ts?: number; + dnd_enabled?: boolean; + error?: string; + needed?: string; + next_dnd_end_ts?: number; next_dnd_start_ts?: number; - ok?: boolean; - provided?: string; - snooze_enabled?: boolean; + ok?: boolean; + provided?: string; + snooze_enabled?: boolean; }; diff --git a/packages/web-api/src/types/response/DndInfoResponse.ts b/packages/web-api/src/types/response/DndInfoResponse.ts index b2887439b..161d3f267 100644 --- a/packages/web-api/src/types/response/DndInfoResponse.ts +++ b/packages/web-api/src/types/response/DndInfoResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type DndInfoResponse = WebAPICallResult & { - dnd_enabled?: boolean; - error?: string; - needed?: string; - next_dnd_end_ts?: number; + dnd_enabled?: boolean; + error?: string; + needed?: string; + next_dnd_end_ts?: number; next_dnd_start_ts?: number; - ok?: boolean; - provided?: string; + ok?: boolean; + provided?: string; }; diff --git a/packages/web-api/src/types/response/DndSetSnoozeResponse.ts b/packages/web-api/src/types/response/DndSetSnoozeResponse.ts index 9a443a16b..f41688d79 100644 --- a/packages/web-api/src/types/response/DndSetSnoozeResponse.ts +++ b/packages/web-api/src/types/response/DndSetSnoozeResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type DndSetSnoozeResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; - snooze_enabled?: boolean; - snooze_endtime?: number; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; + snooze_enabled?: boolean; + snooze_endtime?: number; snooze_is_indefinite?: boolean; - snooze_remaining?: number; + snooze_remaining?: number; }; diff --git a/packages/web-api/src/types/response/DndTeamInfoResponse.ts b/packages/web-api/src/types/response/DndTeamInfoResponse.ts index 371e77c28..e9578937d 100644 --- a/packages/web-api/src/types/response/DndTeamInfoResponse.ts +++ b/packages/web-api/src/types/response/DndTeamInfoResponse.ts @@ -8,17 +8,17 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type DndTeamInfoResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - users?: { [key: string]: User }; + users?: { [key: string]: User }; }; export interface User { - dnd_enabled?: boolean; - next_dnd_end_ts?: number; + dnd_enabled?: boolean; + next_dnd_end_ts?: number; next_dnd_start_ts?: number; } diff --git a/packages/web-api/src/types/response/EmojiListResponse.ts b/packages/web-api/src/types/response/EmojiListResponse.ts index ce29e4cd7..009729324 100644 --- a/packages/web-api/src/types/response/EmojiListResponse.ts +++ b/packages/web-api/src/types/response/EmojiListResponse.ts @@ -8,19 +8,19 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type EmojiListResponse = WebAPICallResult & { - cache_ts?: string; - categories?: Category[]; + cache_ts?: string; + categories?: Category[]; categories_version?: string; - emoji?: { [key: string]: string }; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + emoji?: { [key: string]: string }; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; }; export interface Category { emoji_names?: string[]; - name?: string; + name?: string; } diff --git a/packages/web-api/src/types/response/FilesCommentsAddResponse.ts b/packages/web-api/src/types/response/FilesCommentsAddResponse.ts index 90e5f36e2..83abd022d 100644 --- a/packages/web-api/src/types/response/FilesCommentsAddResponse.ts +++ b/packages/web-api/src/types/response/FilesCommentsAddResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesCommentsAddResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; req_method?: string; }; diff --git a/packages/web-api/src/types/response/FilesCommentsDeleteResponse.ts b/packages/web-api/src/types/response/FilesCommentsDeleteResponse.ts index 55ae084f4..93da8faa3 100644 --- a/packages/web-api/src/types/response/FilesCommentsDeleteResponse.ts +++ b/packages/web-api/src/types/response/FilesCommentsDeleteResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesCommentsDeleteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/FilesCommentsEditResponse.ts b/packages/web-api/src/types/response/FilesCommentsEditResponse.ts index 3ae49de2d..e403da128 100644 --- a/packages/web-api/src/types/response/FilesCommentsEditResponse.ts +++ b/packages/web-api/src/types/response/FilesCommentsEditResponse.ts @@ -8,20 +8,20 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesCommentsEditResponse = WebAPICallResult & { - comment?: Comment; - error?: string; - needed?: string; - ok?: boolean; + comment?: Comment; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; export interface Comment { - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } diff --git a/packages/web-api/src/types/response/FilesCompleteUploadExternalResponse.ts b/packages/web-api/src/types/response/FilesCompleteUploadExternalResponse.ts index 0a3023bde..0920b68c4 100644 --- a/packages/web-api/src/types/response/FilesCompleteUploadExternalResponse.ts +++ b/packages/web-api/src/types/response/FilesCompleteUploadExternalResponse.ts @@ -8,73 +8,73 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesCompleteUploadExternalResponse = WebAPICallResult & { - error?: string; - files?: File[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + files?: File[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface File { - alt_txt?: string; - channels?: string[]; - comments_count?: number; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_type?: string; - file_access?: string; - filetype?: string; - groups?: string[]; - has_more_shares?: boolean; - has_rich_preview?: boolean; - id?: string; - ims?: string[]; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - original_h?: number; - original_w?: number; - permalink?: string; - permalink_public?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + alt_txt?: string; + channels?: string[]; + comments_count?: number; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_type?: string; + file_access?: string; + filetype?: string; + groups?: string[]; + has_more_shares?: boolean; + has_rich_preview?: boolean; + id?: string; + ims?: string[]; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + original_h?: number; + original_w?: number; + permalink?: string; + permalink_public?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - shares?: Shares; - size?: number; - thumb_160?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: number; - thumb_360_w?: number; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: number; - thumb_480_w?: number; - thumb_64?: string; - thumb_80?: string; - thumb_tiny?: string; - timestamp?: number; - title?: string; - url_private?: string; + public_url_shared?: boolean; + shares?: Shares; + size?: number; + thumb_160?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: number; + thumb_360_w?: number; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: number; + thumb_480_w?: number; + thumb_64?: string; + thumb_80?: string; + thumb_tiny?: string; + timestamp?: number; + title?: string; + url_private?: string; url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + user?: string; + user_team?: string; + username?: string; } export interface Shares { @@ -82,16 +82,16 @@ export interface Shares { } export interface Public { - channel_name?: string; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + channel_name?: string; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/FilesDeleteResponse.ts b/packages/web-api/src/types/response/FilesDeleteResponse.ts index ba164803c..a6c45de67 100644 --- a/packages/web-api/src/types/response/FilesDeleteResponse.ts +++ b/packages/web-api/src/types/response/FilesDeleteResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesDeleteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/FilesGetUploadURLExternalResponse.ts b/packages/web-api/src/types/response/FilesGetUploadURLExternalResponse.ts index 3fbed9a36..6fcaea5cd 100644 --- a/packages/web-api/src/types/response/FilesGetUploadURLExternalResponse.ts +++ b/packages/web-api/src/types/response/FilesGetUploadURLExternalResponse.ts @@ -8,15 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesGetUploadURLExternalResponse = WebAPICallResult & { - error?: string; - file_id?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + file_id?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - upload_url?: string; + upload_url?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/FilesInfoResponse.ts b/packages/web-api/src/types/response/FilesInfoResponse.ts index 62608a93c..862351957 100644 --- a/packages/web-api/src/types/response/FilesInfoResponse.ts +++ b/packages/web-api/src/types/response/FilesInfoResponse.ts @@ -8,278 +8,278 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesInfoResponse = WebAPICallResult & { - comments?: Comment[]; - content?: string; - content_highlight_css?: string; - content_highlight_html?: string; + comments?: Comment[]; + content?: string; + content_highlight_css?: string; + content_highlight_html?: string; content_highlight_html_truncated?: boolean; - error?: string; - file?: File; - is_truncated?: boolean; - needed?: string; - ok?: boolean; - paging?: Paging; - provided?: string; + error?: string; + file?: File; + is_truncated?: boolean; + needed?: string; + ok?: boolean; + paging?: Paging; + provided?: string; }; export interface Comment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: Comment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: Comment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -294,161 +294,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -458,42 +458,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -510,25 +510,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -538,11 +538,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } @@ -553,7 +553,7 @@ export interface Transcription { export interface Paging { count?: number; - page?: number; + page?: number; pages?: number; total?: number; } diff --git a/packages/web-api/src/types/response/FilesListResponse.ts b/packages/web-api/src/types/response/FilesListResponse.ts index 8a600f811..286bbacf5 100644 --- a/packages/web-api/src/types/response/FilesListResponse.ts +++ b/packages/web-api/src/types/response/FilesListResponse.ts @@ -8,272 +8,272 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesListResponse = WebAPICallResult & { - error?: string; - files?: File[]; - needed?: string; - ok?: boolean; - paging?: Paging; + error?: string; + files?: File[]; + needed?: string; + ok?: boolean; + paging?: Paging; provided?: string; }; export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -288,161 +288,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -452,42 +452,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -504,25 +504,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -532,11 +532,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } @@ -547,7 +547,7 @@ export interface Transcription { export interface Paging { count?: number; - page?: number; + page?: number; pages?: number; total?: number; } diff --git a/packages/web-api/src/types/response/FilesRemoteAddResponse.ts b/packages/web-api/src/types/response/FilesRemoteAddResponse.ts index 71f466a18..a277c165f 100644 --- a/packages/web-api/src/types/response/FilesRemoteAddResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteAddResponse.ts @@ -8,271 +8,271 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesRemoteAddResponse = WebAPICallResult & { - error?: string; - file?: File; - needed?: string; - ok?: boolean; + error?: string; + file?: File; + needed?: string; + ok?: boolean; provided?: string; }; export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -287,161 +287,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -451,42 +451,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -503,25 +503,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -531,11 +531,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } diff --git a/packages/web-api/src/types/response/FilesRemoteInfoResponse.ts b/packages/web-api/src/types/response/FilesRemoteInfoResponse.ts index 495a33f4b..a2ec38c93 100644 --- a/packages/web-api/src/types/response/FilesRemoteInfoResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteInfoResponse.ts @@ -8,271 +8,271 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesRemoteInfoResponse = WebAPICallResult & { - error?: string; - file?: File; - needed?: string; - ok?: boolean; + error?: string; + file?: File; + needed?: string; + ok?: boolean; provided?: string; }; export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -287,161 +287,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -451,42 +451,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -503,25 +503,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -531,11 +531,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } diff --git a/packages/web-api/src/types/response/FilesRemoteListResponse.ts b/packages/web-api/src/types/response/FilesRemoteListResponse.ts index efee31e87..700c4f591 100644 --- a/packages/web-api/src/types/response/FilesRemoteListResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteListResponse.ts @@ -8,272 +8,272 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesRemoteListResponse = WebAPICallResult & { - error?: string; - files?: File[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + files?: File[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -288,161 +288,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -452,42 +452,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -504,25 +504,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -532,11 +532,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } diff --git a/packages/web-api/src/types/response/FilesRemoteRemoveResponse.ts b/packages/web-api/src/types/response/FilesRemoteRemoveResponse.ts index aeb98392a..b86e44f11 100644 --- a/packages/web-api/src/types/response/FilesRemoteRemoveResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteRemoveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesRemoteRemoveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/FilesRemoteShareResponse.ts b/packages/web-api/src/types/response/FilesRemoteShareResponse.ts index 889ccbdc4..01b9e3b2a 100644 --- a/packages/web-api/src/types/response/FilesRemoteShareResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteShareResponse.ts @@ -8,271 +8,271 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesRemoteShareResponse = WebAPICallResult & { - error?: string; - file?: File; - needed?: string; - ok?: boolean; + error?: string; + file?: File; + needed?: string; + ok?: boolean; provided?: string; }; export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -287,161 +287,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -451,42 +451,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -503,25 +503,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -531,11 +531,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } diff --git a/packages/web-api/src/types/response/FilesRemoteUpdateResponse.ts b/packages/web-api/src/types/response/FilesRemoteUpdateResponse.ts index ab4b3a120..c8012873a 100644 --- a/packages/web-api/src/types/response/FilesRemoteUpdateResponse.ts +++ b/packages/web-api/src/types/response/FilesRemoteUpdateResponse.ts @@ -8,271 +8,271 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesRemoteUpdateResponse = WebAPICallResult & { - error?: string; - file?: File; - needed?: string; - ok?: boolean; + error?: string; + file?: File; + needed?: string; + ok?: boolean; provided?: string; }; export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -287,161 +287,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -451,42 +451,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -503,25 +503,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -531,11 +531,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } diff --git a/packages/web-api/src/types/response/FilesRevokePublicURLResponse.ts b/packages/web-api/src/types/response/FilesRevokePublicURLResponse.ts index 7e515a63e..e9215cc89 100644 --- a/packages/web-api/src/types/response/FilesRevokePublicURLResponse.ts +++ b/packages/web-api/src/types/response/FilesRevokePublicURLResponse.ts @@ -8,271 +8,271 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesRevokePublicURLResponse = WebAPICallResult & { - error?: string; - file?: File; - needed?: string; - ok?: boolean; + error?: string; + file?: File; + needed?: string; + ok?: boolean; provided?: string; }; export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -287,161 +287,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -451,42 +451,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -503,25 +503,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -531,11 +531,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } diff --git a/packages/web-api/src/types/response/FilesSharedPublicURLResponse.ts b/packages/web-api/src/types/response/FilesSharedPublicURLResponse.ts index 17da3ae0d..8310c4b2f 100644 --- a/packages/web-api/src/types/response/FilesSharedPublicURLResponse.ts +++ b/packages/web-api/src/types/response/FilesSharedPublicURLResponse.ts @@ -8,271 +8,271 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesSharedPublicURLResponse = WebAPICallResult & { - error?: string; - file?: File; - needed?: string; - ok?: boolean; + error?: string; + file?: File; + needed?: string; + ok?: boolean; provided?: string; }; export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -287,161 +287,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -451,42 +451,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -503,25 +503,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -531,11 +531,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } diff --git a/packages/web-api/src/types/response/FilesUploadResponse.ts b/packages/web-api/src/types/response/FilesUploadResponse.ts index 7b1fefb78..fd3d5a6af 100644 --- a/packages/web-api/src/types/response/FilesUploadResponse.ts +++ b/packages/web-api/src/types/response/FilesUploadResponse.ts @@ -8,271 +8,271 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FilesUploadResponse = WebAPICallResult & { - error?: string; - file?: File; - needed?: string; - ok?: boolean; + error?: string; + file?: File; + needed?: string; + ok?: boolean; provided?: string; }; export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -287,161 +287,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -451,42 +451,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -503,25 +503,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -531,11 +531,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } diff --git a/packages/web-api/src/types/response/FunctionsCompleteErrorResponse.ts b/packages/web-api/src/types/response/FunctionsCompleteErrorResponse.ts index 0450f7591..d8cb63748 100644 --- a/packages/web-api/src/types/response/FunctionsCompleteErrorResponse.ts +++ b/packages/web-api/src/types/response/FunctionsCompleteErrorResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FunctionsCompleteErrorResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/FunctionsCompleteSuccessResponse.ts b/packages/web-api/src/types/response/FunctionsCompleteSuccessResponse.ts index d40df2d79..260322ef7 100644 --- a/packages/web-api/src/types/response/FunctionsCompleteSuccessResponse.ts +++ b/packages/web-api/src/types/response/FunctionsCompleteSuccessResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type FunctionsCompleteSuccessResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/GroupsArchiveResponse.ts b/packages/web-api/src/types/response/GroupsArchiveResponse.ts index 2f9ac2523..083942caf 100644 --- a/packages/web-api/src/types/response/GroupsArchiveResponse.ts +++ b/packages/web-api/src/types/response/GroupsArchiveResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsArchiveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsCloseResponse.ts b/packages/web-api/src/types/response/GroupsCloseResponse.ts index fd2a67783..3003ff938 100644 --- a/packages/web-api/src/types/response/GroupsCloseResponse.ts +++ b/packages/web-api/src/types/response/GroupsCloseResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsCloseResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/GroupsCreateChildResponse.ts b/packages/web-api/src/types/response/GroupsCreateChildResponse.ts index 1a5419b87..639bf8095 100644 --- a/packages/web-api/src/types/response/GroupsCreateChildResponse.ts +++ b/packages/web-api/src/types/response/GroupsCreateChildResponse.ts @@ -8,49 +8,49 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsCreateChildResponse = WebAPICallResult & { - error?: string; - group?: Group; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + group?: Group; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Group { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_group?: boolean; - is_mpim?: boolean; - is_open?: boolean; - last_read?: string; - latest?: Latest; - members?: string[]; - name?: string; - name_normalized?: string; - parent_group?: string; - purpose?: Purpose; - topic?: Purpose; - unread_count?: number; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_group?: boolean; + is_mpim?: boolean; + is_open?: boolean; + last_read?: string; + latest?: Latest; + members?: string[]; + name?: string; + name_normalized?: string; + parent_group?: string; + purpose?: Purpose; + topic?: Purpose; + unread_count?: number; unread_count_display?: number; } export interface Latest { subtype?: string; - text?: string; - ts?: string; - type?: string; - user?: string; + text?: string; + ts?: string; + type?: string; + user?: string; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsCreateResponse.ts b/packages/web-api/src/types/response/GroupsCreateResponse.ts index 951d4e090..7fc3703cb 100644 --- a/packages/web-api/src/types/response/GroupsCreateResponse.ts +++ b/packages/web-api/src/types/response/GroupsCreateResponse.ts @@ -8,40 +8,40 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsCreateResponse = WebAPICallResult & { - error?: string; - group?: Group; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + group?: Group; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Group { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_group?: boolean; - is_mpim?: boolean; - is_open?: boolean; - last_read?: string; - members?: string[]; - name?: string; - name_normalized?: string; - priority?: number; - purpose?: Purpose; - topic?: Purpose; - unread_count?: number; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_group?: boolean; + is_mpim?: boolean; + is_open?: boolean; + last_read?: string; + members?: string[]; + name?: string; + name_normalized?: string; + priority?: number; + purpose?: Purpose; + topic?: Purpose; + unread_count?: number; unread_count_display?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsHistoryResponse.ts b/packages/web-api/src/types/response/GroupsHistoryResponse.ts index b5da7cded..0020147b1 100644 --- a/packages/web-api/src/types/response/GroupsHistoryResponse.ts +++ b/packages/web-api/src/types/response/GroupsHistoryResponse.ts @@ -8,25 +8,25 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsHistoryResponse = WebAPICallResult & { channel_actions_count?: number; - error?: string; - has_more?: boolean; - messages?: Message[]; - needed?: string; - ok?: boolean; - provided?: string; - response_metadata?: ResponseMetadata; - warning?: string; + error?: string; + has_more?: boolean; + messages?: Message[]; + needed?: string; + ok?: boolean; + provided?: string; + response_metadata?: ResponseMetadata; + warning?: string; }; export interface Message { subtype?: string; - text?: string; - ts?: string; - type?: string; - user?: string; + text?: string; + ts?: string; + type?: string; + user?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsInfoResponse.ts b/packages/web-api/src/types/response/GroupsInfoResponse.ts index d42003b94..babc4263d 100644 --- a/packages/web-api/src/types/response/GroupsInfoResponse.ts +++ b/packages/web-api/src/types/response/GroupsInfoResponse.ts @@ -8,48 +8,48 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsInfoResponse = WebAPICallResult & { - error?: string; - group?: Group; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + group?: Group; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Group { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_group?: boolean; - is_mpim?: boolean; - is_open?: boolean; - last_read?: string; - latest?: Latest; - members?: string[]; - name?: string; - name_normalized?: string; - purpose?: Purpose; - topic?: Purpose; - unread_count?: number; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_group?: boolean; + is_mpim?: boolean; + is_open?: boolean; + last_read?: string; + latest?: Latest; + members?: string[]; + name?: string; + name_normalized?: string; + purpose?: Purpose; + topic?: Purpose; + unread_count?: number; unread_count_display?: number; } export interface Latest { subtype?: string; - text?: string; - ts?: string; - type?: string; - user?: string; + text?: string; + ts?: string; + type?: string; + user?: string; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsInviteResponse.ts b/packages/web-api/src/types/response/GroupsInviteResponse.ts index e6a478ce3..c842eb1b4 100644 --- a/packages/web-api/src/types/response/GroupsInviteResponse.ts +++ b/packages/web-api/src/types/response/GroupsInviteResponse.ts @@ -8,49 +8,49 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsInviteResponse = WebAPICallResult & { - error?: string; - group?: Group; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + group?: Group; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Group { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_group?: boolean; - is_mpim?: boolean; - is_open?: boolean; - last_read?: string; - latest?: Latest; - name?: string; - name_normalized?: string; - priority?: number; - purpose?: Purpose; - topic?: Purpose; - unread_count?: number; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_group?: boolean; + is_mpim?: boolean; + is_open?: boolean; + last_read?: string; + latest?: Latest; + name?: string; + name_normalized?: string; + priority?: number; + purpose?: Purpose; + topic?: Purpose; + unread_count?: number; unread_count_display?: number; } export interface Latest { subtype?: string; - text?: string; - topic?: string; - ts?: string; - type?: string; - user?: string; + text?: string; + topic?: string; + ts?: string; + type?: string; + user?: string; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsKickResponse.ts b/packages/web-api/src/types/response/GroupsKickResponse.ts index 59a0cfed9..27271a0a0 100644 --- a/packages/web-api/src/types/response/GroupsKickResponse.ts +++ b/packages/web-api/src/types/response/GroupsKickResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsKickResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsLeaveResponse.ts b/packages/web-api/src/types/response/GroupsLeaveResponse.ts index f1998fbb0..a11c43fa3 100644 --- a/packages/web-api/src/types/response/GroupsLeaveResponse.ts +++ b/packages/web-api/src/types/response/GroupsLeaveResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsLeaveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsListResponse.ts b/packages/web-api/src/types/response/GroupsListResponse.ts index d3d214859..7c34d49c1 100644 --- a/packages/web-api/src/types/response/GroupsListResponse.ts +++ b/packages/web-api/src/types/response/GroupsListResponse.ts @@ -8,39 +8,39 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsListResponse = WebAPICallResult & { - error?: string; - groups?: Group[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + groups?: Group[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Group { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_group?: boolean; - is_mpim?: boolean; - is_open?: boolean; - last_read?: string; - members?: string[]; - name?: string; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_group?: boolean; + is_mpim?: boolean; + is_open?: boolean; + last_read?: string; + members?: string[]; + name?: string; name_normalized?: string; - parent_group?: string; - priority?: number; - purpose?: Purpose; - topic?: Purpose; + parent_group?: string; + priority?: number; + purpose?: Purpose; + topic?: Purpose; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsMarkResponse.ts b/packages/web-api/src/types/response/GroupsMarkResponse.ts index 19f007a29..3f2f12721 100644 --- a/packages/web-api/src/types/response/GroupsMarkResponse.ts +++ b/packages/web-api/src/types/response/GroupsMarkResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsMarkResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsOpenResponse.ts b/packages/web-api/src/types/response/GroupsOpenResponse.ts index 54b4da2e2..0201d23b8 100644 --- a/packages/web-api/src/types/response/GroupsOpenResponse.ts +++ b/packages/web-api/src/types/response/GroupsOpenResponse.ts @@ -8,16 +8,16 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsOpenResponse = WebAPICallResult & { - already_open?: boolean; - error?: string; - needed?: string; - no_op?: boolean; - ok?: boolean; - provided?: string; + already_open?: boolean; + error?: string; + needed?: string; + no_op?: boolean; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsRenameResponse.ts b/packages/web-api/src/types/response/GroupsRenameResponse.ts index d67f3caac..c0ded3f75 100644 --- a/packages/web-api/src/types/response/GroupsRenameResponse.ts +++ b/packages/web-api/src/types/response/GroupsRenameResponse.ts @@ -8,35 +8,35 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsRenameResponse = WebAPICallResult & { - channel?: Channel; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + channel?: Channel; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Channel { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_group?: boolean; - is_mpim?: boolean; - members?: string[]; - name?: string; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_group?: boolean; + is_mpim?: boolean; + members?: string[]; + name?: string; name_normalized?: string; - purpose?: Purpose; - topic?: Purpose; + purpose?: Purpose; + topic?: Purpose; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsRepliesResponse.ts b/packages/web-api/src/types/response/GroupsRepliesResponse.ts index 0fac5fe26..d514681f5 100644 --- a/packages/web-api/src/types/response/GroupsRepliesResponse.ts +++ b/packages/web-api/src/types/response/GroupsRepliesResponse.ts @@ -8,42 +8,42 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsRepliesResponse = WebAPICallResult & { - error?: string; - has_more?: boolean; - messages?: Message[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + has_more?: boolean; + messages?: Message[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Message { - bot_id?: string; - bot_profile?: BotProfile; - last_read?: string; - latest_reply?: string; - parent_user_id?: string; - reply_count?: number; - reply_users?: string[]; + bot_id?: string; + bot_profile?: BotProfile; + last_read?: string; + latest_reply?: string; + parent_user_id?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - user?: string; + subscribed?: boolean; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + user?: string; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } diff --git a/packages/web-api/src/types/response/GroupsSetPurposeResponse.ts b/packages/web-api/src/types/response/GroupsSetPurposeResponse.ts index 38bcf314b..518eb1ac1 100644 --- a/packages/web-api/src/types/response/GroupsSetPurposeResponse.ts +++ b/packages/web-api/src/types/response/GroupsSetPurposeResponse.ts @@ -8,15 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsSetPurposeResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; - purpose?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; + purpose?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsSetTopicResponse.ts b/packages/web-api/src/types/response/GroupsSetTopicResponse.ts index 140813303..38f284567 100644 --- a/packages/web-api/src/types/response/GroupsSetTopicResponse.ts +++ b/packages/web-api/src/types/response/GroupsSetTopicResponse.ts @@ -8,15 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsSetTopicResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - topic?: string; - warning?: string; + topic?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/GroupsUnarchiveResponse.ts b/packages/web-api/src/types/response/GroupsUnarchiveResponse.ts index 54e8a37bb..adf80c2fd 100644 --- a/packages/web-api/src/types/response/GroupsUnarchiveResponse.ts +++ b/packages/web-api/src/types/response/GroupsUnarchiveResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type GroupsUnarchiveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ImCloseResponse.ts b/packages/web-api/src/types/response/ImCloseResponse.ts index 0bfaa6c31..53f3ed5a9 100644 --- a/packages/web-api/src/types/response/ImCloseResponse.ts +++ b/packages/web-api/src/types/response/ImCloseResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ImCloseResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ImHistoryResponse.ts b/packages/web-api/src/types/response/ImHistoryResponse.ts index d73f3e1e9..351eb60b6 100644 --- a/packages/web-api/src/types/response/ImHistoryResponse.ts +++ b/packages/web-api/src/types/response/ImHistoryResponse.ts @@ -8,124 +8,124 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ImHistoryResponse = WebAPICallResult & { channel_actions_count?: number; - error?: string; - has_more?: boolean; - messages?: Message[]; - needed?: string; - ok?: boolean; - provided?: string; - response_metadata?: ResponseMetadata; - warning?: string; + error?: string; + has_more?: boolean; + messages?: Message[]; + needed?: string; + ok?: boolean; + provided?: string; + response_metadata?: ResponseMetadata; + warning?: string; }; export interface Message { - blocks?: Block[]; - bot_id?: string; - bot_profile?: BotProfile; - client_msg_id?: string; - last_read?: string; - latest_reply?: string; - parent_user_id?: string; - reply_count?: number; - reply_users?: string[]; + blocks?: Block[]; + bot_id?: string; + bot_profile?: BotProfile; + client_msg_id?: string; + last_read?: string; + latest_reply?: string; + parent_user_id?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - user?: string; + subscribed?: boolean; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + user?: string; } export interface Block { - accessory?: Accessory; - alt_text?: string; - block_id?: string; - elements?: Element[]; - fallback?: string; - fields?: Text[]; - image_bytes?: number; + accessory?: Accessory; + alt_text?: string; + block_id?: string; + elements?: Element[]; + fallback?: string; + fields?: Text[]; + image_bytes?: number; image_height?: number; - image_url?: string; - image_width?: number; - text?: Text; - title?: Text; - type?: string; + image_url?: string; + image_width?: number; + text?: Text; + title?: Text; + type?: string; } export interface Accessory { - alt_text?: string; - fallback?: string; - image_bytes?: number; + alt_text?: string; + fallback?: string; + image_bytes?: number; image_height?: number; - image_url?: string; - image_width?: number; - type?: string; + image_url?: string; + image_width?: number; + type?: string; } export interface Element { - action_id?: string; - alt_text?: string; - confirm?: Confirm; + action_id?: string; + alt_text?: string; + confirm?: Confirm; default_to_current_conversation?: boolean; - fallback?: string; - filter?: Filter; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; - initial_conversation?: string; - initial_date?: string; - initial_option?: InitialOption; - initial_user?: string; - min_query_length?: number; - placeholder?: Text; - response_url_enabled?: boolean; - style?: string; - text?: Text; - type?: string; - url?: string; - value?: string; + fallback?: string; + filter?: Filter; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; + initial_conversation?: string; + initial_date?: string; + initial_option?: InitialOption; + initial_user?: string; + min_query_length?: number; + placeholder?: Text; + response_url_enabled?: boolean; + style?: string; + text?: Text; + type?: string; + url?: string; + value?: string; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: string; + emoji?: boolean; + text?: string; + type?: string; verbatim?: boolean; } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; } export interface InitialOption { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } diff --git a/packages/web-api/src/types/response/ImListResponse.ts b/packages/web-api/src/types/response/ImListResponse.ts index c6912478c..a50fd3946 100644 --- a/packages/web-api/src/types/response/ImListResponse.ts +++ b/packages/web-api/src/types/response/ImListResponse.ts @@ -8,30 +8,30 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ImListResponse = WebAPICallResult & { - error?: string; - ims?: Im[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + ims?: Im[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Im { - created?: number; - id?: string; - is_archived?: boolean; - is_im?: boolean; - is_org_shared?: boolean; + created?: number; + id?: string; + is_archived?: boolean; + is_im?: boolean; + is_org_shared?: boolean; is_user_deleted?: boolean; - priority?: number; - user?: string; + priority?: number; + user?: string; } export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; - warnings?: string[]; + warnings?: string[]; } diff --git a/packages/web-api/src/types/response/ImMarkResponse.ts b/packages/web-api/src/types/response/ImMarkResponse.ts index b15449395..2c2681eed 100644 --- a/packages/web-api/src/types/response/ImMarkResponse.ts +++ b/packages/web-api/src/types/response/ImMarkResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ImMarkResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/ImOpenResponse.ts b/packages/web-api/src/types/response/ImOpenResponse.ts index 44e81db63..0815b5932 100644 --- a/packages/web-api/src/types/response/ImOpenResponse.ts +++ b/packages/web-api/src/types/response/ImOpenResponse.ts @@ -8,17 +8,17 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ImOpenResponse = WebAPICallResult & { - already_open?: boolean; - channel?: Channel; - error?: string; - needed?: string; - no_op?: boolean; - ok?: boolean; - provided?: string; + already_open?: boolean; + channel?: Channel; + error?: string; + needed?: string; + no_op?: boolean; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Channel { diff --git a/packages/web-api/src/types/response/ImRepliesResponse.ts b/packages/web-api/src/types/response/ImRepliesResponse.ts index 6f2b6b452..4f7836e8a 100644 --- a/packages/web-api/src/types/response/ImRepliesResponse.ts +++ b/packages/web-api/src/types/response/ImRepliesResponse.ts @@ -8,42 +8,42 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ImRepliesResponse = WebAPICallResult & { - error?: string; - has_more?: boolean; - messages?: Message[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + has_more?: boolean; + messages?: Message[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Message { - bot_id?: string; - bot_profile?: BotProfile; - last_read?: string; - latest_reply?: string; - parent_user_id?: string; - reply_count?: number; - reply_users?: string[]; + bot_id?: string; + bot_profile?: BotProfile; + last_read?: string; + latest_reply?: string; + parent_user_id?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - user?: string; + subscribed?: boolean; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + user?: string; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } diff --git a/packages/web-api/src/types/response/MigrationExchangeResponse.ts b/packages/web-api/src/types/response/MigrationExchangeResponse.ts index 0add511be..d9cbd18a9 100644 --- a/packages/web-api/src/types/response/MigrationExchangeResponse.ts +++ b/packages/web-api/src/types/response/MigrationExchangeResponse.ts @@ -8,15 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type MigrationExchangeResponse = WebAPICallResult & { - enterprise_id?: string; - error?: string; + enterprise_id?: string; + error?: string; invalid_user_ids?: string[]; - needed?: string; - ok?: boolean; - provided?: string; - team_id?: string; - user_id_map?: { [key: string]: string }; - warning?: string; + needed?: string; + ok?: boolean; + provided?: string; + team_id?: string; + user_id_map?: { [key: string]: string }; + warning?: string; }; diff --git a/packages/web-api/src/types/response/MpimCloseResponse.ts b/packages/web-api/src/types/response/MpimCloseResponse.ts index 13f3fe6f7..39d6c5004 100644 --- a/packages/web-api/src/types/response/MpimCloseResponse.ts +++ b/packages/web-api/src/types/response/MpimCloseResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type MpimCloseResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/MpimHistoryResponse.ts b/packages/web-api/src/types/response/MpimHistoryResponse.ts index fdd2939c1..4dd70bfe3 100644 --- a/packages/web-api/src/types/response/MpimHistoryResponse.ts +++ b/packages/web-api/src/types/response/MpimHistoryResponse.ts @@ -8,44 +8,44 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type MpimHistoryResponse = WebAPICallResult & { channel_actions_count?: number; - error?: string; - has_more?: boolean; - messages?: Message[]; - needed?: string; - ok?: boolean; - provided?: string; - response_metadata?: ResponseMetadata; - warning?: string; + error?: string; + has_more?: boolean; + messages?: Message[]; + needed?: string; + ok?: boolean; + provided?: string; + response_metadata?: ResponseMetadata; + warning?: string; }; export interface Message { - bot_id?: string; - bot_profile?: BotProfile; - is_starred?: boolean; - last_read?: string; - latest_reply?: string; - parent_user_id?: string; - reply_count?: number; - reply_users?: string[]; + bot_id?: string; + bot_profile?: BotProfile; + is_starred?: boolean; + last_read?: string; + latest_reply?: string; + parent_user_id?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - user?: string; + subscribed?: boolean; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + user?: string; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } diff --git a/packages/web-api/src/types/response/MpimListResponse.ts b/packages/web-api/src/types/response/MpimListResponse.ts index f06658cf4..ee8f1dcc8 100644 --- a/packages/web-api/src/types/response/MpimListResponse.ts +++ b/packages/web-api/src/types/response/MpimListResponse.ts @@ -8,38 +8,38 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type MpimListResponse = WebAPICallResult & { - error?: string; - groups?: Group[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + groups?: Group[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Group { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_group?: boolean; - is_mpim?: boolean; - is_open?: boolean; - last_read?: string; - members?: string[]; - name?: string; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_group?: boolean; + is_mpim?: boolean; + is_open?: boolean; + last_read?: string; + members?: string[]; + name?: string; name_normalized?: string; - priority?: number; - purpose?: Purpose; - topic?: Purpose; + priority?: number; + purpose?: Purpose; + topic?: Purpose; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/MpimMarkResponse.ts b/packages/web-api/src/types/response/MpimMarkResponse.ts index ecf8be00d..c3481a31d 100644 --- a/packages/web-api/src/types/response/MpimMarkResponse.ts +++ b/packages/web-api/src/types/response/MpimMarkResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type MpimMarkResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/MpimOpenResponse.ts b/packages/web-api/src/types/response/MpimOpenResponse.ts index 656a4e2e4..a0915df20 100644 --- a/packages/web-api/src/types/response/MpimOpenResponse.ts +++ b/packages/web-api/src/types/response/MpimOpenResponse.ts @@ -8,55 +8,55 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type MpimOpenResponse = WebAPICallResult & { - error?: string; - group?: Group; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + group?: Group; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Group { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_group?: boolean; - is_mpim?: boolean; - is_open?: boolean; - last_read?: string; - latest?: Latest; - members?: string[]; - name?: string; - name_normalized?: string; - priority?: number; - purpose?: Purpose; - topic?: Purpose; - unread_count?: number; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_group?: boolean; + is_mpim?: boolean; + is_open?: boolean; + last_read?: string; + latest?: Latest; + members?: string[]; + name?: string; + name_normalized?: string; + priority?: number; + purpose?: Purpose; + topic?: Purpose; + unread_count?: number; unread_count_display?: number; } export interface Latest { - bot_id?: string; - bot_profile?: BotProfile; + bot_id?: string; + bot_profile?: BotProfile; parent_user_id?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - user?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + user?: string; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -68,9 +68,9 @@ export interface Icons { } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/MpimRepliesResponse.ts b/packages/web-api/src/types/response/MpimRepliesResponse.ts index b559652ad..14d6c14af 100644 --- a/packages/web-api/src/types/response/MpimRepliesResponse.ts +++ b/packages/web-api/src/types/response/MpimRepliesResponse.ts @@ -8,42 +8,42 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type MpimRepliesResponse = WebAPICallResult & { - error?: string; - has_more?: boolean; - messages?: Message[]; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + has_more?: boolean; + messages?: Message[]; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - warning?: string; + warning?: string; }; export interface Message { - bot_id?: string; - bot_profile?: BotProfile; - last_read?: string; - latest_reply?: string; - parent_user_id?: string; - reply_count?: number; - reply_users?: string[]; + bot_id?: string; + bot_profile?: BotProfile; + last_read?: string; + latest_reply?: string; + parent_user_id?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - user?: string; + subscribed?: boolean; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + user?: string; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } diff --git a/packages/web-api/src/types/response/OauthAccessResponse.ts b/packages/web-api/src/types/response/OauthAccessResponse.ts index 6b3c99ef9..572b5bc60 100644 --- a/packages/web-api/src/types/response/OauthAccessResponse.ts +++ b/packages/web-api/src/types/response/OauthAccessResponse.ts @@ -8,50 +8,50 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type OauthAccessResponse = WebAPICallResult & { - access_token?: string; + access_token?: string; authorizing_user?: User; - bot?: Bot; - enterprise_id?: string; - error?: string; + bot?: Bot; + enterprise_id?: string; + error?: string; incoming_webhook?: IncomingWebhook; - installer_user?: User; - needed?: string; - ok?: boolean; - provided?: string; - scope?: string; - scopes?: Scopes; - team_id?: string; - team_name?: string; - token_type?: string; - user_id?: string; - warning?: string; + installer_user?: User; + needed?: string; + ok?: boolean; + provided?: string; + scope?: string; + scopes?: Scopes; + team_id?: string; + team_name?: string; + token_type?: string; + user_id?: string; + warning?: string; }; export interface User { app_home?: string; - user_id?: string; + user_id?: string; } export interface Bot { bot_access_token?: string; - bot_user_id?: string; + bot_user_id?: string; } export interface IncomingWebhook { - channel?: string; - channel_id?: string; + channel?: string; + channel_id?: string; configuration_url?: string; - url?: string; + url?: string; } export interface Scopes { app_home?: string[]; - channel?: string[]; - group?: string[]; - im?: string[]; - mpim?: string[]; - team?: string[]; - user?: string[]; + channel?: string[]; + group?: string[]; + im?: string[]; + mpim?: string[]; + team?: string[]; + user?: string[]; } diff --git a/packages/web-api/src/types/response/OauthTokenResponse.ts b/packages/web-api/src/types/response/OauthTokenResponse.ts index a3a5008f2..14c45762d 100644 --- a/packages/web-api/src/types/response/OauthTokenResponse.ts +++ b/packages/web-api/src/types/response/OauthTokenResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type OauthTokenResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; req_method?: string; }; diff --git a/packages/web-api/src/types/response/OauthV2AccessResponse.ts b/packages/web-api/src/types/response/OauthV2AccessResponse.ts index de5aa2def..13e973883 100644 --- a/packages/web-api/src/types/response/OauthV2AccessResponse.ts +++ b/packages/web-api/src/types/response/OauthV2AccessResponse.ts @@ -8,44 +8,44 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type OauthV2AccessResponse = WebAPICallResult & { - access_token?: string; - app_id?: string; - authed_user?: AuthedUser; - bot_user_id?: string; - enterprise?: Enterprise; - error?: string; - expires_in?: number; - incoming_webhook?: IncomingWebhook; + access_token?: string; + app_id?: string; + authed_user?: AuthedUser; + bot_user_id?: string; + enterprise?: Enterprise; + error?: string; + expires_in?: number; + incoming_webhook?: IncomingWebhook; is_enterprise_install?: boolean; - needed?: string; - ok?: boolean; - provided?: string; - refresh_token?: string; - scope?: string; - team?: Enterprise; - token_type?: string; - warning?: string; + needed?: string; + ok?: boolean; + provided?: string; + refresh_token?: string; + scope?: string; + team?: Enterprise; + token_type?: string; + warning?: string; }; export interface AuthedUser { - access_token?: string; - expires_in?: number; - id?: string; + access_token?: string; + expires_in?: number; + id?: string; refresh_token?: string; - scope?: string; - token_type?: string; + scope?: string; + token_type?: string; } export interface Enterprise { - id?: string; + id?: string; name?: string; } export interface IncomingWebhook { - channel?: string; - channel_id?: string; + channel?: string; + channel_id?: string; configuration_url?: string; - url?: string; + url?: string; } diff --git a/packages/web-api/src/types/response/OauthV2ExchangeResponse.ts b/packages/web-api/src/types/response/OauthV2ExchangeResponse.ts index 96427a037..cdd3398c4 100644 --- a/packages/web-api/src/types/response/OauthV2ExchangeResponse.ts +++ b/packages/web-api/src/types/response/OauthV2ExchangeResponse.ts @@ -8,47 +8,47 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type OauthV2ExchangeResponse = WebAPICallResult & { - access_token?: string; - app_id?: string; - authed_user?: AuthedUser; - bot_user_id?: string; - enterprise?: Enterprise; - error?: string; - expires_in?: number; - incoming_webhook?: IncomingWebhook; + access_token?: string; + app_id?: string; + authed_user?: AuthedUser; + bot_user_id?: string; + enterprise?: Enterprise; + error?: string; + expires_in?: number; + incoming_webhook?: IncomingWebhook; is_enterprise_install?: boolean; - needed?: string; - ok?: boolean; - provided?: string; - refresh_token?: string; - response_metadata?: ResponseMetadata; - scope?: string; - team?: Enterprise; - token_type?: string; - warning?: string; + needed?: string; + ok?: boolean; + provided?: string; + refresh_token?: string; + response_metadata?: ResponseMetadata; + scope?: string; + team?: Enterprise; + token_type?: string; + warning?: string; }; export interface AuthedUser { - access_token?: string; - expires_in?: number; - id?: string; + access_token?: string; + expires_in?: number; + id?: string; refresh_token?: string; - scope?: string; - token_type?: string; + scope?: string; + token_type?: string; } export interface Enterprise { - id?: string; + id?: string; name?: string; } export interface IncomingWebhook { - channel?: string; - channel_id?: string; + channel?: string; + channel_id?: string; configuration_url?: string; - url?: string; + url?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/OpenIDConnectTokenResponse.ts b/packages/web-api/src/types/response/OpenIDConnectTokenResponse.ts index b97e54e63..3010c5dfb 100644 --- a/packages/web-api/src/types/response/OpenIDConnectTokenResponse.ts +++ b/packages/web-api/src/types/response/OpenIDConnectTokenResponse.ts @@ -8,16 +8,16 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type OpenIDConnectTokenResponse = WebAPICallResult & { - access_token?: string; - error?: string; - expires_in?: number; - id_token?: string; - needed?: string; - ok?: boolean; - provided?: string; + access_token?: string; + error?: string; + expires_in?: number; + id_token?: string; + needed?: string; + ok?: boolean; + provided?: string; refresh_token?: string; - token_type?: string; - warning?: string; + token_type?: string; + warning?: string; }; diff --git a/packages/web-api/src/types/response/OpenIDConnectUserInfoResponse.ts b/packages/web-api/src/types/response/OpenIDConnectUserInfoResponse.ts index 414e785dc..4932c740d 100644 --- a/packages/web-api/src/types/response/OpenIDConnectUserInfoResponse.ts +++ b/packages/web-api/src/types/response/OpenIDConnectUserInfoResponse.ts @@ -8,41 +8,41 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type OpenIDConnectUserInfoResponse = WebAPICallResult & { - date_email_verified?: number; - email?: string; - email_verified?: boolean; - error?: string; - family_name?: string; - given_name?: string; + date_email_verified?: number; + email?: string; + email_verified?: boolean; + error?: string; + family_name?: string; + given_name?: string; 'https://slack.com/enterprise_domain'?: string; - 'https://slack.com/enterprise_id'?: string; - 'https://slack.com/enterprise_name'?: string; - 'https://slack.com/team_domain'?: string; - 'https://slack.com/team_id'?: string; - 'https://slack.com/team_image_102'?: string; - 'https://slack.com/team_image_132'?: string; - 'https://slack.com/team_image_230'?: string; - 'https://slack.com/team_image_34'?: string; - 'https://slack.com/team_image_44'?: string; - 'https://slack.com/team_image_68'?: string; - 'https://slack.com/team_image_88'?: string; - 'https://slack.com/team_name'?: string; - 'https://slack.com/user_id'?: string; - 'https://slack.com/user_image_1024'?: string; - 'https://slack.com/user_image_192'?: string; - 'https://slack.com/user_image_24'?: string; - 'https://slack.com/user_image_32'?: string; - 'https://slack.com/user_image_48'?: string; - 'https://slack.com/user_image_512'?: string; - 'https://slack.com/user_image_72'?: string; - locale?: string; - name?: string; - needed?: string; - ok?: boolean; - picture?: string; - provided?: string; - sub?: string; - warning?: string; + 'https://slack.com/enterprise_id'?: string; + 'https://slack.com/enterprise_name'?: string; + 'https://slack.com/team_domain'?: string; + 'https://slack.com/team_id'?: string; + 'https://slack.com/team_image_102'?: string; + 'https://slack.com/team_image_132'?: string; + 'https://slack.com/team_image_230'?: string; + 'https://slack.com/team_image_34'?: string; + 'https://slack.com/team_image_44'?: string; + 'https://slack.com/team_image_68'?: string; + 'https://slack.com/team_image_88'?: string; + 'https://slack.com/team_name'?: string; + 'https://slack.com/user_id'?: string; + 'https://slack.com/user_image_1024'?: string; + 'https://slack.com/user_image_192'?: string; + 'https://slack.com/user_image_24'?: string; + 'https://slack.com/user_image_32'?: string; + 'https://slack.com/user_image_48'?: string; + 'https://slack.com/user_image_512'?: string; + 'https://slack.com/user_image_72'?: string; + locale?: string; + name?: string; + needed?: string; + ok?: boolean; + picture?: string; + provided?: string; + sub?: string; + warning?: string; }; diff --git a/packages/web-api/src/types/response/PinsAddResponse.ts b/packages/web-api/src/types/response/PinsAddResponse.ts index 6fe280939..ff681dd1a 100644 --- a/packages/web-api/src/types/response/PinsAddResponse.ts +++ b/packages/web-api/src/types/response/PinsAddResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type PinsAddResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/PinsListResponse.ts b/packages/web-api/src/types/response/PinsListResponse.ts index f1ca84350..37e47d4be 100644 --- a/packages/web-api/src/types/response/PinsListResponse.ts +++ b/packages/web-api/src/types/response/PinsListResponse.ts @@ -8,279 +8,279 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type PinsListResponse = WebAPICallResult & { - error?: string; - items?: Item[]; - needed?: string; - ok?: boolean; + error?: string; + items?: Item[]; + needed?: string; + ok?: boolean; provided?: string; }; export interface Item { - comment?: string; - created?: number; + comment?: string; + created?: number; created_by?: string; - file?: File; - type?: string; + file?: File; + type?: string; } export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -295,161 +295,161 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: Text | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: Text[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: Text | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: Text[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: Text; - thumbnail_url?: string; - title?: Text | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: Text; + thumbnail_url?: string; + title?: Text | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Text; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Text; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Text; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Text; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: Text; - deny?: Text; - style?: string; - text?: Text; - title?: Text; + deny?: Text; + style?: string; + text?: Text; + title?: Text; } export interface Text { - emoji?: boolean; - text?: string; - type?: TextType; + emoji?: boolean; + text?: string; + type?: TextType; verbatim?: boolean; } @@ -459,42 +459,42 @@ export enum TextType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -511,25 +511,25 @@ export enum ElementType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Text; - text?: Text; - url?: string; - value?: string; + text?: Text; + url?: string; + value?: string; } export interface OptionGroup { - label?: Text; + label?: Text; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -539,11 +539,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } diff --git a/packages/web-api/src/types/response/PinsRemoveResponse.ts b/packages/web-api/src/types/response/PinsRemoveResponse.ts index c589322ba..19841744e 100644 --- a/packages/web-api/src/types/response/PinsRemoveResponse.ts +++ b/packages/web-api/src/types/response/PinsRemoveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type PinsRemoveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ReactionsAddResponse.ts b/packages/web-api/src/types/response/ReactionsAddResponse.ts index a7411a9a5..12dd75b20 100644 --- a/packages/web-api/src/types/response/ReactionsAddResponse.ts +++ b/packages/web-api/src/types/response/ReactionsAddResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ReactionsAddResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ReactionsGetResponse.ts b/packages/web-api/src/types/response/ReactionsGetResponse.ts index 90ed4884c..7dd19593a 100644 --- a/packages/web-api/src/types/response/ReactionsGetResponse.ts +++ b/packages/web-api/src/types/response/ReactionsGetResponse.ts @@ -8,139 +8,139 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ReactionsGetResponse = WebAPICallResult & { - channel?: string; - error?: string; - message?: Message; - needed?: string; - ok?: boolean; + channel?: string; + error?: string; + message?: Message; + needed?: string; + ok?: boolean; provided?: string; - type?: string; + type?: string; }; export interface Message { - app_id?: string; - blocks?: MessageBlock[]; - bot_id?: string; + app_id?: string; + blocks?: MessageBlock[]; + bot_id?: string; bot_profile?: BotProfile; - permalink?: string; - reactions?: Reaction[]; - room?: Room; - team?: string; - text?: string; - ts?: string; - type?: string; - user?: string; + permalink?: string; + reactions?: Reaction[]; + room?: Room; + team?: string; + text?: string; + ts?: string; + type?: string; + user?: string; } export interface MessageBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: File; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: File; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: Confirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Confirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -150,42 +150,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: FluffyType; + indent?: number; + offset?: number; + style?: string; + type?: FluffyType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -209,25 +209,25 @@ export enum FluffyType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface OptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: Option[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -237,358 +237,358 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface File { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlockElement[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlockElement[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface TitleBlockElement { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: string; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: string; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -603,64 +603,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -669,11 +669,11 @@ export interface Transcription { } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -685,40 +685,39 @@ export interface Icons { } export interface Room { - app_id?: string; - attached_file_ids?: string[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - knocks?: Knocks; - last_invite_status_by_user?: Knocks; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: string[]; - participants?: string[]; - participants_camera_off?: string[]; - participants_camera_on?: string[]; + app_id?: string; + attached_file_ids?: string[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + knocks?: Knocks; + last_invite_status_by_user?: Knocks; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: string[]; + participants?: string[]; + participants_camera_off?: string[]; + participants_camera_on?: string[]; participants_screenshare_off?: string[]; - participants_screenshare_on?: string[]; - pending_invitees?: Knocks; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: string[]; + pending_invitees?: Knocks; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } -export interface Knocks { -} +export type Knocks = {}; diff --git a/packages/web-api/src/types/response/ReactionsListResponse.ts b/packages/web-api/src/types/response/ReactionsListResponse.ts index bb775928e..d0f5566a1 100644 --- a/packages/web-api/src/types/response/ReactionsListResponse.ts +++ b/packages/web-api/src/types/response/ReactionsListResponse.ts @@ -8,256 +8,256 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ReactionsListResponse = WebAPICallResult & { - error?: string; - items?: Item[]; - needed?: string; - ok?: boolean; - paging?: Paging; - provided?: string; + error?: string; + items?: Item[]; + needed?: string; + ok?: boolean; + paging?: Paging; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Item { channel?: string; message?: ItemMessage; - type?: string; + type?: string; } export interface ItemMessage { - app_id?: string; - attachments?: Attachment[]; - blocks?: PurpleBlock[]; - bot_id?: string; - bot_profile?: BotProfile; - channel?: string; - client_msg_id?: string; - display_as_bot?: boolean; - edited?: Edited; - files?: FileElement[]; - icons?: BotProfileIcons; - inviter?: string; - is_locked?: boolean; - latest_reply?: string; - no_notifications?: boolean; - parent_user_id?: string; - permalink?: string; - reactions?: Reaction[]; - reply_count?: number; - reply_users?: string[]; + app_id?: string; + attachments?: Attachment[]; + blocks?: PurpleBlock[]; + bot_id?: string; + bot_profile?: BotProfile; + channel?: string; + client_msg_id?: string; + display_as_bot?: boolean; + edited?: Edited; + files?: FileElement[]; + icons?: BotProfileIcons; + inviter?: string; + is_locked?: boolean; + latest_reply?: string; + no_notifications?: boolean; + parent_user_id?: string; + permalink?: string; + reactions?: Reaction[]; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - room?: Room; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - upload?: boolean; - user?: string; - username?: string; + room?: Room; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + upload?: boolean; + user?: string; + username?: string; } export interface Attachment { - actions?: Action[]; - app_id?: string; - app_unfurl_url?: string; - author_icon?: string; - author_id?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - blocks?: TitleBlockElement[]; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - channel_team?: string; - color?: string; - fallback?: string; - fields?: AttachmentField[]; - file_id?: string; - filename?: string; - files?: FileElement[]; - footer?: string; - footer_icon?: string; - from_url?: string; - hide_border?: boolean; - hide_color?: boolean; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_file_attachment?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_id?: string; + app_unfurl_url?: string; + author_icon?: string; + author_id?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + blocks?: TitleBlockElement[]; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + channel_team?: string; + color?: string; + fallback?: string; + fields?: AttachmentField[]; + file_id?: string; + filename?: string; + files?: FileElement[]; + footer?: string; + footer_icon?: string; + from_url?: string; + hide_border?: boolean; + hide_color?: boolean; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_file_attachment?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - list?: List; - list_record?: PurpleListRecord; - list_record_id?: string; - list_records?: ListRecordElement[]; - list_schema?: Schema[]; - list_view?: View; - list_view_id?: string; - message_blocks?: MessageBlock[]; - metadata?: AttachmentMetadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - preview?: Preview; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; - video_url?: string; + list?: List; + list_record?: PurpleListRecord; + list_record_id?: string; + list_records?: ListRecordElement[]; + list_schema?: Schema[]; + list_view?: View; + list_view_id?: string; + message_blocks?: MessageBlock[]; + metadata?: AttachmentMetadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + preview?: Preview; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; + video_url?: string; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: ActionOptionGroup[]; - options?: SelectedOptionElement[]; + name?: string; + option_groups?: ActionOptionGroup[]; + options?: SelectedOptionElement[]; selected_options?: SelectedOptionElement[]; - style?: string; - text?: string; - type?: string; - url?: string; - value?: string; + style?: string; + text?: string; + type?: string; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface ActionOptionGroup { options?: SelectedOptionElement[]; - text?: string; + text?: string; } export interface SelectedOptionElement { - text?: string; + text?: string; value?: string; } export interface TitleBlockElement { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: AccessoryConfirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: AccessoryConfirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: InitialOptionElement; - initial_options?: InitialOptionElement[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: AccessoryOptionGroup[]; - options?: InitialOptionElement[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: InitialOptionElement; + initial_options?: InitialOptionElement[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: AccessoryOptionGroup[]; + options?: InitialOptionElement[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface AccessoryConfirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -267,42 +267,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: FluffyType; + indent?: number; + offset?: number; + style?: string; + type?: FluffyType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -326,25 +326,25 @@ export enum FluffyType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface InitialOptionElement { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface AccessoryOptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: InitialOptionElement[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -354,11 +354,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } @@ -380,263 +380,263 @@ export interface AttachmentField { } export interface FileElement { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlockElement[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlockElement[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -651,64 +651,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -717,48 +717,47 @@ export interface Transcription { } export interface List { - channels?: string[]; - comments_count?: number; - created?: number; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - editable?: boolean; - external_type?: string; - file_access?: string; - filetype?: string; - groups?: string[]; - has_more_shares?: boolean; - has_rich_preview?: boolean; - id?: string; - ims?: string[]; - is_external?: boolean; - is_public?: boolean; - last_editor?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: string; - pretty_type?: string; + channels?: string[]; + comments_count?: number; + created?: number; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + editable?: boolean; + external_type?: string; + file_access?: string; + filetype?: string; + groups?: string[]; + has_more_shares?: boolean; + has_rich_preview?: boolean; + id?: string; + ims?: string[]; + is_external?: boolean; + is_public?: boolean; + last_editor?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: string; + pretty_type?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - shares?: Knocks; - size?: number; - timestamp?: number; - title?: string; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + shares?: Knocks; + size?: number; + timestamp?: number; + title?: string; + updated?: number; + url_private?: string; + url_private_download?: string; + user?: string; + user_team?: string; + username?: string; } -export interface Knocks { -} +export type Knocks = {}; export interface PurpleListRecord { record?: Record; @@ -766,90 +765,90 @@ export interface PurpleListRecord { } export interface Record { - fields?: RecordField[]; + fields?: RecordField[]; record_id?: string; } export interface RecordField { attachment?: any[]; - channel?: any[]; - checkbox?: boolean; - column_id?: string; - date?: any[]; - email?: any[]; - key?: string; - message?: FieldMessage; - number?: any[]; - phone?: any[]; - rating?: any[]; - rich_text?: any[]; - select?: any[]; - text?: string; - timestamp?: any[]; - user?: any[]; - value?: string; + channel?: any[]; + checkbox?: boolean; + column_id?: string; + date?: any[]; + email?: any[]; + key?: string; + message?: FieldMessage; + number?: any[]; + phone?: any[]; + rating?: any[]; + rich_text?: any[]; + select?: any[]; + text?: string; + timestamp?: any[]; + user?: any[]; + value?: string; } export interface FieldMessage { - app_id?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - bot_link?: string; - bot_profile?: BotProfile; - channel?: string; - client_msg_id?: string; - comment?: Comment; - display_as_bot?: boolean; - edited?: Edited; - file?: PurpleFile; - files?: any[]; - hidden?: boolean; - icons?: RootIcons; - inviter?: string; - is_intro?: boolean; - is_locked?: boolean; - is_starred?: boolean; + app_id?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + bot_link?: string; + bot_profile?: BotProfile; + channel?: string; + client_msg_id?: string; + comment?: Comment; + display_as_bot?: boolean; + edited?: Edited; + file?: PurpleFile; + files?: any[]; + hidden?: boolean; + icons?: RootIcons; + inviter?: string; + is_intro?: boolean; + is_locked?: boolean; + is_starred?: boolean; is_thread_broadcast?: boolean; - item?: Comment; - item_type?: string; - last_read?: string; - latest_reply?: string; - metadata?: MessageMetadata; - no_notifications?: boolean; - parent_user_id?: string; - pinned_to?: any[]; - purpose?: string; - reactions?: any[]; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; - reply_users_count?: number; - room?: Room; - root?: Root; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - topic?: string; - ts?: string; - type?: string; - unfurl_links?: boolean; - unfurl_media?: boolean; - upload?: boolean; - user?: string; - username?: string; - wibblr?: boolean; - x_files?: any[]; + item?: Comment; + item_type?: string; + last_read?: string; + latest_reply?: string; + metadata?: MessageMetadata; + no_notifications?: boolean; + parent_user_id?: string; + pinned_to?: any[]; + purpose?: string; + reactions?: any[]; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; + reply_users_count?: number; + room?: Room; + root?: Root; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + topic?: string; + ts?: string; + type?: string; + unfurl_links?: boolean; + unfurl_media?: boolean; + upload?: boolean; + user?: string; + username?: string; + wibblr?: boolean; + x_files?: any[]; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: BotProfileIcons; - id?: string; - name?: string; + icons?: BotProfileIcons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -861,208 +860,208 @@ export interface BotProfileIcons { } export interface Comment { - comment?: string; - created?: string; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_type?: string; - filetype?: string; - has_rich_preview?: boolean; - id?: string; - is_external?: boolean; - is_intro?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: boolean; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + comment?: string; + created?: string; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_type?: string; + filetype?: string; + has_rich_preview?: boolean; + id?: string; + is_external?: boolean; + is_intro?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: boolean; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - size?: number; - timestamp?: string; - title?: string; - url_private?: string; + public_url_shared?: boolean; + size?: number; + timestamp?: string; + title?: string; + url_private?: string; url_private_download?: boolean; - user?: string; - username?: string; + user?: string; + username?: string; } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface PurpleFile { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: any[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: any[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: any[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: any[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: any[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: any[]; - file_access?: string; - filetype?: string; - from?: any[]; - groups?: any[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: any[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: any[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: any[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: any[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: any[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: any[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: any[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: any[]; + file_access?: string; + filetype?: string; + from?: any[]; + groups?: any[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: any[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: any[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: any[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Knocks; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: any[]; - to?: any[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: any[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Knocks; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: any[]; + to?: any[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface RootIcons { - emoji?: string; + emoji?: string; image_36?: string; image_48?: string; image_64?: string; @@ -1074,80 +1073,80 @@ export interface MessageMetadata { } export interface Room { - app_id?: string; - attached_file_ids?: string[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - knocks?: Knocks; - last_invite_status_by_user?: Knocks; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: string[]; - participants?: string[]; - participants_camera_off?: string[]; - participants_camera_on?: string[]; + app_id?: string; + attached_file_ids?: string[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + knocks?: Knocks; + last_invite_status_by_user?: Knocks; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: string[]; + participants?: string[]; + participants_camera_off?: string[]; + participants_camera_on?: string[]; participants_screenshare_off?: string[]; - participants_screenshare_on?: string[]; - pending_invitees?: Knocks; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: string[]; + pending_invitees?: Knocks; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Root { - bot_id?: string; - bot_profile?: BotProfile; - edited?: Edited; - icons?: RootIcons; - last_read?: string; - latest_reply?: string; - mrkdwn?: boolean; - no_notifications?: boolean; - parent_user_id?: string; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; + bot_id?: string; + bot_profile?: BotProfile; + edited?: Edited; + icons?: RootIcons; + last_read?: string; + latest_reply?: string; + mrkdwn?: boolean; + no_notifications?: boolean; + parent_user_id?: string; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; reply_users_count?: number; - room?: Room; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - unread_count?: number; - user?: string; - username?: string; + room?: Room; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + unread_count?: number; + user?: string; + username?: string; } export interface ListRecordElement { - created_by?: string; - date_created?: number; - fields?: RecordField[]; - id?: string; - is_subscribed?: boolean; - list_id?: string; - platform_refs?: PlatformRefs; - position?: string; - saved?: Saved; - thread_ts?: string; - updated_by?: string; + created_by?: string; + date_created?: number; + fields?: RecordField[]; + id?: string; + is_subscribed?: boolean; + list_id?: string; + platform_refs?: PlatformRefs; + position?: string; + saved?: Saved; + thread_ts?: string; + updated_by?: string; updated_timestamp?: string; } @@ -1160,133 +1159,133 @@ export interface PlatformRefs { export interface MessageBlock { channel?: string; message?: FieldMessage; - team?: string; - ts?: string; + team?: string; + ts?: string; } export interface AttachmentMetadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Preview { can_remove?: boolean; - icon_url?: string; - subtitle?: DescriptionElement; - title?: DescriptionElement; - type?: string; + icon_url?: string; + subtitle?: DescriptionElement; + title?: DescriptionElement; + type?: string; } export interface PurpleBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: FileElement; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: FileElement; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface Paging { count?: number; - page?: number; + page?: number; pages?: number; total?: number; } diff --git a/packages/web-api/src/types/response/ReactionsRemoveResponse.ts b/packages/web-api/src/types/response/ReactionsRemoveResponse.ts index 652bbf180..3d82a32dc 100644 --- a/packages/web-api/src/types/response/ReactionsRemoveResponse.ts +++ b/packages/web-api/src/types/response/ReactionsRemoveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ReactionsRemoveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/RemindersAddResponse.ts b/packages/web-api/src/types/response/RemindersAddResponse.ts index 9586daa97..b3d2b0c71 100644 --- a/packages/web-api/src/types/response/RemindersAddResponse.ts +++ b/packages/web-api/src/types/response/RemindersAddResponse.ts @@ -8,24 +8,24 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type RemindersAddResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; - reminder?: Reminder; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; + reminder?: Reminder; response_metadata?: ResponseMetadata; }; export interface Reminder { complete_ts?: number; - creator?: string; - id?: string; - recurring?: boolean; - text?: string; - time?: number; - user?: string; + creator?: string; + id?: string; + recurring?: boolean; + text?: string; + time?: number; + user?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/RemindersCompleteResponse.ts b/packages/web-api/src/types/response/RemindersCompleteResponse.ts index db6007716..9c7f20ce1 100644 --- a/packages/web-api/src/types/response/RemindersCompleteResponse.ts +++ b/packages/web-api/src/types/response/RemindersCompleteResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type RemindersCompleteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/RemindersDeleteResponse.ts b/packages/web-api/src/types/response/RemindersDeleteResponse.ts index 1e729bceb..f8caa4433 100644 --- a/packages/web-api/src/types/response/RemindersDeleteResponse.ts +++ b/packages/web-api/src/types/response/RemindersDeleteResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type RemindersDeleteResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/RemindersInfoResponse.ts b/packages/web-api/src/types/response/RemindersInfoResponse.ts index 4ca914103..c6e332826 100644 --- a/packages/web-api/src/types/response/RemindersInfoResponse.ts +++ b/packages/web-api/src/types/response/RemindersInfoResponse.ts @@ -8,21 +8,21 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type RemindersInfoResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; reminder?: Reminder; }; export interface Reminder { complete_ts?: number; - creator?: string; - id?: string; - recurring?: boolean; - text?: string; - time?: number; - user?: string; + creator?: string; + id?: string; + recurring?: boolean; + text?: string; + time?: number; + user?: string; } diff --git a/packages/web-api/src/types/response/RemindersListResponse.ts b/packages/web-api/src/types/response/RemindersListResponse.ts index 8820c1570..ea0137967 100644 --- a/packages/web-api/src/types/response/RemindersListResponse.ts +++ b/packages/web-api/src/types/response/RemindersListResponse.ts @@ -8,28 +8,28 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type RemindersListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; reminders?: Reminder[]; }; export interface Reminder { - channel?: string; + channel?: string; complete_ts?: number; - creator?: string; - id?: string; - recurrence?: Recurrence; - recurring?: boolean; - text?: string; - time?: number; - user?: string; + creator?: string; + id?: string; + recurrence?: Recurrence; + recurring?: boolean; + text?: string; + time?: number; + user?: string; } export interface Recurrence { frequency?: string; - weekdays?: string[]; + weekdays?: string[]; } diff --git a/packages/web-api/src/types/response/RtmConnectResponse.ts b/packages/web-api/src/types/response/RtmConnectResponse.ts index a2e037bb3..c3d14745e 100644 --- a/packages/web-api/src/types/response/RtmConnectResponse.ts +++ b/packages/web-api/src/types/response/RtmConnectResponse.ts @@ -8,24 +8,24 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type RtmConnectResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - self?: Self; - team?: Team; - url?: string; + self?: Self; + team?: Team; + url?: string; }; export interface Self { - id?: string; + id?: string; name?: string; } export interface Team { domain?: string; - id?: string; - name?: string; + id?: string; + name?: string; } diff --git a/packages/web-api/src/types/response/RtmStartResponse.ts b/packages/web-api/src/types/response/RtmStartResponse.ts index d6e3afa30..d72e5cec7 100644 --- a/packages/web-api/src/types/response/RtmStartResponse.ts +++ b/packages/web-api/src/types/response/RtmStartResponse.ts @@ -8,46 +8,46 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type RtmStartResponse = WebAPICallResult & { - accept_tos_url?: string; - bots?: Bot[]; - cache_ts?: number; - cache_ts_version?: string; - cache_version?: string; - can_manage_shared_channels?: boolean; - channels?: Channel[]; - dnd?: Dnd; - error?: string; - groups?: Group[]; - ims?: Im[]; - is_europe?: boolean; - latest_event_ts?: string; - links?: Links; + accept_tos_url?: string; + bots?: Bot[]; + cache_ts?: number; + cache_ts_version?: string; + cache_version?: string; + can_manage_shared_channels?: boolean; + channels?: Channel[]; + dnd?: Dnd; + error?: string; + groups?: Group[]; + ims?: Im[]; + is_europe?: boolean; + latest_event_ts?: string; + links?: Links; mobile_app_requires_upgrade?: boolean; - needed?: string; - non_threadable_channels?: string[]; - ok?: boolean; - provided?: string; - read_only_channels?: string[]; - response_metadata?: ResponseMetadata; - self?: Self; - subteams?: Subteams; - team?: Team; - thread_only_channels?: string[]; - url?: string; - users?: User[]; + needed?: string; + non_threadable_channels?: string[]; + ok?: boolean; + provided?: string; + read_only_channels?: string[]; + response_metadata?: ResponseMetadata; + self?: Self; + subteams?: Subteams; + team?: Team; + thread_only_channels?: string[]; + url?: string; + users?: User[]; }; export interface Bot { - app_id?: Appid; - deleted?: boolean; - icons?: BotIcons; - id?: Id; + app_id?: Appid; + deleted?: boolean; + icons?: BotIcons; + id?: Id; is_workflow_bot?: boolean; - name?: string; - team_id?: string; - updated?: number; + name?: string; + team_id?: string; + updated?: number; } export enum Appid { @@ -68,202 +68,202 @@ export enum Id { export interface Channel { connected_limited_team_ids?: string[]; - connected_team_ids?: string[]; - context_team_id?: string; - conversation_host_id?: string; - created?: number; - creator?: string; - has_pins?: boolean; - id?: string; - internal_team_ids?: string[]; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_group?: boolean; - is_im?: boolean; - is_member?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - last_read?: string; - name?: string; - name_normalized?: string; + connected_team_ids?: string[]; + context_team_id?: string; + conversation_host_id?: string; + created?: number; + creator?: string; + has_pins?: boolean; + id?: string; + internal_team_ids?: string[]; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_group?: boolean; + is_im?: boolean; + is_member?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + last_read?: string; + name?: string; + name_normalized?: string; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - priority?: number; - purpose?: Purpose; - shared_team_ids?: string[]; - topic?: Purpose; - unlinked?: number; + pending_shared?: string[]; + previous_names?: string[]; + priority?: number; + purpose?: Purpose; + shared_team_ids?: string[]; + topic?: Purpose; + unlinked?: number; } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface Dnd { - dnd_enabled?: boolean; - next_dnd_end_ts?: number; + dnd_enabled?: boolean; + next_dnd_end_ts?: number; next_dnd_start_ts?: number; - snooze_enabled?: boolean; + snooze_enabled?: boolean; } export interface Group { - created?: number; - creator?: string; - id?: string; - is_archived?: boolean; - is_group?: boolean; - is_mpim?: boolean; - is_open?: boolean; - is_read_only?: boolean; - is_thread_only?: boolean; - last_read?: string; - latest?: Latest; - members?: string[]; - name?: string; - name_normalized?: string; - parent_group?: string; - priority?: number; - purpose?: Purpose; - topic?: Purpose; - unread_count?: number; + created?: number; + creator?: string; + id?: string; + is_archived?: boolean; + is_group?: boolean; + is_mpim?: boolean; + is_open?: boolean; + is_read_only?: boolean; + is_thread_only?: boolean; + last_read?: string; + latest?: Latest; + members?: string[]; + name?: string; + name_normalized?: string; + parent_group?: string; + priority?: number; + purpose?: Purpose; + topic?: Purpose; + unread_count?: number; unread_count_display?: number; } export interface Latest { - attachments?: Attachment[]; - blocks?: LatestBlock[]; - bot_id?: string; - bot_link?: string; - bot_profile?: Bot; - client_msg_id?: string; + attachments?: Attachment[]; + blocks?: LatestBlock[]; + bot_id?: string; + bot_link?: string; + bot_profile?: Bot; + client_msg_id?: string; display_as_bot?: boolean; - edited?: Edited; - files?: FileElement[]; - icons?: MessageIcons; + edited?: Edited; + files?: FileElement[]; + icons?: MessageIcons; parent_user_id?: string; - reactions?: string[]; - root?: Root; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - topic?: string; - ts?: string; - type?: string; - upload?: boolean; - user?: string; - username?: string; - x_files?: string[]; + reactions?: string[]; + root?: Root; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + topic?: string; + ts?: string; + type?: string; + upload?: boolean; + user?: string; + username?: string; + x_files?: string[]; } export interface Attachment { - actions?: Action[]; - app_id?: string; - app_unfurl_url?: string; - author_icon?: string; - author_id?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - blocks?: TitleBlockElement[]; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - channel_team?: string; - color?: string; - fallback?: string; - fields?: AttachmentField[]; - file_id?: string; - filename?: string; - files?: FileElement[]; - footer?: string; - footer_icon?: string; - from_url?: string; - hide_border?: boolean; - hide_color?: boolean; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_file_attachment?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_id?: string; + app_unfurl_url?: string; + author_icon?: string; + author_id?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + blocks?: TitleBlockElement[]; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + channel_team?: string; + color?: string; + fallback?: string; + fields?: AttachmentField[]; + file_id?: string; + filename?: string; + files?: FileElement[]; + footer?: string; + footer_icon?: string; + from_url?: string; + hide_border?: boolean; + hide_color?: boolean; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_file_attachment?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - list?: List; - list_record?: PurpleListRecord; - list_record_id?: string; - list_records?: ListRecordElement[]; - list_schema?: Schema[]; - list_view?: View; - list_view_id?: string; - message_blocks?: MessageBlock[]; - metadata?: AttachmentMetadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - preview?: Preview; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; - video_url?: string; + list?: List; + list_record?: PurpleListRecord; + list_record_id?: string; + list_records?: ListRecordElement[]; + list_schema?: Schema[]; + list_view?: View; + list_view_id?: string; + message_blocks?: MessageBlock[]; + metadata?: AttachmentMetadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + preview?: Preview; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; + video_url?: string; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: ActionOptionGroup[]; - options?: SelectedOptionElement[]; + name?: string; + option_groups?: ActionOptionGroup[]; + options?: SelectedOptionElement[]; selected_options?: SelectedOptionElement[]; - style?: string; - text?: string; - type?: ActionType; - url?: string; - value?: string; + style?: string; + text?: string; + type?: ActionType; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface ActionOptionGroup { options?: SelectedOptionElement[]; - text?: string; + text?: string; } export interface SelectedOptionElement { - text?: string; + text?: string; value?: string; } @@ -294,100 +294,100 @@ export enum ActionType { } export interface TitleBlockElement { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: AccessoryConfirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: AccessoryConfirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: InitialOptionElement; - initial_options?: InitialOptionElement[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: AccessoryOptionGroup[]; - options?: InitialOptionElement[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: ActionType; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: InitialOptionElement; + initial_options?: InitialOptionElement[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: AccessoryOptionGroup[]; + options?: InitialOptionElement[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: ActionType; + url?: string; + value?: string; + workflow?: Workflow; } export interface AccessoryConfirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -397,42 +397,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: ActionType; + indent?: number; + offset?: number; + style?: string; + type?: ActionType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -449,25 +449,25 @@ export enum PurpleType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface InitialOptionElement { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface AccessoryOptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: InitialOptionElement[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -477,11 +477,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } @@ -503,263 +503,263 @@ export interface AttachmentField { } export interface FileElement { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: PurpleShares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlockElement[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: PurpleShares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlockElement[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -774,64 +774,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface PurpleShares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -840,48 +840,47 @@ export interface Transcription { } export interface List { - channels?: string[]; - comments_count?: number; - created?: number; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - editable?: boolean; - external_type?: string; - file_access?: string; - filetype?: string; - groups?: string[]; - has_more_shares?: boolean; - has_rich_preview?: boolean; - id?: string; - ims?: string[]; - is_external?: boolean; - is_public?: boolean; - last_editor?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: string; - pretty_type?: string; + channels?: string[]; + comments_count?: number; + created?: number; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + editable?: boolean; + external_type?: string; + file_access?: string; + filetype?: string; + groups?: string[]; + has_more_shares?: boolean; + has_rich_preview?: boolean; + id?: string; + ims?: string[]; + is_external?: boolean; + is_public?: boolean; + last_editor?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: string; + pretty_type?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - shares?: ListShares; - size?: number; - timestamp?: number; - title?: string; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + shares?: ListShares; + size?: number; + timestamp?: number; + title?: string; + updated?: number; + url_private?: string; + url_private_download?: string; + user?: string; + user_team?: string; + username?: string; } -export interface ListShares { -} +export type ListShares = {}; export interface PurpleListRecord { record?: Record; @@ -889,287 +888,287 @@ export interface PurpleListRecord { } export interface Record { - fields?: RecordField[]; + fields?: RecordField[]; record_id?: string; } export interface RecordField { attachment?: any[]; - channel?: any[]; - checkbox?: boolean; - column_id?: string; - date?: any[]; - email?: any[]; - key?: string; - message?: Message; - number?: any[]; - phone?: any[]; - rating?: any[]; - rich_text?: any[]; - select?: any[]; - text?: string; - timestamp?: any[]; - user?: any[]; - value?: string; + channel?: any[]; + checkbox?: boolean; + column_id?: string; + date?: any[]; + email?: any[]; + key?: string; + message?: Message; + number?: any[]; + phone?: any[]; + rating?: any[]; + rich_text?: any[]; + select?: any[]; + text?: string; + timestamp?: any[]; + user?: any[]; + value?: string; } export interface Message { - app_id?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - bot_link?: string; - bot_profile?: Bot; - channel?: string; - client_msg_id?: string; - comment?: Comment; - display_as_bot?: boolean; - edited?: Edited; - file?: MessageFile; - files?: any[]; - hidden?: boolean; - icons?: MessageIcons; - inviter?: string; - is_intro?: boolean; - is_locked?: boolean; - is_starred?: boolean; + app_id?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + bot_link?: string; + bot_profile?: Bot; + channel?: string; + client_msg_id?: string; + comment?: Comment; + display_as_bot?: boolean; + edited?: Edited; + file?: MessageFile; + files?: any[]; + hidden?: boolean; + icons?: MessageIcons; + inviter?: string; + is_intro?: boolean; + is_locked?: boolean; + is_starred?: boolean; is_thread_broadcast?: boolean; - item?: Comment; - item_type?: string; - last_read?: string; - latest_reply?: string; - metadata?: MessageMetadata; - no_notifications?: boolean; - parent_user_id?: string; - pinned_to?: any[]; - purpose?: string; - reactions?: any[]; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; - reply_users_count?: number; - room?: Room; - root?: Root; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - topic?: string; - ts?: string; - type?: string; - unfurl_links?: boolean; - unfurl_media?: boolean; - upload?: boolean; - user?: string; - username?: string; - wibblr?: boolean; - x_files?: any[]; + item?: Comment; + item_type?: string; + last_read?: string; + latest_reply?: string; + metadata?: MessageMetadata; + no_notifications?: boolean; + parent_user_id?: string; + pinned_to?: any[]; + purpose?: string; + reactions?: any[]; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; + reply_users_count?: number; + room?: Room; + root?: Root; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + topic?: string; + ts?: string; + type?: string; + unfurl_links?: boolean; + unfurl_media?: boolean; + upload?: boolean; + user?: string; + username?: string; + wibblr?: boolean; + x_files?: any[]; } export interface Comment { - comment?: string; - created?: string; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_type?: string; - filetype?: string; - has_rich_preview?: boolean; - id?: string; - is_external?: boolean; - is_intro?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: boolean; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + comment?: string; + created?: string; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_type?: string; + filetype?: string; + has_rich_preview?: boolean; + id?: string; + is_external?: boolean; + is_intro?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: boolean; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - size?: number; - timestamp?: string; - title?: string; - url_private?: string; + public_url_shared?: boolean; + size?: number; + timestamp?: string; + title?: string; + url_private?: string; url_private_download?: boolean; - user?: string; - username?: string; + user?: string; + username?: string; } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface MessageFile { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: any[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: any[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: any[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: any[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: any[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: any[]; - file_access?: string; - filetype?: string; - from?: any[]; - groups?: any[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: any[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: any[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: any[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: any[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: any[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: any[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: any[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: any[]; + file_access?: string; + filetype?: string; + from?: any[]; + groups?: any[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: any[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: any[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: any[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: ListShares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: any[]; - to?: any[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: any[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: ListShares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: any[]; + to?: any[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface MessageIcons { - emoji?: string; + emoji?: string; image_36?: string; image_48?: string; image_64?: string; @@ -1181,77 +1180,77 @@ export interface MessageMetadata { } export interface Room { - app_id?: string; - attached_file_ids?: any[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: any[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: any[]; - participants?: any[]; - participants_camera_off?: any[]; - participants_camera_on?: any[]; + app_id?: string; + attached_file_ids?: any[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: any[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: any[]; + participants?: any[]; + participants_camera_off?: any[]; + participants_camera_on?: any[]; participants_screenshare_off?: any[]; - participants_screenshare_on?: any[]; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: any[]; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Root { - bot_id?: string; - bot_profile?: Bot; - edited?: Edited; - icons?: MessageIcons; - last_read?: string; - latest_reply?: string; - mrkdwn?: boolean; - no_notifications?: boolean; - parent_user_id?: string; - replies?: Edited[]; - reply_count?: number; - reply_users?: string[]; + bot_id?: string; + bot_profile?: Bot; + edited?: Edited; + icons?: MessageIcons; + last_read?: string; + latest_reply?: string; + mrkdwn?: boolean; + no_notifications?: boolean; + parent_user_id?: string; + replies?: Edited[]; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - room?: Room; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - unread_count?: number; - user?: string; - username?: string; + room?: Room; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + unread_count?: number; + user?: string; + username?: string; } export interface ListRecordElement { - created_by?: string; - date_created?: number; - fields?: RecordField[]; - id?: string; - is_subscribed?: boolean; - list_id?: string; - platform_refs?: PlatformRefs; - position?: string; - saved?: Saved; - thread_ts?: string; - updated_by?: string; + created_by?: string; + date_created?: number; + fields?: RecordField[]; + id?: string; + is_subscribed?: boolean; + list_id?: string; + platform_refs?: PlatformRefs; + position?: string; + saved?: Saved; + thread_ts?: string; + updated_by?: string; updated_timestamp?: string; } @@ -1264,142 +1263,142 @@ export interface PlatformRefs { export interface MessageBlock { channel?: string; message?: Message; - team?: string; - ts?: string; + team?: string; + ts?: string; } export interface AttachmentMetadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Preview { can_remove?: boolean; - icon_url?: string; - subtitle?: DescriptionElement; - title?: DescriptionElement; - type?: string; + icon_url?: string; + subtitle?: DescriptionElement; + title?: DescriptionElement; + type?: string; } export interface LatestBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: FileElement; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: FileElement; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface Im { context_team_id?: string; - created?: number; - has_pins?: boolean; - id?: string; - is_archived?: boolean; - is_im?: boolean; - is_open?: boolean; - is_org_shared?: boolean; - last_read?: string; - priority?: number; - user?: string; + created?: number; + has_pins?: boolean; + id?: string; + is_archived?: boolean; + is_im?: boolean; + is_open?: boolean; + is_org_shared?: boolean; + last_read?: string; + priority?: number; + user?: string; } export interface Links { @@ -1411,493 +1410,493 @@ export interface ResponseMetadata { } export interface Self { - created?: number; - first_login?: number; - id?: string; + created?: number; + first_login?: number; + id?: string; manual_presence?: string; - name?: string; - prefs?: SelfPrefs; + name?: string; + prefs?: SelfPrefs; } export interface SelfPrefs { - a11y_animations?: boolean; - a11y_dyslexic?: boolean; - a11y_play_sound_for_incoming_dm?: boolean; - a11y_play_sound_for_incoming_dm_choice?: string; - a11y_play_sound_for_sent_dm?: boolean; - a11y_play_sound_for_sent_dm_choice?: string; - a11y_read_out_incoming_dm?: boolean; - a11y_screen_reader_message_label_date_time_first?: boolean; - activity_view?: string; - add_apps_prompt_dismissed?: boolean; - add_channel_prompt_dismissed?: boolean; - add_prompt_interacted?: boolean; - all_channels_loud?: boolean; - all_notifications_prefs?: string; - all_unreads_section_filter?: string; - all_unreads_sort_order?: string; - allow_calls_to_set_current_status?: boolean; - allow_cmd_tab_iss?: boolean; - allowed_unfurl_senders?: string; - analytics_upsell_coachmark_seen?: boolean; - app_manifest_schema_format?: string; - app_subdomain_check_completed?: number; - arrow_history?: boolean; - at_channel_suppressed_channels?: string; - box_enabled?: boolean; - browsers_dismissed_channels_low_results_education?: boolean; - browsers_dismissed_files_low_results_education?: boolean; - browsers_dismissed_initial_activity_education?: boolean; - browsers_dismissed_initial_drafts_education?: boolean; - browsers_dismissed_initial_saved_education?: boolean; - browsers_dismissed_people_low_results_education?: boolean; - browsers_dismissed_user_groups_low_results_education?: boolean; - browsers_seen_initial_activity_education?: boolean; - browsers_seen_initial_channels_education?: boolean; - browsers_seen_initial_drafts_education?: boolean; - browsers_seen_initial_files_education?: boolean; - browsers_seen_initial_people_education?: boolean; - browsers_seen_initial_saved_education?: boolean; - browsers_seen_initial_user_groups_education?: boolean; - calls_disconnect_on_lock?: boolean; - calls_survey_last_seen?: string; - channel_canvas_variant?: number; - channel_sections?: string; - channel_sidebar_hide_browse_dms_link?: boolean; - channel_sidebar_hide_invite?: boolean; - channel_sort?: string; - chime_access_check_completed?: number; - clicked_close_onboarding_synth_view_banner?: boolean; - client_logs_pri?: string; - clips_feedback_survey_last_trigger_attempt?: number; - color_names_in_list?: boolean; - composer_nux?: string; - confirm_clear_all_unreads?: boolean; - confirm_sh_call_start?: boolean; - confirm_user_marked_away?: boolean; - connect_dm_early_access?: boolean; - contextual_help_reset_count?: number; - contextual_message_shortcuts_modal_was_seen?: boolean; - convert_emoticons?: boolean; - deprecation_banner_last_seen?: number; - deprecation_modal_last_seen?: number; - deprecation_toast_last_seen?: number; - desktop_client_ids?: string; - dismissed_app_config_redesign_coachmark?: boolean; - dismissed_app_launcher_atlassian_promo?: boolean; - dismissed_app_launcher_limit?: boolean; - dismissed_app_launcher_welcome?: boolean; - dismissed_app_manifest_coachmark?: boolean; - dismissed_app_manifest_description?: boolean; - dismissed_banner_download_ssb_prompt?: boolean; - dismissed_connect_auto_approval_modal?: string; - dismissed_fullscreen_download_ssb_prompt?: boolean; - dismissed_gov_slack_first_time_popup?: boolean; - dismissed_installed_app_dm_suggestions?: string; - dismissed_scdm_education?: boolean; - dismissed_scroll_search_tooltip_count?: number; - dismissed_sent_page_education?: boolean; - display_display_names?: boolean; - display_real_names_override?: number; - dnd_after_friday?: string; - dnd_after_monday?: string; - dnd_after_saturday?: string; - dnd_after_sunday?: string; - dnd_after_thursday?: string; - dnd_after_tuesday?: string; - dnd_after_wednesday?: string; - dnd_before_friday?: string; - dnd_before_monday?: string; - dnd_before_saturday?: string; - dnd_before_sunday?: string; - dnd_before_thursday?: string; - dnd_before_tuesday?: string; - dnd_before_wednesday?: string; - dnd_custom_new_badge_seen?: boolean; - dnd_days?: string; - dnd_enabled?: boolean; - dnd_enabled_friday?: string; - dnd_enabled_monday?: string; - dnd_enabled_saturday?: string; - dnd_enabled_sunday?: string; - dnd_enabled_thursday?: string; - dnd_enabled_tuesday?: string; - dnd_enabled_wednesday?: string; - dnd_end_hour?: string; - dnd_notification_schedule_new_badge_seen?: boolean; - dnd_start_hour?: string; - dnd_weekdays_off_allday?: boolean; - dropbox_enabled?: boolean; - edge_upload_proxy_check_completed?: number; - email_alerts?: string; - email_alerts_sleep_until?: number; - email_developer?: boolean; - email_offers?: boolean; - email_research?: boolean; - email_tips?: boolean; - email_weekly?: boolean; - emoji_autocomplete_big?: boolean; - emoji_mode?: string; - emoji_packs_clicked_collection_cta?: boolean; - emoji_packs_clicked_picker_cta?: boolean; - emoji_packs_clicked_picker_post_install_cta?: boolean; - emoji_packs_most_recent_available_time?: number; - emoji_use?: string; - emoji_use_org?: string; - enable_all_dms_view?: boolean; - enable_app_browser_view?: boolean; - enable_app_config_redesign?: boolean; - enable_channel_browser_view?: boolean; - enable_drafts_view?: boolean; - enable_file_browser_view?: boolean; - enable_file_browser_view_for_docs?: boolean; - enable_hq_view?: boolean; - enable_later_view?: boolean; - enable_media_captions?: boolean; - enable_mentions_and_reactions_view?: boolean; - enable_people_browser_view?: boolean; - enable_quip_file_browser_view?: boolean; - enable_react_emoji_picker?: boolean; - enable_reminders_view?: boolean; - enable_saved_items_view?: boolean; - enable_scheduled_view?: boolean; - enable_sent_view?: boolean; - enable_shortcuts_view?: boolean; - enable_slack_connect_view?: boolean; - enable_slack_connect_view_2?: number; - enable_streamline_view?: boolean; - enable_unread_view?: boolean; - ent_org_wide_channels_sidebar?: boolean; - enter_is_special_in_tbt?: boolean; - enterprise_mdm_custom_msg?: string; - enterprise_migration_seen?: boolean; - expand_inline_imgs?: boolean; - expand_internal_inline_imgs?: boolean; - expand_non_media_attachments?: boolean; - expand_snippets?: boolean; - f_key_search?: boolean; - failover_proxy_check_completed?: number; - file_picker_variant?: number; - first_seen_new_badge_in_more_menu_sidebar?: number; - first_seen_sent_page_in_sidebar?: number; - flannel_server_pool?: string; - folder_data?: string; - folders_enabled?: boolean; - frecency?: string; - frecency_ent_jumper?: string; - frecency_jumper?: string; - fuller_timestamps?: boolean; - graphic_emoticons?: boolean; - growls_enabled?: boolean; - growth_all_banners_prefs?: string; - growth_msg_limit_approaching_cta_count?: number; - growth_msg_limit_approaching_cta_ts?: number; - growth_msg_limit_long_reached_cta_count?: number; - growth_msg_limit_long_reached_cta_last_ts?: number; - growth_msg_limit_reached_cta_count?: number; - growth_msg_limit_reached_cta_last_ts?: number; - growth_msg_limit_sixty_day_banner_cta_count?: number; - growth_msg_limit_sixty_day_banner_cta_last_ts?: number; - has_acknowledged_shortcut_speedbump?: boolean; - has_created_channel?: boolean; - has_created_channel_section?: boolean; - has_dismissed_google_directory_coachmark?: boolean; - has_drafted_message?: boolean; - has_invited?: boolean; - has_joined_huddle?: boolean; - has_received_mention_or_reaction?: boolean; - has_received_threaded_message?: boolean; - has_recently_shared_a_channel?: boolean; - has_searched?: boolean; - has_sent_ten_messages?: number; - has_starred_item?: boolean; - has_uploaded?: boolean; - has_used_quickswitcher_shortcut?: boolean; - help_flexpane_clips_card_seen?: boolean; - help_flexpane_slack_connect_card_seen?: boolean; - help_menu_open_timestamp?: number; - help_modal_consult_banner_dismissed?: boolean; - help_modal_open_timestamp?: number; - hidden_users?: string; - hide_external_members_sharing_speed_bump?: boolean; - hide_hex_swatch?: boolean; - hide_user_group_info_pane?: boolean; - highlight_words?: string; - huddle_invite_sound?: string; - huddle_survey_last_seen?: string; - huddles_allow_smart_notif?: boolean; - huddles_cc_by_default?: boolean; - huddles_chime_new_endpoints_check_completed?: number; - huddles_disconnect_on_lock?: boolean; - huddles_global_mute?: boolean; - huddles_mini_panel?: boolean; - huddles_mute_by_default?: boolean; - huddles_play_music_when_last?: boolean; - huddles_reactions_play_sound?: boolean; - huddles_reactions_read_out_loud?: boolean; - huddles_set_status?: boolean; - huddles_show_shouty_rooster?: boolean; - huddles_variant?: number; - ia_details_coachmark_seen?: boolean; - ia_platform_actions_lab?: number; - ia_slackbot_survey_timestamp_48h?: number; - ia_slackbot_survey_timestamp_7d?: number; - ia_top_nav_theme?: string; - iap1_lab?: number; - identity_links_global_prefs?: string; - identity_links_prefs?: string; - in_interactive_mas_migration_flow?: boolean; - in_prod_surveys_enabled?: boolean; - inbox_views_workspace_filter?: string; - invite_accepted_notifications_muted?: boolean; - join_calls_device_settings?: string; - joiner_message_suggestion_dismissed?: boolean; - joiner_notifications_muted?: boolean; - jumbomoji?: boolean; - k_key_omnibox?: boolean; - k_key_omnibox_auto_hide_count?: number; - last_dismissed_scroll_search_tooltip_timestamp?: number; - last_seen_at_channel_warning?: number; - last_seen_sections_unreads_only_prompt_timestamp?: number; - last_snippet_type?: string; - lessons_enabled?: boolean; - load_lato_2?: boolean; - locale?: string; - locales_enabled?: LocalesEnabled; - loud_channels?: string; - loud_channels_set?: string; - ls_disabled?: boolean; - mac_ssb_bounce?: string; - mac_ssb_bullet?: boolean; - mark_msgs_read_immediately?: boolean; - media_muted?: boolean; - media_playback_speed?: number; - media_volume?: number; - mentions_exclude_at_channels?: boolean; - mentions_exclude_at_user_groups?: boolean; - mentions_exclude_reactions?: boolean; - message_navigation_toast_was_seen?: boolean; - messages_theme?: string; - mobile_channel_list_show_all_dms?: boolean; - mobile_channel_list_sort?: string; - msg_input_send_btn?: boolean; - msg_input_send_btn_auto_set?: boolean; - msg_input_sticky_composer?: boolean; - mute_sounds?: boolean; - muted_channels?: string; - mx_calendar_type?: string; - needs_initial_password_set?: boolean; - never_channels?: string; - new_msg_snd?: string; - newxp_seen_help_message?: number; - newxp_seen_last_message?: number; - newxp_suggested_channels?: string; - no_created_overlays?: boolean; - no_invites_widget_in_sidebar?: boolean; - no_joined_overlays?: boolean; - no_macelectron_banner?: boolean; - no_macssb1_banner?: boolean; - no_macssb2_banner?: boolean; - no_omnibox_in_channels?: boolean; - no_text_in_notifications?: boolean; - no_winssb1_banner?: boolean; - notification_center_filters?: string; - notifications_view?: string; - obey_inline_img_limit?: boolean; - onboarding_cancelled?: boolean; - onboarding_complete?: boolean; - onboarding_slackbot_conversation_step?: number; - onboarding_state?: number; - onboarding_tip_opt_out?: boolean; - open_quip_doc_in_flexpane?: boolean; - opened_slackbot_dm?: boolean; - overloaded_message_enabled?: boolean; - pagekeys_handled?: boolean; - phc_dismissed?: string; - phc_viewed?: string; - plain_text_mode?: boolean; - posts_formatting_guide?: boolean; - preferred_skin_tone?: string; - privacy_policy_seen?: boolean; - progressive_disclosure_state?: string; - prompted_for_email_disabling?: boolean; - purchaser?: boolean; - push_at_channel_suppressed_channels?: string; - push_dm_alert?: boolean; - push_everything?: boolean; - push_idle_wait?: number; - push_loud_channels?: string; - push_loud_channels_set?: string; - push_mention_alert?: boolean; - push_mention_channels?: string; - push_show_preview?: boolean; - push_sound?: string; - reached_all_dms_disclosure?: boolean; - reaction_notifications?: string; - reminder_notification_time?: string; - require_at?: boolean; - saved_searches?: string; - saved_view?: string; - scdm_trial_offer_banner?: string; - search_channel_sort?: string; - search_exclude_bots?: boolean; - search_exclude_channels?: string; - search_file_sort?: string; - search_hide_deactivated_users?: boolean; - search_hide_my_channels?: boolean; - search_only_current_team?: boolean; - search_only_my_channels?: boolean; - search_only_show_online?: boolean; - search_people_sort?: string; - search_sort?: string; - seen_a11y_pref_setup_coachmark?: boolean; - seen_administration_menu?: boolean; - seen_app_space_coachmark?: boolean; - seen_app_space_tutorial?: boolean; - seen_bookmarks_intro?: boolean; - seen_calls_interactive_coachmark?: boolean; - seen_channel_browser_admin_coachmark?: boolean; - seen_channel_email_tooltip?: boolean; - seen_channel_search?: boolean; - seen_connect_dm_coachmark?: boolean; - seen_connect_section_coachmark?: boolean; - seen_contextual_message_shortcuts_modal?: boolean; - seen_corporate_export_alert?: boolean; - seen_custom_status_badge?: boolean; - seen_custom_status_callout?: boolean; - seen_custom_status_expiration_badge?: boolean; - seen_domain_invite_reminder?: boolean; - seen_drafts_section_coachmark?: boolean; - seen_edit_mode?: boolean; - seen_edit_mode_edu?: boolean; - seen_emoji_pack_cta?: number; - seen_emoji_pack_dialog?: boolean; - seen_emoji_update_overlay_coachmark?: boolean; - seen_existing_install_coachmark?: boolean; - seen_first_install_coachmark?: boolean; - seen_floating_sidebar_coachmark?: boolean; - seen_gdrive_coachmark?: boolean; - seen_guest_admin_slackbot_announcement?: boolean; - seen_highlights_arrows_coachmark?: boolean; - seen_highlights_coachmark?: boolean; - seen_highlights_warm_welcome?: boolean; - seen_ia_education?: boolean; - seen_intl_channel_names_coachmark?: boolean; - seen_japanese_locale_change_message?: boolean; - seen_keyboard_shortcuts_coachmark?: boolean; - seen_link_unfurl_coachmark?: boolean; - seen_locale_change_message?: number; - seen_markdown_paste_shortcut?: number; - seen_markdown_paste_toast?: number; - seen_member_invite_reminder?: boolean; - seen_message_navigation_educational_toast?: boolean; - seen_name_tagging_coachmark?: boolean; - seen_new_badge_in_more_menu_sidebar?: boolean; - seen_new_search_ui?: boolean; - seen_onboarding_banner?: boolean; - seen_onboarding_channels?: boolean; - seen_onboarding_direct_messages?: boolean; - seen_onboarding_invites?: boolean; - seen_onboarding_private_groups?: boolean; - seen_onboarding_recent_mentions?: boolean; - seen_onboarding_search?: boolean; - seen_onboarding_slackbot_conversation?: boolean; - seen_onboarding_starred_items?: boolean; - seen_onboarding_start?: boolean; - seen_onboarding_synth_view?: boolean; - seen_onboarding_synth_view_count?: number; - seen_onboarding_synth_view_count_v2?: number; - seen_onboarding_synth_view_v2?: boolean; - seen_p3_locale_change_message_ko_kr?: number; - seen_people_search?: boolean; - seen_people_search_count?: number; - seen_quickswitcher_shortcut_tip_count?: number; - seen_sc_menu_coachmark?: boolean; - seen_sc_page?: boolean; - seen_sc_page_banner?: boolean; - seen_schedule_send_coachmark?: boolean; - seen_sections_unreads_only_prompt_count?: number; - seen_sent_page_in_sidebar?: boolean; - seen_shared_channels_coachmark?: boolean; - seen_shared_channels_opt_in_change_message?: boolean; - seen_shdep_slackbot_message?: boolean; - seen_single_emoji_msg?: boolean; - seen_sonic_deluxe_toast?: number; - seen_ssb_prompt?: boolean; - seen_threads_notification_banner?: boolean; - seen_toast_new_locale_launch?: string; - seen_toast_new_locale_launch_ts?: number; - seen_unread_view_coachmark?: boolean; - seen_welcome_2?: boolean; - seen_workflow_builder_deluxe_toast?: boolean; - seen_wysiwyg_deluxe_toast?: boolean; - separate_private_channels?: boolean; - separate_shared_channels?: boolean; - set_a11y_prefs_new_user?: boolean; - set_tz_automatically?: boolean; - shdep_promo_code_submitted?: boolean; - should_show_connect_section?: boolean; - should_show_contextual_help_for_conversation_navigation?: boolean; - should_show_contextual_help_for_jump_to_conversation?: boolean; - should_show_contextual_help_for_section_navigation?: boolean; - should_show_contextual_help_for_thread_navigation?: boolean; - should_show_unsend_message_confirmation?: boolean; - show_all_skin_tones?: boolean; - show_autocomplete_help?: number; - show_ent_onboarding?: boolean; - show_gov_slack_context_bar_banner?: boolean; - show_ia_tour_relaunch?: number; - show_jumper_scores?: boolean; - show_memory_instrument?: boolean; - show_quick_reactions?: boolean; - show_shared_channels_education_banner?: boolean; - show_sidebar_avatars?: boolean; - show_sidebar_quickswitcher_button?: boolean; - show_typing?: boolean; - sidebar_behavior?: string; - sidebar_pref_dismissed_tip?: boolean; - sidebar_theme?: string; - sidebar_theme_custom_values?: string; - slack_connect_invite_should_badge_sidebar?: boolean; - snippet_editor_wrap_long_lines?: boolean; - spaces_new_xp_banner_dismissed?: boolean; - ss_emojis?: boolean; - ssb_space_window?: string; - start_scroll_at_oldest?: boolean; - suggestions_request_id?: string; - sunset_interactive_message_views?: number; - suppress_external_invites_from_compose_warning?: boolean; - suppress_link_warning?: boolean; - suppress_thread_mention_warning?: boolean; - synth_view_prefs?: string; - tab_ui_return_selects?: boolean; - tasks_view?: string; - threads_everything?: boolean; - time24?: boolean; - tractor_enabled?: boolean; - tractor_experiment_group?: string; - two_factor_auth_enabled?: boolean; - tz?: string; - underline_links?: boolean; - up_to_browse_kb_shortcut?: boolean; - used_custom_status_kb_shortcut?: boolean; - user_colors?: string; - user_customized_quick_reactions_display_feature?: number; - user_customized_quick_reactions_has_customized?: boolean; + a11y_animations?: boolean; + a11y_dyslexic?: boolean; + a11y_play_sound_for_incoming_dm?: boolean; + a11y_play_sound_for_incoming_dm_choice?: string; + a11y_play_sound_for_sent_dm?: boolean; + a11y_play_sound_for_sent_dm_choice?: string; + a11y_read_out_incoming_dm?: boolean; + a11y_screen_reader_message_label_date_time_first?: boolean; + activity_view?: string; + add_apps_prompt_dismissed?: boolean; + add_channel_prompt_dismissed?: boolean; + add_prompt_interacted?: boolean; + all_channels_loud?: boolean; + all_notifications_prefs?: string; + all_unreads_section_filter?: string; + all_unreads_sort_order?: string; + allow_calls_to_set_current_status?: boolean; + allow_cmd_tab_iss?: boolean; + allowed_unfurl_senders?: string; + analytics_upsell_coachmark_seen?: boolean; + app_manifest_schema_format?: string; + app_subdomain_check_completed?: number; + arrow_history?: boolean; + at_channel_suppressed_channels?: string; + box_enabled?: boolean; + browsers_dismissed_channels_low_results_education?: boolean; + browsers_dismissed_files_low_results_education?: boolean; + browsers_dismissed_initial_activity_education?: boolean; + browsers_dismissed_initial_drafts_education?: boolean; + browsers_dismissed_initial_saved_education?: boolean; + browsers_dismissed_people_low_results_education?: boolean; + browsers_dismissed_user_groups_low_results_education?: boolean; + browsers_seen_initial_activity_education?: boolean; + browsers_seen_initial_channels_education?: boolean; + browsers_seen_initial_drafts_education?: boolean; + browsers_seen_initial_files_education?: boolean; + browsers_seen_initial_people_education?: boolean; + browsers_seen_initial_saved_education?: boolean; + browsers_seen_initial_user_groups_education?: boolean; + calls_disconnect_on_lock?: boolean; + calls_survey_last_seen?: string; + channel_canvas_variant?: number; + channel_sections?: string; + channel_sidebar_hide_browse_dms_link?: boolean; + channel_sidebar_hide_invite?: boolean; + channel_sort?: string; + chime_access_check_completed?: number; + clicked_close_onboarding_synth_view_banner?: boolean; + client_logs_pri?: string; + clips_feedback_survey_last_trigger_attempt?: number; + color_names_in_list?: boolean; + composer_nux?: string; + confirm_clear_all_unreads?: boolean; + confirm_sh_call_start?: boolean; + confirm_user_marked_away?: boolean; + connect_dm_early_access?: boolean; + contextual_help_reset_count?: number; + contextual_message_shortcuts_modal_was_seen?: boolean; + convert_emoticons?: boolean; + deprecation_banner_last_seen?: number; + deprecation_modal_last_seen?: number; + deprecation_toast_last_seen?: number; + desktop_client_ids?: string; + dismissed_app_config_redesign_coachmark?: boolean; + dismissed_app_launcher_atlassian_promo?: boolean; + dismissed_app_launcher_limit?: boolean; + dismissed_app_launcher_welcome?: boolean; + dismissed_app_manifest_coachmark?: boolean; + dismissed_app_manifest_description?: boolean; + dismissed_banner_download_ssb_prompt?: boolean; + dismissed_connect_auto_approval_modal?: string; + dismissed_fullscreen_download_ssb_prompt?: boolean; + dismissed_gov_slack_first_time_popup?: boolean; + dismissed_installed_app_dm_suggestions?: string; + dismissed_scdm_education?: boolean; + dismissed_scroll_search_tooltip_count?: number; + dismissed_sent_page_education?: boolean; + display_display_names?: boolean; + display_real_names_override?: number; + dnd_after_friday?: string; + dnd_after_monday?: string; + dnd_after_saturday?: string; + dnd_after_sunday?: string; + dnd_after_thursday?: string; + dnd_after_tuesday?: string; + dnd_after_wednesday?: string; + dnd_before_friday?: string; + dnd_before_monday?: string; + dnd_before_saturday?: string; + dnd_before_sunday?: string; + dnd_before_thursday?: string; + dnd_before_tuesday?: string; + dnd_before_wednesday?: string; + dnd_custom_new_badge_seen?: boolean; + dnd_days?: string; + dnd_enabled?: boolean; + dnd_enabled_friday?: string; + dnd_enabled_monday?: string; + dnd_enabled_saturday?: string; + dnd_enabled_sunday?: string; + dnd_enabled_thursday?: string; + dnd_enabled_tuesday?: string; + dnd_enabled_wednesday?: string; + dnd_end_hour?: string; + dnd_notification_schedule_new_badge_seen?: boolean; + dnd_start_hour?: string; + dnd_weekdays_off_allday?: boolean; + dropbox_enabled?: boolean; + edge_upload_proxy_check_completed?: number; + email_alerts?: string; + email_alerts_sleep_until?: number; + email_developer?: boolean; + email_offers?: boolean; + email_research?: boolean; + email_tips?: boolean; + email_weekly?: boolean; + emoji_autocomplete_big?: boolean; + emoji_mode?: string; + emoji_packs_clicked_collection_cta?: boolean; + emoji_packs_clicked_picker_cta?: boolean; + emoji_packs_clicked_picker_post_install_cta?: boolean; + emoji_packs_most_recent_available_time?: number; + emoji_use?: string; + emoji_use_org?: string; + enable_all_dms_view?: boolean; + enable_app_browser_view?: boolean; + enable_app_config_redesign?: boolean; + enable_channel_browser_view?: boolean; + enable_drafts_view?: boolean; + enable_file_browser_view?: boolean; + enable_file_browser_view_for_docs?: boolean; + enable_hq_view?: boolean; + enable_later_view?: boolean; + enable_media_captions?: boolean; + enable_mentions_and_reactions_view?: boolean; + enable_people_browser_view?: boolean; + enable_quip_file_browser_view?: boolean; + enable_react_emoji_picker?: boolean; + enable_reminders_view?: boolean; + enable_saved_items_view?: boolean; + enable_scheduled_view?: boolean; + enable_sent_view?: boolean; + enable_shortcuts_view?: boolean; + enable_slack_connect_view?: boolean; + enable_slack_connect_view_2?: number; + enable_streamline_view?: boolean; + enable_unread_view?: boolean; + ent_org_wide_channels_sidebar?: boolean; + enter_is_special_in_tbt?: boolean; + enterprise_mdm_custom_msg?: string; + enterprise_migration_seen?: boolean; + expand_inline_imgs?: boolean; + expand_internal_inline_imgs?: boolean; + expand_non_media_attachments?: boolean; + expand_snippets?: boolean; + f_key_search?: boolean; + failover_proxy_check_completed?: number; + file_picker_variant?: number; + first_seen_new_badge_in_more_menu_sidebar?: number; + first_seen_sent_page_in_sidebar?: number; + flannel_server_pool?: string; + folder_data?: string; + folders_enabled?: boolean; + frecency?: string; + frecency_ent_jumper?: string; + frecency_jumper?: string; + fuller_timestamps?: boolean; + graphic_emoticons?: boolean; + growls_enabled?: boolean; + growth_all_banners_prefs?: string; + growth_msg_limit_approaching_cta_count?: number; + growth_msg_limit_approaching_cta_ts?: number; + growth_msg_limit_long_reached_cta_count?: number; + growth_msg_limit_long_reached_cta_last_ts?: number; + growth_msg_limit_reached_cta_count?: number; + growth_msg_limit_reached_cta_last_ts?: number; + growth_msg_limit_sixty_day_banner_cta_count?: number; + growth_msg_limit_sixty_day_banner_cta_last_ts?: number; + has_acknowledged_shortcut_speedbump?: boolean; + has_created_channel?: boolean; + has_created_channel_section?: boolean; + has_dismissed_google_directory_coachmark?: boolean; + has_drafted_message?: boolean; + has_invited?: boolean; + has_joined_huddle?: boolean; + has_received_mention_or_reaction?: boolean; + has_received_threaded_message?: boolean; + has_recently_shared_a_channel?: boolean; + has_searched?: boolean; + has_sent_ten_messages?: number; + has_starred_item?: boolean; + has_uploaded?: boolean; + has_used_quickswitcher_shortcut?: boolean; + help_flexpane_clips_card_seen?: boolean; + help_flexpane_slack_connect_card_seen?: boolean; + help_menu_open_timestamp?: number; + help_modal_consult_banner_dismissed?: boolean; + help_modal_open_timestamp?: number; + hidden_users?: string; + hide_external_members_sharing_speed_bump?: boolean; + hide_hex_swatch?: boolean; + hide_user_group_info_pane?: boolean; + highlight_words?: string; + huddle_invite_sound?: string; + huddle_survey_last_seen?: string; + huddles_allow_smart_notif?: boolean; + huddles_cc_by_default?: boolean; + huddles_chime_new_endpoints_check_completed?: number; + huddles_disconnect_on_lock?: boolean; + huddles_global_mute?: boolean; + huddles_mini_panel?: boolean; + huddles_mute_by_default?: boolean; + huddles_play_music_when_last?: boolean; + huddles_reactions_play_sound?: boolean; + huddles_reactions_read_out_loud?: boolean; + huddles_set_status?: boolean; + huddles_show_shouty_rooster?: boolean; + huddles_variant?: number; + ia_details_coachmark_seen?: boolean; + ia_platform_actions_lab?: number; + ia_slackbot_survey_timestamp_48h?: number; + ia_slackbot_survey_timestamp_7d?: number; + ia_top_nav_theme?: string; + iap1_lab?: number; + identity_links_global_prefs?: string; + identity_links_prefs?: string; + in_interactive_mas_migration_flow?: boolean; + in_prod_surveys_enabled?: boolean; + inbox_views_workspace_filter?: string; + invite_accepted_notifications_muted?: boolean; + join_calls_device_settings?: string; + joiner_message_suggestion_dismissed?: boolean; + joiner_notifications_muted?: boolean; + jumbomoji?: boolean; + k_key_omnibox?: boolean; + k_key_omnibox_auto_hide_count?: number; + last_dismissed_scroll_search_tooltip_timestamp?: number; + last_seen_at_channel_warning?: number; + last_seen_sections_unreads_only_prompt_timestamp?: number; + last_snippet_type?: string; + lessons_enabled?: boolean; + load_lato_2?: boolean; + locale?: string; + locales_enabled?: LocalesEnabled; + loud_channels?: string; + loud_channels_set?: string; + ls_disabled?: boolean; + mac_ssb_bounce?: string; + mac_ssb_bullet?: boolean; + mark_msgs_read_immediately?: boolean; + media_muted?: boolean; + media_playback_speed?: number; + media_volume?: number; + mentions_exclude_at_channels?: boolean; + mentions_exclude_at_user_groups?: boolean; + mentions_exclude_reactions?: boolean; + message_navigation_toast_was_seen?: boolean; + messages_theme?: string; + mobile_channel_list_show_all_dms?: boolean; + mobile_channel_list_sort?: string; + msg_input_send_btn?: boolean; + msg_input_send_btn_auto_set?: boolean; + msg_input_sticky_composer?: boolean; + mute_sounds?: boolean; + muted_channels?: string; + mx_calendar_type?: string; + needs_initial_password_set?: boolean; + never_channels?: string; + new_msg_snd?: string; + newxp_seen_help_message?: number; + newxp_seen_last_message?: number; + newxp_suggested_channels?: string; + no_created_overlays?: boolean; + no_invites_widget_in_sidebar?: boolean; + no_joined_overlays?: boolean; + no_macelectron_banner?: boolean; + no_macssb1_banner?: boolean; + no_macssb2_banner?: boolean; + no_omnibox_in_channels?: boolean; + no_text_in_notifications?: boolean; + no_winssb1_banner?: boolean; + notification_center_filters?: string; + notifications_view?: string; + obey_inline_img_limit?: boolean; + onboarding_cancelled?: boolean; + onboarding_complete?: boolean; + onboarding_slackbot_conversation_step?: number; + onboarding_state?: number; + onboarding_tip_opt_out?: boolean; + open_quip_doc_in_flexpane?: boolean; + opened_slackbot_dm?: boolean; + overloaded_message_enabled?: boolean; + pagekeys_handled?: boolean; + phc_dismissed?: string; + phc_viewed?: string; + plain_text_mode?: boolean; + posts_formatting_guide?: boolean; + preferred_skin_tone?: string; + privacy_policy_seen?: boolean; + progressive_disclosure_state?: string; + prompted_for_email_disabling?: boolean; + purchaser?: boolean; + push_at_channel_suppressed_channels?: string; + push_dm_alert?: boolean; + push_everything?: boolean; + push_idle_wait?: number; + push_loud_channels?: string; + push_loud_channels_set?: string; + push_mention_alert?: boolean; + push_mention_channels?: string; + push_show_preview?: boolean; + push_sound?: string; + reached_all_dms_disclosure?: boolean; + reaction_notifications?: string; + reminder_notification_time?: string; + require_at?: boolean; + saved_searches?: string; + saved_view?: string; + scdm_trial_offer_banner?: string; + search_channel_sort?: string; + search_exclude_bots?: boolean; + search_exclude_channels?: string; + search_file_sort?: string; + search_hide_deactivated_users?: boolean; + search_hide_my_channels?: boolean; + search_only_current_team?: boolean; + search_only_my_channels?: boolean; + search_only_show_online?: boolean; + search_people_sort?: string; + search_sort?: string; + seen_a11y_pref_setup_coachmark?: boolean; + seen_administration_menu?: boolean; + seen_app_space_coachmark?: boolean; + seen_app_space_tutorial?: boolean; + seen_bookmarks_intro?: boolean; + seen_calls_interactive_coachmark?: boolean; + seen_channel_browser_admin_coachmark?: boolean; + seen_channel_email_tooltip?: boolean; + seen_channel_search?: boolean; + seen_connect_dm_coachmark?: boolean; + seen_connect_section_coachmark?: boolean; + seen_contextual_message_shortcuts_modal?: boolean; + seen_corporate_export_alert?: boolean; + seen_custom_status_badge?: boolean; + seen_custom_status_callout?: boolean; + seen_custom_status_expiration_badge?: boolean; + seen_domain_invite_reminder?: boolean; + seen_drafts_section_coachmark?: boolean; + seen_edit_mode?: boolean; + seen_edit_mode_edu?: boolean; + seen_emoji_pack_cta?: number; + seen_emoji_pack_dialog?: boolean; + seen_emoji_update_overlay_coachmark?: boolean; + seen_existing_install_coachmark?: boolean; + seen_first_install_coachmark?: boolean; + seen_floating_sidebar_coachmark?: boolean; + seen_gdrive_coachmark?: boolean; + seen_guest_admin_slackbot_announcement?: boolean; + seen_highlights_arrows_coachmark?: boolean; + seen_highlights_coachmark?: boolean; + seen_highlights_warm_welcome?: boolean; + seen_ia_education?: boolean; + seen_intl_channel_names_coachmark?: boolean; + seen_japanese_locale_change_message?: boolean; + seen_keyboard_shortcuts_coachmark?: boolean; + seen_link_unfurl_coachmark?: boolean; + seen_locale_change_message?: number; + seen_markdown_paste_shortcut?: number; + seen_markdown_paste_toast?: number; + seen_member_invite_reminder?: boolean; + seen_message_navigation_educational_toast?: boolean; + seen_name_tagging_coachmark?: boolean; + seen_new_badge_in_more_menu_sidebar?: boolean; + seen_new_search_ui?: boolean; + seen_onboarding_banner?: boolean; + seen_onboarding_channels?: boolean; + seen_onboarding_direct_messages?: boolean; + seen_onboarding_invites?: boolean; + seen_onboarding_private_groups?: boolean; + seen_onboarding_recent_mentions?: boolean; + seen_onboarding_search?: boolean; + seen_onboarding_slackbot_conversation?: boolean; + seen_onboarding_starred_items?: boolean; + seen_onboarding_start?: boolean; + seen_onboarding_synth_view?: boolean; + seen_onboarding_synth_view_count?: number; + seen_onboarding_synth_view_count_v2?: number; + seen_onboarding_synth_view_v2?: boolean; + seen_p3_locale_change_message_ko_kr?: number; + seen_people_search?: boolean; + seen_people_search_count?: number; + seen_quickswitcher_shortcut_tip_count?: number; + seen_sc_menu_coachmark?: boolean; + seen_sc_page?: boolean; + seen_sc_page_banner?: boolean; + seen_schedule_send_coachmark?: boolean; + seen_sections_unreads_only_prompt_count?: number; + seen_sent_page_in_sidebar?: boolean; + seen_shared_channels_coachmark?: boolean; + seen_shared_channels_opt_in_change_message?: boolean; + seen_shdep_slackbot_message?: boolean; + seen_single_emoji_msg?: boolean; + seen_sonic_deluxe_toast?: number; + seen_ssb_prompt?: boolean; + seen_threads_notification_banner?: boolean; + seen_toast_new_locale_launch?: string; + seen_toast_new_locale_launch_ts?: number; + seen_unread_view_coachmark?: boolean; + seen_welcome_2?: boolean; + seen_workflow_builder_deluxe_toast?: boolean; + seen_wysiwyg_deluxe_toast?: boolean; + separate_private_channels?: boolean; + separate_shared_channels?: boolean; + set_a11y_prefs_new_user?: boolean; + set_tz_automatically?: boolean; + shdep_promo_code_submitted?: boolean; + should_show_connect_section?: boolean; + should_show_contextual_help_for_conversation_navigation?: boolean; + should_show_contextual_help_for_jump_to_conversation?: boolean; + should_show_contextual_help_for_section_navigation?: boolean; + should_show_contextual_help_for_thread_navigation?: boolean; + should_show_unsend_message_confirmation?: boolean; + show_all_skin_tones?: boolean; + show_autocomplete_help?: number; + show_ent_onboarding?: boolean; + show_gov_slack_context_bar_banner?: boolean; + show_ia_tour_relaunch?: number; + show_jumper_scores?: boolean; + show_memory_instrument?: boolean; + show_quick_reactions?: boolean; + show_shared_channels_education_banner?: boolean; + show_sidebar_avatars?: boolean; + show_sidebar_quickswitcher_button?: boolean; + show_typing?: boolean; + sidebar_behavior?: string; + sidebar_pref_dismissed_tip?: boolean; + sidebar_theme?: string; + sidebar_theme_custom_values?: string; + slack_connect_invite_should_badge_sidebar?: boolean; + snippet_editor_wrap_long_lines?: boolean; + spaces_new_xp_banner_dismissed?: boolean; + ss_emojis?: boolean; + ssb_space_window?: string; + start_scroll_at_oldest?: boolean; + suggestions_request_id?: string; + sunset_interactive_message_views?: number; + suppress_external_invites_from_compose_warning?: boolean; + suppress_link_warning?: boolean; + suppress_thread_mention_warning?: boolean; + synth_view_prefs?: string; + tab_ui_return_selects?: boolean; + tasks_view?: string; + threads_everything?: boolean; + time24?: boolean; + tractor_enabled?: boolean; + tractor_experiment_group?: string; + two_factor_auth_enabled?: boolean; + tz?: string; + underline_links?: boolean; + up_to_browse_kb_shortcut?: boolean; + used_custom_status_kb_shortcut?: boolean; + user_colors?: string; + user_customized_quick_reactions_display_feature?: number; + user_customized_quick_reactions_has_customized?: boolean; user_customized_quick_reactions_use_frequently_used_emoji?: boolean; - user_expectations_survey_last_trigger_attempt?: number; - webapp_spellcheck?: boolean; - welcome_message_hidden?: boolean; - welcome_place_state?: string; - whats_new_read?: number; - who_can_see_account_by_searching_email?: string; - who_can_share_contact_card?: string; - whocanseethis_dm_mpdm_badge?: boolean; - workflow_builder_coachmarks?: string; - workflow_builder_intro_modal_clicked_through?: boolean; - xws_dismissed_education?: boolean; - xws_seen_education?: number; - xws_sidebar_variant?: number; + user_expectations_survey_last_trigger_attempt?: number; + webapp_spellcheck?: boolean; + welcome_message_hidden?: boolean; + welcome_place_state?: string; + whats_new_read?: number; + who_can_see_account_by_searching_email?: string; + who_can_share_contact_card?: string; + whocanseethis_dm_mpdm_badge?: boolean; + workflow_builder_coachmarks?: string; + workflow_builder_intro_modal_clicked_through?: boolean; + xws_dismissed_education?: boolean; + xws_seen_education?: number; + xws_sidebar_variant?: number; } export interface LocalesEnabled { @@ -1917,288 +1916,288 @@ export interface LocalesEnabled { } export interface Subteams { - all?: All[]; + all?: All[]; self?: string[]; } export interface All { - auto_provision?: boolean; - channel_count?: number; - created_by?: string; - date_create?: number; - date_delete?: number; - date_update?: number; - description?: string; + auto_provision?: boolean; + channel_count?: number; + created_by?: string; + date_create?: number; + date_delete?: number; + date_update?: number; + description?: string; enterprise_subteam_id?: string; - handle?: string; - id?: string; - is_external?: boolean; - is_subteam?: boolean; - is_usergroup?: boolean; - name?: string; - prefs?: AllPrefs; - team_id?: string; - updated_by?: string; - user_count?: number; + handle?: string; + id?: string; + is_external?: boolean; + is_subteam?: boolean; + is_usergroup?: boolean; + name?: string; + prefs?: AllPrefs; + team_id?: string; + updated_by?: string; + user_count?: number; } export interface AllPrefs { channels?: string[]; - groups?: Group[]; + groups?: Group[]; } export interface Team { - avatar_base_url?: string; - date_create?: number; - domain?: string; - email_domain?: string; - icon?: Icon; - id?: string; - is_verified?: boolean; - limit_ts?: number; - messages_count?: number; - msg_edit_window_mins?: number; - name?: string; + avatar_base_url?: string; + date_create?: number; + domain?: string; + email_domain?: string; + icon?: Icon; + id?: string; + is_verified?: boolean; + limit_ts?: number; + messages_count?: number; + msg_edit_window_mins?: number; + name?: string; onboarding_channel_id?: string; - over_storage_limit?: boolean; - plan?: string; - prefs?: TeamPrefs; - url?: string; + over_storage_limit?: boolean; + plan?: string; + prefs?: TeamPrefs; + url?: string; } export interface Icon { - image_102?: string; - image_132?: string; - image_230?: string; - image_34?: string; - image_44?: string; - image_68?: string; - image_88?: string; + image_102?: string; + image_132?: string; + image_230?: string; + image_34?: string; + image_44?: string; + image_68?: string; + image_88?: string; image_original?: string; } export interface TeamPrefs { - admin_customized_quick_reactions?: string[]; - all_users_can_purchase?: boolean; - allow_admin_retention_override?: number; - allow_audio_clip_sharing_slack_connect?: boolean; - allow_audio_clips?: boolean; - allow_box_cfs?: boolean; - allow_calls?: boolean; - allow_calls_interactive_screen_sharing?: boolean; - allow_clip_downloads?: string; - allow_free_automated_trials?: boolean; - allow_huddles?: boolean; - allow_huddles_transcriptions?: boolean; - allow_huddles_video?: boolean; - allow_media_transcriptions?: boolean; - allow_message_deletion?: boolean; - allow_retention_override?: boolean; - allow_spaceship?: string; - allow_sponsored_slack_connections?: boolean; - allow_video_clip_sharing_slack_connect?: boolean; - allow_video_clips?: boolean; - app_dir_only?: boolean; - app_management_apps?: string[]; - app_whitelist_enabled?: boolean; - auth_mode?: string; - block_file_download?: boolean; - box_app_installed?: boolean; - calls_apps?: CallsApps; - calls_locations?: string[]; - can_accept_slack_connect_channel_invites?: boolean; - can_create_external_limited_invite?: boolean; - can_create_slack_connect_channel_invite?: boolean; - can_receive_shared_channels_invites?: boolean; - channel_email_addresses_enabled?: boolean; - compliance_export_start?: number; - content_review_enabled?: boolean; - created_with_google?: boolean; - custom_status_default_emoji?: string; - custom_status_presets?: Array; - daily_prompts_enabled?: boolean; - default_channel_creation_enabled?: boolean; - default_channels?: string[]; - default_create_private_channel?: boolean; - default_rxns?: string[]; - disable_email_ingestion?: boolean; - disable_file_deleting?: boolean; - disable_file_editing?: boolean; - disable_file_uploads?: string; - disable_sidebar_connect_prompts?: string[]; - disable_sidebar_install_prompts?: string[]; - disallow_public_file_urls?: boolean; - discoverable?: string; - display_anniversary_celebration?: boolean; - display_default_phone?: boolean; - display_email_addresses?: boolean; - display_external_email_addresses?: boolean; - display_name_pronunciation?: boolean; - display_new_hire_celebration?: boolean; - display_pronouns?: boolean; - display_real_names?: boolean; - dm_retention_duration?: number; - dm_retention_redaction_duration?: number; - dm_retention_type?: number; - dnd_after_friday?: string; - dnd_after_monday?: string; - dnd_after_saturday?: string; - dnd_after_sunday?: string; - dnd_after_thursday?: string; - dnd_after_tuesday?: string; - dnd_after_wednesday?: string; - dnd_before_friday?: string; - dnd_before_monday?: string; - dnd_before_saturday?: string; - dnd_before_sunday?: string; - dnd_before_thursday?: string; - dnd_before_tuesday?: string; - dnd_before_wednesday?: string; - dnd_days?: string; - dnd_enabled?: boolean; - dnd_enabled_friday?: string; - dnd_enabled_monday?: string; - dnd_enabled_saturday?: string; - dnd_enabled_sunday?: string; - dnd_enabled_thursday?: string; - dnd_enabled_tuesday?: string; - dnd_enabled_wednesday?: string; - dnd_end_hour?: string; - dnd_start_hour?: string; - dnd_weekdays_off_allday?: boolean; - dropbox_legacy_picker?: boolean; - emoji_only_admins?: boolean; - enable_connect_dm_early_access?: boolean; - enable_domain_allowlist_for_cea?: boolean; - enable_info_barriers?: boolean; - enable_mpdm_to_private_channel_conversion?: boolean; - enable_shared_channels?: number; - enterprise_default_channels?: string[]; - enterprise_has_corporate_exports?: boolean; - enterprise_intune_enabled?: boolean; - enterprise_mandatory_channels?: string[]; - enterprise_mdm_date_enabled?: number; - enterprise_mdm_disable_file_download?: boolean; - enterprise_mdm_level?: number; - enterprise_mdm_token?: string; - enterprise_mobile_device_check?: boolean; - enterprise_team_creation_request?: EnterpriseTeamCreationRequest; - ext_audit_log_retention_duration?: number; - ext_audit_log_retention_type?: number; - file_limit_whitelisted?: boolean; - file_retention_duration?: number; - file_retention_type?: number; - filepicker_app_first_install?: boolean; - gdrive_enabled_team?: boolean; - gg_enabled?: boolean; - group_retention_duration?: number; - group_retention_type?: number; - has_compliance_export?: boolean; - has_hipaa_compliance?: boolean; - has_seen_partner_promo?: boolean; - hermes_has_accepted_tos?: boolean; + admin_customized_quick_reactions?: string[]; + all_users_can_purchase?: boolean; + allow_admin_retention_override?: number; + allow_audio_clip_sharing_slack_connect?: boolean; + allow_audio_clips?: boolean; + allow_box_cfs?: boolean; + allow_calls?: boolean; + allow_calls_interactive_screen_sharing?: boolean; + allow_clip_downloads?: string; + allow_free_automated_trials?: boolean; + allow_huddles?: boolean; + allow_huddles_transcriptions?: boolean; + allow_huddles_video?: boolean; + allow_media_transcriptions?: boolean; + allow_message_deletion?: boolean; + allow_retention_override?: boolean; + allow_spaceship?: string; + allow_sponsored_slack_connections?: boolean; + allow_video_clip_sharing_slack_connect?: boolean; + allow_video_clips?: boolean; + app_dir_only?: boolean; + app_management_apps?: string[]; + app_whitelist_enabled?: boolean; + auth_mode?: string; + block_file_download?: boolean; + box_app_installed?: boolean; + calls_apps?: CallsApps; + calls_locations?: string[]; + can_accept_slack_connect_channel_invites?: boolean; + can_create_external_limited_invite?: boolean; + can_create_slack_connect_channel_invite?: boolean; + can_receive_shared_channels_invites?: boolean; + channel_email_addresses_enabled?: boolean; + compliance_export_start?: number; + content_review_enabled?: boolean; + created_with_google?: boolean; + custom_status_default_emoji?: string; + custom_status_presets?: Array; + daily_prompts_enabled?: boolean; + default_channel_creation_enabled?: boolean; + default_channels?: string[]; + default_create_private_channel?: boolean; + default_rxns?: string[]; + disable_email_ingestion?: boolean; + disable_file_deleting?: boolean; + disable_file_editing?: boolean; + disable_file_uploads?: string; + disable_sidebar_connect_prompts?: string[]; + disable_sidebar_install_prompts?: string[]; + disallow_public_file_urls?: boolean; + discoverable?: string; + display_anniversary_celebration?: boolean; + display_default_phone?: boolean; + display_email_addresses?: boolean; + display_external_email_addresses?: boolean; + display_name_pronunciation?: boolean; + display_new_hire_celebration?: boolean; + display_pronouns?: boolean; + display_real_names?: boolean; + dm_retention_duration?: number; + dm_retention_redaction_duration?: number; + dm_retention_type?: number; + dnd_after_friday?: string; + dnd_after_monday?: string; + dnd_after_saturday?: string; + dnd_after_sunday?: string; + dnd_after_thursday?: string; + dnd_after_tuesday?: string; + dnd_after_wednesday?: string; + dnd_before_friday?: string; + dnd_before_monday?: string; + dnd_before_saturday?: string; + dnd_before_sunday?: string; + dnd_before_thursday?: string; + dnd_before_tuesday?: string; + dnd_before_wednesday?: string; + dnd_days?: string; + dnd_enabled?: boolean; + dnd_enabled_friday?: string; + dnd_enabled_monday?: string; + dnd_enabled_saturday?: string; + dnd_enabled_sunday?: string; + dnd_enabled_thursday?: string; + dnd_enabled_tuesday?: string; + dnd_enabled_wednesday?: string; + dnd_end_hour?: string; + dnd_start_hour?: string; + dnd_weekdays_off_allday?: boolean; + dropbox_legacy_picker?: boolean; + emoji_only_admins?: boolean; + enable_connect_dm_early_access?: boolean; + enable_domain_allowlist_for_cea?: boolean; + enable_info_barriers?: boolean; + enable_mpdm_to_private_channel_conversion?: boolean; + enable_shared_channels?: number; + enterprise_default_channels?: string[]; + enterprise_has_corporate_exports?: boolean; + enterprise_intune_enabled?: boolean; + enterprise_mandatory_channels?: string[]; + enterprise_mdm_date_enabled?: number; + enterprise_mdm_disable_file_download?: boolean; + enterprise_mdm_level?: number; + enterprise_mdm_token?: string; + enterprise_mobile_device_check?: boolean; + enterprise_team_creation_request?: EnterpriseTeamCreationRequest; + ext_audit_log_retention_duration?: number; + ext_audit_log_retention_type?: number; + file_limit_whitelisted?: boolean; + file_retention_duration?: number; + file_retention_type?: number; + filepicker_app_first_install?: boolean; + gdrive_enabled_team?: boolean; + gg_enabled?: boolean; + group_retention_duration?: number; + group_retention_type?: number; + has_compliance_export?: boolean; + has_hipaa_compliance?: boolean; + has_seen_partner_promo?: boolean; + hermes_has_accepted_tos?: boolean; hermes_triggers_trippable_by_slack_connected_teams?: boolean; - hide_gsuite_invite_option?: boolean; - hide_referers?: boolean; - identity_links_prefs?: EnterpriseTeamCreationRequest; - invite_requests_enabled?: boolean; - invited_user_preset?: InvitedUserPreset; - invites_limit?: boolean; - invites_only_admins?: boolean; - joiner_notifications_enabled?: boolean; - loading_only_admins?: boolean; - locale?: string; - loud_channel_mentions_limit?: number; - magic_unfurls_enabled?: boolean; - member_analytics_disabled?: boolean; - ml_opt_out?: boolean; - mobile_passcode_timeout_in_seconds?: number; - mobile_session_duration?: number; - msg_edit_window_mins?: number; - notification_redaction_type?: string; - notify_pending_enabled?: boolean; - ntlm_credential_domains?: string; - onedrive_app_installed?: boolean; - onedrive_enabled_team?: boolean; - private_channel_membership_limit?: number; - private_retention_redaction_duration?: number; - public_retention_redaction_duration?: number; - received_esc_route_to_channel_awareness_message?: boolean; - retention_duration?: number; - retention_type?: number; - rich_previews_default?: string; - saml_enable?: boolean; - search_feedback_opt_out?: boolean; - self_serve_select?: boolean; - session_duration?: number; - session_duration_type?: number; - show_join_leave?: boolean; - show_legacy_paid_benefits_page?: boolean; - show_mobile_promos?: boolean; - sign_in_with_slack_default?: string; - sign_in_with_slack_disabled?: boolean; - single_user_exports?: boolean; - slack_connect_account_visibility?: string; - slack_connect_allowed_workspaces?: SlackConnectAllowedWorkspaces; - slack_connect_approval_type?: string; - slack_connect_dm_only_verified_orgs?: boolean; - slack_connect_file_upload_sharing_enabled?: boolean; - slackbot_responses_disabled?: boolean; - slackbot_responses_only_admins?: boolean; - spaceship_workspace_setting_visible?: boolean; - sso_disable_emails?: boolean; - sso_optional?: boolean; - sso_signup_restrictions?: number; - sso_sync_with_provider?: boolean; - stats_only_admins?: boolean; - subteams_auto_create_admin?: boolean; - subteams_auto_create_owner?: boolean; - thorn_safer_scan?: boolean; - two_factor_auth_required?: number; - uneditable_user_profile_fields?: string[]; - use_browser_picker?: boolean; - uses_customized_custom_status_presets?: boolean; - warn_before_at_channel?: string; - warn_user_before_logout?: boolean; - warn_user_before_logout_desktop?: boolean; - warn_user_before_logout_mobile?: boolean; - welcome_place_enabled?: boolean; - who_can_accept_slack_connect_channel_invites?: SlackConnectAllowedWorkspaces; - who_can_archive_channels?: string; - who_can_at_channel?: string; - who_can_at_everyone?: string; - who_can_change_team_profile?: string; - who_can_create_channel_email_addresses?: SlackConnectAllowedWorkspaces; - who_can_create_channels?: string; - who_can_create_delete_user_groups?: string; - who_can_create_external_limited_invite?: SlackConnectAllowedWorkspaces; - who_can_create_groups?: string; - who_can_create_shared_channels?: string; - who_can_create_slack_connect_channel_invite?: SlackConnectAllowedWorkspaces; - who_can_create_workflows?: SlackConnectAllowedWorkspaces; - who_can_dm_anyone?: SlackConnectAllowedWorkspaces; - who_can_edit_user_groups?: string; - who_can_kick_channels?: string; - who_can_kick_groups?: string; - who_can_manage_channel_posting_prefs?: string; - who_can_manage_ext_shared_channels?: SlackConnectAllowedWorkspaces; - who_can_manage_guests?: SlackConnectAllowedWorkspaces; - who_can_manage_integrations?: SlackConnectAllowedWorkspaces; - who_can_manage_private_channels?: WhoCanManageP; + hide_gsuite_invite_option?: boolean; + hide_referers?: boolean; + identity_links_prefs?: EnterpriseTeamCreationRequest; + invite_requests_enabled?: boolean; + invited_user_preset?: InvitedUserPreset; + invites_limit?: boolean; + invites_only_admins?: boolean; + joiner_notifications_enabled?: boolean; + loading_only_admins?: boolean; + locale?: string; + loud_channel_mentions_limit?: number; + magic_unfurls_enabled?: boolean; + member_analytics_disabled?: boolean; + ml_opt_out?: boolean; + mobile_passcode_timeout_in_seconds?: number; + mobile_session_duration?: number; + msg_edit_window_mins?: number; + notification_redaction_type?: string; + notify_pending_enabled?: boolean; + ntlm_credential_domains?: string; + onedrive_app_installed?: boolean; + onedrive_enabled_team?: boolean; + private_channel_membership_limit?: number; + private_retention_redaction_duration?: number; + public_retention_redaction_duration?: number; + received_esc_route_to_channel_awareness_message?: boolean; + retention_duration?: number; + retention_type?: number; + rich_previews_default?: string; + saml_enable?: boolean; + search_feedback_opt_out?: boolean; + self_serve_select?: boolean; + session_duration?: number; + session_duration_type?: number; + show_join_leave?: boolean; + show_legacy_paid_benefits_page?: boolean; + show_mobile_promos?: boolean; + sign_in_with_slack_default?: string; + sign_in_with_slack_disabled?: boolean; + single_user_exports?: boolean; + slack_connect_account_visibility?: string; + slack_connect_allowed_workspaces?: SlackConnectAllowedWorkspaces; + slack_connect_approval_type?: string; + slack_connect_dm_only_verified_orgs?: boolean; + slack_connect_file_upload_sharing_enabled?: boolean; + slackbot_responses_disabled?: boolean; + slackbot_responses_only_admins?: boolean; + spaceship_workspace_setting_visible?: boolean; + sso_disable_emails?: boolean; + sso_optional?: boolean; + sso_signup_restrictions?: number; + sso_sync_with_provider?: boolean; + stats_only_admins?: boolean; + subteams_auto_create_admin?: boolean; + subteams_auto_create_owner?: boolean; + thorn_safer_scan?: boolean; + two_factor_auth_required?: number; + uneditable_user_profile_fields?: string[]; + use_browser_picker?: boolean; + uses_customized_custom_status_presets?: boolean; + warn_before_at_channel?: string; + warn_user_before_logout?: boolean; + warn_user_before_logout_desktop?: boolean; + warn_user_before_logout_mobile?: boolean; + welcome_place_enabled?: boolean; + who_can_accept_slack_connect_channel_invites?: SlackConnectAllowedWorkspaces; + who_can_archive_channels?: string; + who_can_at_channel?: string; + who_can_at_everyone?: string; + who_can_change_team_profile?: string; + who_can_create_channel_email_addresses?: SlackConnectAllowedWorkspaces; + who_can_create_channels?: string; + who_can_create_delete_user_groups?: string; + who_can_create_external_limited_invite?: SlackConnectAllowedWorkspaces; + who_can_create_groups?: string; + who_can_create_shared_channels?: string; + who_can_create_slack_connect_channel_invite?: SlackConnectAllowedWorkspaces; + who_can_create_workflows?: SlackConnectAllowedWorkspaces; + who_can_dm_anyone?: SlackConnectAllowedWorkspaces; + who_can_edit_user_groups?: string; + who_can_kick_channels?: string; + who_can_kick_groups?: string; + who_can_manage_channel_posting_prefs?: string; + who_can_manage_ext_shared_channels?: SlackConnectAllowedWorkspaces; + who_can_manage_guests?: SlackConnectAllowedWorkspaces; + who_can_manage_integrations?: SlackConnectAllowedWorkspaces; + who_can_manage_private_channels?: WhoCanManageP; who_can_manage_private_channels_at_workspace_level?: WhoCanManageP; - who_can_manage_public_channels?: WhoCanManageP; - who_can_manage_shared_channels?: SlackConnectAllowedWorkspaces; - who_can_post_general?: string; - who_can_post_in_shared_channels?: SlackConnectAllowedWorkspaces; - who_can_request_ext_shared_channels?: SlackConnectAllowedWorkspaces; - who_can_review_flagged_content?: SlackConnectAllowedWorkspaces; - who_can_use_hermes?: WhoCanUseHermes; - who_can_view_message_activity?: SlackConnectAllowedWorkspaces; - workflow_builder_enabled?: boolean; - workflow_extension_steps_beta_opt_in?: boolean; - workflow_extension_steps_enabled?: boolean; - workflows_export_csv_enabled?: boolean; - workflows_webhook_trigger_enabled?: boolean; + who_can_manage_public_channels?: WhoCanManageP; + who_can_manage_shared_channels?: SlackConnectAllowedWorkspaces; + who_can_post_general?: string; + who_can_post_in_shared_channels?: SlackConnectAllowedWorkspaces; + who_can_request_ext_shared_channels?: SlackConnectAllowedWorkspaces; + who_can_review_flagged_content?: SlackConnectAllowedWorkspaces; + who_can_use_hermes?: WhoCanUseHermes; + who_can_view_message_activity?: SlackConnectAllowedWorkspaces; + workflow_builder_enabled?: boolean; + workflow_extension_steps_beta_opt_in?: boolean; + workflow_extension_steps_enabled?: boolean; + workflows_export_csv_enabled?: boolean; + workflows_webhook_trigger_enabled?: boolean; } export interface CallsApps { @@ -2207,9 +2206,9 @@ export interface CallsApps { } export interface Video { - id?: string; + id?: string; image?: string; - name?: string; + name?: string; } export interface EnterpriseTeamCreationRequest { @@ -2231,71 +2230,71 @@ export interface WhoCanManageP { export interface WhoCanUseHermes { subteam?: string[]; - type?: string[]; - user?: string[]; + type?: string[]; + user?: string[]; } export interface User { - color?: string; - deleted?: boolean; - id?: string; - is_admin?: boolean; - is_app_user?: boolean; - is_bot?: boolean; - is_email_confirmed?: boolean; - is_invited_user?: boolean; - is_owner?: boolean; - is_primary_owner?: boolean; - is_restricted?: boolean; - is_ultra_restricted?: boolean; - is_workflow_bot?: boolean; - name?: string; - presence?: string; - profile?: Profile; - real_name?: string; - team_id?: string; - tz?: string; - tz_label?: string; - tz_offset?: number; - updated?: number; + color?: string; + deleted?: boolean; + id?: string; + is_admin?: boolean; + is_app_user?: boolean; + is_bot?: boolean; + is_email_confirmed?: boolean; + is_invited_user?: boolean; + is_owner?: boolean; + is_primary_owner?: boolean; + is_restricted?: boolean; + is_ultra_restricted?: boolean; + is_workflow_bot?: boolean; + name?: string; + presence?: string; + profile?: Profile; + real_name?: string; + team_id?: string; + tz?: string; + tz_label?: string; + tz_offset?: number; + updated?: number; who_can_share_contact_card?: string; } export interface Profile { - always_active?: boolean; - api_app_id?: string; - avatar_hash?: string; - bot_id?: Id; - display_name?: string; - display_name_normalized?: string; - email?: string; - fields?: Fields; - first_name?: string; - guest_invited_by?: string; - huddle_state?: string; + always_active?: boolean; + api_app_id?: string; + avatar_hash?: string; + bot_id?: Id; + display_name?: string; + display_name_normalized?: string; + email?: string; + fields?: Fields; + first_name?: string; + guest_invited_by?: string; + huddle_state?: string; huddle_state_expiration_ts?: number; - image_1024?: string; - image_192?: string; - image_24?: string; - image_32?: string; - image_48?: string; - image_512?: string; - image_72?: string; - image_original?: string; - is_custom_image?: boolean; - last_name?: string; - phone?: string; - pronouns?: string; - real_name?: string; - real_name_normalized?: string; - skype?: string; - status_emoji?: string; - status_emoji_display_info?: StatusEmojiDisplayInfo[]; - status_expiration?: number; - status_text?: string; - status_text_canonical?: string; - team?: string; - title?: string; + image_1024?: string; + image_192?: string; + image_24?: string; + image_32?: string; + image_48?: string; + image_512?: string; + image_72?: string; + image_original?: string; + is_custom_image?: boolean; + last_name?: string; + phone?: string; + pronouns?: string; + real_name?: string; + real_name_normalized?: string; + skype?: string; + status_emoji?: string; + status_emoji_display_info?: StatusEmojiDisplayInfo[]; + status_expiration?: number; + status_text?: string; + status_text_canonical?: string; + team?: string; + title?: string; } export interface Fields { @@ -2303,13 +2302,13 @@ export interface Fields { } export interface Xf019LT13Z16 { - alt?: string; + alt?: string; value?: string; } export interface StatusEmojiDisplayInfo { display_alias?: string; - display_url?: string; - emoji_name?: string; - unicode?: string; + display_url?: string; + emoji_name?: string; + unicode?: string; } diff --git a/packages/web-api/src/types/response/SearchAllResponse.ts b/packages/web-api/src/types/response/SearchAllResponse.ts index baa23d576..d79529263 100644 --- a/packages/web-api/src/types/response/SearchAllResponse.ts +++ b/packages/web-api/src/types/response/SearchAllResponse.ts @@ -8,233 +8,233 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type SearchAllResponse = WebAPICallResult & { - error?: string; - files?: Files; + error?: string; + files?: Files; messages?: Messages; - needed?: string; - ok?: boolean; - posts?: Posts; + needed?: string; + ok?: boolean; + posts?: Posts; provided?: string; - query?: string; + query?: string; }; export interface Files { - matches?: FilesMatch[]; + matches?: FilesMatch[]; pagination?: Pagination; - paging?: Paging; - total?: number; + paging?: Paging; + total?: number; } export interface FilesMatch { - access?: string; - attachments?: Attachment[]; - bot_id?: string; - cc?: Cc[]; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - edit_link?: string; - editable?: boolean; - editors?: LastEditor[]; - editors_count?: number; - external_id?: string; - external_type?: string; - external_url?: string; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: MatchHeaders; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: LastEditor; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - non_owner_editable?: boolean; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: number; - original_w?: number; - permalink?: string; - permalink_public?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + attachments?: Attachment[]; + bot_id?: string; + cc?: Cc[]; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + edit_link?: string; + editable?: boolean; + editors?: LastEditor[]; + editors_count?: number; + external_id?: string; + external_type?: string; + external_url?: string; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: MatchHeaders; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: LastEditor; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + non_owner_editable?: boolean; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: number; + original_w?: number; + permalink?: string; + permalink_public?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - sent_to_self?: boolean; - shares?: MatchShares; - size?: number; - subject?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: string[]; - thumb_1024?: string; - thumb_1024_h?: number; - thumb_1024_w?: number; - thumb_160?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: number; - thumb_360_w?: number; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: number; - thumb_480_w?: number; - thumb_64?: string; - thumb_720?: string; - thumb_720_h?: number; - thumb_720_w?: number; - thumb_80?: string; - thumb_800?: string; - thumb_800_h?: number; - thumb_800_w?: number; - thumb_960?: string; - thumb_960_h?: number; - thumb_960_w?: number; - thumb_pdf?: string; - thumb_pdf_h?: number; - thumb_pdf_w?: number; - thumb_tiny?: string; - thumb_video?: string; - timestamp?: number; - title?: string; - title_blocks?: MatchTitleBlock[]; - to?: Cc[]; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: LastEditor; - user_team?: UserTeam; - username?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + sent_to_self?: boolean; + shares?: MatchShares; + size?: number; + subject?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: string[]; + thumb_1024?: string; + thumb_1024_h?: number; + thumb_1024_w?: number; + thumb_160?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: number; + thumb_360_w?: number; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: number; + thumb_480_w?: number; + thumb_64?: string; + thumb_720?: string; + thumb_720_h?: number; + thumb_720_w?: number; + thumb_80?: string; + thumb_800?: string; + thumb_800_h?: number; + thumb_800_w?: number; + thumb_960?: string; + thumb_960_h?: number; + thumb_960_w?: number; + thumb_pdf?: string; + thumb_pdf_h?: number; + thumb_pdf_w?: number; + thumb_tiny?: string; + thumb_video?: string; + timestamp?: number; + title?: string; + title_blocks?: MatchTitleBlock[]; + to?: Cc[]; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: LastEditor; + user_team?: UserTeam; + username?: string; } export interface Attachment { - actions?: Action[]; - app_id?: string; - app_unfurl_url?: string; - author_icon?: string; - author_id?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - blocks?: AttachmentBlock[]; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - channel_team?: string; - color?: string; - fallback?: string; - fields?: AttachmentField[]; - file_id?: string; - filename?: string; - files?: FileElement[]; - footer?: string; - footer_icon?: string; - from_url?: string; - hide_border?: boolean; - hide_color?: boolean; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_file_attachment?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_id?: string; + app_unfurl_url?: string; + author_icon?: string; + author_id?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + blocks?: AttachmentBlock[]; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + channel_team?: string; + color?: string; + fallback?: string; + fields?: AttachmentField[]; + file_id?: string; + filename?: string; + files?: FileElement[]; + footer?: string; + footer_icon?: string; + from_url?: string; + hide_border?: boolean; + hide_color?: boolean; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_file_attachment?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - list?: List; - list_record?: PurpleListRecord; - list_record_id?: string; - list_records?: ListRecordElement[]; - list_schema?: Schema[]; - list_view?: View; - list_view_id?: string; - message_blocks?: MessageBlock[]; - metadata?: AttachmentMetadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - preview?: Preview; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; - video_url?: string; + list?: List; + list_record?: PurpleListRecord; + list_record_id?: string; + list_records?: ListRecordElement[]; + list_schema?: Schema[]; + list_view?: View; + list_view_id?: string; + message_blocks?: MessageBlock[]; + metadata?: AttachmentMetadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + preview?: Preview; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; + video_url?: string; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: ActionOptionGroup[]; - options?: SelectedOptionElement[]; + name?: string; + option_groups?: ActionOptionGroup[]; + options?: SelectedOptionElement[]; selected_options?: SelectedOptionElement[]; - style?: string; - text?: string; - type?: ActionType; - url?: string; - value?: string; + style?: string; + text?: string; + type?: ActionType; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface ActionOptionGroup { options?: SelectedOptionElement[]; - text?: string; + text?: string; } export interface SelectedOptionElement { - text?: string; + text?: string; value?: string; } @@ -265,100 +265,100 @@ export enum ActionType { } export interface AttachmentBlock { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: AccessoryConfirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: AccessoryConfirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: InitialOptionElement; - initial_options?: InitialOptionElement[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: AccessoryOptionGroup[]; - options?: InitialOptionElement[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: ActionType; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: InitialOptionElement; + initial_options?: InitialOptionElement[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: AccessoryOptionGroup[]; + options?: InitialOptionElement[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: ActionType; + url?: string; + value?: string; + workflow?: Workflow; } export interface AccessoryConfirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -368,42 +368,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: ActionType; + indent?: number; + offset?: number; + style?: string; + type?: ActionType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -420,25 +420,25 @@ export enum PurpleType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface InitialOptionElement { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface AccessoryOptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: InitialOptionElement[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -448,11 +448,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } @@ -474,173 +474,173 @@ export interface AttachmentField { } export interface FileElement { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: AttachmentBlock[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: FileHeaders; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: AttachmentBlock[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: FileHeaders; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: PurpleShares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: AttachmentBlock[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: PurpleShares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: AttachmentBlock[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: LastEditor; } @@ -650,92 +650,92 @@ export enum LastEditor { } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface FileHeaders { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -750,64 +750,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface PurpleShares { private?: { [key: string]: Public[] }; - public?: { [key: string]: Public[] }; + public?: { [key: string]: Public[] }; } export interface Public { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: LastEditor; - source?: string; - team_id?: UserTeam; - thread_ts?: string; - ts?: Ts; + share_user_id?: LastEditor; + source?: string; + team_id?: UserTeam; + thread_ts?: string; + ts?: Ts; } export enum UserTeam { @@ -826,48 +826,47 @@ export interface Transcription { } export interface List { - channels?: string[]; - comments_count?: number; - created?: number; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - editable?: boolean; - external_type?: string; - file_access?: string; - filetype?: string; - groups?: string[]; - has_more_shares?: boolean; - has_rich_preview?: boolean; - id?: string; - ims?: string[]; - is_external?: boolean; - is_public?: boolean; - last_editor?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: string; - pretty_type?: string; + channels?: string[]; + comments_count?: number; + created?: number; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + editable?: boolean; + external_type?: string; + file_access?: string; + filetype?: string; + groups?: string[]; + has_more_shares?: boolean; + has_rich_preview?: boolean; + id?: string; + ims?: string[]; + is_external?: boolean; + is_public?: boolean; + last_editor?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: string; + pretty_type?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - shares?: ListShares; - size?: number; - timestamp?: number; - title?: string; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + shares?: ListShares; + size?: number; + timestamp?: number; + title?: string; + updated?: number; + url_private?: string; + url_private_download?: string; + user?: string; + user_team?: string; + username?: string; } -export interface ListShares { -} +export type ListShares = {}; export interface PurpleListRecord { record?: Record; @@ -875,90 +874,90 @@ export interface PurpleListRecord { } export interface Record { - fields?: RecordField[]; + fields?: RecordField[]; record_id?: string; } export interface RecordField { attachment?: any[]; - channel?: any[]; - checkbox?: boolean; - column_id?: string; - date?: any[]; - email?: any[]; - key?: string; - message?: Message; - number?: any[]; - phone?: any[]; - rating?: any[]; - rich_text?: any[]; - select?: any[]; - text?: string; - timestamp?: any[]; - user?: any[]; - value?: string; + channel?: any[]; + checkbox?: boolean; + column_id?: string; + date?: any[]; + email?: any[]; + key?: string; + message?: Message; + number?: any[]; + phone?: any[]; + rating?: any[]; + rich_text?: any[]; + select?: any[]; + text?: string; + timestamp?: any[]; + user?: any[]; + value?: string; } export interface Message { - app_id?: string; - attachments?: any[]; - blocks?: AttachmentBlock[]; - bot_id?: string; - bot_link?: string; - bot_profile?: BotProfile; - channel?: string; - client_msg_id?: string; - comment?: Comment; - display_as_bot?: boolean; - edited?: Edited; - file?: MessageFile; - files?: any[]; - hidden?: boolean; - icons?: MessageIcons; - inviter?: string; - is_intro?: boolean; - is_locked?: boolean; - is_starred?: boolean; + app_id?: string; + attachments?: any[]; + blocks?: AttachmentBlock[]; + bot_id?: string; + bot_link?: string; + bot_profile?: BotProfile; + channel?: string; + client_msg_id?: string; + comment?: Comment; + display_as_bot?: boolean; + edited?: Edited; + file?: MessageFile; + files?: any[]; + hidden?: boolean; + icons?: MessageIcons; + inviter?: string; + is_intro?: boolean; + is_locked?: boolean; + is_starred?: boolean; is_thread_broadcast?: boolean; - item?: Comment; - item_type?: string; - last_read?: string; - latest_reply?: string; - metadata?: MessageMetadata; - no_notifications?: boolean; - parent_user_id?: string; - pinned_to?: any[]; - purpose?: string; - reactions?: any[]; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; - reply_users_count?: number; - room?: Room; - root?: Root; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - topic?: string; - ts?: string; - type?: string; - unfurl_links?: boolean; - unfurl_media?: boolean; - upload?: boolean; - user?: string; - username?: string; - wibblr?: boolean; - x_files?: any[]; + item?: Comment; + item_type?: string; + last_read?: string; + latest_reply?: string; + metadata?: MessageMetadata; + no_notifications?: boolean; + parent_user_id?: string; + pinned_to?: any[]; + purpose?: string; + reactions?: any[]; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; + reply_users_count?: number; + room?: Room; + root?: Root; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + topic?: string; + ts?: string; + type?: string; + unfurl_links?: boolean; + unfurl_media?: boolean; + upload?: boolean; + user?: string; + username?: string; + wibblr?: boolean; + x_files?: any[]; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: BotProfileIcons; - id?: string; - name?: string; + icons?: BotProfileIcons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -970,208 +969,208 @@ export interface BotProfileIcons { } export interface Comment { - comment?: string; - created?: string; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_type?: string; - filetype?: string; - has_rich_preview?: boolean; - id?: string; - is_external?: boolean; - is_intro?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: boolean; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + comment?: string; + created?: string; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_type?: string; + filetype?: string; + has_rich_preview?: boolean; + id?: string; + is_external?: boolean; + is_intro?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: boolean; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - size?: number; - timestamp?: string; - title?: string; - url_private?: string; + public_url_shared?: boolean; + size?: number; + timestamp?: string; + title?: string; + url_private?: string; url_private_download?: boolean; - user?: string; - username?: string; + user?: string; + username?: string; } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface MessageFile { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: any[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: any[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: any[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: any[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: any[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: any[]; - file_access?: string; - filetype?: string; - from?: any[]; - groups?: any[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: FileHeaders; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: any[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: any[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: any[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: any[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: any[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: any[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: any[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: any[]; + file_access?: string; + filetype?: string; + from?: any[]; + groups?: any[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: FileHeaders; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: any[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: any[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: any[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: ListShares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: any[]; - to?: any[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: any[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: ListShares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: any[]; + to?: any[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface MessageIcons { - emoji?: string; + emoji?: string; image_36?: string; image_48?: string; image_64?: string; @@ -1183,77 +1182,77 @@ export interface MessageMetadata { } export interface Room { - app_id?: string; - attached_file_ids?: any[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: any[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: any[]; - participants?: any[]; - participants_camera_off?: any[]; - participants_camera_on?: any[]; + app_id?: string; + attached_file_ids?: any[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: any[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: any[]; + participants?: any[]; + participants_camera_off?: any[]; + participants_camera_on?: any[]; participants_screenshare_off?: any[]; - participants_screenshare_on?: any[]; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: any[]; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Root { - bot_id?: string; - bot_profile?: BotProfile; - edited?: Edited; - icons?: MessageIcons; - last_read?: string; - latest_reply?: string; - mrkdwn?: boolean; - no_notifications?: boolean; - parent_user_id?: string; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; + bot_id?: string; + bot_profile?: BotProfile; + edited?: Edited; + icons?: MessageIcons; + last_read?: string; + latest_reply?: string; + mrkdwn?: boolean; + no_notifications?: boolean; + parent_user_id?: string; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; reply_users_count?: number; - room?: Room; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - unread_count?: number; - user?: string; - username?: string; + room?: Room; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + unread_count?: number; + user?: string; + username?: string; } export interface ListRecordElement { - created_by?: string; - date_created?: number; - fields?: RecordField[]; - id?: string; - is_subscribed?: boolean; - list_id?: string; - platform_refs?: PlatformRefs; - position?: string; - saved?: Saved; - thread_ts?: string; - updated_by?: string; + created_by?: string; + date_created?: number; + fields?: RecordField[]; + id?: string; + is_subscribed?: boolean; + list_id?: string; + platform_refs?: PlatformRefs; + position?: string; + saved?: Saved; + thread_ts?: string; + updated_by?: string; updated_timestamp?: string; } @@ -1266,30 +1265,30 @@ export interface PlatformRefs { export interface MessageBlock { channel?: string; message?: Message; - team?: string; - ts?: string; + team?: string; + ts?: string; } export interface AttachmentMetadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Preview { can_remove?: boolean; - icon_url?: string; - subtitle?: DescriptionElement; - title?: DescriptionElement; - type?: string; + icon_url?: string; + subtitle?: DescriptionElement; + title?: DescriptionElement; + type?: string; } export interface MatchHeaders { @@ -1301,177 +1300,177 @@ export interface MatchShares { } export interface MatchTitleBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: FileElement; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: FileElement; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface Pagination { - first?: number; - last?: number; - page?: number; - page_count?: number; - per_page?: number; + first?: number; + last?: number; + page?: number; + page_count?: number; + per_page?: number; total_count?: number; } export interface Paging { count?: number; - page?: number; + page?: number; pages?: number; total?: number; } export interface Messages { - matches?: MessagesMatch[]; + matches?: MessagesMatch[]; pagination?: Pagination; - paging?: Paging; - total?: number; + paging?: Paging; + total?: number; } export interface MessagesMatch { - attachments?: Attachment[]; - blocks?: MatchTitleBlock[]; - channel?: Channel; - files?: FileElement[]; - iid?: string; - is_mpim?: boolean; + attachments?: Attachment[]; + blocks?: MatchTitleBlock[]; + channel?: Channel; + files?: FileElement[]; + iid?: string; + is_mpim?: boolean; no_reactions?: boolean; - permalink?: string; - previous?: Previous; - previous_2?: Previous; - score?: number; - team?: UserTeam; - text?: string; - ts?: Ts; - type?: string; - user?: LastEditor; - username?: string; + permalink?: string; + previous?: Previous; + previous_2?: Previous; + score?: number; + team?: UserTeam; + text?: string; + ts?: Ts; + type?: string; + user?: LastEditor; + username?: string; } export interface Channel { - id?: string; - is_channel?: boolean; - is_ext_shared?: boolean; - is_file?: boolean; - is_group?: boolean; - is_im?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; + id?: string; + is_channel?: boolean; + is_ext_shared?: boolean; + is_file?: boolean; + is_group?: boolean; + is_im?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - name?: string; - name_normalized?: string; - pending_shared?: string[]; - user?: LastEditor; + is_private?: boolean; + is_shared?: boolean; + name?: string; + name_normalized?: string; + pending_shared?: string[]; + user?: LastEditor; } export interface Previous { attachments?: Attachment[]; - blocks?: MatchTitleBlock[]; - iid?: string; - permalink?: string; - text?: string; - ts?: Ts; - type?: string; - user?: LastEditor; - username?: string; + blocks?: MatchTitleBlock[]; + iid?: string; + permalink?: string; + text?: string; + ts?: Ts; + type?: string; + user?: LastEditor; + username?: string; } export interface Posts { matches?: string[]; - total?: number; + total?: number; } diff --git a/packages/web-api/src/types/response/SearchFilesResponse.ts b/packages/web-api/src/types/response/SearchFilesResponse.ts index 480917bc1..b72c691b1 100644 --- a/packages/web-api/src/types/response/SearchFilesResponse.ts +++ b/packages/web-api/src/types/response/SearchFilesResponse.ts @@ -8,329 +8,329 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type SearchFilesResponse = WebAPICallResult & { - error?: string; - files?: Files; - needed?: string; - ok?: boolean; + error?: string; + files?: Files; + needed?: string; + ok?: boolean; provided?: string; - query?: string; + query?: string; }; export interface Files { - matches?: Match[]; + matches?: Match[]; pagination?: Pagination; - paging?: Paging; - total?: number; + paging?: Paging; + total?: number; } export interface Match { - access?: string; - attachments?: Attachment[]; - bot_id?: string; - cc?: Cc[]; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - edit_link?: string; - editable?: boolean; - editors?: LastEditor[]; - editors_count?: number; - external_id?: string; - external_type?: string; - external_url?: string; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: MatchHeaders; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: LastEditor; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - non_owner_editable?: boolean; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: number; - original_w?: number; - permalink?: string; - permalink_public?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + attachments?: Attachment[]; + bot_id?: string; + cc?: Cc[]; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + edit_link?: string; + editable?: boolean; + editors?: LastEditor[]; + editors_count?: number; + external_id?: string; + external_type?: string; + external_url?: string; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: MatchHeaders; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: LastEditor; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + non_owner_editable?: boolean; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: number; + original_w?: number; + permalink?: string; + permalink_public?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - sent_to_self?: boolean; - shares?: MatchShares; - size?: number; - subject?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: string[]; - thumb_1024?: string; - thumb_1024_h?: number; - thumb_1024_w?: number; - thumb_160?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: number; - thumb_360_w?: number; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: number; - thumb_480_w?: number; - thumb_64?: string; - thumb_720?: string; - thumb_720_h?: number; - thumb_720_w?: number; - thumb_80?: string; - thumb_800?: string; - thumb_800_h?: number; - thumb_800_w?: number; - thumb_960?: string; - thumb_960_h?: number; - thumb_960_w?: number; - thumb_pdf?: string; - thumb_pdf_h?: number; - thumb_pdf_w?: number; - thumb_tiny?: string; - thumb_video?: string; - timestamp?: number; - title?: string; - title_blocks?: TitleBlock[]; - to?: Cc[]; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: LastEditor; - user_team?: UserTeam; - username?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + sent_to_self?: boolean; + shares?: MatchShares; + size?: number; + subject?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: string[]; + thumb_1024?: string; + thumb_1024_h?: number; + thumb_1024_w?: number; + thumb_160?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: number; + thumb_360_w?: number; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: number; + thumb_480_w?: number; + thumb_64?: string; + thumb_720?: string; + thumb_720_h?: number; + thumb_720_w?: number; + thumb_80?: string; + thumb_800?: string; + thumb_800_h?: number; + thumb_800_w?: number; + thumb_960?: string; + thumb_960_h?: number; + thumb_960_w?: number; + thumb_pdf?: string; + thumb_pdf_h?: number; + thumb_pdf_w?: number; + thumb_tiny?: string; + thumb_video?: string; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: LastEditor; + user_team?: UserTeam; + username?: string; } export interface Attachment { - actions?: Action[]; - app_id?: string; - app_unfurl_url?: string; - author_icon?: string; - author_id?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - blocks?: Block[]; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - channel_team?: string; - color?: string; - fallback?: string; - fields?: AttachmentField[]; - file_id?: string; - filename?: string; - files?: FileElement[]; - footer?: string; - footer_icon?: string; - from_url?: string; - hide_border?: boolean; - hide_color?: boolean; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_file_attachment?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_id?: string; + app_unfurl_url?: string; + author_icon?: string; + author_id?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + blocks?: Block[]; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + channel_team?: string; + color?: string; + fallback?: string; + fields?: AttachmentField[]; + file_id?: string; + filename?: string; + files?: FileElement[]; + footer?: string; + footer_icon?: string; + from_url?: string; + hide_border?: boolean; + hide_color?: boolean; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_file_attachment?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - list?: List; - list_record?: PurpleListRecord; - list_record_id?: string; - list_records?: ListRecordElement[]; - list_schema?: Schema[]; - list_view?: View; - list_view_id?: string; - message_blocks?: MessageBlock[]; - metadata?: AttachmentMetadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - preview?: Preview; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; - video_url?: string; + list?: List; + list_record?: PurpleListRecord; + list_record_id?: string; + list_records?: ListRecordElement[]; + list_schema?: Schema[]; + list_view?: View; + list_view_id?: string; + message_blocks?: MessageBlock[]; + metadata?: AttachmentMetadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + preview?: Preview; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; + video_url?: string; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: ActionOptionGroup[]; - options?: SelectedOptionElement[]; + name?: string; + option_groups?: ActionOptionGroup[]; + options?: SelectedOptionElement[]; selected_options?: SelectedOptionElement[]; - style?: string; - text?: string; - type?: string; - url?: string; - value?: string; + style?: string; + text?: string; + type?: string; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface ActionOptionGroup { options?: SelectedOptionElement[]; - text?: string; + text?: string; } export interface SelectedOptionElement { - text?: string; + text?: string; value?: string; } export interface Block { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: AccessoryConfirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: AccessoryConfirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: InitialOptionElement; - initial_options?: InitialOptionElement[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: AccessoryOptionGroup[]; - options?: InitialOptionElement[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: InitialOptionElement; + initial_options?: InitialOptionElement[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: AccessoryOptionGroup[]; + options?: InitialOptionElement[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface AccessoryConfirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -340,42 +340,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: FluffyType; + indent?: number; + offset?: number; + style?: string; + type?: FluffyType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -399,25 +399,25 @@ export enum FluffyType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface InitialOptionElement { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface AccessoryOptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: InitialOptionElement[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -427,11 +427,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } @@ -453,173 +453,173 @@ export interface AttachmentField { } export interface FileElement { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: Block[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: FileHeaders; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: Block[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: FileHeaders; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: PurpleShares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: Block[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: PurpleShares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: Block[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: LastEditor; } @@ -629,92 +629,92 @@ export enum LastEditor { } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface FileHeaders { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -729,64 +729,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface PurpleShares { private?: { [key: string]: Public[] }; - public?: { [key: string]: Public[] }; + public?: { [key: string]: Public[] }; } export interface Public { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: LastEditor; - source?: string; - team_id?: UserTeam; - thread_ts?: string; - ts?: Ts; + share_user_id?: LastEditor; + source?: string; + team_id?: UserTeam; + thread_ts?: string; + ts?: Ts; } export enum UserTeam { @@ -805,48 +805,47 @@ export interface Transcription { } export interface List { - channels?: string[]; - comments_count?: number; - created?: number; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - editable?: boolean; - external_type?: string; - file_access?: string; - filetype?: string; - groups?: string[]; - has_more_shares?: boolean; - has_rich_preview?: boolean; - id?: string; - ims?: string[]; - is_external?: boolean; - is_public?: boolean; - last_editor?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: string; - pretty_type?: string; + channels?: string[]; + comments_count?: number; + created?: number; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + editable?: boolean; + external_type?: string; + file_access?: string; + filetype?: string; + groups?: string[]; + has_more_shares?: boolean; + has_rich_preview?: boolean; + id?: string; + ims?: string[]; + is_external?: boolean; + is_public?: boolean; + last_editor?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: string; + pretty_type?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - shares?: ListShares; - size?: number; - timestamp?: number; - title?: string; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + shares?: ListShares; + size?: number; + timestamp?: number; + title?: string; + updated?: number; + url_private?: string; + url_private_download?: string; + user?: string; + user_team?: string; + username?: string; } -export interface ListShares { -} +export type ListShares = {}; export interface PurpleListRecord { record?: Record; @@ -854,90 +853,90 @@ export interface PurpleListRecord { } export interface Record { - fields?: RecordField[]; + fields?: RecordField[]; record_id?: string; } export interface RecordField { attachment?: any[]; - channel?: any[]; - checkbox?: boolean; - column_id?: string; - date?: any[]; - email?: any[]; - key?: string; - message?: Message; - number?: any[]; - phone?: any[]; - rating?: any[]; - rich_text?: any[]; - select?: any[]; - text?: string; - timestamp?: any[]; - user?: any[]; - value?: string; + channel?: any[]; + checkbox?: boolean; + column_id?: string; + date?: any[]; + email?: any[]; + key?: string; + message?: Message; + number?: any[]; + phone?: any[]; + rating?: any[]; + rich_text?: any[]; + select?: any[]; + text?: string; + timestamp?: any[]; + user?: any[]; + value?: string; } export interface Message { - app_id?: string; - attachments?: any[]; - blocks?: Block[]; - bot_id?: string; - bot_link?: string; - bot_profile?: BotProfile; - channel?: string; - client_msg_id?: string; - comment?: Comment; - display_as_bot?: boolean; - edited?: Edited; - file?: MessageFile; - files?: any[]; - hidden?: boolean; - icons?: MessageIcons; - inviter?: string; - is_intro?: boolean; - is_locked?: boolean; - is_starred?: boolean; + app_id?: string; + attachments?: any[]; + blocks?: Block[]; + bot_id?: string; + bot_link?: string; + bot_profile?: BotProfile; + channel?: string; + client_msg_id?: string; + comment?: Comment; + display_as_bot?: boolean; + edited?: Edited; + file?: MessageFile; + files?: any[]; + hidden?: boolean; + icons?: MessageIcons; + inviter?: string; + is_intro?: boolean; + is_locked?: boolean; + is_starred?: boolean; is_thread_broadcast?: boolean; - item?: Comment; - item_type?: string; - last_read?: string; - latest_reply?: string; - metadata?: MessageMetadata; - no_notifications?: boolean; - parent_user_id?: string; - pinned_to?: any[]; - purpose?: string; - reactions?: any[]; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; - reply_users_count?: number; - room?: Room; - root?: Root; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - topic?: string; - ts?: string; - type?: string; - unfurl_links?: boolean; - unfurl_media?: boolean; - upload?: boolean; - user?: string; - username?: string; - wibblr?: boolean; - x_files?: any[]; + item?: Comment; + item_type?: string; + last_read?: string; + latest_reply?: string; + metadata?: MessageMetadata; + no_notifications?: boolean; + parent_user_id?: string; + pinned_to?: any[]; + purpose?: string; + reactions?: any[]; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; + reply_users_count?: number; + room?: Room; + root?: Root; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + topic?: string; + ts?: string; + type?: string; + unfurl_links?: boolean; + unfurl_media?: boolean; + upload?: boolean; + user?: string; + username?: string; + wibblr?: boolean; + x_files?: any[]; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: BotProfileIcons; - id?: string; - name?: string; + icons?: BotProfileIcons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -949,208 +948,208 @@ export interface BotProfileIcons { } export interface Comment { - comment?: string; - created?: string; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_type?: string; - filetype?: string; - has_rich_preview?: boolean; - id?: string; - is_external?: boolean; - is_intro?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: boolean; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + comment?: string; + created?: string; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_type?: string; + filetype?: string; + has_rich_preview?: boolean; + id?: string; + is_external?: boolean; + is_intro?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: boolean; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - size?: number; - timestamp?: string; - title?: string; - url_private?: string; + public_url_shared?: boolean; + size?: number; + timestamp?: string; + title?: string; + url_private?: string; url_private_download?: boolean; - user?: string; - username?: string; + user?: string; + username?: string; } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface MessageFile { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: any[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: any[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: any[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: any[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: any[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: any[]; - file_access?: string; - filetype?: string; - from?: any[]; - groups?: any[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: FileHeaders; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: any[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: any[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: any[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: any[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: any[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: any[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: any[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: any[]; + file_access?: string; + filetype?: string; + from?: any[]; + groups?: any[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: FileHeaders; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: any[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: any[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: any[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: ListShares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: any[]; - to?: any[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: any[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: ListShares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: any[]; + to?: any[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface MessageIcons { - emoji?: string; + emoji?: string; image_36?: string; image_48?: string; image_64?: string; @@ -1162,77 +1161,77 @@ export interface MessageMetadata { } export interface Room { - app_id?: string; - attached_file_ids?: any[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: any[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: any[]; - participants?: any[]; - participants_camera_off?: any[]; - participants_camera_on?: any[]; + app_id?: string; + attached_file_ids?: any[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: any[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: any[]; + participants?: any[]; + participants_camera_off?: any[]; + participants_camera_on?: any[]; participants_screenshare_off?: any[]; - participants_screenshare_on?: any[]; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: any[]; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Root { - bot_id?: string; - bot_profile?: BotProfile; - edited?: Edited; - icons?: MessageIcons; - last_read?: string; - latest_reply?: string; - mrkdwn?: boolean; - no_notifications?: boolean; - parent_user_id?: string; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; + bot_id?: string; + bot_profile?: BotProfile; + edited?: Edited; + icons?: MessageIcons; + last_read?: string; + latest_reply?: string; + mrkdwn?: boolean; + no_notifications?: boolean; + parent_user_id?: string; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; reply_users_count?: number; - room?: Room; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - unread_count?: number; - user?: string; - username?: string; + room?: Room; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + unread_count?: number; + user?: string; + username?: string; } export interface ListRecordElement { - created_by?: string; - date_created?: number; - fields?: RecordField[]; - id?: string; - is_subscribed?: boolean; - list_id?: string; - platform_refs?: PlatformRefs; - position?: string; - saved?: Saved; - thread_ts?: string; - updated_by?: string; + created_by?: string; + date_created?: number; + fields?: RecordField[]; + id?: string; + is_subscribed?: boolean; + list_id?: string; + platform_refs?: PlatformRefs; + position?: string; + saved?: Saved; + thread_ts?: string; + updated_by?: string; updated_timestamp?: string; } @@ -1245,30 +1244,30 @@ export interface PlatformRefs { export interface MessageBlock { channel?: string; message?: Message; - team?: string; - ts?: string; + team?: string; + ts?: string; } export interface AttachmentMetadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Preview { can_remove?: boolean; - icon_url?: string; - subtitle?: DescriptionElement; - title?: DescriptionElement; - type?: string; + icon_url?: string; + subtitle?: DescriptionElement; + title?: DescriptionElement; + type?: string; } export interface MatchHeaders { @@ -1280,115 +1279,115 @@ export interface MatchShares { } export interface TitleBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: FileElement; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: FileElement; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface Pagination { - first?: number; - last?: number; - page?: number; - page_count?: number; - per_page?: number; + first?: number; + last?: number; + page?: number; + page_count?: number; + per_page?: number; total_count?: number; } export interface Paging { count?: number; - page?: number; + page?: number; pages?: number; total?: number; } diff --git a/packages/web-api/src/types/response/SearchMessagesResponse.ts b/packages/web-api/src/types/response/SearchMessagesResponse.ts index a871fa241..1de72cf18 100644 --- a/packages/web-api/src/types/response/SearchMessagesResponse.ts +++ b/packages/web-api/src/types/response/SearchMessagesResponse.ts @@ -8,143 +8,143 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type SearchMessagesResponse = WebAPICallResult & { - error?: string; + error?: string; messages?: Messages; - needed?: string; - ok?: boolean; + needed?: string; + ok?: boolean; provided?: string; - query?: string; + query?: string; }; export interface Messages { - matches?: Match[]; + matches?: Match[]; pagination?: Pagination; - paging?: Paging; - total?: number; + paging?: Paging; + total?: number; } export interface Match { - attachments?: Attachment[]; - blocks?: MatchBlock[]; - channel?: Channel; - files?: FileElement[]; - iid?: string; - is_mpim?: boolean; + attachments?: Attachment[]; + blocks?: MatchBlock[]; + channel?: Channel; + files?: FileElement[]; + iid?: string; + is_mpim?: boolean; no_reactions?: boolean; - permalink?: string; - previous?: Previous; - previous_2?: Previous; - score?: number; - team?: string; - text?: string; - ts?: string; - type?: string; - user?: string; - username?: string; + permalink?: string; + previous?: Previous; + previous_2?: Previous; + score?: number; + team?: string; + text?: string; + ts?: string; + type?: string; + user?: string; + username?: string; } export interface Attachment { - actions?: Action[]; - app_id?: string; - app_unfurl_url?: string; - author_icon?: string; - author_id?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - blocks?: TitleBlockElement[]; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - channel_team?: string; - color?: string; - fallback?: string; - fields?: AttachmentField[]; - file_id?: string; - filename?: string; - files?: FileElement[]; - footer?: string; - footer_icon?: string; - from_url?: string; - hide_border?: boolean; - hide_color?: boolean; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_file_attachment?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_id?: string; + app_unfurl_url?: string; + author_icon?: string; + author_id?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + blocks?: TitleBlockElement[]; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + channel_team?: string; + color?: string; + fallback?: string; + fields?: AttachmentField[]; + file_id?: string; + filename?: string; + files?: FileElement[]; + footer?: string; + footer_icon?: string; + from_url?: string; + hide_border?: boolean; + hide_color?: boolean; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_file_attachment?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - list?: List; - list_record?: PurpleListRecord; - list_record_id?: string; - list_records?: ListRecordElement[]; - list_schema?: Schema[]; - list_view?: View; - list_view_id?: string; - message_blocks?: MessageBlock[]; - metadata?: AttachmentMetadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - preview?: Preview; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; - video_url?: string; + list?: List; + list_record?: PurpleListRecord; + list_record_id?: string; + list_records?: ListRecordElement[]; + list_schema?: Schema[]; + list_view?: View; + list_view_id?: string; + message_blocks?: MessageBlock[]; + metadata?: AttachmentMetadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + preview?: Preview; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; + video_url?: string; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: ActionOptionGroup[]; - options?: SelectedOptionElement[]; + name?: string; + option_groups?: ActionOptionGroup[]; + options?: SelectedOptionElement[]; selected_options?: SelectedOptionElement[]; - style?: string; - text?: string; - type?: ActionType; - url?: string; - value?: string; + style?: string; + text?: string; + type?: ActionType; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface ActionOptionGroup { options?: SelectedOptionElement[]; - text?: string; + text?: string; } export interface SelectedOptionElement { - text?: string; + text?: string; value?: string; } @@ -175,100 +175,100 @@ export enum ActionType { } export interface TitleBlockElement { - accessory?: Accessory; - alt_text?: string; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - description?: DescriptionElement | string; - developer_trace_id?: string; - elements?: Accessory[]; - fallback?: string; - fields?: DescriptionElement[]; - function_trigger_id?: string; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + description?: DescriptionElement | string; + developer_trace_id?: string; + elements?: Accessory[]; + fallback?: string; + fields?: DescriptionElement[]; + function_trigger_id?: string; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement | string; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement | string; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: AccessoryConfirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: AccessoryConfirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: InitialOptionElement; - initial_options?: InitialOptionElement[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: AccessoryOptionGroup[]; - options?: InitialOptionElement[]; - placeholder?: DescriptionElement; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: DescriptionElement; - timezone?: string; - type?: ActionType; - url?: string; - value?: string; - workflow?: Workflow; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: InitialOptionElement; + initial_options?: InitialOptionElement[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: AccessoryOptionGroup[]; + options?: InitialOptionElement[]; + placeholder?: DescriptionElement; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: DescriptionElement; + timezone?: string; + type?: ActionType; + url?: string; + value?: string; + workflow?: Workflow; } export interface AccessoryConfirm { confirm?: DescriptionElement; - deny?: DescriptionElement; - style?: string; - text?: DescriptionElement; - title?: DescriptionElement; + deny?: DescriptionElement; + style?: string; + text?: DescriptionElement; + title?: DescriptionElement; } export interface DescriptionElement { - emoji?: boolean; - text?: string; - type?: DescriptionType; + emoji?: boolean; + text?: string; + type?: DescriptionType; verbatim?: boolean; } @@ -278,42 +278,42 @@ export enum DescriptionType { } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: ActionType; + indent?: number; + offset?: number; + style?: string; + type?: ActionType; } export interface PurpleElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: PurpleType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: PurpleType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum PurpleType { @@ -330,25 +330,25 @@ export enum PurpleType { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface InitialOptionElement { description?: DescriptionElement; - text?: DescriptionElement; - url?: string; - value?: string; + text?: DescriptionElement; + url?: string; + value?: string; } export interface AccessoryOptionGroup { - label?: DescriptionElement; + label?: DescriptionElement; options?: InitialOptionElement[]; } export interface SlackFile { - id?: string; + id?: string; url?: string; } @@ -358,11 +358,11 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } @@ -384,263 +384,263 @@ export interface AttachmentField { } export interface FileElement { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: Favorite[]; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: string[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: Favorite[]; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: PurpleShares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: TitleBlockElement[]; - to?: Cc[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: PurpleShares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: TitleBlockElement[]; + to?: Cc[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface DmMpdmUsersWithFileAccess { - access?: string; + access?: string; user_id?: string; } export interface Favorite { - collection_id?: string; + collection_id?: string; collection_name?: string; - position?: string; + position?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface InitialComment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; timestamp?: number; - user?: string; + user?: string; } export interface ListLimits { - column_count?: number; - column_count_limit?: number; + column_count?: number; + column_count_limit?: number; over_column_maximum?: boolean; - over_row_maximum?: boolean; - over_view_maximum?: boolean; - row_count?: number; - row_count_limit?: number; - view_count?: number; - view_count_limit?: number; + over_row_maximum?: boolean; + over_view_maximum?: boolean; + row_count?: number; + row_count_limit?: number; + view_count?: number; + view_count_limit?: number; } export interface ListMetadata { creation_source?: CreationSource; - description?: string; - icon?: string; - icon_team_id?: string; - icon_url?: string; - integrations?: string[]; - is_trial?: boolean; - schema?: Schema[]; - views?: View[]; + description?: string; + icon?: string; + icon_team_id?: string; + icon_url?: string; + integrations?: string[]; + is_trial?: boolean; + schema?: Schema[]; + views?: View[]; } export interface CreationSource { - reference_id?: string; - type?: string; + reference_id?: string; + type?: string; workflow_function_id?: string; } export interface Schema { - id?: string; + id?: string; is_primary_column?: boolean; - key?: string; - name?: string; - options?: Options; - type?: string; + key?: string; + name?: string; + options?: Options; + type?: string; } export interface Options { - canvas_id?: string; + canvas_id?: string; canvas_placeholder_mapping?: CanvasPlaceholderMapping[]; - choices?: Choice[]; - currency?: string; - currency_format?: string; - date_format?: string; - default_value?: string; - default_value_typed?: DefaultValueTyped; - emoji?: string; - emoji_team_id?: string; - for_assignment?: boolean; - format?: string; - linked_to?: string[]; - mark_as_done_when_checked?: boolean; - max?: number; - notify_users?: boolean; - precision?: number; - rounding?: string; - show_member_name?: boolean; - time_format?: string; + choices?: Choice[]; + currency?: string; + currency_format?: string; + date_format?: string; + default_value?: string; + default_value_typed?: DefaultValueTyped; + emoji?: string; + emoji_team_id?: string; + for_assignment?: boolean; + format?: string; + linked_to?: string[]; + mark_as_done_when_checked?: boolean; + max?: number; + notify_users?: boolean; + precision?: number; + rounding?: string; + show_member_name?: boolean; + time_format?: string; } export interface CanvasPlaceholderMapping { - column?: string; + column?: string; variable?: string; } @@ -655,64 +655,64 @@ export interface DefaultValueTyped { } export interface View { - columns?: Column[]; - created_by?: string; - date_created?: number; - id?: string; + columns?: Column[]; + created_by?: string; + date_created?: number; + id?: string; is_all_items_view?: boolean; - is_locked?: boolean; - name?: string; - position?: string; + is_locked?: boolean; + name?: string; + position?: string; stick_column_left?: boolean; - type?: string; + type?: string; } export interface Column { - id?: string; - key?: string; + id?: string; + key?: string; position?: string; - visible?: boolean; - width?: number; + visible?: boolean; + width?: number; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface PurpleShares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - access?: string; - channel_name?: string; - date_last_shared?: number; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + access?: string; + channel_name?: string; + date_last_shared?: number; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - source?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + source?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -721,48 +721,47 @@ export interface Transcription { } export interface List { - channels?: string[]; - comments_count?: number; - created?: number; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; - editable?: boolean; - external_type?: string; - file_access?: string; - filetype?: string; - groups?: string[]; - has_more_shares?: boolean; - has_rich_preview?: boolean; - id?: string; - ims?: string[]; - is_external?: boolean; - is_public?: boolean; - last_editor?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: string; - pretty_type?: string; + channels?: string[]; + comments_count?: number; + created?: number; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + editable?: boolean; + external_type?: string; + file_access?: string; + filetype?: string; + groups?: string[]; + has_more_shares?: boolean; + has_rich_preview?: boolean; + id?: string; + ims?: string[]; + is_external?: boolean; + is_public?: boolean; + last_editor?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: string; + pretty_type?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - shares?: ListShares; - size?: number; - timestamp?: number; - title?: string; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + shares?: ListShares; + size?: number; + timestamp?: number; + title?: string; + updated?: number; + url_private?: string; + url_private_download?: string; + user?: string; + user_team?: string; + username?: string; } -export interface ListShares { -} +export type ListShares = {}; export interface PurpleListRecord { record?: Record; @@ -770,90 +769,90 @@ export interface PurpleListRecord { } export interface Record { - fields?: RecordField[]; + fields?: RecordField[]; record_id?: string; } export interface RecordField { attachment?: any[]; - channel?: any[]; - checkbox?: boolean; - column_id?: string; - date?: any[]; - email?: any[]; - key?: string; - message?: Message; - number?: any[]; - phone?: any[]; - rating?: any[]; - rich_text?: any[]; - select?: any[]; - text?: string; - timestamp?: any[]; - user?: any[]; - value?: string; + channel?: any[]; + checkbox?: boolean; + column_id?: string; + date?: any[]; + email?: any[]; + key?: string; + message?: Message; + number?: any[]; + phone?: any[]; + rating?: any[]; + rich_text?: any[]; + select?: any[]; + text?: string; + timestamp?: any[]; + user?: any[]; + value?: string; } export interface Message { - app_id?: string; - attachments?: any[]; - blocks?: TitleBlockElement[]; - bot_id?: string; - bot_link?: string; - bot_profile?: BotProfile; - channel?: string; - client_msg_id?: string; - comment?: Comment; - display_as_bot?: boolean; - edited?: Edited; - file?: MessageFile; - files?: any[]; - hidden?: boolean; - icons?: MessageIcons; - inviter?: string; - is_intro?: boolean; - is_locked?: boolean; - is_starred?: boolean; + app_id?: string; + attachments?: any[]; + blocks?: TitleBlockElement[]; + bot_id?: string; + bot_link?: string; + bot_profile?: BotProfile; + channel?: string; + client_msg_id?: string; + comment?: Comment; + display_as_bot?: boolean; + edited?: Edited; + file?: MessageFile; + files?: any[]; + hidden?: boolean; + icons?: MessageIcons; + inviter?: string; + is_intro?: boolean; + is_locked?: boolean; + is_starred?: boolean; is_thread_broadcast?: boolean; - item?: Comment; - item_type?: string; - last_read?: string; - latest_reply?: string; - metadata?: MessageMetadata; - no_notifications?: boolean; - parent_user_id?: string; - pinned_to?: any[]; - purpose?: string; - reactions?: any[]; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; - reply_users_count?: number; - room?: Room; - root?: Root; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - topic?: string; - ts?: string; - type?: string; - unfurl_links?: boolean; - unfurl_media?: boolean; - upload?: boolean; - user?: string; - username?: string; - wibblr?: boolean; - x_files?: any[]; + item?: Comment; + item_type?: string; + last_read?: string; + latest_reply?: string; + metadata?: MessageMetadata; + no_notifications?: boolean; + parent_user_id?: string; + pinned_to?: any[]; + purpose?: string; + reactions?: any[]; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; + reply_users_count?: number; + room?: Room; + root?: Root; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + topic?: string; + ts?: string; + type?: string; + unfurl_links?: boolean; + unfurl_media?: boolean; + upload?: boolean; + user?: string; + username?: string; + wibblr?: boolean; + x_files?: any[]; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: BotProfileIcons; - id?: string; - name?: string; + icons?: BotProfileIcons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -865,208 +864,208 @@ export interface BotProfileIcons { } export interface Comment { - comment?: string; - created?: string; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - external_type?: string; - filetype?: string; - has_rich_preview?: boolean; - id?: string; - is_external?: boolean; - is_intro?: boolean; - is_public?: boolean; - is_starred?: boolean; - lines?: number; - lines_more?: number; - media_display_type?: string; - mimetype?: string; - mode?: string; - name?: string; - permalink?: string; - permalink_public?: boolean; - pretty_type?: string; - preview?: string; - preview_highlight?: string; + comment?: string; + created?: string; + display_as_bot?: boolean; + edit_link?: string; + editable?: boolean; + external_type?: string; + filetype?: string; + has_rich_preview?: boolean; + id?: string; + is_external?: boolean; + is_intro?: boolean; + is_public?: boolean; + is_starred?: boolean; + lines?: number; + lines_more?: number; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + permalink?: string; + permalink_public?: boolean; + pretty_type?: string; + preview?: string; + preview_highlight?: string; preview_is_truncated?: boolean; - public_url_shared?: boolean; - size?: number; - timestamp?: string; - title?: string; - url_private?: string; + public_url_shared?: boolean; + size?: number; + timestamp?: string; + title?: string; + url_private?: string; url_private_download?: boolean; - user?: string; - username?: string; + user?: string; + username?: string; } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface MessageFile { - access?: string; - alt_txt?: string; - app_id?: string; - app_name?: string; - attachments?: any[]; - blocks?: any[]; - bot_id?: string; - can_toggle_canvas_lock?: boolean; - canvas_template_mode?: string; - cc?: any[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: any[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - dm_mpdm_users_with_file_access?: any[]; - duration_ms?: number; - edit_link?: string; - edit_timestamp?: number; - editable?: boolean; - editor?: string; - editors?: any[]; - external_id?: string; - external_type?: string; - external_url?: string; - favorites?: any[]; - file_access?: string; - filetype?: string; - from?: any[]; - groups?: any[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: any[]; - initial_comment?: InitialComment; - is_channel_space?: boolean; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - last_read?: number; - lines?: number; - lines_more?: number; - linked_channel_id?: string; - list_limits?: ListLimits; - list_metadata?: ListMetadata; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; - org_or_workspace_access?: string; - original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: any[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; + access?: string; + alt_txt?: string; + app_id?: string; + app_name?: string; + attachments?: any[]; + blocks?: any[]; + bot_id?: string; + can_toggle_canvas_lock?: boolean; + canvas_template_mode?: string; + cc?: any[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: any[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: any[]; + duration_ms?: number; + edit_link?: string; + edit_timestamp?: number; + editable?: boolean; + editor?: string; + editors?: any[]; + external_id?: string; + external_type?: string; + external_url?: string; + favorites?: any[]; + file_access?: string; + filetype?: string; + from?: any[]; + groups?: any[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: any[]; + initial_comment?: InitialComment; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + last_read?: number; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + list_limits?: ListLimits; + list_metadata?: ListMetadata; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: any[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; private_channels_with_file_access_count?: number; - private_file_with_access_count?: number; - public_url_shared?: boolean; - quip_thread_id?: string; - reactions?: any[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: ListShares; - show_badge?: boolean; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - team_pref_version_history_enabled?: boolean; - teams_shared_with?: any[]; - template_conversion_ts?: number; - template_description?: string; - template_icon?: string; - template_name?: string; - template_title?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - title_blocks?: any[]; - to?: any[]; - transcription?: Transcription; - update_notification?: number; - updated?: number; - url_private?: string; - url_private_download?: string; - url_static_preview?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + private_file_with_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + reactions?: any[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: ListShares; + show_badge?: boolean; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: any[]; + template_conversion_ts?: number; + template_description?: string; + template_icon?: string; + template_name?: string; + template_title?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + title_blocks?: any[]; + to?: any[]; + transcription?: Transcription; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface MessageIcons { - emoji?: string; + emoji?: string; image_36?: string; image_48?: string; image_64?: string; @@ -1078,77 +1077,77 @@ export interface MessageMetadata { } export interface Room { - app_id?: string; - attached_file_ids?: any[]; - background_id?: string; - call_family?: string; - canvas_background?: string; - canvas_thread_ts?: string; - channels?: any[]; - created_by?: string; - date_end?: number; - date_start?: number; - display_id?: string; - external_unique_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - is_prewarmed?: boolean; - is_scheduled?: boolean; - media_backend_type?: string; - media_server?: string; - name?: string; - participant_history?: any[]; - participants?: any[]; - participants_camera_off?: any[]; - participants_camera_on?: any[]; + app_id?: string; + attached_file_ids?: any[]; + background_id?: string; + call_family?: string; + canvas_background?: string; + canvas_thread_ts?: string; + channels?: any[]; + created_by?: string; + date_end?: number; + date_start?: number; + display_id?: string; + external_unique_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + is_prewarmed?: boolean; + is_scheduled?: boolean; + media_backend_type?: string; + media_server?: string; + name?: string; + participant_history?: any[]; + participants?: any[]; + participants_camera_off?: any[]; + participants_camera_on?: any[]; participants_screenshare_off?: any[]; - participants_screenshare_on?: any[]; - thread_root_ts?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + participants_screenshare_on?: any[]; + thread_root_ts?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Root { - bot_id?: string; - bot_profile?: BotProfile; - edited?: Edited; - icons?: MessageIcons; - last_read?: string; - latest_reply?: string; - mrkdwn?: boolean; - no_notifications?: boolean; - parent_user_id?: string; - replies?: any[]; - reply_count?: number; - reply_users?: any[]; + bot_id?: string; + bot_profile?: BotProfile; + edited?: Edited; + icons?: MessageIcons; + last_read?: string; + latest_reply?: string; + mrkdwn?: boolean; + no_notifications?: boolean; + parent_user_id?: string; + replies?: any[]; + reply_count?: number; + reply_users?: any[]; reply_users_count?: number; - room?: Room; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - unread_count?: number; - user?: string; - username?: string; + room?: Room; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + unread_count?: number; + user?: string; + username?: string; } export interface ListRecordElement { - created_by?: string; - date_created?: number; - fields?: RecordField[]; - id?: string; - is_subscribed?: boolean; - list_id?: string; - platform_refs?: PlatformRefs; - position?: string; - saved?: Saved; - thread_ts?: string; - updated_by?: string; + created_by?: string; + date_created?: number; + fields?: RecordField[]; + id?: string; + is_subscribed?: boolean; + list_id?: string; + platform_refs?: PlatformRefs; + position?: string; + saved?: Saved; + thread_ts?: string; + updated_by?: string; updated_timestamp?: string; } @@ -1161,172 +1160,172 @@ export interface PlatformRefs { export interface MessageBlock { channel?: string; message?: Message; - team?: string; - ts?: string; + team?: string; + ts?: string; } export interface AttachmentMetadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Preview { can_remove?: boolean; - icon_url?: string; - subtitle?: DescriptionElement; - title?: DescriptionElement; - type?: string; + icon_url?: string; + subtitle?: DescriptionElement; + title?: DescriptionElement; + type?: string; } export interface MatchBlock { - accessory?: Accessory; - alt_text?: string; - api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: DescriptionElement; - developer_trace_id?: string; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: DescriptionElement[]; - file?: FileElement; - file_id?: string; - function_trigger_id?: string; - hint?: DescriptionElement; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - is_workflow_app?: boolean; - label?: DescriptionElement; - optional?: boolean; - owning_team_id?: string; - provider_icon_url?: string; - provider_name?: string; + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: FileElement; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; sales_home_workflow_app_type?: number; - share_url?: string; - slack_file?: SlackFile; - source?: string; - text?: DescriptionElement; - thumbnail_url?: string; - title?: DescriptionElement; - title_url?: string; - trigger_subtype?: string; - trigger_type?: string; - type?: BlockType; - url?: string; - video_url?: string; - workflow_id?: string; + share_url?: string; + slack_file?: SlackFile; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } export interface Channel { - id?: string; - is_channel?: boolean; - is_ext_shared?: boolean; - is_file?: boolean; - is_group?: boolean; - is_im?: boolean; - is_mpim?: boolean; - is_org_shared?: boolean; + id?: string; + is_channel?: boolean; + is_ext_shared?: boolean; + is_file?: boolean; + is_group?: boolean; + is_im?: boolean; + is_mpim?: boolean; + is_org_shared?: boolean; is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - name?: string; - name_normalized?: string; - pending_shared?: string[]; - user?: string; + is_private?: boolean; + is_shared?: boolean; + name?: string; + name_normalized?: string; + pending_shared?: string[]; + user?: string; } export interface Previous { attachments?: Attachment[]; - blocks?: MatchBlock[]; - iid?: string; - permalink?: string; - text?: string; - ts?: string; - type?: string; - user?: string; - username?: string; + blocks?: MatchBlock[]; + iid?: string; + permalink?: string; + text?: string; + ts?: string; + type?: string; + user?: string; + username?: string; } export interface Pagination { - first?: number; - last?: number; - page?: number; - page_count?: number; - per_page?: number; + first?: number; + last?: number; + page?: number; + page_count?: number; + per_page?: number; total_count?: number; } export interface Paging { count?: number; - page?: number; + page?: number; pages?: number; total?: number; } diff --git a/packages/web-api/src/types/response/StarsAddResponse.ts b/packages/web-api/src/types/response/StarsAddResponse.ts index 44712411b..c32e94c9a 100644 --- a/packages/web-api/src/types/response/StarsAddResponse.ts +++ b/packages/web-api/src/types/response/StarsAddResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type StarsAddResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/StarsListResponse.ts b/packages/web-api/src/types/response/StarsListResponse.ts index 8d466a9a0..45d532ea8 100644 --- a/packages/web-api/src/types/response/StarsListResponse.ts +++ b/packages/web-api/src/types/response/StarsListResponse.ts @@ -8,216 +8,216 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type StarsListResponse = WebAPICallResult & { - error?: string; - items?: Item[]; - needed?: string; - ok?: boolean; - paging?: Paging; + error?: string; + items?: Item[]; + needed?: string; + ok?: boolean; + paging?: Paging; provided?: string; }; export interface Item { - channel?: string; - comment?: Comment; + channel?: string; + comment?: Comment; date_create?: number; - file?: ItemFile; - message?: Message; - type?: string; + file?: ItemFile; + message?: Message; + type?: string; } export interface Comment { - channel?: string; - comment?: string; - created?: number; - id?: string; - is_intro?: boolean; + channel?: string; + comment?: string; + created?: number; + id?: string; + is_intro?: boolean; is_starred?: boolean; - num_stars?: number; - timestamp?: number; - user?: string; + num_stars?: number; + timestamp?: number; + user?: string; } export interface ItemFile { - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - duration_ms?: number; - edit_link?: string; - editable?: boolean; - editor?: string; - external_id?: string; - external_type?: string; - external_url?: string; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: Comment; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - lines?: number; - lines_more?: number; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + duration_ms?: number; + edit_link?: string; + editable?: boolean; + editor?: string; + external_id?: string; + external_type?: string; + external_url?: string; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: Comment; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + lines?: number; + lines_more?: number; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; - public_url_shared?: boolean; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - to?: Cc[]; - transcription?: Transcription; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; + public_url_shared?: boolean; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + to?: Cc[]; + transcription?: Transcription; + updated?: number; + url_private?: string; + url_private_download?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Cc { - address?: string; - name?: string; + address?: string; + name?: string; original?: string; } export interface Headers { - date?: string; + date?: string; in_reply_to?: string; - message_id?: string; - reply_to?: string; + message_id?: string; + reply_to?: string; } export interface MediaProgress { - duration_ms?: number; + duration_ms?: number; max_offset_ms?: number; - offset_ms?: number; + offset_ms?: number; } export interface Reaction { count?: number; - name?: string; - url?: string; + name?: string; + url?: string; users?: string[]; } export interface Saved { date_completed?: number; - date_due?: number; - is_archived?: boolean; - state?: string; + date_due?: number; + is_archived?: boolean; + state?: string; } export interface Shares { private?: { [key: string]: Private[] }; - public?: { [key: string]: Private[] }; + public?: { [key: string]: Private[] }; } export interface Private { - channel_name?: string; - latest_reply?: string; - reply_count?: number; - reply_users?: string[]; + channel_name?: string; + latest_reply?: string; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - share_user_id?: string; - team_id?: string; - thread_ts?: string; - ts?: string; + share_user_id?: string; + team_id?: string; + thread_ts?: string; + ts?: string; } export interface Transcription { @@ -226,321 +226,321 @@ export interface Transcription { } export interface Message { - attachments?: Attachment[]; - blocks?: Block[]; - bot_id?: string; - bot_profile?: BotProfile; - client_msg_id?: string; - display_as_bot?: boolean; - edited?: Edited; - files?: FileElement[]; - inviter?: string; - is_locked?: boolean; - is_starred?: boolean; - last_read?: string; - latest_reply?: string; - permalink?: string; - reactions?: Reaction[]; - reply_count?: number; - reply_users?: string[]; + attachments?: Attachment[]; + blocks?: Block[]; + bot_id?: string; + bot_profile?: BotProfile; + client_msg_id?: string; + display_as_bot?: boolean; + edited?: Edited; + files?: FileElement[]; + inviter?: string; + is_locked?: boolean; + is_starred?: boolean; + last_read?: string; + latest_reply?: string; + permalink?: string; + reactions?: Reaction[]; + reply_count?: number; + reply_users?: string[]; reply_users_count?: number; - subscribed?: boolean; - subtype?: string; - team?: string; - text?: string; - thread_ts?: string; - ts?: string; - type?: string; - upload?: boolean; - user?: string; - username?: string; + subscribed?: boolean; + subtype?: string; + team?: string; + text?: string; + thread_ts?: string; + ts?: string; + type?: string; + upload?: boolean; + user?: string; + username?: string; } export interface Attachment { - actions?: Action[]; - app_id?: string; - app_unfurl_url?: string; - author_icon?: string; - author_id?: string; - author_link?: string; - author_name?: string; - author_subname?: string; - blocks?: Block[]; - bot_id?: string; - callback_id?: string; - channel_id?: string; - channel_name?: string; - channel_team?: string; - color?: string; - fallback?: string; - fields?: Field[]; - filename?: string; - files?: FileElement[]; - footer?: string; - footer_icon?: string; - from_url?: string; - id?: number; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: boolean; - is_app_unfurl?: boolean; - is_msg_unfurl?: boolean; - is_reply_unfurl?: boolean; + actions?: Action[]; + app_id?: string; + app_unfurl_url?: string; + author_icon?: string; + author_id?: string; + author_link?: string; + author_name?: string; + author_subname?: string; + blocks?: Block[]; + bot_id?: string; + callback_id?: string; + channel_id?: string; + channel_name?: string; + channel_team?: string; + color?: string; + fallback?: string; + fields?: Field[]; + filename?: string; + files?: FileElement[]; + footer?: string; + footer_icon?: string; + from_url?: string; + id?: number; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: boolean; + is_app_unfurl?: boolean; + is_msg_unfurl?: boolean; + is_reply_unfurl?: boolean; is_thread_root_unfurl?: boolean; - metadata?: Metadata; - mimetype?: string; - mrkdwn_in?: string[]; - msg_subtype?: string; - original_url?: string; - pretext?: string; - preview?: Preview; - service_icon?: string; - service_name?: string; - service_url?: string; - size?: number; - text?: string; - thumb_height?: number; - thumb_url?: string; - thumb_width?: number; - title?: string; - title_link?: string; - ts?: string; - url?: string; - video_html?: string; - video_html_height?: number; - video_html_width?: number; - video_url?: string; + metadata?: Metadata; + mimetype?: string; + mrkdwn_in?: string[]; + msg_subtype?: string; + original_url?: string; + pretext?: string; + preview?: Preview; + service_icon?: string; + service_name?: string; + service_url?: string; + size?: number; + text?: string; + thumb_height?: number; + thumb_url?: string; + thumb_width?: number; + title?: string; + title_link?: string; + ts?: string; + url?: string; + video_html?: string; + video_html_height?: number; + video_html_width?: number; + video_url?: string; } export interface Action { - confirm?: ActionConfirm; - data_source?: string; - id?: string; + confirm?: ActionConfirm; + data_source?: string; + id?: string; min_query_length?: number; - name?: string; - option_groups?: ActionOptionGroup[]; - options?: SelectedOptionElement[]; + name?: string; + option_groups?: ActionOptionGroup[]; + options?: SelectedOptionElement[]; selected_options?: SelectedOptionElement[]; - style?: string; - text?: string; - type?: string; - url?: string; - value?: string; + style?: string; + text?: string; + type?: string; + url?: string; + value?: string; } export interface ActionConfirm { dismiss_text?: string; - ok_text?: string; - text?: string; - title?: string; + ok_text?: string; + text?: string; + title?: string; } export interface ActionOptionGroup { options?: SelectedOptionElement[]; - text?: string; + text?: string; } export interface SelectedOptionElement { - text?: string; + text?: string; value?: string; } export interface Block { - accessory?: Accessory; - alt_text?: string; + accessory?: Accessory; + alt_text?: string; api_decoration_available?: boolean; - app_collaborators?: string[]; - app_id?: string; - author_name?: string; - block_id?: string; - bot_user_id?: string; - button_label?: string; - call?: Call; - call_id?: string; - description?: Description; - dispatch_action?: boolean; - element?: Accessory; - elements?: Accessory[]; - external_id?: string; - fallback?: string; - fields?: Description[]; - file?: ItemFile; - file_id?: string; - function_trigger_id?: string; - hint?: Description; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_workflow_app?: boolean; - label?: Description; - optional?: boolean; - provider_icon_url?: string; - provider_name?: string; - source?: string; - text?: Description; - thumbnail_url?: string; - title?: Description; - title_url?: string; - type?: string; - url?: string; - video_url?: string; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: Description; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: Description[]; + file?: ItemFile; + file_id?: string; + function_trigger_id?: string; + hint?: Description; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_workflow_app?: boolean; + label?: Description; + optional?: boolean; + provider_icon_url?: string; + provider_name?: string; + source?: string; + text?: Description; + thumbnail_url?: string; + title?: Description; + title_url?: string; + type?: string; + url?: string; + video_url?: string; } export interface Accessory { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - border?: number; - confirm?: AccessoryConfirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + border?: number; + confirm?: AccessoryConfirm; default_to_current_conversation?: boolean; - elements?: AccessoryElement[]; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - indent?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: InitialOptionElement; - initial_options?: InitialOptionElement[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - offset?: number; - option_groups?: AccessoryOptionGroup[]; - options?: InitialOptionElement[]; - placeholder?: Description; - response_url_enabled?: boolean; - style?: string; - text?: Description; - timezone?: string; - type?: string; - url?: string; - value?: string; + elements?: AccessoryElement[]; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + indent?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: InitialOptionElement; + initial_options?: InitialOptionElement[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + offset?: number; + option_groups?: AccessoryOptionGroup[]; + options?: InitialOptionElement[]; + placeholder?: Description; + response_url_enabled?: boolean; + style?: string; + text?: Description; + timezone?: string; + type?: string; + url?: string; + value?: string; } export interface AccessoryConfirm { confirm?: Description; - deny?: Description; - style?: string; - text?: Description; - title?: Description; + deny?: Description; + style?: string; + text?: Description; + title?: Description; } export interface Description { - emoji?: boolean; - text?: string; - type?: string; + emoji?: boolean; + text?: string; + type?: string; verbatim?: boolean; } export interface AccessoryElement { - border?: number; + border?: number; elements?: PurpleElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface PurpleElement { - channel_id?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: string; - unicode?: string; - url?: string; - user_id?: string; + channel_id?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: string; + unicode?: string; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; - code?: boolean; + bold?: boolean; + code?: boolean; italic?: boolean; strike?: boolean; } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: string[]; + include?: string[]; } export interface InitialOptionElement { description?: Description; - text?: Description; - url?: string; - value?: string; + text?: Description; + url?: string; + value?: string; } export interface AccessoryOptionGroup { - label?: Description; + label?: Description; options?: InitialOptionElement[]; } export interface Call { media_backend_type?: string; - v1?: V1; + v1?: V1; } export interface V1 { - active_participants?: Participant[]; - all_participants?: Participant[]; - app_icon_urls?: AppIconUrls; - app_id?: string; - channels?: string[]; - created_by?: string; - date_end?: number; - date_start?: number; + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; desktop_app_join_url?: string; - display_id?: string; - has_ended?: boolean; - id?: string; - is_dm_call?: boolean; - join_url?: string; - name?: string; - was_accepted?: boolean; - was_missed?: boolean; - was_rejected?: boolean; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; } export interface Participant { - avatar_url?: string; + avatar_url?: string; display_name?: string; - external_id?: string; - slack_id?: string; + external_id?: string; + slack_id?: string; } export interface AppIconUrls { - image_1024?: string; - image_128?: string; - image_192?: string; - image_32?: string; - image_36?: string; - image_48?: string; - image_512?: string; - image_64?: string; - image_72?: string; - image_96?: string; + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; image_original?: string; } @@ -551,164 +551,164 @@ export interface Field { } export interface FileElement { - alt_txt?: string; - app_id?: string; - app_name?: string; - bot_id?: string; - cc?: Cc[]; - channel_actions_count?: number; - channel_actions_ts?: string; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - deanimate?: string; - deanimate_gif?: string; - display_as_bot?: boolean; - duration_ms?: number; - edit_link?: string; - editable?: boolean; - editor?: string; - external_id?: string; - external_type?: string; - external_url?: string; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: Headers; - hls?: string; - hls_embed?: string; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - initial_comment?: Comment; - is_external?: boolean; - is_public?: boolean; - is_starred?: boolean; - last_editor?: string; - lines?: number; - lines_more?: number; - media_display_type?: string; - media_progress?: MediaProgress; - mimetype?: string; - mode?: string; - mp4?: string; - mp4_low?: string; - name?: string; - non_owner_editable?: boolean; - num_stars?: number; + alt_txt?: string; + app_id?: string; + app_name?: string; + bot_id?: string; + cc?: Cc[]; + channel_actions_count?: number; + channel_actions_ts?: string; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + deanimate?: string; + deanimate_gif?: string; + display_as_bot?: boolean; + duration_ms?: number; + edit_link?: string; + editable?: boolean; + editor?: string; + external_id?: string; + external_type?: string; + external_url?: string; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: Headers; + hls?: string; + hls_embed?: string; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + initial_comment?: Comment; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + lines?: number; + lines_more?: number; + media_display_type?: string; + media_progress?: MediaProgress; + mimetype?: string; + mode?: string; + mp4?: string; + mp4_low?: string; + name?: string; + non_owner_editable?: boolean; + num_stars?: number; original_attachment_count?: number; - original_h?: string; - original_w?: string; - permalink?: string; - permalink_public?: string; - pinned_to?: string[]; - pjpeg?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; - public_url_shared?: boolean; - reactions?: Reaction[]; - saved?: Saved; - sent_to_self?: boolean; - shares?: Shares; - simplified_html?: string; - size?: number; - source_team?: string; - subject?: string; - subtype?: string; - thumb_1024?: string; - thumb_1024_gif?: string; - thumb_1024_h?: string; - thumb_1024_w?: string; - thumb_160?: string; - thumb_160_gif?: string; - thumb_160_h?: string; - thumb_160_w?: string; - thumb_360?: string; - thumb_360_gif?: string; - thumb_360_h?: string; - thumb_360_w?: string; - thumb_480?: string; - thumb_480_gif?: string; - thumb_480_h?: string; - thumb_480_w?: string; - thumb_64?: string; - thumb_64_gif?: string; - thumb_64_h?: string; - thumb_64_w?: string; - thumb_720?: string; - thumb_720_gif?: string; - thumb_720_h?: string; - thumb_720_w?: string; - thumb_80?: string; - thumb_800?: string; - thumb_800_gif?: string; - thumb_800_h?: string; - thumb_800_w?: string; - thumb_80_gif?: string; - thumb_80_h?: string; - thumb_80_w?: string; - thumb_960?: string; - thumb_960_gif?: string; - thumb_960_h?: string; - thumb_960_w?: string; - thumb_gif?: string; - thumb_pdf?: string; - thumb_pdf_h?: string; - thumb_pdf_w?: string; - thumb_tiny?: string; - thumb_video?: string; - thumb_video_h?: number; - thumb_video_w?: number; - timestamp?: number; - title?: string; - to?: Cc[]; - transcription?: Transcription; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; - vtt?: string; + original_h?: string; + original_w?: string; + permalink?: string; + permalink_public?: string; + pinned_to?: string[]; + pjpeg?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; + public_url_shared?: boolean; + reactions?: Reaction[]; + saved?: Saved; + sent_to_self?: boolean; + shares?: Shares; + simplified_html?: string; + size?: number; + source_team?: string; + subject?: string; + subtype?: string; + thumb_1024?: string; + thumb_1024_gif?: string; + thumb_1024_h?: string; + thumb_1024_w?: string; + thumb_160?: string; + thumb_160_gif?: string; + thumb_160_h?: string; + thumb_160_w?: string; + thumb_360?: string; + thumb_360_gif?: string; + thumb_360_h?: string; + thumb_360_w?: string; + thumb_480?: string; + thumb_480_gif?: string; + thumb_480_h?: string; + thumb_480_w?: string; + thumb_64?: string; + thumb_64_gif?: string; + thumb_64_h?: string; + thumb_64_w?: string; + thumb_720?: string; + thumb_720_gif?: string; + thumb_720_h?: string; + thumb_720_w?: string; + thumb_80?: string; + thumb_800?: string; + thumb_800_gif?: string; + thumb_800_h?: string; + thumb_800_w?: string; + thumb_80_gif?: string; + thumb_80_h?: string; + thumb_80_w?: string; + thumb_960?: string; + thumb_960_gif?: string; + thumb_960_h?: string; + thumb_960_w?: string; + thumb_gif?: string; + thumb_pdf?: string; + thumb_pdf_h?: string; + thumb_pdf_w?: string; + thumb_tiny?: string; + thumb_video?: string; + thumb_video_h?: number; + thumb_video_w?: number; + timestamp?: number; + title?: string; + to?: Cc[]; + transcription?: Transcription; + updated?: number; + url_private?: string; + url_private_download?: string; + user?: string; + user_team?: string; + username?: string; + vtt?: string; } export interface Metadata { - extension?: string; - format?: string; - original_h?: number; - original_w?: number; - rotation?: number; - thumb_160?: boolean; + extension?: string; + format?: string; + original_h?: number; + original_w?: number; + rotation?: number; + thumb_160?: boolean; thumb_360_h?: number; thumb_360_w?: number; - thumb_64?: boolean; - thumb_80?: boolean; - thumb_tiny?: string; + thumb_64?: boolean; + thumb_80?: boolean; + thumb_tiny?: string; } export interface Preview { can_remove?: boolean; - icon_url?: string; - subtitle?: Description; - title?: Description; - type?: string; + icon_url?: string; + subtitle?: Description; + title?: Description; + type?: string; } export interface BotProfile { - app_id?: string; + app_id?: string; deleted?: boolean; - icons?: Icons; - id?: string; - name?: string; + icons?: Icons; + id?: string; + name?: string; team_id?: string; updated?: number; } @@ -720,14 +720,14 @@ export interface Icons { } export interface Edited { - ts?: string; + ts?: string; user?: string; } export interface Paging { - page?: number; - pages?: number; + page?: number; + pages?: number; per_page?: number; - spill?: number; - total?: number; + spill?: number; + total?: number; } diff --git a/packages/web-api/src/types/response/StarsRemoveResponse.ts b/packages/web-api/src/types/response/StarsRemoveResponse.ts index d22d82a0d..73fb46223 100644 --- a/packages/web-api/src/types/response/StarsRemoveResponse.ts +++ b/packages/web-api/src/types/response/StarsRemoveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type StarsRemoveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/TeamAccessLogsResponse.ts b/packages/web-api/src/types/response/TeamAccessLogsResponse.ts index 7312ef0d1..6a6c9de7c 100644 --- a/packages/web-api/src/types/response/TeamAccessLogsResponse.ts +++ b/packages/web-api/src/types/response/TeamAccessLogsResponse.ts @@ -8,33 +8,33 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type TeamAccessLogsResponse = WebAPICallResult & { - error?: string; - logins?: Login[]; - needed?: string; - ok?: boolean; - paging?: Paging; - provided?: string; + error?: string; + logins?: Login[]; + needed?: string; + ok?: boolean; + paging?: Paging; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Login { - count?: number; - country?: string; + count?: number; + country?: string; date_first?: number; - date_last?: number; - ip?: string; - isp?: string; - region?: string; + date_last?: number; + ip?: string; + isp?: string; + region?: string; user_agent?: string; - user_id?: string; - username?: string; + user_id?: string; + username?: string; } export interface Paging { count?: number; - page?: number; + page?: number; pages?: number; total?: number; } diff --git a/packages/web-api/src/types/response/TeamBillableInfoResponse.ts b/packages/web-api/src/types/response/TeamBillableInfoResponse.ts index 30c6fb668..bf8a5839a 100644 --- a/packages/web-api/src/types/response/TeamBillableInfoResponse.ts +++ b/packages/web-api/src/types/response/TeamBillableInfoResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type TeamBillableInfoResponse = WebAPICallResult & { - billable_info?: { [key: string]: BillableInfo }; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + billable_info?: { [key: string]: BillableInfo }; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/TeamBillingInfoResponse.ts b/packages/web-api/src/types/response/TeamBillingInfoResponse.ts index 55262c442..c8ae0e599 100644 --- a/packages/web-api/src/types/response/TeamBillingInfoResponse.ts +++ b/packages/web-api/src/types/response/TeamBillingInfoResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type TeamBillingInfoResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - plan?: string; + error?: string; + needed?: string; + ok?: boolean; + plan?: string; provided?: string; }; diff --git a/packages/web-api/src/types/response/TeamExternalTeamsDisconnectResponse.ts b/packages/web-api/src/types/response/TeamExternalTeamsDisconnectResponse.ts index f06e85cb4..2318bf471 100644 --- a/packages/web-api/src/types/response/TeamExternalTeamsDisconnectResponse.ts +++ b/packages/web-api/src/types/response/TeamExternalTeamsDisconnectResponse.ts @@ -8,12 +8,12 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type TeamExternalTeamsDisconnectResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/TeamExternalTeamsListResponse.ts b/packages/web-api/src/types/response/TeamExternalTeamsListResponse.ts index 43ab136fb..e53d21f7d 100644 --- a/packages/web-api/src/types/response/TeamExternalTeamsListResponse.ts +++ b/packages/web-api/src/types/response/TeamExternalTeamsListResponse.ts @@ -8,124 +8,124 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type TeamExternalTeamsListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - organizations?: Organization[]; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + organizations?: Organization[]; + provided?: string; response_metadata?: ResponseMetadata; - total_count?: number; + total_count?: number; }; export interface Organization { - canvas?: Canvas; - connected_workspaces?: ConnectedWorkspace[]; - connection_status?: string; - im_channel_count?: number; - is_sponsored?: boolean; + canvas?: Canvas; + connected_workspaces?: ConnectedWorkspace[]; + connection_status?: string; + im_channel_count?: number; + is_sponsored?: boolean; last_active_timestamp?: number; - lists?: Canvas; - mpim_channel_count?: number; + lists?: Canvas; + mpim_channel_count?: number; private_channel_count?: number; - public_channel_count?: number; - slack_connect_prefs?: SlackConnectPrefs; - team_domain?: string; - team_id?: string; - team_name?: string; + public_channel_count?: number; + slack_connect_prefs?: SlackConnectPrefs; + team_domain?: string; + team_id?: string; + team_name?: string; } export interface Canvas { ownership_details?: OwnershipDetail[]; - total_count?: number; + total_count?: number; } export interface OwnershipDetail { - count?: number; + count?: number; team_id?: string; } export interface ConnectedWorkspace { - workspace_id?: string; + workspace_id?: string; workspace_name?: string; } export interface SlackConnectPrefs { - accept_sc_invites?: AcceptScInvites; - allow_sc_file_uploads?: AllowScFileUploads; - allowed_canvas_sharing?: AllowScFileUploads; - allowed_list_sharing?: AllowScFileUploads; - allowed_workspaces?: AllowedWorkspaces; - approved_org_info?: AllowScFileUploads; + accept_sc_invites?: AcceptScInvites; + allow_sc_file_uploads?: AllowScFileUploads; + allowed_canvas_sharing?: AllowScFileUploads; + allowed_list_sharing?: AllowScFileUploads; + allowed_workspaces?: AllowedWorkspaces; + approved_org_info?: AllowScFileUploads; away_team_sc_invite_permissions?: AllowedWorkspaces; away_team_sc_invite_require_2fa?: AllowScFileUploads; - external_awareness_context_bar?: AllowScFileUploads; - profile_visibility?: AllowScFileUploads; - require_sc_channel_for_sc_dm?: AllowScFileUploads; - sc_channel_limited_access?: AllowScFileUploads; - sc_mpdm_to_private?: ScMpdmToPrivate; + external_awareness_context_bar?: AllowScFileUploads; + profile_visibility?: AllowScFileUploads; + require_sc_channel_for_sc_dm?: AllowScFileUploads; + sc_channel_limited_access?: AllowScFileUploads; + sc_mpdm_to_private?: ScMpdmToPrivate; shared_channel_invite_requested?: SharedChannelInviteRequested; } export interface AcceptScInvites { accept_in_workspace_ids?: string[]; - accept_private?: boolean; - actor?: string; - date_update?: number; - invalid_workspace_ids?: string[]; - source?: string; - type?: string; - use_allowed_workspaces?: boolean; + accept_private?: boolean; + actor?: string; + date_update?: number; + invalid_workspace_ids?: string[]; + source?: string; + type?: string; + use_allowed_workspaces?: boolean; } export interface AllowScFileUploads { - actor?: string; + actor?: string; approval_type?: string; - date_update?: number; - source?: string; - type?: boolean | string; - value?: boolean; + date_update?: number; + source?: string; + type?: boolean | string; + value?: boolean; } export interface AllowedWorkspaces { - actor?: string; + actor?: string; date_update?: number; - source?: string; - team_ids?: string[]; - type?: string; + source?: string; + team_ids?: string[]; + type?: string; } export interface ScMpdmToPrivate { accept_in_workspace_id?: string; - actor?: string; - date_update?: number; - invalid_workspace_ids?: string[]; - source?: string; - type?: string; + actor?: string; + date_update?: number; + invalid_workspace_ids?: string[]; + source?: string; + type?: string; } export interface SharedChannelInviteRequested { - actor?: string; + actor?: string; approval_destination?: ApprovalDestination; - date_update?: number; - enabled?: boolean; - source?: string; - usergroup_exclude?: UsergroupClude; - usergroup_include?: UsergroupClude; + date_update?: number; + enabled?: boolean; + source?: string; + usergroup_exclude?: UsergroupClude; + usergroup_include?: UsergroupClude; } export interface ApprovalDestination { all_who_can_manage_shared_channels?: boolean; - channel_id?: string; + channel_id?: string; } export interface UsergroupClude { - id?: string; + id?: string; team_id?: string; } export interface ResponseMetadata { - messages?: string[]; + messages?: string[]; next_cursor?: string; } diff --git a/packages/web-api/src/types/response/TeamInfoResponse.ts b/packages/web-api/src/types/response/TeamInfoResponse.ts index fc93fd118..dc05a3992 100644 --- a/packages/web-api/src/types/response/TeamInfoResponse.ts +++ b/packages/web-api/src/types/response/TeamInfoResponse.ts @@ -8,39 +8,39 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type TeamInfoResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - team?: Team; + team?: Team; }; export interface Team { - avatar_base_url?: string; - discoverable?: string; - domain?: string; - email_domain?: string; - enterprise_domain?: string; - enterprise_id?: string; - enterprise_name?: string; - icon?: Icon; - id?: string; - is_verified?: boolean; + avatar_base_url?: string; + discoverable?: string; + domain?: string; + email_domain?: string; + enterprise_domain?: string; + enterprise_id?: string; + enterprise_name?: string; + icon?: Icon; + id?: string; + is_verified?: boolean; lob_sales_home_enabled?: boolean; - name?: string; - url?: string; + name?: string; + url?: string; } export interface Icon { - image_102?: string; - image_132?: string; - image_230?: string; - image_34?: string; - image_44?: string; - image_68?: string; - image_88?: string; - image_default?: boolean; + image_102?: string; + image_132?: string; + image_230?: string; + image_34?: string; + image_44?: string; + image_68?: string; + image_88?: string; + image_default?: boolean; image_original?: string; } diff --git a/packages/web-api/src/types/response/TeamIntegrationLogsResponse.ts b/packages/web-api/src/types/response/TeamIntegrationLogsResponse.ts index f5cf5ffb3..06cdc0379 100644 --- a/packages/web-api/src/types/response/TeamIntegrationLogsResponse.ts +++ b/packages/web-api/src/types/response/TeamIntegrationLogsResponse.ts @@ -8,38 +8,38 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type TeamIntegrationLogsResponse = WebAPICallResult & { - error?: string; - logs?: Log[]; - needed?: string; - ok?: boolean; - paging?: Paging; + error?: string; + logs?: Log[]; + needed?: string; + ok?: boolean; + paging?: Paging; provided?: string; }; export interface Log { - app_id?: string; - app_type?: string; - change_type?: string; - channel?: string; - date?: string; - reason?: string; - resolution?: string; - rss_feed?: boolean; + app_id?: string; + app_type?: string; + change_type?: string; + channel?: string; + date?: string; + reason?: string; + resolution?: string; + rss_feed?: boolean; rss_feed_change_type?: string; - rss_feed_title?: string; - rss_feed_url?: string; - scope?: string; - service_id?: number; - service_type?: string; - user_id?: string; - user_name?: string; + rss_feed_title?: string; + rss_feed_url?: string; + scope?: string; + service_id?: number; + service_type?: string; + user_id?: string; + user_name?: string; } export interface Paging { count?: number; - page?: number; + page?: number; pages?: number; total?: number; } diff --git a/packages/web-api/src/types/response/TeamPreferencesListResponse.ts b/packages/web-api/src/types/response/TeamPreferencesListResponse.ts index 064b55782..ea7e4d885 100644 --- a/packages/web-api/src/types/response/TeamPreferencesListResponse.ts +++ b/packages/web-api/src/types/response/TeamPreferencesListResponse.ts @@ -8,15 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type TeamPreferencesListResponse = WebAPICallResult & { allow_message_deletion?: boolean; - disable_file_uploads?: string; - display_real_names?: boolean; - error?: string; - msg_edit_window_mins?: number; - needed?: string; - ok?: boolean; - provided?: string; - who_can_post_general?: string; + disable_file_uploads?: string; + display_real_names?: boolean; + error?: string; + msg_edit_window_mins?: number; + needed?: string; + ok?: boolean; + provided?: string; + who_can_post_general?: string; }; diff --git a/packages/web-api/src/types/response/TeamProfileGetResponse.ts b/packages/web-api/src/types/response/TeamProfileGetResponse.ts index f61d615df..7a3d02b5a 100644 --- a/packages/web-api/src/types/response/TeamProfileGetResponse.ts +++ b/packages/web-api/src/types/response/TeamProfileGetResponse.ts @@ -8,51 +8,51 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type TeamProfileGetResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - profile?: Profile; + error?: string; + needed?: string; + ok?: boolean; + profile?: Profile; provided?: string; }; export interface Profile { - fields?: Field[]; + fields?: Field[]; sections?: Section[]; } export interface Field { - field_name?: string; - hint?: string; - id?: string; - is_hidden?: boolean; - is_inverse?: boolean; - label?: string; - options?: Options; - ordering?: number; - permissions?: Permissions; + field_name?: string; + hint?: string; + id?: string; + is_hidden?: boolean; + is_inverse?: boolean; + label?: string; + options?: Options; + ordering?: number; + permissions?: Permissions; possible_values?: string[]; - section_id?: string; - type?: string; + section_id?: string; + type?: string; } export interface Options { is_protected?: boolean; - is_scim?: boolean; + is_scim?: boolean; } export interface Permissions { - api?: string[]; + api?: string[]; scim?: boolean; - ui?: boolean; + ui?: boolean; } export interface Section { - id?: string; - is_hidden?: boolean; - label?: string; - order?: number; + id?: string; + is_hidden?: boolean; + label?: string; + order?: number; section_type?: string; - team_id?: string; + team_id?: string; } diff --git a/packages/web-api/src/types/response/ToolingTokensRotateResponse.ts b/packages/web-api/src/types/response/ToolingTokensRotateResponse.ts index 94e5b79a1..711d25020 100644 --- a/packages/web-api/src/types/response/ToolingTokensRotateResponse.ts +++ b/packages/web-api/src/types/response/ToolingTokensRotateResponse.ts @@ -8,19 +8,19 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ToolingTokensRotateResponse = WebAPICallResult & { - error?: string; - exp?: number; - iat?: number; - needed?: string; - ok?: boolean; - provided?: string; - refresh_token?: string; + error?: string; + exp?: number; + iat?: number; + needed?: string; + ok?: boolean; + provided?: string; + refresh_token?: string; response_metadata?: ResponseMetadata; - team_id?: string; - token?: string; - user_id?: string; + team_id?: string; + token?: string; + user_id?: string; }; export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/UsergroupsCreateResponse.ts b/packages/web-api/src/types/response/UsergroupsCreateResponse.ts index 3f77cf8a5..da8f8cc62 100644 --- a/packages/web-api/src/types/response/UsergroupsCreateResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsCreateResponse.ts @@ -8,37 +8,37 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsergroupsCreateResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; usergroup?: Usergroup; }; export interface Usergroup { - auto_provision?: boolean; - channel_count?: number; - created_by?: string; - date_create?: number; - date_delete?: number; - date_update?: number; - description?: string; + auto_provision?: boolean; + channel_count?: number; + created_by?: string; + date_create?: number; + date_delete?: number; + date_update?: number; + description?: string; enterprise_subteam_id?: string; - handle?: string; - id?: string; - is_external?: boolean; - is_subteam?: boolean; - is_usergroup?: boolean; - name?: string; - prefs?: Prefs; - team_id?: string; - updated_by?: string; - users?: string[]; + handle?: string; + id?: string; + is_external?: boolean; + is_subteam?: boolean; + is_usergroup?: boolean; + name?: string; + prefs?: Prefs; + team_id?: string; + updated_by?: string; + users?: string[]; } export interface Prefs { channels?: string[]; - groups?: string[]; + groups?: string[]; } diff --git a/packages/web-api/src/types/response/UsergroupsDisableResponse.ts b/packages/web-api/src/types/response/UsergroupsDisableResponse.ts index 29c7a2e09..001e20ea0 100644 --- a/packages/web-api/src/types/response/UsergroupsDisableResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsDisableResponse.ts @@ -8,38 +8,38 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsergroupsDisableResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; usergroup?: Usergroup; }; export interface Usergroup { - auto_provision?: boolean; - channel_count?: number; - created_by?: string; - date_create?: number; - date_delete?: number; - date_update?: number; - deleted_by?: string; - description?: string; + auto_provision?: boolean; + channel_count?: number; + created_by?: string; + date_create?: number; + date_delete?: number; + date_update?: number; + deleted_by?: string; + description?: string; enterprise_subteam_id?: string; - handle?: string; - id?: string; - is_external?: boolean; - is_subteam?: boolean; - is_usergroup?: boolean; - name?: string; - prefs?: Prefs; - team_id?: string; - updated_by?: string; - users?: string[]; + handle?: string; + id?: string; + is_external?: boolean; + is_subteam?: boolean; + is_usergroup?: boolean; + name?: string; + prefs?: Prefs; + team_id?: string; + updated_by?: string; + users?: string[]; } export interface Prefs { channels?: string[]; - groups?: string[]; + groups?: string[]; } diff --git a/packages/web-api/src/types/response/UsergroupsEnableResponse.ts b/packages/web-api/src/types/response/UsergroupsEnableResponse.ts index 9ebabcac4..6e45241d8 100644 --- a/packages/web-api/src/types/response/UsergroupsEnableResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsEnableResponse.ts @@ -8,37 +8,37 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsergroupsEnableResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; usergroup?: Usergroup; }; export interface Usergroup { - auto_provision?: boolean; - channel_count?: number; - created_by?: string; - date_create?: number; - date_delete?: number; - date_update?: number; - description?: string; + auto_provision?: boolean; + channel_count?: number; + created_by?: string; + date_create?: number; + date_delete?: number; + date_update?: number; + description?: string; enterprise_subteam_id?: string; - handle?: string; - id?: string; - is_external?: boolean; - is_subteam?: boolean; - is_usergroup?: boolean; - name?: string; - prefs?: Prefs; - team_id?: string; - updated_by?: string; - users?: string[]; + handle?: string; + id?: string; + is_external?: boolean; + is_subteam?: boolean; + is_usergroup?: boolean; + name?: string; + prefs?: Prefs; + team_id?: string; + updated_by?: string; + users?: string[]; } export interface Prefs { channels?: string[]; - groups?: string[]; + groups?: string[]; } diff --git a/packages/web-api/src/types/response/UsergroupsListResponse.ts b/packages/web-api/src/types/response/UsergroupsListResponse.ts index ed962117f..6a87313bc 100644 --- a/packages/web-api/src/types/response/UsergroupsListResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsListResponse.ts @@ -8,38 +8,38 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsergroupsListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; usergroups?: Usergroup[]; }; export interface Usergroup { - auto_provision?: boolean; - channel_count?: number; - created_by?: string; - date_create?: number; - date_delete?: number; - date_update?: number; - description?: string; + auto_provision?: boolean; + channel_count?: number; + created_by?: string; + date_create?: number; + date_delete?: number; + date_update?: number; + description?: string; enterprise_subteam_id?: string; - handle?: string; - id?: string; - is_external?: boolean; - is_subteam?: boolean; - is_usergroup?: boolean; - name?: string; - prefs?: Prefs; - team_id?: string; - updated_by?: string; - user_count?: number; - users?: string[]; + handle?: string; + id?: string; + is_external?: boolean; + is_subteam?: boolean; + is_usergroup?: boolean; + name?: string; + prefs?: Prefs; + team_id?: string; + updated_by?: string; + user_count?: number; + users?: string[]; } export interface Prefs { channels?: string[]; - groups?: string[]; + groups?: string[]; } diff --git a/packages/web-api/src/types/response/UsergroupsUpdateResponse.ts b/packages/web-api/src/types/response/UsergroupsUpdateResponse.ts index cfa03043d..3fc507ca5 100644 --- a/packages/web-api/src/types/response/UsergroupsUpdateResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsUpdateResponse.ts @@ -8,37 +8,37 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsergroupsUpdateResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; usergroup?: Usergroup; }; export interface Usergroup { - auto_provision?: boolean; - channel_count?: number; - created_by?: string; - date_create?: number; - date_delete?: number; - date_update?: number; - description?: string; + auto_provision?: boolean; + channel_count?: number; + created_by?: string; + date_create?: number; + date_delete?: number; + date_update?: number; + description?: string; enterprise_subteam_id?: string; - handle?: string; - id?: string; - is_external?: boolean; - is_subteam?: boolean; - is_usergroup?: boolean; - name?: string; - prefs?: Prefs; - team_id?: string; - updated_by?: string; - users?: string[]; + handle?: string; + id?: string; + is_external?: boolean; + is_subteam?: boolean; + is_usergroup?: boolean; + name?: string; + prefs?: Prefs; + team_id?: string; + updated_by?: string; + users?: string[]; } export interface Prefs { channels?: string[]; - groups?: string[]; + groups?: string[]; } diff --git a/packages/web-api/src/types/response/UsergroupsUsersListResponse.ts b/packages/web-api/src/types/response/UsergroupsUsersListResponse.ts index 33a66d2f7..32a9d0ab5 100644 --- a/packages/web-api/src/types/response/UsergroupsUsersListResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsUsersListResponse.ts @@ -8,11 +8,11 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsergroupsUsersListResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - users?: string[]; + users?: string[]; }; diff --git a/packages/web-api/src/types/response/UsergroupsUsersUpdateResponse.ts b/packages/web-api/src/types/response/UsergroupsUsersUpdateResponse.ts index 33899c869..542a81a6b 100644 --- a/packages/web-api/src/types/response/UsergroupsUsersUpdateResponse.ts +++ b/packages/web-api/src/types/response/UsergroupsUsersUpdateResponse.ts @@ -8,37 +8,37 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsergroupsUsersUpdateResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; usergroup?: Usergroup; }; export interface Usergroup { - auto_provision?: boolean; - channel_count?: number; - created_by?: string; - date_create?: number; - date_delete?: number; - date_update?: number; - description?: string; + auto_provision?: boolean; + channel_count?: number; + created_by?: string; + date_create?: number; + date_delete?: number; + date_update?: number; + description?: string; enterprise_subteam_id?: string; - handle?: string; - id?: string; - is_external?: boolean; - is_subteam?: boolean; - is_usergroup?: boolean; - name?: string; - prefs?: Prefs; - team_id?: string; - updated_by?: string; - users?: string[]; + handle?: string; + id?: string; + is_external?: boolean; + is_subteam?: boolean; + is_usergroup?: boolean; + name?: string; + prefs?: Prefs; + team_id?: string; + updated_by?: string; + users?: string[]; } export interface Prefs { channels?: string[]; - groups?: string[]; + groups?: string[]; } diff --git a/packages/web-api/src/types/response/UsersConversationsResponse.ts b/packages/web-api/src/types/response/UsersConversationsResponse.ts index 027795d79..143906ed8 100644 --- a/packages/web-api/src/types/response/UsersConversationsResponse.ts +++ b/packages/web-api/src/types/response/UsersConversationsResponse.ts @@ -8,69 +8,69 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersConversationsResponse = WebAPICallResult & { - channels?: Channel[]; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + channels?: Channel[]; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Channel { - context_team_id?: string; - conversation_host_id?: string; - created?: number; - creator?: string; - enterprise_id?: string; - id?: string; - internal_team_ids?: string[]; - is_archived?: boolean; - is_channel?: boolean; - is_ext_shared?: boolean; - is_general?: boolean; - is_global_shared?: boolean; - is_group?: boolean; - is_im?: boolean; - is_moved?: number; - is_mpim?: boolean; - is_open?: boolean; - is_org_default?: boolean; - is_org_mandatory?: boolean; - is_org_shared?: boolean; - is_pending_ext_shared?: boolean; - is_private?: boolean; - is_shared?: boolean; - is_user_deleted?: boolean; - last_read?: string; - name?: string; - name_normalized?: string; - parent_conversation?: string; + context_team_id?: string; + conversation_host_id?: string; + created?: number; + creator?: string; + enterprise_id?: string; + id?: string; + internal_team_ids?: string[]; + is_archived?: boolean; + is_channel?: boolean; + is_ext_shared?: boolean; + is_general?: boolean; + is_global_shared?: boolean; + is_group?: boolean; + is_im?: boolean; + is_moved?: number; + is_mpim?: boolean; + is_open?: boolean; + is_org_default?: boolean; + is_org_mandatory?: boolean; + is_org_shared?: boolean; + is_pending_ext_shared?: boolean; + is_private?: boolean; + is_shared?: boolean; + is_user_deleted?: boolean; + last_read?: string; + name?: string; + name_normalized?: string; + parent_conversation?: string; pending_connected_team_ids?: string[]; - pending_shared?: string[]; - previous_names?: string[]; - priority?: number; - properties?: Properties; - purpose?: Purpose; - shared_team_ids?: string[]; - topic?: Purpose; - unlinked?: number; - updated?: number; - user?: string; + pending_shared?: string[]; + previous_names?: string[]; + priority?: number; + properties?: Properties; + purpose?: Purpose; + shared_team_ids?: string[]; + topic?: Purpose; + unlinked?: number; + updated?: number; + user?: string; } export interface Properties { - canvas?: Canvas; - huddles_restricted?: boolean; + canvas?: Canvas; + huddles_restricted?: boolean; posting_restricted_to?: PostingRestrictedTo; - tabs?: Tab[]; + tabs?: Tab[]; threads_restricted_to?: ThreadsRestrictedTo; } export interface Canvas { - file_id?: string; - is_empty?: boolean; + file_id?: string; + is_empty?: boolean; quip_thread_id?: string; } @@ -80,9 +80,9 @@ export interface PostingRestrictedTo { } export interface Tab { - id?: string; + id?: string; label?: string; - type?: string; + type?: string; } export interface ThreadsRestrictedTo { @@ -90,9 +90,9 @@ export interface ThreadsRestrictedTo { } export interface Purpose { - creator?: string; + creator?: string; last_set?: number; - value?: string; + value?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/UsersDeletePhotoResponse.ts b/packages/web-api/src/types/response/UsersDeletePhotoResponse.ts index 3917e1297..ce940b023 100644 --- a/packages/web-api/src/types/response/UsersDeletePhotoResponse.ts +++ b/packages/web-api/src/types/response/UsersDeletePhotoResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersDeletePhotoResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/UsersDiscoverableContactsLookupResponse.ts b/packages/web-api/src/types/response/UsersDiscoverableContactsLookupResponse.ts index 8806cf76b..6ea47e1bf 100644 --- a/packages/web-api/src/types/response/UsersDiscoverableContactsLookupResponse.ts +++ b/packages/web-api/src/types/response/UsersDiscoverableContactsLookupResponse.ts @@ -8,13 +8,13 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersDiscoverableContactsLookupResponse = WebAPICallResult & { - error?: string; - is_discoverable?: boolean; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + is_discoverable?: boolean; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; diff --git a/packages/web-api/src/types/response/UsersGetPresenceResponse.ts b/packages/web-api/src/types/response/UsersGetPresenceResponse.ts index cd675caeb..9ccd29150 100644 --- a/packages/web-api/src/types/response/UsersGetPresenceResponse.ts +++ b/packages/web-api/src/types/response/UsersGetPresenceResponse.ts @@ -8,17 +8,17 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersGetPresenceResponse = WebAPICallResult & { - auto_away?: boolean; + auto_away?: boolean; connection_count?: number; - error?: string; - last_activity?: number; - manual_away?: boolean; - needed?: string; - ok?: boolean; - online?: boolean; - presence?: string; - provided?: string; - warning?: string; + error?: string; + last_activity?: number; + manual_away?: boolean; + needed?: string; + ok?: boolean; + online?: boolean; + presence?: string; + provided?: string; + warning?: string; }; diff --git a/packages/web-api/src/types/response/UsersIdentityResponse.ts b/packages/web-api/src/types/response/UsersIdentityResponse.ts index d8c54e65e..f476cfe37 100644 --- a/packages/web-api/src/types/response/UsersIdentityResponse.ts +++ b/packages/web-api/src/types/response/UsersIdentityResponse.ts @@ -8,30 +8,30 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersIdentityResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - team?: Team; - user?: User; - warning?: string; + team?: Team; + user?: User; + warning?: string; }; export interface Team { - id?: string; + id?: string; name?: string; } export interface User { - email?: string; - id?: string; + email?: string; + id?: string; image_192?: string; - image_24?: string; - image_32?: string; - image_48?: string; + image_24?: string; + image_32?: string; + image_48?: string; image_512?: string; - image_72?: string; - name?: string; + image_72?: string; + name?: string; } diff --git a/packages/web-api/src/types/response/UsersInfoResponse.ts b/packages/web-api/src/types/response/UsersInfoResponse.ts index 6ddd53c88..a95de8fa2 100644 --- a/packages/web-api/src/types/response/UsersInfoResponse.ts +++ b/packages/web-api/src/types/response/UsersInfoResponse.ts @@ -8,94 +8,94 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersInfoResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; - user?: User; + user?: User; }; export interface User { - color?: string; - deleted?: boolean; - enterprise_user?: EnterpriseUser; - has_2fa?: boolean; - id?: string; - is_admin?: boolean; - is_app_user?: boolean; - is_bot?: boolean; - is_connector_bot?: boolean; - is_email_confirmed?: boolean; - is_invited_user?: boolean; - is_owner?: boolean; - is_primary_owner?: boolean; - is_restricted?: boolean; - is_stranger?: boolean; - is_ultra_restricted?: boolean; - is_workflow_bot?: boolean; - locale?: string; - name?: string; - profile?: Profile; - real_name?: string; - team_id?: string; - tz?: string; - tz_label?: string; - tz_offset?: number; - updated?: number; + color?: string; + deleted?: boolean; + enterprise_user?: EnterpriseUser; + has_2fa?: boolean; + id?: string; + is_admin?: boolean; + is_app_user?: boolean; + is_bot?: boolean; + is_connector_bot?: boolean; + is_email_confirmed?: boolean; + is_invited_user?: boolean; + is_owner?: boolean; + is_primary_owner?: boolean; + is_restricted?: boolean; + is_stranger?: boolean; + is_ultra_restricted?: boolean; + is_workflow_bot?: boolean; + locale?: string; + name?: string; + profile?: Profile; + real_name?: string; + team_id?: string; + tz?: string; + tz_label?: string; + tz_offset?: number; + updated?: number; who_can_share_contact_card?: string; } export interface EnterpriseUser { - enterprise_id?: string; + enterprise_id?: string; enterprise_name?: string; - id?: string; - is_admin?: boolean; - is_owner?: boolean; - teams?: string[]; + id?: string; + is_admin?: boolean; + is_owner?: boolean; + teams?: string[]; } export interface Profile { - always_active?: boolean; - api_app_id?: string; - avatar_hash?: string; - bot_id?: string; - display_name?: string; - display_name_normalized?: string; - email?: string; - first_name?: string; - guest_invited_by?: string; - huddle_state?: string; + always_active?: boolean; + api_app_id?: string; + avatar_hash?: string; + bot_id?: string; + display_name?: string; + display_name_normalized?: string; + email?: string; + first_name?: string; + guest_invited_by?: string; + huddle_state?: string; huddle_state_expiration_ts?: number; - image_1024?: string; - image_192?: string; - image_24?: string; - image_32?: string; - image_48?: string; - image_512?: string; - image_72?: string; - image_original?: string; - is_custom_image?: boolean; - last_name?: string; - phone?: string; - pronouns?: string; - real_name?: string; - real_name_normalized?: string; - skype?: string; - status_emoji?: string; - status_emoji_display_info?: StatusEmojiDisplayInfo[]; - status_emoji_url?: string; - status_expiration?: number; - status_text?: string; - status_text_canonical?: string; - team?: string; - title?: string; + image_1024?: string; + image_192?: string; + image_24?: string; + image_32?: string; + image_48?: string; + image_512?: string; + image_72?: string; + image_original?: string; + is_custom_image?: boolean; + last_name?: string; + phone?: string; + pronouns?: string; + real_name?: string; + real_name_normalized?: string; + skype?: string; + status_emoji?: string; + status_emoji_display_info?: StatusEmojiDisplayInfo[]; + status_emoji_url?: string; + status_expiration?: number; + status_text?: string; + status_text_canonical?: string; + team?: string; + title?: string; } export interface StatusEmojiDisplayInfo { display_alias?: string; - display_url?: string; - emoji_name?: string; - unicode?: string; + display_url?: string; + emoji_name?: string; + unicode?: string; } diff --git a/packages/web-api/src/types/response/UsersListResponse.ts b/packages/web-api/src/types/response/UsersListResponse.ts index bb17aa38f..5365ed57e 100644 --- a/packages/web-api/src/types/response/UsersListResponse.ts +++ b/packages/web-api/src/types/response/UsersListResponse.ts @@ -8,105 +8,104 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersListResponse = WebAPICallResult & { - arg?: string; - cache_ts?: number; - error?: string; - members?: Member[]; - needed?: string; - offset?: string; - ok?: boolean; - provided?: string; + arg?: string; + cache_ts?: number; + error?: string; + members?: Member[]; + needed?: string; + offset?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; }; export interface Member { - color?: string; - deleted?: boolean; - enterprise_user?: EnterpriseUser; - has_2fa?: boolean; - id?: string; - is_admin?: boolean; - is_app_user?: boolean; - is_bot?: boolean; - is_connector_bot?: boolean; - is_email_confirmed?: boolean; - is_invited_user?: boolean; - is_owner?: boolean; - is_primary_owner?: boolean; - is_restricted?: boolean; - is_ultra_restricted?: boolean; - is_workflow_bot?: boolean; - locale?: string; - name?: string; - profile?: Profile; - real_name?: string; - team_id?: string; - two_factor_type?: string; - tz?: string; - tz_label?: string; - tz_offset?: number; - updated?: number; + color?: string; + deleted?: boolean; + enterprise_user?: EnterpriseUser; + has_2fa?: boolean; + id?: string; + is_admin?: boolean; + is_app_user?: boolean; + is_bot?: boolean; + is_connector_bot?: boolean; + is_email_confirmed?: boolean; + is_invited_user?: boolean; + is_owner?: boolean; + is_primary_owner?: boolean; + is_restricted?: boolean; + is_ultra_restricted?: boolean; + is_workflow_bot?: boolean; + locale?: string; + name?: string; + profile?: Profile; + real_name?: string; + team_id?: string; + two_factor_type?: string; + tz?: string; + tz_label?: string; + tz_offset?: number; + updated?: number; who_can_share_contact_card?: string; } export interface EnterpriseUser { - enterprise_id?: string; - enterprise_name?: string; - id?: string; - is_admin?: boolean; - is_owner?: boolean; + enterprise_id?: string; + enterprise_name?: string; + id?: string; + is_admin?: boolean; + is_owner?: boolean; is_primary_owner?: boolean; - teams?: string[]; + teams?: string[]; } export interface Profile { - always_active?: boolean; - api_app_id?: string; - avatar_hash?: string; - bot_id?: string; - display_name?: string; - display_name_normalized?: string; - email?: string; - fields?: Fields; - first_name?: string; - guest_expiration_ts?: number; - guest_invited_by?: string; - huddle_state?: string; + always_active?: boolean; + api_app_id?: string; + avatar_hash?: string; + bot_id?: string; + display_name?: string; + display_name_normalized?: string; + email?: string; + fields?: Fields; + first_name?: string; + guest_expiration_ts?: number; + guest_invited_by?: string; + huddle_state?: string; huddle_state_expiration_ts?: number; - image_1024?: string; - image_192?: string; - image_24?: string; - image_32?: string; - image_48?: string; - image_512?: string; - image_72?: string; - image_original?: string; - is_custom_image?: boolean; - last_name?: string; - phone?: string; - pronouns?: string; - real_name?: string; - real_name_normalized?: string; - skype?: string; - status_emoji?: string; - status_emoji_display_info?: StatusEmojiDisplayInfo[]; - status_expiration?: number; - status_text?: string; - status_text_canonical?: string; - team?: string; - title?: string; + image_1024?: string; + image_192?: string; + image_24?: string; + image_32?: string; + image_48?: string; + image_512?: string; + image_72?: string; + image_original?: string; + is_custom_image?: boolean; + last_name?: string; + phone?: string; + pronouns?: string; + real_name?: string; + real_name_normalized?: string; + skype?: string; + status_emoji?: string; + status_emoji_display_info?: StatusEmojiDisplayInfo[]; + status_expiration?: number; + status_text?: string; + status_text_canonical?: string; + team?: string; + title?: string; } -export interface Fields { -} +export type Fields = {}; export interface StatusEmojiDisplayInfo { display_alias?: string; - display_url?: string; - emoji_name?: string; - unicode?: string; + display_url?: string; + emoji_name?: string; + unicode?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/types/response/UsersLookupByEmailResponse.ts b/packages/web-api/src/types/response/UsersLookupByEmailResponse.ts index 9f036eb34..fb1829ba4 100644 --- a/packages/web-api/src/types/response/UsersLookupByEmailResponse.ts +++ b/packages/web-api/src/types/response/UsersLookupByEmailResponse.ts @@ -8,14 +8,14 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersLookupByEmailResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - user?: User; + user?: User; }; export interface ResponseMetadata { @@ -23,67 +23,67 @@ export interface ResponseMetadata { } export interface User { - color?: string; - deleted?: boolean; - has_2fa?: boolean; - id?: string; - is_admin?: boolean; - is_app_user?: boolean; - is_bot?: boolean; - is_email_confirmed?: boolean; - is_invited_user?: boolean; - is_owner?: boolean; - is_primary_owner?: boolean; - is_restricted?: boolean; - is_ultra_restricted?: boolean; - name?: string; - profile?: Profile; - real_name?: string; - team_id?: string; - tz?: string; - tz_label?: string; - tz_offset?: number; - updated?: number; + color?: string; + deleted?: boolean; + has_2fa?: boolean; + id?: string; + is_admin?: boolean; + is_app_user?: boolean; + is_bot?: boolean; + is_email_confirmed?: boolean; + is_invited_user?: boolean; + is_owner?: boolean; + is_primary_owner?: boolean; + is_restricted?: boolean; + is_ultra_restricted?: boolean; + name?: string; + profile?: Profile; + real_name?: string; + team_id?: string; + tz?: string; + tz_label?: string; + tz_offset?: number; + updated?: number; who_can_share_contact_card?: string; } export interface Profile { - avatar_hash?: string; - display_name?: string; - display_name_normalized?: string; - email?: string; - first_name?: string; - guest_invited_by?: string; - huddle_state?: string; + avatar_hash?: string; + display_name?: string; + display_name_normalized?: string; + email?: string; + first_name?: string; + guest_invited_by?: string; + huddle_state?: string; huddle_state_expiration_ts?: number; - image_1024?: string; - image_192?: string; - image_24?: string; - image_32?: string; - image_48?: string; - image_512?: string; - image_72?: string; - image_original?: string; - is_custom_image?: boolean; - last_name?: string; - phone?: string; - pronouns?: string; - real_name?: string; - real_name_normalized?: string; - skype?: string; - status_emoji?: string; - status_emoji_display_info?: StatusEmojiDisplayInfo[]; - status_emoji_url?: string; - status_expiration?: number; - status_text?: string; - status_text_canonical?: string; - team?: string; - title?: string; + image_1024?: string; + image_192?: string; + image_24?: string; + image_32?: string; + image_48?: string; + image_512?: string; + image_72?: string; + image_original?: string; + is_custom_image?: boolean; + last_name?: string; + phone?: string; + pronouns?: string; + real_name?: string; + real_name_normalized?: string; + skype?: string; + status_emoji?: string; + status_emoji_display_info?: StatusEmojiDisplayInfo[]; + status_emoji_url?: string; + status_expiration?: number; + status_text?: string; + status_text_canonical?: string; + team?: string; + title?: string; } export interface StatusEmojiDisplayInfo { display_alias?: string; - display_url?: string; - emoji_name?: string; - unicode?: string; + display_url?: string; + emoji_name?: string; + unicode?: string; } diff --git a/packages/web-api/src/types/response/UsersProfileGetResponse.ts b/packages/web-api/src/types/response/UsersProfileGetResponse.ts index 51e1f88e6..957231a74 100644 --- a/packages/web-api/src/types/response/UsersProfileGetResponse.ts +++ b/packages/web-api/src/types/response/UsersProfileGetResponse.ts @@ -8,57 +8,57 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersProfileGetResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - profile?: Profile; + error?: string; + needed?: string; + ok?: boolean; + profile?: Profile; provided?: string; }; export interface Profile { - avatar_hash?: string; - display_name?: string; - display_name_normalized?: string; - email?: string; - fields?: { [key: string]: Field }; - first_name?: string; - huddle_state?: string; + avatar_hash?: string; + display_name?: string; + display_name_normalized?: string; + email?: string; + fields?: { [key: string]: Field }; + first_name?: string; + huddle_state?: string; huddle_state_expiration_ts?: number; - image_1024?: string; - image_192?: string; - image_24?: string; - image_32?: string; - image_48?: string; - image_512?: string; - image_72?: string; - image_original?: string; - is_custom_image?: boolean; - last_name?: string; - phone?: string; - pronouns?: string; - real_name?: string; - real_name_normalized?: string; - skype?: string; - status_emoji?: string; - status_emoji_display_info?: StatusEmojiDisplayInfo[]; - status_emoji_url?: string; - status_expiration?: number; - status_text?: string; - status_text_canonical?: string; - title?: string; + image_1024?: string; + image_192?: string; + image_24?: string; + image_32?: string; + image_48?: string; + image_512?: string; + image_72?: string; + image_original?: string; + is_custom_image?: boolean; + last_name?: string; + phone?: string; + pronouns?: string; + real_name?: string; + real_name_normalized?: string; + skype?: string; + status_emoji?: string; + status_emoji_display_info?: StatusEmojiDisplayInfo[]; + status_emoji_url?: string; + status_expiration?: number; + status_text?: string; + status_text_canonical?: string; + title?: string; } export interface Field { - alt?: string; + alt?: string; label?: string; value?: string; } export interface StatusEmojiDisplayInfo { display_alias?: string; - display_url?: string; - emoji_name?: string; - unicode?: string; + display_url?: string; + emoji_name?: string; + unicode?: string; } diff --git a/packages/web-api/src/types/response/UsersProfileSetResponse.ts b/packages/web-api/src/types/response/UsersProfileSetResponse.ts index df307449e..ba65ece3a 100644 --- a/packages/web-api/src/types/response/UsersProfileSetResponse.ts +++ b/packages/web-api/src/types/response/UsersProfileSetResponse.ts @@ -8,57 +8,57 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersProfileSetResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - profile?: Profile; + error?: string; + needed?: string; + ok?: boolean; + profile?: Profile; provided?: string; username?: string; }; export interface Profile { - avatar_hash?: string; - display_name?: string; - display_name_normalized?: string; - email?: string; - fields?: { [key: string]: Field }; - first_name?: string; - huddle_state?: string; + avatar_hash?: string; + display_name?: string; + display_name_normalized?: string; + email?: string; + fields?: { [key: string]: Field }; + first_name?: string; + huddle_state?: string; huddle_state_expiration_ts?: number; - image_1024?: string; - image_192?: string; - image_24?: string; - image_32?: string; - image_48?: string; - image_512?: string; - image_72?: string; - image_original?: string; - is_custom_image?: boolean; - last_name?: string; - phone?: string; - pronouns?: string; - real_name?: string; - real_name_normalized?: string; - skype?: string; - status_emoji?: string; - status_emoji_display_info?: StatusEmojiDisplayInfo[]; - status_emoji_url?: string; - status_expiration?: number; - status_text?: string; - status_text_canonical?: string; - title?: string; + image_1024?: string; + image_192?: string; + image_24?: string; + image_32?: string; + image_48?: string; + image_512?: string; + image_72?: string; + image_original?: string; + is_custom_image?: boolean; + last_name?: string; + phone?: string; + pronouns?: string; + real_name?: string; + real_name_normalized?: string; + skype?: string; + status_emoji?: string; + status_emoji_display_info?: StatusEmojiDisplayInfo[]; + status_emoji_url?: string; + status_expiration?: number; + status_text?: string; + status_text_canonical?: string; + title?: string; } export interface Field { - alt?: string; + alt?: string; value?: string; } export interface StatusEmojiDisplayInfo { display_alias?: string; - display_url?: string; - emoji_name?: string; - unicode?: string; + display_url?: string; + emoji_name?: string; + unicode?: string; } diff --git a/packages/web-api/src/types/response/UsersSetActiveResponse.ts b/packages/web-api/src/types/response/UsersSetActiveResponse.ts index 19d0e8a2a..d3252658d 100644 --- a/packages/web-api/src/types/response/UsersSetActiveResponse.ts +++ b/packages/web-api/src/types/response/UsersSetActiveResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersSetActiveResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/UsersSetPhotoResponse.ts b/packages/web-api/src/types/response/UsersSetPhotoResponse.ts index 87d31637e..1c273a88c 100644 --- a/packages/web-api/src/types/response/UsersSetPhotoResponse.ts +++ b/packages/web-api/src/types/response/UsersSetPhotoResponse.ts @@ -8,23 +8,23 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersSetPhotoResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - profile?: Profile; + error?: string; + needed?: string; + ok?: boolean; + profile?: Profile; provided?: string; }; export interface Profile { - avatar_hash?: string; - image_1024?: string; - image_192?: string; - image_24?: string; - image_32?: string; - image_48?: string; - image_512?: string; - image_72?: string; + avatar_hash?: string; + image_1024?: string; + image_192?: string; + image_24?: string; + image_32?: string; + image_48?: string; + image_512?: string; + image_72?: string; image_original?: string; } diff --git a/packages/web-api/src/types/response/UsersSetPresenceResponse.ts b/packages/web-api/src/types/response/UsersSetPresenceResponse.ts index 011735983..2bd4955e2 100644 --- a/packages/web-api/src/types/response/UsersSetPresenceResponse.ts +++ b/packages/web-api/src/types/response/UsersSetPresenceResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type UsersSetPresenceResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/ViewsOpenResponse.ts b/packages/web-api/src/types/response/ViewsOpenResponse.ts index 2a965f6d9..813ebe4d5 100644 --- a/packages/web-api/src/types/response/ViewsOpenResponse.ts +++ b/packages/web-api/src/types/response/ViewsOpenResponse.ts @@ -8,15 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ViewsOpenResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - view?: View; - warning?: string; + view?: View; + warning?: string; }; export interface ResponseMetadata { @@ -24,78 +24,78 @@ export interface ResponseMetadata { } export interface View { - app_id?: string; + app_id?: string; app_installed_team_id?: string; - blocks?: Block[]; - bot_id?: string; - callback_id?: string; - clear_on_close?: boolean; - close?: Close; - external_id?: string; - hash?: string; - id?: string; - notify_on_close?: boolean; - previous_view_id?: string; - private_metadata?: string; - root_view_id?: string; - state?: State; - submit?: Close; - submit_disabled?: boolean; - team_id?: string; - title?: Close; - type?: string; + blocks?: Block[]; + bot_id?: string; + callback_id?: string; + clear_on_close?: boolean; + close?: Close; + external_id?: string; + hash?: string; + id?: string; + notify_on_close?: boolean; + previous_view_id?: string; + private_metadata?: string; + root_view_id?: string; + state?: State; + submit?: Close; + submit_disabled?: boolean; + team_id?: string; + title?: Close; + type?: string; } export interface Block { - accessory?: Accessory; - alt_text?: string; - author_name?: string; - block_id?: string; - description?: Close; - dispatch_action?: boolean; - element?: PurpleElement; - elements?: StickyElement[]; - fallback?: string; - fields?: Close[]; - hint?: Close; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - label?: Close; - optional?: boolean; + accessory?: Accessory; + alt_text?: string; + author_name?: string; + block_id?: string; + description?: Close; + dispatch_action?: boolean; + element?: PurpleElement; + elements?: StickyElement[]; + fallback?: string; + fields?: Close[]; + hint?: Close; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + label?: Close; + optional?: boolean; provider_icon_url?: string; - provider_name?: string; - slack_file?: SlackFile; - text?: Close; - thumbnail_url?: string; - title?: Close; - title_url?: string; - type?: string; - video_url?: string; + provider_name?: string; + slack_file?: SlackFile; + text?: Close; + thumbnail_url?: string; + title?: Close; + title_url?: string; + type?: string; + video_url?: string; } export interface Accessory { - alt_text?: string; - fallback?: string; - image_bytes?: number; + alt_text?: string; + fallback?: string; + image_bytes?: number; image_height?: number; - image_url?: string; - image_width?: number; - slack_file?: SlackFile; - type?: string; + image_url?: string; + image_width?: number; + slack_file?: SlackFile; + type?: string; } export interface SlackFile { - id?: string; + id?: string; url?: string; } export interface Close { - emoji?: boolean; - text?: string; - type?: CloseType; + emoji?: boolean; + text?: string; + type?: CloseType; verbatim?: boolean; } @@ -106,50 +106,50 @@ export enum CloseType { } export interface PurpleElement { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + confirm?: Confirm; default_to_current_conversation?: boolean; - dispatch_action_config?: DispatchActionConfig; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; - initial_conversation?: string; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_time?: string; - initial_user?: string; - initial_value?: InitialValueClass | string; - max_length?: number; - min_length?: number; - min_query_length?: number; - multiline?: boolean; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Close; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Close; - timezone?: string; - type?: string; - url?: string; - value?: string; + dispatch_action_config?: DispatchActionConfig; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; + initial_conversation?: string; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_time?: string; + initial_user?: string; + initial_value?: InitialValueClass | string; + max_length?: number; + min_length?: number; + min_query_length?: number; + multiline?: boolean; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Close; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Close; + timezone?: string; + type?: string; + url?: string; + value?: string; } export interface Confirm { confirm?: Close; - deny?: Close; - style?: string; - text?: Close; - title?: Close; + deny?: Close; + style?: string; + text?: Close; + title?: Close; } export interface DispatchActionConfig { @@ -157,70 +157,70 @@ export interface DispatchActionConfig { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Close; - text?: Close; - url?: string; - value?: string; + text?: Close; + url?: string; + value?: string; } export interface InitialValueClass { block_id?: string; elements?: InitialValueElement[]; - type?: string; + type?: string; } export interface InitialValueElement { - border?: number; + border?: number; elements?: FluffyElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface FluffyElement { - border?: number; + border?: number; elements?: TentacledElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface TentacledElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -237,48 +237,48 @@ export enum ElementType { } export interface OptionGroup { - label?: Close; + label?: Close; options?: Option[]; } export interface StickyElement { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + confirm?: Confirm; default_to_current_conversation?: boolean; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Close; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Close; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Close; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Close; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Workflow { @@ -287,13 +287,12 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } -export interface State { -} +export type State = {}; diff --git a/packages/web-api/src/types/response/ViewsPublishResponse.ts b/packages/web-api/src/types/response/ViewsPublishResponse.ts index 7dc5a9c66..e9f3fc753 100644 --- a/packages/web-api/src/types/response/ViewsPublishResponse.ts +++ b/packages/web-api/src/types/response/ViewsPublishResponse.ts @@ -8,15 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ViewsPublishResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - view?: View; - warning?: string; + view?: View; + warning?: string; }; export interface ResponseMetadata { @@ -24,78 +24,78 @@ export interface ResponseMetadata { } export interface View { - app_id?: string; + app_id?: string; app_installed_team_id?: string; - blocks?: Block[]; - bot_id?: string; - callback_id?: string; - clear_on_close?: boolean; - close?: Close; - external_id?: string; - hash?: string; - id?: string; - notify_on_close?: boolean; - previous_view_id?: string; - private_metadata?: string; - root_view_id?: string; - state?: State; - submit?: Close; - submit_disabled?: boolean; - team_id?: string; - title?: Close; - type?: string; + blocks?: Block[]; + bot_id?: string; + callback_id?: string; + clear_on_close?: boolean; + close?: Close; + external_id?: string; + hash?: string; + id?: string; + notify_on_close?: boolean; + previous_view_id?: string; + private_metadata?: string; + root_view_id?: string; + state?: State; + submit?: Close; + submit_disabled?: boolean; + team_id?: string; + title?: Close; + type?: string; } export interface Block { - accessory?: Accessory; - alt_text?: string; - author_name?: string; - block_id?: string; - description?: Close; - dispatch_action?: boolean; - element?: PurpleElement; - elements?: StickyElement[]; - fallback?: string; - fields?: Close[]; - hint?: Close; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - label?: Close; - optional?: boolean; + accessory?: Accessory; + alt_text?: string; + author_name?: string; + block_id?: string; + description?: Close; + dispatch_action?: boolean; + element?: PurpleElement; + elements?: StickyElement[]; + fallback?: string; + fields?: Close[]; + hint?: Close; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + label?: Close; + optional?: boolean; provider_icon_url?: string; - provider_name?: string; - slack_file?: SlackFile; - text?: Close; - thumbnail_url?: string; - title?: Close; - title_url?: string; - type?: string; - video_url?: string; + provider_name?: string; + slack_file?: SlackFile; + text?: Close; + thumbnail_url?: string; + title?: Close; + title_url?: string; + type?: string; + video_url?: string; } export interface Accessory { - alt_text?: string; - fallback?: string; - image_bytes?: number; + alt_text?: string; + fallback?: string; + image_bytes?: number; image_height?: number; - image_url?: string; - image_width?: number; - slack_file?: SlackFile; - type?: string; + image_url?: string; + image_width?: number; + slack_file?: SlackFile; + type?: string; } export interface SlackFile { - id?: string; + id?: string; url?: string; } export interface Close { - emoji?: boolean; - text?: string; - type?: CloseType; + emoji?: boolean; + text?: string; + type?: CloseType; verbatim?: boolean; } @@ -106,50 +106,50 @@ export enum CloseType { } export interface PurpleElement { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + confirm?: Confirm; default_to_current_conversation?: boolean; - dispatch_action_config?: DispatchActionConfig; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; - initial_conversation?: string; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_time?: string; - initial_user?: string; - initial_value?: InitialValueClass | string; - max_length?: number; - min_length?: number; - min_query_length?: number; - multiline?: boolean; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Close; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Close; - timezone?: string; - type?: string; - url?: string; - value?: string; + dispatch_action_config?: DispatchActionConfig; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; + initial_conversation?: string; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_time?: string; + initial_user?: string; + initial_value?: InitialValueClass | string; + max_length?: number; + min_length?: number; + min_query_length?: number; + multiline?: boolean; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Close; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Close; + timezone?: string; + type?: string; + url?: string; + value?: string; } export interface Confirm { confirm?: Close; - deny?: Close; - style?: string; - text?: Close; - title?: Close; + deny?: Close; + style?: string; + text?: Close; + title?: Close; } export interface DispatchActionConfig { @@ -157,70 +157,70 @@ export interface DispatchActionConfig { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Close; - text?: Close; - url?: string; - value?: string; + text?: Close; + url?: string; + value?: string; } export interface InitialValueClass { block_id?: string; elements?: InitialValueElement[]; - type?: string; + type?: string; } export interface InitialValueElement { - border?: number; + border?: number; elements?: FluffyElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface FluffyElement { - border?: number; + border?: number; elements?: TentacledElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface TentacledElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -237,48 +237,48 @@ export enum ElementType { } export interface OptionGroup { - label?: Close; + label?: Close; options?: Option[]; } export interface StickyElement { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + confirm?: Confirm; default_to_current_conversation?: boolean; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Close; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Close; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Close; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Close; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Workflow { @@ -287,13 +287,12 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } -export interface State { -} +export type State = {}; diff --git a/packages/web-api/src/types/response/ViewsPushResponse.ts b/packages/web-api/src/types/response/ViewsPushResponse.ts index a2541b7cc..056536cdf 100644 --- a/packages/web-api/src/types/response/ViewsPushResponse.ts +++ b/packages/web-api/src/types/response/ViewsPushResponse.ts @@ -8,15 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ViewsPushResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - view?: View; - warning?: string; + view?: View; + warning?: string; }; export interface ResponseMetadata { @@ -24,78 +24,78 @@ export interface ResponseMetadata { } export interface View { - app_id?: string; + app_id?: string; app_installed_team_id?: string; - blocks?: Block[]; - bot_id?: string; - callback_id?: string; - clear_on_close?: boolean; - close?: Close; - external_id?: string; - hash?: string; - id?: string; - notify_on_close?: boolean; - previous_view_id?: string; - private_metadata?: string; - root_view_id?: string; - state?: State; - submit?: Close; - submit_disabled?: boolean; - team_id?: string; - title?: Close; - type?: string; + blocks?: Block[]; + bot_id?: string; + callback_id?: string; + clear_on_close?: boolean; + close?: Close; + external_id?: string; + hash?: string; + id?: string; + notify_on_close?: boolean; + previous_view_id?: string; + private_metadata?: string; + root_view_id?: string; + state?: State; + submit?: Close; + submit_disabled?: boolean; + team_id?: string; + title?: Close; + type?: string; } export interface Block { - accessory?: Accessory; - alt_text?: string; - author_name?: string; - block_id?: string; - description?: Close; - dispatch_action?: boolean; - element?: PurpleElement; - elements?: StickyElement[]; - fallback?: string; - fields?: Close[]; - hint?: Close; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - label?: Close; - optional?: boolean; + accessory?: Accessory; + alt_text?: string; + author_name?: string; + block_id?: string; + description?: Close; + dispatch_action?: boolean; + element?: PurpleElement; + elements?: StickyElement[]; + fallback?: string; + fields?: Close[]; + hint?: Close; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + label?: Close; + optional?: boolean; provider_icon_url?: string; - provider_name?: string; - slack_file?: SlackFile; - text?: Close; - thumbnail_url?: string; - title?: Close; - title_url?: string; - type?: string; - video_url?: string; + provider_name?: string; + slack_file?: SlackFile; + text?: Close; + thumbnail_url?: string; + title?: Close; + title_url?: string; + type?: string; + video_url?: string; } export interface Accessory { - alt_text?: string; - fallback?: string; - image_bytes?: number; + alt_text?: string; + fallback?: string; + image_bytes?: number; image_height?: number; - image_url?: string; - image_width?: number; - slack_file?: SlackFile; - type?: string; + image_url?: string; + image_width?: number; + slack_file?: SlackFile; + type?: string; } export interface SlackFile { - id?: string; + id?: string; url?: string; } export interface Close { - emoji?: boolean; - text?: string; - type?: CloseType; + emoji?: boolean; + text?: string; + type?: CloseType; verbatim?: boolean; } @@ -106,50 +106,50 @@ export enum CloseType { } export interface PurpleElement { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + confirm?: Confirm; default_to_current_conversation?: boolean; - dispatch_action_config?: DispatchActionConfig; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; - initial_conversation?: string; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_time?: string; - initial_user?: string; - initial_value?: InitialValueClass | string; - max_length?: number; - min_length?: number; - min_query_length?: number; - multiline?: boolean; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Close; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Close; - timezone?: string; - type?: string; - url?: string; - value?: string; + dispatch_action_config?: DispatchActionConfig; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; + initial_conversation?: string; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_time?: string; + initial_user?: string; + initial_value?: InitialValueClass | string; + max_length?: number; + min_length?: number; + min_query_length?: number; + multiline?: boolean; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Close; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Close; + timezone?: string; + type?: string; + url?: string; + value?: string; } export interface Confirm { confirm?: Close; - deny?: Close; - style?: string; - text?: Close; - title?: Close; + deny?: Close; + style?: string; + text?: Close; + title?: Close; } export interface DispatchActionConfig { @@ -157,70 +157,70 @@ export interface DispatchActionConfig { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Close; - text?: Close; - url?: string; - value?: string; + text?: Close; + url?: string; + value?: string; } export interface InitialValueClass { block_id?: string; elements?: InitialValueElement[]; - type?: string; + type?: string; } export interface InitialValueElement { - border?: number; + border?: number; elements?: FluffyElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface FluffyElement { - border?: number; + border?: number; elements?: TentacledElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface TentacledElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -237,48 +237,48 @@ export enum ElementType { } export interface OptionGroup { - label?: Close; + label?: Close; options?: Option[]; } export interface StickyElement { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + confirm?: Confirm; default_to_current_conversation?: boolean; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Close; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Close; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Close; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Close; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Workflow { @@ -287,13 +287,12 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } -export interface State { -} +export type State = {}; diff --git a/packages/web-api/src/types/response/ViewsUpdateResponse.ts b/packages/web-api/src/types/response/ViewsUpdateResponse.ts index bf14c0c15..7de19bf79 100644 --- a/packages/web-api/src/types/response/ViewsUpdateResponse.ts +++ b/packages/web-api/src/types/response/ViewsUpdateResponse.ts @@ -8,15 +8,15 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type ViewsUpdateResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; response_metadata?: ResponseMetadata; - view?: View; - warning?: string; + view?: View; + warning?: string; }; export interface ResponseMetadata { @@ -24,78 +24,78 @@ export interface ResponseMetadata { } export interface View { - app_id?: string; + app_id?: string; app_installed_team_id?: string; - blocks?: Block[]; - bot_id?: string; - callback_id?: string; - clear_on_close?: boolean; - close?: Close; - external_id?: string; - hash?: string; - id?: string; - notify_on_close?: boolean; - previous_view_id?: string; - private_metadata?: string; - root_view_id?: string; - state?: State; - submit?: Close; - submit_disabled?: boolean; - team_id?: string; - title?: Close; - type?: string; + blocks?: Block[]; + bot_id?: string; + callback_id?: string; + clear_on_close?: boolean; + close?: Close; + external_id?: string; + hash?: string; + id?: string; + notify_on_close?: boolean; + previous_view_id?: string; + private_metadata?: string; + root_view_id?: string; + state?: State; + submit?: Close; + submit_disabled?: boolean; + team_id?: string; + title?: Close; + type?: string; } export interface Block { - accessory?: Accessory; - alt_text?: string; - author_name?: string; - block_id?: string; - description?: Close; - dispatch_action?: boolean; - element?: PurpleElement; - elements?: StickyElement[]; - fallback?: string; - fields?: Close[]; - hint?: Close; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - is_animated?: boolean; - label?: Close; - optional?: boolean; + accessory?: Accessory; + alt_text?: string; + author_name?: string; + block_id?: string; + description?: Close; + dispatch_action?: boolean; + element?: PurpleElement; + elements?: StickyElement[]; + fallback?: string; + fields?: Close[]; + hint?: Close; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_animated?: boolean; + label?: Close; + optional?: boolean; provider_icon_url?: string; - provider_name?: string; - slack_file?: SlackFile; - text?: Close; - thumbnail_url?: string; - title?: Close; - title_url?: string; - type?: string; - video_url?: string; + provider_name?: string; + slack_file?: SlackFile; + text?: Close; + thumbnail_url?: string; + title?: Close; + title_url?: string; + type?: string; + video_url?: string; } export interface Accessory { - alt_text?: string; - fallback?: string; - image_bytes?: number; + alt_text?: string; + fallback?: string; + image_bytes?: number; image_height?: number; - image_url?: string; - image_width?: number; - slack_file?: SlackFile; - type?: string; + image_url?: string; + image_width?: number; + slack_file?: SlackFile; + type?: string; } export interface SlackFile { - id?: string; + id?: string; url?: string; } export interface Close { - emoji?: boolean; - text?: string; - type?: CloseType; + emoji?: boolean; + text?: string; + type?: CloseType; verbatim?: boolean; } @@ -106,50 +106,50 @@ export enum CloseType { } export interface PurpleElement { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + confirm?: Confirm; default_to_current_conversation?: boolean; - dispatch_action_config?: DispatchActionConfig; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; - initial_conversation?: string; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_time?: string; - initial_user?: string; - initial_value?: InitialValueClass | string; - max_length?: number; - min_length?: number; - min_query_length?: number; - multiline?: boolean; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Close; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Close; - timezone?: string; - type?: string; - url?: string; - value?: string; + dispatch_action_config?: DispatchActionConfig; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; + initial_conversation?: string; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_time?: string; + initial_user?: string; + initial_value?: InitialValueClass | string; + max_length?: number; + min_length?: number; + min_query_length?: number; + multiline?: boolean; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Close; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Close; + timezone?: string; + type?: string; + url?: string; + value?: string; } export interface Confirm { confirm?: Close; - deny?: Close; - style?: string; - text?: Close; - title?: Close; + deny?: Close; + style?: string; + text?: Close; + title?: Close; } export interface DispatchActionConfig { @@ -157,70 +157,70 @@ export interface DispatchActionConfig { } export interface Filter { - exclude_bot_users?: boolean; + exclude_bot_users?: boolean; exclude_external_shared_channels?: boolean; - include?: any[]; + include?: any[]; } export interface Option { description?: Close; - text?: Close; - url?: string; - value?: string; + text?: Close; + url?: string; + value?: string; } export interface InitialValueClass { block_id?: string; elements?: InitialValueElement[]; - type?: string; + type?: string; } export interface InitialValueElement { - border?: number; + border?: number; elements?: FluffyElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface FluffyElement { - border?: number; + border?: number; elements?: TentacledElement[]; - indent?: number; - offset?: number; - style?: string; - type?: string; + indent?: number; + offset?: number; + style?: string; + type?: string; } export interface TentacledElement { - channel_id?: string; - fallback?: string; - format?: string; - name?: string; - range?: string; - skin_tone?: number; - style?: Style; - team_id?: string; - text?: string; - timestamp?: string; - type?: ElementType; - unicode?: string; - unsafe?: boolean; - url?: string; - user_id?: string; + channel_id?: string; + fallback?: string; + format?: string; + name?: string; + range?: string; + skin_tone?: number; + style?: Style; + team_id?: string; + text?: string; + timestamp?: string; + type?: ElementType; + unicode?: string; + unsafe?: boolean; + url?: string; + user_id?: string; usergroup_id?: string; - value?: string; + value?: string; } export interface Style { - bold?: boolean; + bold?: boolean; client_highlight?: boolean; - code?: boolean; - highlight?: boolean; - italic?: boolean; - strike?: boolean; - unlink?: boolean; + code?: boolean; + highlight?: boolean; + italic?: boolean; + strike?: boolean; + unlink?: boolean; } export enum ElementType { @@ -237,48 +237,48 @@ export enum ElementType { } export interface OptionGroup { - label?: Close; + label?: Close; options?: Option[]; } export interface StickyElement { - accessibility_label?: string; - action_id?: string; - alt_text?: string; - confirm?: Confirm; + accessibility_label?: string; + action_id?: string; + alt_text?: string; + confirm?: Confirm; default_to_current_conversation?: boolean; - fallback?: string; - filter?: Filter; - focus_on_load?: boolean; - image_bytes?: number; - image_height?: number; - image_url?: string; - image_width?: number; - initial_channel?: string; - initial_channels?: string[]; - initial_conversation?: string; - initial_conversations?: string[]; - initial_date?: string; - initial_date_time?: number; - initial_option?: Option; - initial_options?: Option[]; - initial_time?: string; - initial_user?: string; - initial_users?: string[]; - max_selected_items?: number; - min_query_length?: number; - option_groups?: OptionGroup[]; - options?: Option[]; - placeholder?: Close; - response_url_enabled?: boolean; - slack_file?: SlackFile; - style?: string; - text?: Close; - timezone?: string; - type?: string; - url?: string; - value?: string; - workflow?: Workflow; + fallback?: string; + filter?: Filter; + focus_on_load?: boolean; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + initial_channel?: string; + initial_channels?: string[]; + initial_conversation?: string; + initial_conversations?: string[]; + initial_date?: string; + initial_date_time?: number; + initial_option?: Option; + initial_options?: Option[]; + initial_time?: string; + initial_user?: string; + initial_users?: string[]; + max_selected_items?: number; + min_query_length?: number; + option_groups?: OptionGroup[]; + options?: Option[]; + placeholder?: Close; + response_url_enabled?: boolean; + slack_file?: SlackFile; + style?: string; + text?: Close; + timezone?: string; + type?: string; + url?: string; + value?: string; + workflow?: Workflow; } export interface Workflow { @@ -287,13 +287,12 @@ export interface Workflow { export interface Trigger { customizable_input_parameters?: CustomizableInputParameter[]; - url?: string; + url?: string; } export interface CustomizableInputParameter { - name?: string; + name?: string; value?: string; } -export interface State { -} +export type State = {}; diff --git a/packages/web-api/src/types/response/WorkflowsStepCompletedResponse.ts b/packages/web-api/src/types/response/WorkflowsStepCompletedResponse.ts index 13e34f298..717f73928 100644 --- a/packages/web-api/src/types/response/WorkflowsStepCompletedResponse.ts +++ b/packages/web-api/src/types/response/WorkflowsStepCompletedResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type WorkflowsStepCompletedResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/WorkflowsStepFailedResponse.ts b/packages/web-api/src/types/response/WorkflowsStepFailedResponse.ts index 8c000ea37..f203382fb 100644 --- a/packages/web-api/src/types/response/WorkflowsStepFailedResponse.ts +++ b/packages/web-api/src/types/response/WorkflowsStepFailedResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type WorkflowsStepFailedResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/WorkflowsUpdateStepResponse.ts b/packages/web-api/src/types/response/WorkflowsUpdateStepResponse.ts index 7f04e0980..de11fa37a 100644 --- a/packages/web-api/src/types/response/WorkflowsUpdateStepResponse.ts +++ b/packages/web-api/src/types/response/WorkflowsUpdateStepResponse.ts @@ -8,10 +8,10 @@ // // ///////////////////////////////////////////////////////////////////////////////////////// -import { WebAPICallResult } from '../../WebClient'; +import type { WebAPICallResult } from '../../WebClient'; export type WorkflowsUpdateStepResponse = WebAPICallResult & { - error?: string; - needed?: string; - ok?: boolean; + error?: string; + needed?: string; + ok?: boolean; provided?: string; }; diff --git a/packages/web-api/src/types/response/index.ts b/packages/web-api/src/types/response/index.ts index e9b723a27..5ea973d37 100644 --- a/packages/web-api/src/types/response/index.ts +++ b/packages/web-api/src/types/response/index.ts @@ -1,4 +1,9 @@ -export { AdminAnalyticsGetFileResponse, AdminAnalyticsMemberDetails, AdminAnalyticsPublicChannelDetails, AdminAnalyticsPublicChannelMetadataDetails } from './AdminAnalyticsGetFileResponse'; +export { + AdminAnalyticsGetFileResponse, + AdminAnalyticsMemberDetails, + AdminAnalyticsPublicChannelDetails, + AdminAnalyticsPublicChannelMetadataDetails, +} from './AdminAnalyticsGetFileResponse'; export { AdminAppsActivitiesListResponse } from './AdminAppsActivitiesListResponse'; export { AdminAppsApproveResponse } from './AdminAppsApproveResponse'; export { AdminAppsApprovedListResponse } from './AdminAppsApprovedListResponse'; diff --git a/packages/web-api/test/integration/commonjs-project/index.js b/packages/web-api/test/integration/commonjs-project/index.js index f4b70cd6e..411282ebe 100644 --- a/packages/web-api/test/integration/commonjs-project/index.js +++ b/packages/web-api/test/integration/commonjs-project/index.js @@ -1,11 +1,18 @@ -/* eslint-disable */ const WebApi = require('../../../dist/index'); const client = new WebApi.WebClient('invalid-token'); -const assert = require('assert'); -client.auth.test().then((res) => { - console.error('❌ Unexpected `auth.test` API success! Exiting CJS project integration test with non-zero exit code.'); - process.exit(1); -}).catch((e) => { - assert(e.message.includes('invalid_auth'), '❌ Did not receive expected "invalid_auth" response from `auth.test` API, CJS project integration test failed.'); - console.log('✅ CJS project integration test succeeded!'); -}); +const assert = require('node:assert'); +client.auth + .test() + .then((_res) => { + console.error( + '❌ Unexpected `auth.test` API success! Exiting CJS project integration test with non-zero exit code.', + ); + process.exit(1); + }) + .catch((e) => { + assert( + e.message.includes('invalid_auth'), + '❌ Did not receive expected "invalid_auth" response from `auth.test` API, CJS project integration test failed.', + ); + console.log('✅ CJS project integration test succeeded!'); + }); diff --git a/packages/web-api/test/integration/esm-project/index.mjs b/packages/web-api/test/integration/esm-project/index.mjs index e361528fb..eff09e533 100644 --- a/packages/web-api/test/integration/esm-project/index.mjs +++ b/packages/web-api/test/integration/esm-project/index.mjs @@ -1,12 +1,14 @@ -/* eslint-disable */ +import assert from 'node:assert'; import { WebClient } from '../../../dist/index.js'; -import assert from 'assert'; const client = new WebClient('invalid-token'); try { - const res = await client.auth.test(); + await client.auth.test(); console.error('❌ Unexpected auth.test success! Exiting ESM project integration test with non-zero exit code.'); process.exit(1); } catch (e) { - assert(e.message.includes('invalid_auth'), '❌ Did not receive expected "invalid_auth" response from `auth.test` API, ESM project integration test failed.'); + assert( + e.message.includes('invalid_auth'), + '❌ Did not receive expected "invalid_auth" response from `auth.test` API, ESM project integration test failed.', + ); console.log('✅ ESM project integration test succeeded!'); } diff --git a/packages/web-api/test/integration/ts-4.7-project/tsconfig.json b/packages/web-api/test/integration/ts-4.7-project/tsconfig.json index 8f4612c2c..3259b22b9 100644 --- a/packages/web-api/test/integration/ts-4.7-project/tsconfig.json +++ b/packages/web-api/test/integration/ts-4.7-project/tsconfig.json @@ -16,10 +16,8 @@ "moduleResolution": "node", "baseUrl": ".", - "esModuleInterop" : true, + "esModuleInterop": true, "resolveJsonModule": true }, - "include": [ - "index.ts" - ] + "include": ["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 index 629fad9e0..65ef19c03 100644 --- a/packages/web-api/test/types/methods/admin.analytics.test-d.ts +++ b/packages/web-api/test/types/methods/admin.analytics.test-d.ts @@ -7,39 +7,57 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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, -}]); +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 index 499a735dc..b1eb0e81e 100644 --- a/packages/web-api/test/types/methods/admin.apps.test-d.ts +++ b/packages/web-api/test/types/methods/admin.apps.test-d.ts @@ -13,252 +13,358 @@ expectAssignable>([]); // no a // -- 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 -})); +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', -}]); +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 -})); +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 -}]); +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 -})); +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>([{ - token: 'xoxp-example', - app_id: 'A1234', - team_id: 'T1234', -}]); -expectAssignable>([{ - app_id: 'A1234', - enterprise_id: 'E1234', -}]); -expectAssignable>([{ - token: 'xoxp-example', - app_id: 'A1234', - enterprise_id: 'E1234', -}]); +expectAssignable>([ + { + app_id: 'A1234', + team_id: 'T1234', + }, +]); +expectAssignable>([ + { + token: 'xoxp-example', + app_id: 'A1234', + team_id: 'T1234', + }, +]); +expectAssignable>([ + { + app_id: 'A1234', + enterprise_id: 'E1234', + }, +]); +expectAssignable>([ + { + token: 'xoxp-example', + 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'], -}]); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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 -})); +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>([{ - token: 'xoxp-example', - app_id: 'A1234', - team_id: 'T1234', -}]); -expectAssignable>([{ - app_id: 'A1234', - enterprise_id: 'E1234', -}]); -expectAssignable>([{ - token: 'xoxp-example', - app_id: 'A1234', - enterprise_id: 'E1234', -}]); +expectAssignable>([ + { + app_id: 'A1234', + team_id: 'T1234', + }, +]); +expectAssignable>([ + { + token: 'xoxp-example', + app_id: 'A1234', + team_id: 'T1234', + }, +]); +expectAssignable>([ + { + app_id: 'A1234', + enterprise_id: 'E1234', + }, +]); +expectAssignable>([ + { + token: 'xoxp-example', + 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 index a85075965..3334b6565 100644 --- a/packages/web-api/test/types/methods/admin.auth.test-d.ts +++ b/packages/web-api/test/types/methods/admin.auth.test-d.ts @@ -7,71 +7,101 @@ const web = new WebClient('TOKEN'); // -- 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', -})); +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'], -}]); +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', -}]); +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', -})); +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'], -}]); +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 index 7534848ca..ecc6699fb 100644 --- a/packages/web-api/test/types/methods/admin.barriers.test-d.ts +++ b/packages/web-api/test/types/methods/admin.barriers.test-d.ts @@ -7,47 +7,65 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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'], -}]); +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', -}]); +expectAssignable>([ + { + barrier_id: 'B1234', + }, +]); // admin.barriers.list // -- sad path @@ -59,72 +77,104 @@ expectAssignable>([]); // no arg is f // -- 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 -})); +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'], -}]); +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 index 14a7a8ba3..0b4682ac3 100644 --- a/packages/web-api/test/types/methods/admin.conversations.test-d.ts +++ b/packages/web-api/test/types/methods/admin.conversations.test-d.ts @@ -8,155 +8,206 @@ const web = new WebClient('TOKEN'); expectError(web.admin.conversations.archive()); // lacking argument expectError(web.admin.conversations.archive({})); // empty argument // -- happy path -expectAssignable>([{ - channel_id: 'C1234', -}]); +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 -})); +expectError( + web.admin.conversations.bulkArchive({ + channel_ids: [], // must include at least one element + }), +); // -- happy path -expectAssignable>([{ - channel_ids: ['C1234'], -}]); +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 -})); +expectError( + web.admin.conversations.bulkDelete({ + channel_ids: [], // must include at least one element + }), +); // -- happy path -expectAssignable>([{ - channel_ids: ['C1234'], -}]); +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 -})); +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'], -}]); +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', -}]); +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', -}]); +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 -})); +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', -}]); +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', -}]); +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', -}]); +expectAssignable>([ + { + channel_id: 'C1234', + }, +]); // admin.conversations.ekm.listOriginalConnectedChannelInfo // -- sad path // -- happy path -expectAssignable>([{ -}]); // all optional args +expectAssignable>([{}]); // all optional args expectAssignable>([]); // all optional args // admin.conversations.getConversationPrefs @@ -164,180 +215,235 @@ expectAssignable>([{ - channel_id: 'C1234', -}]); +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', -}]); +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', -}]); +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 -})); +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'], -}]); +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 -})); +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, -}]); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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', -}]); +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 -})); +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', -}]); +expectAssignable>([ + { + channel_id: 'C1234', + group_id: 'G1234', + }, +]); // admin.conversations.search // -- sad path // -- happy path -expectAssignable>([{ -}]); // all optional args +expectAssignable>([{}]); // all optional args expectAssignable>([]); // no arg is fine // 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 -})); +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: {}, -}]); +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 -})); +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, -}]); +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', -}]); +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', -}]); +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 index b16361dc5..c6244b62b 100644 --- a/packages/web-api/test/types/methods/admin.emoji.test-d.ts +++ b/packages/web-api/test/types/methods/admin.emoji.test-d.ts @@ -7,33 +7,45 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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', -}]); +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 -})); +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', -}]); +expectAssignable>([ + { + name: 'facepalm', + alias_for: 'fp', + }, +]); // admin.emoji.list // -- sad path @@ -46,22 +58,30 @@ expectAssignable>([]); // no arg is fine expectError(web.admin.emoji.remove()); // lacking argument expectError(web.admin.emoji.remove({})); // empty argument // -- happy path -expectAssignable>([{ - name: 'facepalm', -}]); +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 -})); +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', -}]); +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 index b2067ea7f..4db421401 100644 --- a/packages/web-api/test/types/methods/admin.functions.test-d.ts +++ b/packages/web-api/test/types/methods/admin.functions.test-d.ts @@ -8,34 +8,46 @@ const web = new WebClient('TOKEN'); expectError(web.admin.functions.list()); // lacking argument expectError(web.admin.functions.list({})); // empty argument // -- happy path -expectAssignable>([{ - app_ids: [], -}]); +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 -})); +expectError( + web.admin.functions.permissions.lookup({ + function_ids: [], // must provide at least 1 + }), +); // -- happy path -expectAssignable>([{ - function_ids: ['F1234'], -}]); +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 -})); +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', -}]); +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 index 29a25a097..a8867652b 100644 --- a/packages/web-api/test/types/methods/admin.inviteRequests.test-d.ts +++ b/packages/web-api/test/types/methods/admin.inviteRequests.test-d.ts @@ -7,57 +7,75 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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', -}]); +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', -}]); +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', -}]); +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 -})); +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', -}]); +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', -}]); +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 index de8510707..9ed583c05 100644 --- a/packages/web-api/test/types/methods/admin.roles.test-d.ts +++ b/packages/web-api/test/types/methods/admin.roles.test-d.ts @@ -7,43 +7,61 @@ const web = new WebClient('TOKEN'); // -- 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, -})); +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'], -}]); +expectAssignable>([ + { + entity_ids: ['C1234'], + role_id: 'Rl0A', + user_ids: ['U1234'], + }, +]); // admin.roles.listAssignments // -- sad path @@ -55,40 +73,58 @@ expectAssignable>([]); // no // -- 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, -})); +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'], -}]); +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 index 16580afd8..23406c27f 100644 --- a/packages/web-api/test/types/methods/admin.teams.test-d.ts +++ b/packages/web-api/test/types/methods/admin.teams.test-d.ts @@ -8,25 +8,33 @@ const web = new WebClient('TOKEN'); expectError(web.admin.teams.admins.list()); // lacking argument expectError(web.admin.teams.admins.list({})); // empty argument // -- happy path -expectAssignable>([{ - team_id: 'T1234', -}]); +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 -})); +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', -}]); +expectAssignable>([ + { + team_domain: 'jokers', + team_name: 'Jokers', + }, +]); // admin.teams.list // -- sad path @@ -39,99 +47,135 @@ expectAssignable>([]); // no arg is fine expectError(web.admin.teams.owners.list()); // lacking argument expectError(web.admin.teams.owners.list({})); // empty argument // -- happy path -expectAssignable>([{ - team_id: 'T1234', -}]); +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', -}]); +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 -})); +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'], -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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 index 2b12d49d7..dc0091441 100644 --- a/packages/web-api/test/types/methods/admin.usergroups.test-d.ts +++ b/packages/web-api/test/types/methods/admin.usergroups.test-d.ts @@ -7,67 +7,93 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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', -}]); +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 -})); +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', -}]); +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', -}]); +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 -})); +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', -}]); +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 index b882db662..40a53cb31 100644 --- a/packages/web-api/test/types/methods/admin.users.test-d.ts +++ b/packages/web-api/test/types/methods/admin.users.test-d.ts @@ -7,255 +7,351 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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', -}]); +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 -})); +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'], -}]); +expectAssignable>([ + { + team_id: 'T1234', + email: 'me@you.com', + channel_ids: ['C1234'], + }, +]); // admin.users.list // -- sad path -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 -})); +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>([]); // no args is fine -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 -}]); +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 -})); +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', -}]); +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 +expectError( + web.admin.users.session.clearSettings({ + user_ids: [], + }), +); // must provide at least one user_id // -- happy path -expectAssignable>([{ - user_ids: ['U1234'], -}]); +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 +expectError( + web.admin.users.session.getSettings({ + user_ids: [], + }), +); // must provide at least one user_id // -- happy path -expectAssignable>([{ - user_ids: ['U1234'], -}]); +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 -})); +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', -}]); +expectAssignable>([ + { + team_id: 'T1234', + session_id: '1234', + }, +]); // admin.users.session.list // -- sad path -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 -})); +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>([]); // no arg is fine -expectAssignable>([{ - team_id: 'T1234', - user_id: 'U1234', // also providing both team and user id - but has to be both -}]); +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', -}]); +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 +expectError( + web.admin.users.session.resetBulk({ + user_ids: [], + }), +); // must provide at least one user_id // -- happy path -expectAssignable>([{ - user_ids: ['U1234'], -}]); +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 +expectError( + web.admin.users.session.setSettings({ + user_ids: [], + }), +); // must provide at least one user_id // -- happy path -expectAssignable>([{ - user_ids: ['U1234'], -}]); +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 -})); +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', -}]); +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 -})); +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, -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +expectAssignable>([ + { + team_id: 'T1234', + user_id: 'U1234', + }, +]); // admin.users.session.unsupportedVersions.export // -- sad path 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 index f459961b1..790b8c693 100644 --- a/packages/web-api/test/types/methods/admin.workflows.test-d.ts +++ b/packages/web-api/test/types/methods/admin.workflows.test-d.ts @@ -7,67 +7,93 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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'], -}]); +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 -})); +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'], -}]); +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 -})); +expectError( + web.admin.workflows.permissions.lookup({ + workflow_ids: [], // must provide at least 1 id + }), +); // -- happy path -expectAssignable>([{ - workflow_ids: ['Wf1234'], -}]); +expectAssignable>([ + { + workflow_ids: ['Wf1234'], + }, +]); // admin.workflows.search // -- sad path -expectError(web.admin.workflows.search({ - collaborator_ids: [], // must provide at least 1 ID -})); +expectError( + web.admin.workflows.search({ + collaborator_ids: [], // must provide at least 1 ID + }), +); // -- happy path expectAssignable>([{}]); // all optional args OK expectAssignable>([]); // no arg is fine @@ -75,10 +101,14 @@ expectAssignable>([]); // no arg i // 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 -})); +expectError( + web.admin.workflows.unpublish({ + workflow_ids: [], // must provide at least 1 ID + }), +); // -- happy path -expectAssignable>([{ - workflow_ids: ['Wf1234'], -}]); +expectAssignable>([ + { + workflow_ids: ['Wf1234'], + }, +]); diff --git a/packages/web-api/test/types/methods/apps.test-d.ts b/packages/web-api/test/types/methods/apps.test-d.ts index e4b288887..a59b9cdc8 100644 --- a/packages/web-api/test/types/methods/apps.test-d.ts +++ b/packages/web-api/test/types/methods/apps.test-d.ts @@ -14,95 +14,120 @@ expectAssignable>([]); // no arg is expectError(web.apps.event.authorizations.list()); // lacking argument expectError(web.apps.event.authorizations.list({})); // empty argument // -- happy path -expectAssignable>([{ - event_context: '12345', -}]); +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', +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', -}]); +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', -}]); +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', +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', +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', +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 -})); +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', -}]); -expectAssignable>([{ - token: 'xoxb-example', - client_id: '1234.56', - client_secret: 'ABC123', -}]); +expectAssignable>([ + { + client_id: '1234.56', + client_secret: 'ABC123', + }, +]); +expectAssignable>([ + { + token: 'xoxb-example', + client_id: '1234.56', + client_secret: 'ABC123', + }, +]); diff --git a/packages/web-api/test/types/methods/bookmarks.test-d.ts b/packages/web-api/test/types/methods/bookmarks.test-d.ts index 86474f108..ec5e1b1c1 100644 --- a/packages/web-api/test/types/methods/bookmarks.test-d.ts +++ b/packages/web-api/test/types/methods/bookmarks.test-d.ts @@ -7,117 +7,165 @@ const web = new WebClient('TOKEN'); // -- 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', -})); +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', -}]); +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 -})); +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', -}]); +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', -}]); +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 -})); +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', -}]); +expectAssignable>([ + { + channel_id: 'C1234', + bookmark_id: 'B1234', + }, +]); diff --git a/packages/web-api/test/types/methods/calls.test-d.ts b/packages/web-api/test/types/methods/calls.test-d.ts index 438ba293d..9a9c2f79b 100644 --- a/packages/web-api/test/types/methods/calls.test-d.ts +++ b/packages/web-api/test/types/methods/calls.test-d.ts @@ -7,73 +7,97 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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', -}]); +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', -}]); +expectAssignable>([ + { + id: 'R1234', + }, +]); // calls.info // -- sad path expectError(web.calls.info()); // lacking argument expectError(web.calls.info({})); // empty argument // -- happy path -expectAssignable>([{ - id: 'R1234', -}]); +expectAssignable>([ + { + id: 'R1234', + }, +]); // calls.update // -- sad path expectError(web.calls.update()); // lacking argument expectError(web.calls.update({})); // empty argument // -- happy path -expectAssignable>([{ - id: 'R1234', -}]); +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 -})); +expectError( + web.calls.participants.add({ + id: 'R1234', // missing users + }), +); +expectError( + web.calls.participants.add({ + users: [], // missing id + }), +); // -- happy path -expectAssignable>([{ - id: 'R1234', - users: [], -}]); +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 -})); +expectError( + web.calls.participants.remove({ + id: 'R1234', // missing users + }), +); +expectError( + web.calls.participants.remove({ + users: [], // missing id + }), +); // -- happy path -expectAssignable>([{ - id: 'R1234', - users: [], -}]); +expectAssignable>([ + { + id: 'R1234', + users: [], + }, +]); diff --git a/packages/web-api/test/types/methods/canvas.test-d.ts b/packages/web-api/test/types/methods/canvas.test-d.ts index 19c6740d5..38fbdd9b8 100644 --- a/packages/web-api/test/types/methods/canvas.test-d.ts +++ b/packages/web-api/test/types/methods/canvas.test-d.ts @@ -8,34 +8,46 @@ const web = new WebClient('TOKEN'); expectError(web.canvases.access.delete()); // lacking argument expectError(web.canvases.access.delete({})); // empty argument // -- happy path -expectAssignable>([{ - canvas_id: 'F1234', -}]); +expectAssignable>([ + { + canvas_id: 'F1234', + }, +]); // canvases.access.set // -- sad path expectError(web.canvases.access.set()); // lacking argument expectError(web.canvases.access.set({})); // empty argument -expectError(web.canvases.access.set({ - canvas_id: 'F1234', // missing access_level -})); -expectError(web.canvases.access.set({ - access_level: 'read', // missing canvas_id -})); +expectError( + web.canvases.access.set({ + canvas_id: 'F1234', // missing access_level + }), +); +expectError( + web.canvases.access.set({ + access_level: 'read', // missing canvas_id + }), +); // -- happy path -expectAssignable>([{ - canvas_id: 'F1234', - access_level: 'write', -}]); +expectAssignable>([ + { + canvas_id: 'F1234', + access_level: 'write', + }, +]); // canvases.create // -- sad path -expectError(web.canvases.create({ - document_content: 'heyo', // invalid document_content -})); -expectError(web.canvases.create({ - document_content: { type: 'mrkdwn', markdown: 'hihi' }, // invalid document_content -})); +expectError( + web.canvases.create({ + document_content: 'heyo', // invalid document_content + }), +); +expectError( + web.canvases.create({ + document_content: { type: 'mrkdwn', markdown: 'hihi' }, // invalid document_content + }), +); // -- happy path expectAssignable>([]); // no arg ok expectAssignable>([{}]); // all optional args @@ -44,129 +56,186 @@ expectAssignable>([{}]); // all optional // -- sad path expectError(web.canvases.sections.lookup()); // lacking argument expectError(web.canvases.sections.lookup({})); // empty argument -expectError(web.canvases.sections.lookup({ - canvas_id: 'F1234', // missing criteria -})); -expectError(web.canvases.sections.lookup({ - criteria: { contains_text: 'hi' }, // missing canvas_id -})); -expectError(web.canvases.sections.lookup({ - canvas_id: 'F1234', - criteria: {}, // empty criteria object -})); -expectError(web.canvases.sections.lookup({ - canvas_id: 'F1234', - criteria: { - section_types: [], // need at least one section type - }, -})); +expectError( + web.canvases.sections.lookup({ + canvas_id: 'F1234', // missing criteria + }), +); +expectError( + web.canvases.sections.lookup({ + criteria: { contains_text: 'hi' }, // missing canvas_id + }), +); +expectError( + web.canvases.sections.lookup({ + canvas_id: 'F1234', + criteria: {}, // empty criteria object + }), +); +expectError( + web.canvases.sections.lookup({ + canvas_id: 'F1234', + criteria: { + section_types: [], // need at least one section type + }, + }), +); // -- happy path -expectAssignable>([{ - canvas_id: 'F1234', - criteria: { contains_text: 'hi' }, -}]); -expectAssignable>([{ - canvas_id: 'F1234', - criteria: { section_types: ['any_header'] }, -}]); -expectAssignable>([{ - canvas_id: 'F1234', - criteria: { - section_types: ['any_header'], - contains_text: 'list', +expectAssignable>([ + { + canvas_id: 'F1234', + criteria: { contains_text: 'hi' }, + }, +]); +expectAssignable>([ + { + canvas_id: 'F1234', + criteria: { section_types: ['any_header'] }, }, -}]); +]); +expectAssignable>([ + { + canvas_id: 'F1234', + criteria: { + section_types: ['any_header'], + contains_text: 'list', + }, + }, +]); // canvases.delete // -- sad path expectError(web.canvases.delete()); // lacking argument expectError(web.canvases.delete({})); // empty argument // -- happy path -expectAssignable>([{ - canvas_id: 'F1234', -}]); +expectAssignable>([ + { + canvas_id: 'F1234', + }, +]); // canvases.edit // -- sad path expectError(web.canvases.edit()); // lacking argument expectError(web.canvases.edit({})); // empty argument -expectError(web.canvases.edit({ - canvas_id: 'F1234', // missing changes -})); -expectError(web.canvases.edit({ - changes: [{ - operation: 'delete', - section_id: 'S1234', - }], // missing canvas_id -})); -expectError(web.canvases.edit({ - changes: [], // minimum 1 change - canvas_id: 'F1234', -})); -expectError(web.canvases.edit({ - changes: [{ - document_content: { type: 'markdown', markdown: 'hihi' }, // missing operation - }], - canvas_id: 'F1234', -})); -expectError(web.canvases.edit({ - changes: [{ - operation: 'insert_after', - document_content: { type: 'markdown', markdown: 'hihi' }, // missing section_id for op: insert_after - }], - canvas_id: 'F1234', -})); -expectError(web.canvases.edit({ - changes: [{ - operation: 'insert_before', - section_id: '1234', // missing document_content for op: insert_before - }], - canvas_id: 'F1234', -})); -expectError(web.canvases.edit({ - changes: [{ - operation: 'insert_at_end', // missing document_content for op: insert_at_end - }], - canvas_id: 'F1234', -})); -expectError(web.canvases.edit({ - changes: [{ - operation: 'replace', // missing document_content for op: replace - section_id: '1234', - }], - canvas_id: 'F1234', -})); -expectError(web.canvases.edit({ - changes: [{ - operation: 'delete', // missing section_id for op: delete - }], - canvas_id: 'F1234', -})); +expectError( + web.canvases.edit({ + canvas_id: 'F1234', // missing changes + }), +); +expectError( + web.canvases.edit({ + changes: [ + { + operation: 'delete', + section_id: 'S1234', + }, + ], // missing canvas_id + }), +); +expectError( + web.canvases.edit({ + changes: [], // minimum 1 change + canvas_id: 'F1234', + }), +); +expectError( + web.canvases.edit({ + changes: [ + { + document_content: { type: 'markdown', markdown: 'hihi' }, // missing operation + }, + ], + canvas_id: 'F1234', + }), +); +expectError( + web.canvases.edit({ + changes: [ + { + operation: 'insert_after', + document_content: { type: 'markdown', markdown: 'hihi' }, // missing section_id for op: insert_after + }, + ], + canvas_id: 'F1234', + }), +); +expectError( + web.canvases.edit({ + changes: [ + { + operation: 'insert_before', + section_id: '1234', // missing document_content for op: insert_before + }, + ], + canvas_id: 'F1234', + }), +); +expectError( + web.canvases.edit({ + changes: [ + { + operation: 'insert_at_end', // missing document_content for op: insert_at_end + }, + ], + canvas_id: 'F1234', + }), +); +expectError( + web.canvases.edit({ + changes: [ + { + operation: 'replace', // missing document_content for op: replace + section_id: '1234', + }, + ], + canvas_id: 'F1234', + }), +); +expectError( + web.canvases.edit({ + changes: [ + { + operation: 'delete', // missing section_id for op: delete + }, + ], + canvas_id: 'F1234', + }), +); // -- happy path -expectAssignable>([{ - canvas_id: 'F1234', - changes: [{ - operation: 'insert_after', - document_content: { type: 'markdown', markdown: 'hihi' }, - section_id: '1234', - }, { - operation: 'insert_at_start', - document_content: { type: 'markdown', markdown: 'hihi' }, - }, { - operation: 'replace', - document_content: { type: 'markdown', markdown: 'hihi' }, - section_id: '1234', - }, { - operation: 'delete', - section_id: '1234', - }], -}]); +expectAssignable>([ + { + canvas_id: 'F1234', + changes: [ + { + operation: 'insert_after', + document_content: { type: 'markdown', markdown: 'hihi' }, + section_id: '1234', + }, + { + operation: 'insert_at_start', + document_content: { type: 'markdown', markdown: 'hihi' }, + }, + { + operation: 'replace', + document_content: { type: 'markdown', markdown: 'hihi' }, + section_id: '1234', + }, + { + operation: 'delete', + section_id: '1234', + }, + ], + }, +]); // conversations.canvases.create // -- sad path expectError(web.conversations.canvases.create()); // lacking argument expectError(web.conversations.canvases.create({})); // empty argument // -- happy path -expectAssignable>([{ - channel_id: 'C1234', -}]); +expectAssignable>([ + { + channel_id: 'C1234', + }, +]); diff --git a/packages/web-api/test/types/methods/chat.test-d.ts b/packages/web-api/test/types/methods/chat.test-d.ts index 530ebb088..cf5349a30 100644 --- a/packages/web-api/test/types/methods/chat.test-d.ts +++ b/packages/web-api/test/types/methods/chat.test-d.ts @@ -8,298 +8,408 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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 -})); +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 -}]); +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 -})); +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 -}]); -expectAssignable>([{ - channel: 'C1234', - blocks: [], - thread_ts: '1234.56', - reply_broadcast: false, // can send a threaded message and explicitly not broadcast it -}]); -// adding a test for when `reply_broadcast` specific boolean value is not known ahead of time -// https://github.com/slackapi/node-slack-sdk/issues/1859 -function wideBooleanTest(b: boolean) { - expectAssignable>([{ +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 + }, +]); +expectAssignable>([ + { channel: 'C1234', blocks: [], thread_ts: '1234.56', - reply_broadcast: b, // can reply_broadcast be parameterized? - }]); + reply_broadcast: false, // can send a threaded message and explicitly not broadcast it + }, +]); +// adding a test for when `reply_broadcast` specific boolean value is not known ahead of time +// https://github.com/slackapi/node-slack-sdk/issues/1859 +function wideBooleanTest(b: boolean) { + expectAssignable>([ + { + channel: 'C1234', + blocks: [], + thread_ts: '1234.56', + reply_broadcast: b, // can reply_broadcast be parameterized? + }, + ]); } wideBooleanTest(true); wideBooleanTest(false); @@ -308,84 +418,116 @@ wideBooleanTest(false); // -- 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 -})); +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 -}]); +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 @@ -397,123 +539,177 @@ expectAssignable>([]); // no // -- 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: {}, -})); +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', -}]); +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', -})); +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 -}]); +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 index a23df782e..197da1d30 100644 --- a/packages/web-api/test/types/methods/conversations.test-d.ts +++ b/packages/web-api/test/types/methods/conversations.test-d.ts @@ -8,69 +8,89 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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', -}]); +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', -}]); +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', -}]); +expectAssignable>([ + { + channel: 'C1234', + }, +]); // conversations.close // -- sad path expectError(web.conversations.close()); // lacking argument expectError(web.conversations.close({})); // empty argument // -- happy path -expectAssignable>([{ - channel: 'C1234', -}]); +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', -}]); +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', -}]); +expectAssignable>([ + { + invite_id: 'I1234', + }, +]); // conversations.externalInvitePermissions.set // -- sad path @@ -83,107 +103,141 @@ expectError(web.conversations.externalInvitePermissions.set({ action: 'upgrade', expectError(web.conversations.externalInvitePermissions.set({ channel: 'C1234', target_team: 'T1234' })); // missing action expectError(web.conversations.externalInvitePermissions.set({ target_team: 'T1234', action: 'downgrade' })); // missing channel // -- happy path -expectAssignable>([{ - channel: 'C1234', - target_team: 'T1234', - action: 'upgrade', -}]); +expectAssignable>([ + { + channel: 'C1234', + target_team: 'T1234', + action: 'upgrade', + }, +]); // conversations.history // -- sad path expectError(web.conversations.history()); // lacking argument expectError(web.conversations.history({})); // empty argument // -- happy path -expectAssignable>([{ - channel: 'C1234', -}]); +expectAssignable>([ + { + channel: 'C1234', + }, +]); // conversations.info // -- sad path expectError(web.conversations.info()); // lacking argument expectError(web.conversations.info({})); // empty argument // -- happy path -expectAssignable>([{ - channel: 'C1234', -}]); +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 -})); +expectError( + web.conversations.invite({ + channel: 'C1234', // missing users + }), +); +expectError( + web.conversations.invite({ + users: 'U1234', // missing channel + }), +); // -- happy path -expectAssignable>([{ - channel: 'C1234', - users: 'U1234', -}]); +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 -})); +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'], -}]); +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', -}]); +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 -})); +expectError( + web.conversations.kick({ + channel: 'C1234', // missing user + }), +); +expectError( + web.conversations.kick({ + user: 'U1234', // missing channel + }), +); // -- happy path -expectAssignable>([{ - channel: 'C1234', - user: 'U1234', -}]); +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', -}]); +expectAssignable>([ + { + channel: 'C1234', + }, +]); // conversations.list // -- sad path @@ -201,108 +255,146 @@ expectAssignable>([]); / // -- 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 -})); +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', -}]); +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', -}]); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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 -})); +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', -}]); +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', -}]); +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 index 2c9aaf457..a02e22663 100644 --- a/packages/web-api/test/types/methods/dialog.test-d.ts +++ b/packages/web-api/test/types/methods/dialog.test-d.ts @@ -13,14 +13,20 @@ const dialog = { // -- 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` -})); +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, -}]); +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 index ecc891413..8e49b55f0 100644 --- a/packages/web-api/test/types/methods/dnd.test-d.ts +++ b/packages/web-api/test/types/methods/dnd.test-d.ts @@ -26,15 +26,19 @@ expectAssignable>([]); // no arg is fine expectError(web.dnd.setSnooze()); // lacking argument expectError(web.dnd.setSnooze({})); // empty argument // -- happy path -expectAssignable>([{ - num_minutes: 1, -}]); +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', -}]); +expectAssignable>([ + { + users: 'U1234', + }, +]); diff --git a/packages/web-api/test/types/methods/files.test-d.ts b/packages/web-api/test/types/methods/files.test-d.ts index 60e69d8ca..60b8e873b 100644 --- a/packages/web-api/test/types/methods/files.test-d.ts +++ b/packages/web-api/test/types/methods/files.test-d.ts @@ -10,36 +10,48 @@ const file = { id: 'F1234', title: 'Choose Boring Technology' }; // -- 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 -}]); +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 -}]); +expectAssignable>([ + { + file: 'F123', // must specify a file + }, +]); // files.getUploadURLExternal // -- sad path @@ -48,19 +60,23 @@ 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, -}]); +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 -}]); +expectAssignable>([ + { + file: 'F123', // must specify a file + }, +]); // files.list // -- sad path @@ -73,18 +89,22 @@ expectAssignable>([{}]); // able to call it wi expectError(web.files.revokePublicURL()); // lacking argument expectError(web.files.revokePublicURL({})); // empty argument // -- happy path -expectAssignable>([{ - file: 'F123', // must specify a file -}]); +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 -}]); +expectAssignable>([ + { + file: 'F123', // must specify a file + }, +]); // files.upload // -- sad path @@ -92,20 +112,28 @@ 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', -}]); +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 @@ -113,30 +141,42 @@ 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>([{ - channel_id: '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', -}]); -expectAssignable>([{ - channel_id: 'C1234', - thread_ts: '12345.67', // or even to a specific thread - content: 'text', -}]); +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>([ + { + channel_id: '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', + }, +]); +expectAssignable>([ + { + channel_id: 'C1234', + thread_ts: '12345.67', // or even to a specific thread + content: 'text', + }, +]); // files.comments.delete // -- sad path @@ -145,10 +185,12 @@ 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', -}]); +expectAssignable>([ + { + file: 'F1234', + id: 'Fc1234', + }, +]); // files.remote.add // -- sad path @@ -161,11 +203,13 @@ expectError(web.files.remote.add({ external_id: '1234', external_url: 'https://e 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', -}]); +expectAssignable>([ + { + external_id: '1234', + external_url: 'https://example.com', + title: 'my document', + }, +]); // files.remote.info // -- sad path @@ -173,12 +217,16 @@ 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', -}]); +expectAssignable>([ + { + external_id: '1234', + }, +]); +expectAssignable>([ + { + file: 'F1234', + }, +]); // files.remote.list // -- sad path @@ -192,12 +240,16 @@ 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', -}]); +expectAssignable>([ + { + external_id: '1234', + }, +]); +expectAssignable>([ + { + file: 'F1234', + }, +]); // files.remote.share // -- sad path @@ -206,14 +258,18 @@ 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', -}]); +expectAssignable>([ + { + channels: 'C123', + external_id: '1234', + }, +]); +expectAssignable>([ + { + channels: 'C123', + file: 'F1234', + }, +]); // files.remote.update // -- sad path @@ -222,11 +278,15 @@ 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', -}]); +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 index 20e8814bf..30c1a9169 100644 --- a/packages/web-api/test/types/methods/functions.test-d.ts +++ b/packages/web-api/test/types/methods/functions.test-d.ts @@ -7,30 +7,42 @@ const web = new WebClient('TOKEN'); // -- 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 -})); +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', -}]); +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 -})); +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: {}, -}]); +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 index 420eaba04..d99a6b964 100644 --- a/packages/web-api/test/types/methods/migration.test-d.ts +++ b/packages/web-api/test/types/methods/migration.test-d.ts @@ -8,6 +8,8 @@ const web = new WebClient('TOKEN'); expectError(web.migration.exchange()); // lacking argument expectError(web.migration.exchange({})); // empty argument // -- happy path -expectAssignable>([{ - users: 'U1234', -}]); +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 index 3056677dd..e67486619 100644 --- a/packages/web-api/test/types/methods/oauth.test-d.ts +++ b/packages/web-api/test/types/methods/oauth.test-d.ts @@ -10,59 +10,85 @@ const creds = { client_id: 'C1234', client_secret: '1234.567' }; // -- 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` -})); +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, -}]); +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` -})); +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, -}]); +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, token -})); -expectError(web.oauth.v2.exchange({ - client_secret: '1234.567', // missing `client_id`, token -})); -expectError(web.oauth.v2.exchange({ - token: 'xoxp-blah', // missing `client_id`, client_secret -})); -expectError(web.oauth.v2.exchange({ - client_id: 'C1234', - client_secret: '1234.567', // missing token -})); -expectError(web.oauth.v2.exchange({ - client_id: 'C1234', - token: 'xoxb-blah', // missing client_secret -})); -expectError(web.oauth.v2.exchange({ - client_secret: '1234.567', - token: 'xoxb-blah', // missing client_id -})); +expectError( + web.oauth.v2.exchange({ + client_id: 'C1234', // missing client_secret, token + }), +); +expectError( + web.oauth.v2.exchange({ + client_secret: '1234.567', // missing `client_id`, token + }), +); +expectError( + web.oauth.v2.exchange({ + token: 'xoxp-blah', // missing `client_id`, client_secret + }), +); +expectError( + web.oauth.v2.exchange({ + client_id: 'C1234', + client_secret: '1234.567', // missing token + }), +); +expectError( + web.oauth.v2.exchange({ + client_id: 'C1234', + token: 'xoxb-blah', // missing client_secret + }), +); +expectError( + web.oauth.v2.exchange({ + client_secret: '1234.567', + token: 'xoxb-blah', // missing client_id + }), +); // -- happy path -expectAssignable>([{ - token: 'xoxb-blah', - ...creds, -}]); +expectAssignable>([ + { + token: 'xoxb-blah', + ...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 index 0871960e4..0c36ed918 100644 --- a/packages/web-api/test/types/methods/openid.test-d.ts +++ b/packages/web-api/test/types/methods/openid.test-d.ts @@ -10,16 +10,22 @@ const creds = { client_id: 'C1234', client_secret: '1234.567' }; // -- 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` -})); +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, -}]); +expectAssignable>([ + { + ...creds, + }, +]); // openid.connect.userInfo // -- sad path diff --git a/packages/web-api/test/types/methods/pins.test-d.ts b/packages/web-api/test/types/methods/pins.test-d.ts index 3173134b1..2960ef0c0 100644 --- a/packages/web-api/test/types/methods/pins.test-d.ts +++ b/packages/web-api/test/types/methods/pins.test-d.ts @@ -10,37 +10,51 @@ const message = { channel: 'C1234', timestamp: '1234.567' }; // -- 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` -})); +expectError( + web.pins.add({ + channel: 'C1234', // missing timestamp + }), +); +expectError( + web.pins.add({ + timestamp: '1234.567', // missing `channel` + }), +); // -- happy path -expectAssignable>([{ - ...message, -}]); +expectAssignable>([ + { + ...message, + }, +]); // pins.list // -- sad path expectError(web.pins.list()); // lacking argument expectError(web.pins.list({})); // empty argument // -- happy path -expectAssignable>([{ - channel: message.channel, -}]); +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` -})); +expectError( + web.pins.remove({ + channel: 'C1234', // missing timestamp + }), +); +expectError( + web.pins.remove({ + timestamp: '1234.567', // missing `channel` + }), +); // -- happy path -expectAssignable>([{ - ...message, -}]); +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 index b7e14a850..608d4a3cc 100644 --- a/packages/web-api/test/types/methods/reactions.test-d.ts +++ b/packages/web-api/test/types/methods/reactions.test-d.ts @@ -10,46 +10,66 @@ const message = { channel: 'C1234', timestamp: '1234.567' }; // -- 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', -})); +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', -}]); +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 -})); +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 -}]); +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 @@ -61,36 +81,54 @@ expectAssignable>([]); // no arg is fine // -- 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 -})); +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 -}]); +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 index 4c815c22f..1e0c5f933 100644 --- a/packages/web-api/test/types/methods/reminders.test-d.ts +++ b/packages/web-api/test/types/methods/reminders.test-d.ts @@ -9,68 +9,84 @@ 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 - }, -})); +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: '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', +]); +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 -}]); +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 -}]); +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 -}]); +expectAssignable>([ + { + reminder: 'R1234', // needs the reminder ID + }, +]); // reminders.list // -- sad path diff --git a/packages/web-api/test/types/methods/search.test-d.ts b/packages/web-api/test/types/methods/search.test-d.ts index c675690b1..1d835f370 100644 --- a/packages/web-api/test/types/methods/search.test-d.ts +++ b/packages/web-api/test/types/methods/search.test-d.ts @@ -8,24 +8,30 @@ const web = new WebClient('TOKEN'); expectError(web.search.all()); // lacking argument expectError(web.search.all({})); // empty argument // -- happy path -expectAssignable>([{ - query: '1234', // must specify query -}]); +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 -}]); +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 -}]); +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 index e8dad312b..a5b4f4618 100644 --- a/packages/web-api/test/types/methods/team.test-d.ts +++ b/packages/web-api/test/types/methods/team.test-d.ts @@ -26,9 +26,11 @@ expectAssignable>([{}]); // all optiona expectError(web.team.externalTeams.disconnect()); // lacking argument expectError(web.team.externalTeams.disconnect({})); // missing `target_team` // -- happy path -expectAssignable>([{ - target_team: 'T1234', -}]); +expectAssignable>([ + { + target_team: 'T1234', + }, +]); // team.externalTeams.list // -- sad path diff --git a/packages/web-api/test/types/methods/tooling.test-d.ts b/packages/web-api/test/types/methods/tooling.test-d.ts index 3eb7b9770..b79c5e08e 100644 --- a/packages/web-api/test/types/methods/tooling.test-d.ts +++ b/packages/web-api/test/types/methods/tooling.test-d.ts @@ -8,6 +8,8 @@ const web = new WebClient('TOKEN'); expectError(web.tooling.tokens.rotate()); // lacking argument expectError(web.tooling.tokens.rotate({})); // empty argument // -- happy path -expectAssignable>([{ - refresh_token: '1234', // must specify refresh_token -}]); +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 index 009737c30..e12477968 100644 --- a/packages/web-api/test/types/methods/usergroups.test-d.ts +++ b/packages/web-api/test/types/methods/usergroups.test-d.ts @@ -8,27 +8,33 @@ const web = new WebClient('TOKEN'); expectError(web.usergroups.create()); // lacking argument expectError(web.usergroups.create({})); // empty argument // -- happy path -expectAssignable>([{ - name: 'knights who say ni', // must specify name -}]); +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 -}]); +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 -}]); +expectAssignable>([ + { + usergroup: 'Sg1234', // must specify usergroup + }, +]); // usergroups.list // -- sad path @@ -41,18 +47,22 @@ expectAssignable>([]); // no arg is fine expectError(web.usergroups.update()); // lacking argument expectError(web.usergroups.update({})); // empty argument // -- happy path -expectAssignable>([{ - usergroup: 'Sg1234', // must specify usergroup -}]); +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 -}]); +expectAssignable>([ + { + usergroup: 'Sg1234', // must specify usergroup + }, +]); // usergroups.users.update // -- sad path @@ -61,7 +71,9 @@ 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 -}]); +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 index 9a1b9a26d..8ff5b8cdf 100644 --- a/packages/web-api/test/types/methods/users.test-d.ts +++ b/packages/web-api/test/types/methods/users.test-d.ts @@ -32,9 +32,11 @@ expectAssignable>([{}]); // all args are o expectError(web.users.info()); // lacking argument expectError(web.users.info({})); // empty argument // -- happy path -expectAssignable>([{ - user: 'U1234', // must specify a user -}]); +expectAssignable>([ + { + user: 'U1234', // must specify a user + }, +]); // users.list // -- sad path @@ -47,27 +49,33 @@ expectAssignable>([{}]); // all args are optio expectError(web.users.lookupByEmail()); // lacking argument expectError(web.users.lookupByEmail({})); // empty argument // -- happy path -expectAssignable>([{ - email: 'ceo@slack.com', // must specify an email -}]); +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 -}]); +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 -}]); +expectAssignable>([ + { + presence: 'auto', // must specify presence + }, +]); // users.profile.get // -- sad path diff --git a/packages/web-api/test/types/methods/views.test-d.ts b/packages/web-api/test/types/methods/views.test-d.ts index a0411ba30..2d0c838df 100644 --- a/packages/web-api/test/types/methods/views.test-d.ts +++ b/packages/web-api/test/types/methods/views.test-d.ts @@ -7,116 +7,163 @@ const web = new WebClient('TOKEN'); // -- 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', -})); +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: [], +expectAssignable>([ + { + view: { + type: 'home', + blocks: [], + }, + interactivity_pointer: '1234', // provide a view and interactivity pointer, or.. }, - interactivity_pointer: '1234', // provide a view and interactivity pointer, or.. -}]); -expectAssignable>([{ - view: { - type: 'home', - blocks: [], +]); +expectAssignable>([ + { + view: { + type: 'home', + blocks: [], + }, + trigger_id: '1234', // .. a trigger_id }, - 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', -})); +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: [], +expectAssignable>([ + { + view: { + type: 'home', + blocks: [], + }, + interactivity_pointer: '1234', // provide a view and interactivity pointer, or.. }, - interactivity_pointer: '1234', // provide a view and interactivity pointer, or.. -}]); -expectAssignable>([{ - view: { - type: 'home', - blocks: [], +]); +expectAssignable>([ + { + view: { + type: 'home', + blocks: [], + }, + trigger_id: '1234', // .. a trigger_id }, - 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', -})); +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: [], +expectAssignable>([ + { + view: { + type: 'home', + blocks: [], + }, + user_id: 'U1234', // provide a view and user_id }, - 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', -})); +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: [], +expectAssignable>([ + { + view: { + type: 'home', + blocks: [], + }, + external_id: '1234', // provide a view and view_id, or.. }, - external_id: '1234', // provide a view and view_id, or.. -}]); -expectAssignable>([{ - view: { - type: 'home', - blocks: [], +]); +expectAssignable>([ + { + view: { + type: 'home', + blocks: [], + }, + view_id: '1234', // .. a view_id }, - view_id: '1234', // .. a view_id -}]); +]); 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 fc96355e9..1e3f383e0 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,12 +1,14 @@ import { expectType } from 'tsd'; import { WebClient } from '../..'; -import { OauthAccessResponse } from '../../src/types/response/OauthAccessResponse'; +import type { OauthAccessResponse } from '../../src/types/response/OauthAccessResponse'; const web = new WebClient(); -expectType>(web.oauth.access({ - client_id: 'CLIENT_ID', - client_secret: 'CLIENT_SECRET', - code: 'CODE', - redirect_uri: 'REDIRECT_URI', -})); +expectType>( + web.oauth.access({ + client_id: 'CLIENT_ID', + client_secret: 'CLIENT_SECRET', + code: 'CODE', + redirect_uri: 'REDIRECT_URI', + }), +); diff --git a/packages/web-api/test/types/webclient-paginate-types.test-d.ts b/packages/web-api/test/types/webclient-paginate-types.test-d.ts index 94c82eedf..f5376010d 100644 --- a/packages/web-api/test/types/webclient-paginate-types.test-d.ts +++ b/packages/web-api/test/types/webclient-paginate-types.test-d.ts @@ -1,7 +1,7 @@ /// -import { expectType, expectError } from 'tsd'; -import { WebClient, WebAPICallResult } from '../../'; +import { expectError, expectType } from 'tsd'; +import { type WebAPICallResult, WebClient } from '../../'; const web = new WebClient(); @@ -15,7 +15,14 @@ expectType>(web.paginate('conversations.list', {}, () => false)); expectError(web.paginate('conversations.list', {}, () => 7)); -expectType>(web.paginate('conversations.list', {}, () => false, () => 5)); +expectType>( + web.paginate( + 'conversations.list', + {}, + () => false, + () => 5, + ), +); // NOTE: this error does not arise with TypeScript 4.4+ // When there's no shouldStop predicate given but there is a reducer, the behavior is undefined. @@ -39,20 +46,24 @@ web.paginate('conversations.list', {}, (page) => { /* Testing the arguments of the reduce param */ // Dummy type to make sure the generic param is bound properly -interface Dummy { t: 'dummy'; } +interface Dummy { + t: 'dummy'; +} const d: Dummy = { t: 'dummy' }; // Ideally, we would get all the same expected types even when accumulator was not explicitly typed (only the return // value of reduce having a known type). -expectType>(web.paginate( - 'conversations.list', - {}, - () => false, - (accumulator, page, pageNumber) => { - expectType(accumulator); - expectType(page); - expectType(pageNumber); - - return d; - } -)); +expectType>( + web.paginate( + 'conversations.list', + {}, + () => false, + (accumulator, page, pageNumber) => { + expectType(accumulator); + expectType(page); + expectType(pageNumber); + + return d; + }, + ), +); diff --git a/packages/web-api/tsconfig.eslint.json b/packages/web-api/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/web-api/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/web-api/tsconfig.json b/packages/web-api/tsconfig.json index 1ba8e53b9..050426ea7 100644 --- a/packages/web-api/tsconfig.json +++ b/packages/web-api/tsconfig.json @@ -15,13 +15,13 @@ "include": [ "src/**/*" ], + "exclude": [ + "src/**/*.spec.*" + ], "jsdoc": { "out": "support/jsdoc", "access": "public" }, - "exclude": [ - "src/**/*.js" - ], "ts-node": { "esm": true } diff --git a/packages/webhook/.eslintignore b/packages/webhook/.eslintignore deleted file mode 120000 index 5169d53c8..000000000 --- a/packages/webhook/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintignore \ No newline at end of file diff --git a/packages/webhook/.eslintrc.js b/packages/webhook/.eslintrc.js deleted file mode 120000 index 5962fa3ca..000000000 --- a/packages/webhook/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/.eslintrc.js \ No newline at end of file diff --git a/packages/webhook/.gitignore b/packages/webhook/.gitignore index f47692353..b024219cb 100644 --- a/packages/webhook/.gitignore +++ b/packages/webhook/.gitignore @@ -6,5 +6,4 @@ /dist # coverage -/.nyc_output /coverage diff --git a/packages/webhook/.vscode/launch.json b/packages/webhook/.vscode/launch.json index f2b586f71..cdf936528 100644 --- a/packages/webhook/.vscode/launch.json +++ b/packages/webhook/.vscode/launch.json @@ -1,25 +1,15 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "node", - "request": "launch", - "name": "Webhook Tests", - "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", - "args": [ - "--timeout", - "999999", - "--colors", - "${workspaceFolder}/src/*.spec.js" - ], - "internalConsoleOptions": "openOnSessionStart", - "skipFiles": [ - "/**" - ], - "cwd": "${workspaceFolder}" - }, - ] -} \ No newline at end of file + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Webhook Tests", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": ["--timeout", "999999", "--colors", "${workspaceFolder}/src/*.spec.js"], + "internalConsoleOptions": "openOnSessionStart", + "skipFiles": ["/**"], + "cwd": "${workspaceFolder}" + } + ] +} diff --git a/packages/webhook/.vscode/settings.json b/packages/webhook/.vscode/settings.json index 6de18e4ed..97bef4c57 100644 --- a/packages/webhook/.vscode/settings.json +++ b/packages/webhook/.vscode/settings.json @@ -1,3 +1,3 @@ { - "typescript.tsdk": "./node_modules/typescript/lib" + "typescript.tsdk": "./node_modules/typescript/lib" } diff --git a/packages/webhook/api-extractor.json b/packages/webhook/api-extractor.json deleted file mode 100644 index dbbbba8b5..000000000 --- a/packages/webhook/api-extractor.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - /** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - "mainEntryPointFilePath": "/dist/index.d.ts", - - "apiReport": { - "enabled": false - }, - - "docModel": { - "enabled": true, - "apiJsonFilePath": "/../../support/ref-docs/models/.api.json" - }, - - "dtsRollup": { - "enabled": false - }, - - "tsdocMetadata": { - "enabled": false - }, - - "messages": { - "extractorMessageReporting": { - // Disable release tagging warnings - "ae-missing-release-tag": { - "logLevel": "none" - } - } - } -} diff --git a/packages/webhook/biome.json b/packages/webhook/biome.json new file mode 100644 index 000000000..ea710a856 --- /dev/null +++ b/packages/webhook/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/webhook/package.json b/packages/webhook/package.json index 716e07d2c..1984439e5 100644 --- a/packages/webhook/package.json +++ b/packages/webhook/package.json @@ -4,19 +4,10 @@ "description": "Official library for using the Slack Platform's Incoming Webhooks", "author": "Slack Technologies, LLC", "license": "MIT", - "keywords": [ - "slack", - "request", - "client", - "http", - "api", - "proxy" - ], + "keywords": ["slack", "request", "client", "http", "api", "proxy"], "main": "dist/index.js", "types": "./dist/index.d.ts", - "files": [ - "dist/**/*" - ], + "files": ["dist/**/*"], "engines": { "node": ">= 18", "npm": ">= 8.6.0" @@ -33,11 +24,10 @@ "prepare": "npm run build", "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage", - "lint": "eslint --fix --ext .ts src", - "mocha": "mocha --config .mocharc.json src/*.spec.js", + "lint": "npx @biomejs/biome check --write .", + "mocha": "mocha --config .mocharc.json src/*.spec.ts", "test": "npm run lint && npm run test:unit", - "test:unit": "npm run build && c8 npm run mocha", - "ref-docs:model": "api-extractor run" + "test:unit": "npm run build && c8 npm run mocha" }, "dependencies": { "@slack/types": "^2.9.0", @@ -45,24 +35,14 @@ "axios": "^1.7.4" }, "devDependencies": { - "@microsoft/api-extractor": "^7.38.0", + "@biomejs/biome": "^1.8.3", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", - "@typescript-eslint/eslint-plugin": "^6.4.1", - "@typescript-eslint/parser": "^6.4.0", "c8": "^9.1.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-import-newlines": "^1.3.4", - "eslint-plugin-jsdoc": "^46.5.0", - "eslint-plugin-node": "^11.1.0", "mocha": "^10.2.0", "nock": "^13.3.3", "shx": "^0.3.2", - "sinon": "^17.0.0", "source-map-support": "^0.5.21", "ts-node": "^8.2.0", "typescript": "^4.1.0" diff --git a/packages/webhook/src/IncomingWebhook.spec.js b/packages/webhook/src/IncomingWebhook.spec.js deleted file mode 100644 index d1bc42cd9..000000000 --- a/packages/webhook/src/IncomingWebhook.spec.js +++ /dev/null @@ -1,137 +0,0 @@ -require('mocha'); -const { Agent } = require('https'); -const { IncomingWebhook } = require('./IncomingWebhook'); -const { ErrorCode } = require('./errors'); -const { assert } = require('chai'); -const nock = require('nock'); -const sinon = require('sinon'); - -const url = 'https://hooks.slack.com/services/FAKEWEBHOOK'; - -describe('IncomingWebhook', function () { - - describe('constructor()', function () { - it('should build a default webhook given a URL', function () { - const webhook = new IncomingWebhook(url); - assert.instanceOf(webhook, IncomingWebhook); - }); - - it('should create a default webhook with a default timeout', function () { - const webhook = new IncomingWebhook(url); - assert.equal(webhook.defaults.timeout, 0); - }); - - it('should create an axios instance that has the timeout passed by the user', function () { - const givenTimeout = 100; - const webhook = new IncomingWebhook(url, { timeout: givenTimeout }) - assert.equal(webhook.axios.defaults.timeout, givenTimeout) - }) - }); - - describe('send()', function () { - beforeEach(function () { - this.webhook = new IncomingWebhook(url); - }); - - describe('when making a successful call', function () { - beforeEach(function () { - this.scope = nock('https://hooks.slack.com') - .post(/services/) - .reply(200, 'ok'); - }); - - it('should return results in a Promise', function () { - const result = this.webhook.send('Hello'); - return result.then((result) => { - assert.strictEqual(result.text, 'ok'); - this.scope.done(); - }); - }); - - it('should send metadata', function () { - const result = this.webhook.send({ - text: 'Hello', - response_type: 'in_channel', - metadata: { - event_type: 'foo', - event_payload: { foo: 'bar'}, - } - }); - return result.then((result) => { - assert.strictEqual(result.text, 'ok'); - this.scope.done(); - }); - }); - }); - - describe('when the call fails', function () { - beforeEach(function () { - this.statusCode = 500; - this.scope = nock('https://hooks.slack.com') - .post(/services/) - .reply(this.statusCode); - }); - - it('should return a Promise which rejects on error', function () { - const result = this.webhook.send('Hello'); - return result.catch((error) => { - assert.ok(error); - assert.instanceOf(error, Error); - assert.match(error.message, new RegExp(this.statusCode)); - this.scope.done(); - }); - }); - - it('should fail with IncomingWebhookRequestError when the API request fails', function () { - // One known request error is when the node encounters an ECONNREFUSED. In order to simulate this, rather than - // using nock, we send the request to a host:port that is not listening. - const webhook = new IncomingWebhook('https://localhost:8999/api/'); - const result = webhook.send('Hello'); - return result.catch((error) => { - assert.instanceOf(error, Error); - assert.equal(error.code, ErrorCode.RequestError); - assert.instanceOf(error.original, Error); - }); - }); - }); - - describe('lifecycle', function () { - it('should not overwrite the default parameters after a call', function () { - const defaultParams = { channel: 'default' }; - const expectedParams = Object.assign({}, defaultParams); - const webhook = new IncomingWebhook(url, defaultParams); - - const result = webhook.send({ channel: 'different' }); - return result.catch((error) => { - assert.deepEqual(webhook.defaults, expectedParams); - }); - }); - }); - }); - - describe('has an option to set a custom HTTP agent', function () { - it('should send a request using the custom agent', function () { - const agent = new Agent({ keepAlive: true }); - const spy = sinon.spy(agent, 'addRequest'); - const webhook = new IncomingWebhook(url, { agent }); - - return webhook.send('Hello') - .catch(() => { - assert(spy.called); - }) - .then(() => { - agent.addRequest.restore(); - agent.destroy(); - }) - .catch((error) => { - agent.addRequest.restore(); - agent.destroy(); - throw error; - }); - }); - }); - - afterEach(function () { - nock.cleanAll(); - }); -}); diff --git a/packages/webhook/src/IncomingWebhook.spec.ts b/packages/webhook/src/IncomingWebhook.spec.ts new file mode 100644 index 000000000..963da77af --- /dev/null +++ b/packages/webhook/src/IncomingWebhook.spec.ts @@ -0,0 +1,114 @@ +import { assert } from 'chai'; +import nock from 'nock'; +import { IncomingWebhook } from './IncomingWebhook'; +import { ErrorCode } from './errors'; + +const url = 'https://hooks.slack.com/services/FAKEWEBHOOK'; + +describe('IncomingWebhook', () => { + afterEach(() => { + nock.cleanAll(); + }); + + describe('constructor()', () => { + it('should build a default webhook given a URL', () => { + const webhook = new IncomingWebhook(url); + assert.instanceOf(webhook, IncomingWebhook); + }); + + it('should create a default webhook with a default timeout', () => { + const webhook = new IncomingWebhook(url); + assert.nestedPropertyVal(webhook, 'defaults.timeout', 0); + }); + + it('should create an axios instance that has the timeout passed by the user', () => { + const givenTimeout = 100; + const webhook = new IncomingWebhook(url, { timeout: givenTimeout }); + assert.nestedPropertyVal(webhook, 'axios.defaults.timeout', givenTimeout); + }); + }); + + describe('send()', () => { + let webhook: IncomingWebhook; + beforeEach(() => { + webhook = new IncomingWebhook(url); + }); + + describe('when making a successful call', () => { + let scope: nock.Scope; + beforeEach(() => { + scope = nock('https://hooks.slack.com') + .post(/services/) + .reply(200, 'ok'); + }); + + it('should return results in a Promise', async () => { + const result = await webhook.send('Hello'); + assert.strictEqual(result.text, 'ok'); + scope.done(); + }); + + it('should send metadata', async () => { + const result = await webhook.send({ + text: 'Hello', + metadata: { + event_type: 'foo', + event_payload: { foo: 'bar' }, + }, + }); + assert.strictEqual(result.text, 'ok'); + scope.done(); + }); + }); + + describe('when the call fails', () => { + let statusCode: number; + let scope: nock.Scope; + beforeEach(() => { + statusCode = 500; + scope = nock('https://hooks.slack.com') + .post(/services/) + .reply(statusCode); + }); + + it('should return a Promise which rejects on error', async () => { + try { + await webhook.send('Hello'); + assert.fail('expected rejection'); + } catch (error) { + assert.ok(error); + assert.instanceOf(error, Error); + assert.match((error as Error).message, new RegExp(String(statusCode))); + scope.done(); + } + }); + + it('should fail with IncomingWebhookRequestError when the API request fails', async () => { + // One known request error is when the node encounters an ECONNREFUSED. In order to simulate this, rather than + // using nock, we send the request to a host:port that is not listening. + const webhook = new IncomingWebhook('https://localhost:8999/api/'); + try { + await webhook.send('Hello'); + assert.fail('expected rejection'); + } catch (error) { + assert.instanceOf(error, Error); + assert.propertyVal(error, 'code', ErrorCode.RequestError); + } + }); + }); + + describe('lifecycle', () => { + it('should not overwrite the default parameters after a call', async () => { + const defaultParams = { channel: 'default' }; + const webhook = new IncomingWebhook(url, defaultParams); + + try { + await webhook.send({ channel: 'different' }); + assert.fail('expected rejection'); + } catch (error) { + assert.nestedPropertyVal(webhook, 'defaults.channel', defaultParams.channel); + } + }); + }); + }); +}); diff --git a/packages/webhook/src/IncomingWebhook.ts b/packages/webhook/src/IncomingWebhook.ts index ba2aa3ab0..8b5046121 100644 --- a/packages/webhook/src/IncomingWebhook.ts +++ b/packages/webhook/src/IncomingWebhook.ts @@ -1,7 +1,7 @@ -import { Agent } from 'http'; +import type { Agent } from 'node:http'; -import { Block, KnownBlock, MessageAttachment } from '@slack/types'; // TODO: Block and KnownBlock will be merged into AnyBlock in upcoming types release -import axios, { AxiosInstance, AxiosResponse } from 'axios'; +import type { Block, KnownBlock, MessageAttachment } from '@slack/types'; // TODO: Block and KnownBlock will be merged into AnyBlock in upcoming types release +import axios, { type AxiosInstance, type AxiosResponse } from 'axios'; import { httpErrorWithOriginal, requestErrorWithOriginal } from './errors'; import { getUserAgent } from './instrument'; @@ -46,12 +46,11 @@ export class IncomingWebhook { proxy: false, timeout: defaults.timeout, headers: { - // eslint-disable-next-line @typescript-eslint/naming-convention 'User-Agent': getUserAgent(), }, }); - delete this.defaults.agent; + this.defaults.agent = undefined; } /** @@ -71,23 +70,22 @@ export class IncomingWebhook { try { const response = await this.axios.post(this.url, payload); return this.buildResult(response); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: errors can be anything } catch (error: any) { // Wrap errors in this packages own error types (abstract the implementation details' types) if (error.response !== undefined) { throw httpErrorWithOriginal(error); - } else if (error.request !== undefined) { + } + if (error.request !== undefined) { throw requestErrorWithOriginal(error); - } else { - throw error; } + throw error; } } /** * Processes an HTTP response into an IncomingWebhookResult. */ - // eslint-disable-next-line class-methods-use-this private buildResult(response: AxiosResponse): IncomingWebhookResult { return { text: response.data, @@ -117,7 +115,7 @@ export interface IncomingWebhookSendArguments extends IncomingWebhookDefaultArgu unfurl_media?: boolean; metadata?: { event_type: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: errors can be anything event_payload: Record; }; } diff --git a/packages/webhook/src/errors.ts b/packages/webhook/src/errors.ts index f209565ba..1252b190a 100644 --- a/packages/webhook/src/errors.ts +++ b/packages/webhook/src/errors.ts @@ -1,4 +1,4 @@ -import { AxiosError, AxiosResponse } from 'axios'; +import type { AxiosError, AxiosResponse } from 'axios'; /** * All errors produced by this package adhere to this interface @@ -47,7 +47,7 @@ export function requestErrorWithOriginal(original: AxiosError): IncomingWebhookR ErrorCode.RequestError, ) as Partial; error.original = original; - return (error as IncomingWebhookRequestError); + return error as IncomingWebhookRequestError; } /** @@ -60,5 +60,5 @@ export function httpErrorWithOriginal(original: AxiosError & { response: AxiosRe ErrorCode.HTTPError, ) as Partial; error.original = original; - return (error as IncomingWebhookHTTPError); + return error as IncomingWebhookHTTPError; } diff --git a/packages/webhook/src/instrument.ts b/packages/webhook/src/instrument.ts index 9cbc08051..679143486 100644 --- a/packages/webhook/src/instrument.ts +++ b/packages/webhook/src/instrument.ts @@ -1,6 +1,6 @@ -import * as os from 'os'; +import * as os from 'node:os'; -const packageJson = require('../package.json'); // eslint-disable-line import/no-commonjs, @typescript-eslint/no-var-requires +const packageJson = require('../package.json'); /** * Replaces occurrences of '/' with ':' in a string, since '/' is meaningful inside User-Agent strings as a separator. @@ -9,9 +9,10 @@ function replaceSlashes(s: string): string { return s.replace('/', ':'); } -const baseUserAgent = `${replaceSlashes(packageJson.name)}/${packageJson.version} ` + - `node/${process.version.replace('v', '')} ` + - `${os.platform()}/${os.release()}`; +const baseUserAgent = + `${replaceSlashes(packageJson.name)}/${packageJson.version} ` + + `node/${process.version.replace('v', '')} ` + + `${os.platform()}/${os.release()}`; const appMetadata: { [key: string]: string } = {}; @@ -20,7 +21,7 @@ const appMetadata: { [key: string]: string } = {}; * @param appMetadata.name name of tool to be counted in instrumentation * @param appMetadata.version version of tool to be counted in instrumentation */ -export function addAppMetadata({ name, version }: { name: string, version: string }): void { +export function addAppMetadata({ name, version }: { name: string; version: string }): void { appMetadata[replaceSlashes(name)] = version; } @@ -28,7 +29,9 @@ export function addAppMetadata({ name, version }: { name: string, version: strin * Returns the current User-Agent value for instrumentation */ export function getUserAgent(): string { - const appIdentifier = Object.entries(appMetadata).map(([name, version]) => `${name}/${version}`).join(' '); + const appIdentifier = Object.entries(appMetadata) + .map(([name, version]) => `${name}/${version}`) + .join(' '); // only prepend the appIdentifier when its not empty - return ((appIdentifier.length > 0) ? `${appIdentifier} ` : '') + baseUserAgent; + return (appIdentifier.length > 0 ? `${appIdentifier} ` : '') + baseUserAgent; } diff --git a/packages/webhook/tsconfig.eslint.json b/packages/webhook/tsconfig.eslint.json deleted file mode 120000 index 2cd9fb812..000000000 --- a/packages/webhook/tsconfig.eslint.json +++ /dev/null @@ -1 +0,0 @@ -../../lint-configs/tsconfig.eslint.json \ No newline at end of file diff --git a/packages/webhook/tsconfig.json b/packages/webhook/tsconfig.json index b61d86ce5..139d474c6 100644 --- a/packages/webhook/tsconfig.json +++ b/packages/webhook/tsconfig.json @@ -13,14 +13,14 @@ "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", "baseUrl": ".", "paths": { - "*": ["./types/*"] + "*": [ + "./types/*" + ] }, - "esModuleInterop" : true, - + "esModuleInterop": true // Not using this setting because its only used to require the package.json file, and that would change the // structure of the files in the dist directory because package.json is not located inside src. It would be nice // to use import instead of require(), but its not worth the tradeoff of restructuring the build (for now). @@ -30,8 +30,7 @@ "src/**/*" ], "exclude": [ - "src/**/*.spec.js", - "src/**/*.js" + "src/**/*.spec.*" ], "jsdoc": { "out": "support/jsdoc", diff --git a/scripts/code_generator.rb b/scripts/code_generator.rb index c703b71c8..a8dd3e868 100644 --- a/scripts/code_generator.rb +++ b/scripts/code_generator.rb @@ -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 = "#{NOTICE}\nimport { WebAPICallResult } from '../../WebClient';\n" + stdout.read source.gsub!( "export interface #{root_class_name} {", "export type #{root_class_name} = WebAPICallResult & {"