diff --git a/.eslintrc.js b/.eslintrc.js index 89ee233..b5b8bc5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,6 +23,7 @@ module.exports = { }, rules: { semi: "off", + "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/semi": "off", "@typescript-eslint/promise-function-async": "off", "@typescript-eslint/explicit-function-return-type": "off", diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 48ffc76..18f8ac2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,8 +41,8 @@ $ yarn generate:open-api:dev Fix manually the known issues issues in the generated code: -- Add `// @ts-expect-error` for imports for `ImageSizeRequest`, `OnlyUserIDRequest` in the `gen/chat/FilesApi.ts` and `gen/chat/MessagesApi.ts` files -- Add `// @ts-expect-error` for duplicate exports in `gen/chat/index.ts` +- Add `/** @ts-expect-error */ ` for imports for `ImageSizeRequest`, `OnlyUserIDRequest` in the `gen/chat/FilesApi.ts` and `gen/chat/MessagesApi.ts` files +- Add `/** @ts-expect-error */ ` for duplicate exports in `gen/chat/index.ts` - Fix the query param serizalization in the `gen/chat/MessagesApi.ts` file's `getManyMessagesRaw` function. This is the correct serialization: ```typescript diff --git a/src/StreamChannel.ts b/src/StreamChannel.ts index ac66494..ab3b3e8 100644 --- a/src/StreamChannel.ts +++ b/src/StreamChannel.ts @@ -42,11 +42,11 @@ export class StreamChannel { public id?: string, ) { const configuration = this.streamClient.getConfiguration(); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.channelsApi = new ChannelsApi(configuration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.messagesApi = new MessagesApi(configuration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.eventsApi = new EventsApi(configuration); } diff --git a/src/StreamChatClient.ts b/src/StreamChatClient.ts index 05d7b0b..1768b96 100644 --- a/src/StreamChatClient.ts +++ b/src/StreamChatClient.ts @@ -31,13 +31,13 @@ export class StreamChatClient { constructor(private readonly streamClient: StreamClient) { const configuration = this.streamClient.getConfiguration(); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.settingsApi = new SettingsApi(configuration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.channelTypesApi = new ChannelTypesApi(configuration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.channelsApi = new ChannelsApi(configuration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.commandsApi = new CustomCommandsApi(configuration); } diff --git a/src/StreamClient.ts b/src/StreamClient.ts index 06d6c6e..fa60ac3 100644 --- a/src/StreamClient.ts +++ b/src/StreamClient.ts @@ -103,23 +103,23 @@ export class StreamClient { } const chatConfiguration = this.getConfiguration(); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.usersApi = new UsersApi(chatConfiguration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.devicesApi = new DevicesApi(chatConfiguration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.pushApi = new PushApi(chatConfiguration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.serversideApi = new ServerSideApi(chatConfiguration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.testingApi = new TestingApi(chatConfiguration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.permissionsApi = new PermissionsV2Api(chatConfiguration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.settingsApi = new SettingsApi(chatConfiguration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.eventsApi = new EventsApi(chatConfiguration); - // @ts-expect-error typing problem + /** @ts-expect-error */ this.tasksApi = new TasksApi(chatConfiguration); } @@ -292,7 +292,7 @@ export class StreamClient { queryUsers = async (payload: QueryUsersRequest) => { payload.user = this.mapCustomDataBeforeSend(payload.user); const response = await this.usersApi.queryUsers({ payload }); - // @ts-expect-error typing problem + /** @ts-expect-error */ response.users = response.users.map((u) => this.mapCustomDataAfterReceive(u), ); @@ -349,7 +349,7 @@ export class StreamClient { users: UpdateUserPartialRequest[]; }) => { const response = await this.usersApi.updateUsersPartial({ - // @ts-expect-error typing error + /** @ts-expect-error */ updateUserPartialRequest: request, }); Object.keys(response.users).forEach((key) => { @@ -572,7 +572,7 @@ export class StreamClient { if (!user) { return undefined; } - // @ts-expect-error typing problem + /** @ts-expect-error */ const result: UserObject | UserResponse = {}; Object.keys(user).forEach((key) => { if (!this.reservedKeywords.includes(key)) { diff --git a/src/gen/chat/apis/FilesApi.ts b/src/gen/chat/apis/FilesApi.ts index c203474..1bc5579 100644 --- a/src/gen/chat/apis/FilesApi.ts +++ b/src/gen/chat/apis/FilesApi.ts @@ -18,10 +18,10 @@ import type { APIError, FileDeleteResponse, FileUploadResponse, - // @ts-expect-error + /** @ts-expect-error */ ImageSizeRequest, ImageUploadResponse, - // @ts-expect-error + /** @ts-expect-error */ OnlyUserIDRequest, } from '../models'; diff --git a/src/gen/chat/apis/MessagesApi.ts b/src/gen/chat/apis/MessagesApi.ts index 010bfed..42650c1 100644 --- a/src/gen/chat/apis/MessagesApi.ts +++ b/src/gen/chat/apis/MessagesApi.ts @@ -24,7 +24,7 @@ import type { GetOGResponse, GetReactionsResponse, GetRepliesResponse, - // @ts-expect-error + /** @ts-expect-error */ ImageSizeRequest, ImageUploadResponse, MarkChannelsReadRequest, @@ -34,7 +34,7 @@ import type { MessageActionRequest, MessageResponse, MessageWithPendingMetadataResponse, - // @ts-expect-error + /** @ts-expect-error */ OnlyUserIDRequest, QueryMessageFlagsRequest, QueryMessageFlagsResponse, diff --git a/src/gen/chat/apis/index.ts b/src/gen/chat/apis/index.ts index 97829aa..e60051e 100644 --- a/src/gen/chat/apis/index.ts +++ b/src/gen/chat/apis/index.ts @@ -7,23 +7,23 @@ export * from './DefaultApi'; export * from './DevicesApi'; export * from './EventsApi'; export * from './FilesApi'; -// @ts-expect-error +/** @ts-expect-error */ export * from './GDPRApi'; export * from './ImportsApi'; -// @ts-expect-error +/** @ts-expect-error */ export * from './MessagesApi'; -// @ts-expect-error +/** @ts-expect-error */ export * from './ModerationApi'; export * from './PermissionsV2Api'; -// @ts-expect-error +/** @ts-expect-error */ export * from './PushApi'; -// @ts-expect-error +/** @ts-expect-error */ export * from './ReactionsApi'; export * from './ServerSideApi'; -// @ts-expect-error +/** @ts-expect-error */ export * from './SettingsApi'; export * from './TasksApi'; -// @ts-expect-error +/** @ts-expect-error */ export * from './TestingApi'; -// @ts-expect-error +/** @ts-expect-error */ export * from './UsersApi';