Skip to content

Commit

Permalink
web-api(fix): revert use of export type * to maintain backwards com…
Browse files Browse the repository at this point in the history
…patibility with TS 4.7 (#1841)
  • Loading branch information
filmaj authored Jul 4, 2024
1 parent e678aff commit b284994
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 43 deletions.
3 changes: 3 additions & 0 deletions packages/web-api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ package-lock.json
# coverage
/.nyc_output
/coverage

# test fixtures
test/integration/**/dist
3 changes: 2 additions & 1 deletion packages/web-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"lint": "eslint --fix --ext .ts src",
"mocha": "mocha --config .mocharc.json src/*.spec.js",
"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",
"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",
Expand Down
84 changes: 42 additions & 42 deletions packages/web-api/src/types/request/index.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
export type * from './workflows';
export type * from './views';
export type * from './users';
export type * from './tooling';
export type * from './search';
export type * from './usergroups';
export type * from './team';
export type * from './stars';
export type * from './rtm';
export type * from './reminders';
export type * from './reactions';
export type * from './pins';
export type * from './openid';
export type * from './oauth';
export type * from './migration';
export type * from './files';
export type * from './emoji';
export type * from './dnd';
export type * from './dialog';
export type * from './conversations';
export type * from './chat';
export type * from './canvas';
export type * from './calls';
export type * from './bots';
export type * from './bookmarks';
export type * from './auth';
export type * from './apps';
export type * from './api';
export type * from './admin/analytics';
export type * from './admin/apps';
export type * from './admin/auth';
export type * from './admin/barriers';
export type * from './admin/conversations';
export type * from './admin/emoji';
export type * from './admin/functions';
export type * from './functions';
export type * from './admin/inviteRequests';
export type * from './admin/roles';
export type * from './admin/teams';
export type * from './admin/usergroups';
export type * from './admin/users';
export type * from './admin/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 { 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 { 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 { 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 { EmojiListArguments } from './emoji';
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 { BotsInfoArguments } from './bots';
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 { 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 { 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';
2 changes: 2 additions & 0 deletions packages/web-api/test/integration/ts-4.7-project/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { WebClient } from '../../../src/index';
new WebClient('invalid-token');
15 changes: 15 additions & 0 deletions packages/web-api/test/integration/ts-4.7-project/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "ts-47-project",
"version": "1.0.0",
"description": "",
"scripts": {
"build": "shx rm -rf ./dist && tsc"
},
"devDependencies": {
"shx": "0.3.2",
"typescript": "4.7.2"
},
"keywords": [],
"author": "",
"license": "ISC"
}
24 changes: 24 additions & 0 deletions packages/web-api/test/integration/ts-4.7-project/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "dist",

"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,

"moduleResolution": "node",
"baseUrl": ".",
"esModuleInterop" : true,
"resolveJsonModule": true
},
"include": [
"index.ts"
]
}

0 comments on commit b284994

Please sign in to comment.