From dce2662afdbbea4fdb68b88e195eb6e931b13725 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Fri, 1 Dec 2023 10:56:15 +0100 Subject: [PATCH 1/2] feat: update open api spec --- src/gen/chat/apis/ChannelTypesApi.ts | 2 +- src/gen/chat/apis/ChannelsApi.ts | 2 +- src/gen/chat/apis/CustomCommandsApi.ts | 2 +- src/gen/chat/apis/DefaultApi.ts | 2 +- src/gen/chat/apis/DevicesApi.ts | 2 +- src/gen/chat/apis/EventsApi.ts | 2 +- src/gen/chat/apis/FilesApi.ts | 6 ++-- src/gen/chat/apis/GDPRApi.ts | 2 +- src/gen/chat/apis/ImportsApi.ts | 2 +- src/gen/chat/apis/MessagesApi.ts | 2 +- src/gen/chat/apis/ModerationApi.ts | 2 +- src/gen/chat/apis/PermissionsV2Api.ts | 2 +- src/gen/chat/apis/PushApi.ts | 2 +- src/gen/chat/apis/ReactionsApi.ts | 2 +- src/gen/chat/apis/ServerSideApi.ts | 2 +- src/gen/chat/apis/SettingsApi.ts | 2 +- src/gen/chat/apis/TasksApi.ts | 2 +- src/gen/chat/apis/TestingApi.ts | 2 +- src/gen/chat/apis/UsersApi.ts | 2 +- src/gen/chat/apis/index.ts | 16 ++++----- src/gen/chat/models/index.ts | 50 ++++++++++++++++++++++++++ src/gen/chat/runtime.ts | 2 +- src/gen/video/apis/DefaultApi.ts | 2 +- src/gen/video/apis/ServerSideApi.ts | 2 +- src/gen/video/runtime.ts | 2 +- 25 files changed, 83 insertions(+), 33 deletions(-) diff --git a/src/gen/chat/apis/ChannelTypesApi.ts b/src/gen/chat/apis/ChannelTypesApi.ts index 0e5004e..dddb500 100644 --- a/src/gen/chat/apis/ChannelTypesApi.ts +++ b/src/gen/chat/apis/ChannelTypesApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/ChannelsApi.ts b/src/gen/chat/apis/ChannelsApi.ts index 7b42f83..982700c 100644 --- a/src/gen/chat/apis/ChannelsApi.ts +++ b/src/gen/chat/apis/ChannelsApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/CustomCommandsApi.ts b/src/gen/chat/apis/CustomCommandsApi.ts index eb773ff..f9f0045 100644 --- a/src/gen/chat/apis/CustomCommandsApi.ts +++ b/src/gen/chat/apis/CustomCommandsApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/DefaultApi.ts b/src/gen/chat/apis/DefaultApi.ts index 00c6cf7..ef803a4 100644 --- a/src/gen/chat/apis/DefaultApi.ts +++ b/src/gen/chat/apis/DefaultApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/DevicesApi.ts b/src/gen/chat/apis/DevicesApi.ts index 6209172..06f2844 100644 --- a/src/gen/chat/apis/DevicesApi.ts +++ b/src/gen/chat/apis/DevicesApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/EventsApi.ts b/src/gen/chat/apis/EventsApi.ts index ac636a9..f575bf1 100644 --- a/src/gen/chat/apis/EventsApi.ts +++ b/src/gen/chat/apis/EventsApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/FilesApi.ts b/src/gen/chat/apis/FilesApi.ts index e581271..c203474 100644 --- a/src/gen/chat/apis/FilesApi.ts +++ b/src/gen/chat/apis/FilesApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -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/GDPRApi.ts b/src/gen/chat/apis/GDPRApi.ts index e9809e9..1e7c162 100644 --- a/src/gen/chat/apis/GDPRApi.ts +++ b/src/gen/chat/apis/GDPRApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/ImportsApi.ts b/src/gen/chat/apis/ImportsApi.ts index 958ca40..1bc12f5 100644 --- a/src/gen/chat/apis/ImportsApi.ts +++ b/src/gen/chat/apis/ImportsApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/MessagesApi.ts b/src/gen/chat/apis/MessagesApi.ts index d5958b3..010bfed 100644 --- a/src/gen/chat/apis/MessagesApi.ts +++ b/src/gen/chat/apis/MessagesApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/ModerationApi.ts b/src/gen/chat/apis/ModerationApi.ts index 17542d8..13323fc 100644 --- a/src/gen/chat/apis/ModerationApi.ts +++ b/src/gen/chat/apis/ModerationApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/PermissionsV2Api.ts b/src/gen/chat/apis/PermissionsV2Api.ts index c507266..487a209 100644 --- a/src/gen/chat/apis/PermissionsV2Api.ts +++ b/src/gen/chat/apis/PermissionsV2Api.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/PushApi.ts b/src/gen/chat/apis/PushApi.ts index 651567a..f811ee5 100644 --- a/src/gen/chat/apis/PushApi.ts +++ b/src/gen/chat/apis/PushApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/ReactionsApi.ts b/src/gen/chat/apis/ReactionsApi.ts index 297334c..b94ffa5 100644 --- a/src/gen/chat/apis/ReactionsApi.ts +++ b/src/gen/chat/apis/ReactionsApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/ServerSideApi.ts b/src/gen/chat/apis/ServerSideApi.ts index 87bfc16..717bf79 100644 --- a/src/gen/chat/apis/ServerSideApi.ts +++ b/src/gen/chat/apis/ServerSideApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/SettingsApi.ts b/src/gen/chat/apis/SettingsApi.ts index 9edecbf..416cc77 100644 --- a/src/gen/chat/apis/SettingsApi.ts +++ b/src/gen/chat/apis/SettingsApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/TasksApi.ts b/src/gen/chat/apis/TasksApi.ts index 0968f6a..57c4c2e 100644 --- a/src/gen/chat/apis/TasksApi.ts +++ b/src/gen/chat/apis/TasksApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/TestingApi.ts b/src/gen/chat/apis/TestingApi.ts index ea40fe6..738d530 100644 --- a/src/gen/chat/apis/TestingApi.ts +++ b/src/gen/chat/apis/TestingApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/UsersApi.ts b/src/gen/chat/apis/UsersApi.ts index ad71340..3e35315 100644 --- a/src/gen/chat/apis/UsersApi.ts +++ b/src/gen/chat/apis/UsersApi.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/apis/index.ts b/src/gen/chat/apis/index.ts index 9b196ae..97829aa 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'; diff --git a/src/gen/chat/models/index.ts b/src/gen/chat/models/index.ts index 563602e..8dd9b93 100644 --- a/src/gen/chat/models/index.ts +++ b/src/gen/chat/models/index.ts @@ -379,6 +379,12 @@ export interface App { * @memberof App */ custom_action_handler_url: string; + /** + * + * @type {DataDogInfo} + * @memberof App + */ + datadog_info?: DataDogInfo; /** * * @type {boolean} @@ -4931,6 +4937,44 @@ export interface CreateRoleResponse { */ role: Role; } +/** + * + * @export + * @interface DataDogInfo + */ +export interface DataDogInfo { + /** + * + * @type {string} + * @memberof DataDogInfo + */ + api_key: string; + /** + * + * @type {string} + * @memberof DataDogInfo + */ + site: string; +} +/** + * + * @export + * @interface DataDogInfoRequest + */ +export interface DataDogInfoRequest { + /** + * + * @type {string} + * @memberof DataDogInfoRequest + */ + api_key?: string; + /** + * + * @type {string} + * @memberof DataDogInfoRequest + */ + site?: string; +} /** * * @export @@ -13446,6 +13490,12 @@ export interface UpdateAppRequest { * @memberof UpdateAppRequest */ custom_action_handler_url?: string; + /** + * + * @type {DataDogInfoRequest} + * @memberof UpdateAppRequest + */ + datadog_info?: DataDogInfoRequest; /** * * @type {boolean} diff --git a/src/gen/chat/runtime.ts b/src/gen/chat/runtime.ts index 4dc8430..c6ff583 100644 --- a/src/gen/chat/runtime.ts +++ b/src/gen/chat/runtime.ts @@ -4,7 +4,7 @@ * Stream Chat API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/video/apis/DefaultApi.ts b/src/gen/video/apis/DefaultApi.ts index 3663d08..78498b8 100644 --- a/src/gen/video/apis/DefaultApi.ts +++ b/src/gen/video/apis/DefaultApi.ts @@ -4,7 +4,7 @@ * Stream Video API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/video/apis/ServerSideApi.ts b/src/gen/video/apis/ServerSideApi.ts index c66b8c8..5da3f06 100644 --- a/src/gen/video/apis/ServerSideApi.ts +++ b/src/gen/video/apis/ServerSideApi.ts @@ -4,7 +4,7 @@ * Stream Video API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/video/runtime.ts b/src/gen/video/runtime.ts index 5058a80..d28abf4 100644 --- a/src/gen/video/runtime.ts +++ b/src/gen/video/runtime.ts @@ -4,7 +4,7 @@ * Stream Video API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.5.0 + * The version of the OpenAPI document: v92.7.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). From 036c60b9e5bc429421082d7c7e5a70bcc252ae99 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Fri, 1 Dec 2023 10:56:30 +0100 Subject: [PATCH 2/2] chore: add contributing.md --- CONTRIBUTING.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..bd361d7 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,67 @@ +# :recycle: Contributing + +We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. See our license file for more details. + +## Getting started + +### Install dependencies + +```shell +$ yarn install +``` + +### Run tests + +```shell +$ yarn test +``` + +## Linting and code formatting + +We use [ESLint](https://eslint.org/) for linting and [Prettier](https://prettier.io/) for code formatting. We enforce formatting with pre-commit hook, linting with CI. If your IDE has integration with these tools, it's recommended to set them up. + +## Commit message convention + +Since we're autogenerating our [CHANGELOG](./CHANGELOG.md), we need to follow a specific commit message convention. +You can read about conventional commits [here](https://www.conventionalcommits.org/). Here's how a usual commit message looks like for a new feature: `feat: allow provided config object to extend other configs`. A bugfix: `fix: prevent racing of requests`. + +## Generating code from Open API + +Checkout the [protocol](https://github.com/GetStream/protocol) or [chat](https://github.com/GetStream/chat) reporisitories and run one of the following commands: + +```shell +# if you have protocol repo: +$ yarn generate:open-api +# if you have chat repo +$ 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` +- Fix the query param serizalization in the `gen/chat/MessagesApi.ts` file's `getManyMessagesRaw` function. This is the correct serialization: + +```typescript +if (requestParameters.ids) { + queryParameters["ids"] = requestParameters.ids.join(","); +} +``` + +To check your work, run the following commands: + +``` +yarn start +yarn test +``` + +If these commands run fine, we're good to go. + +## Release (for Stream developers) + +Releasing this package involves two GitHub Action steps: + +- Whenever a new feature/fix is pushed to `main` a release PR is created ([example PR](https://github.com/GetStream/stream-node/pull/8)). That PR will be automatically updated on pushes to `main`. +- When you're ready to release, merge the release PR + +Once the PR is merged, it automatically kicks off another job which will release the pacakge to npm.