Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update open api #10

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion src/gen/chat/apis/ChannelTypesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/ChannelsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/CustomCommandsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/DefaultApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/DevicesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/EventsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
6 changes: 3 additions & 3 deletions src/gen/chat/apis/FilesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/GDPRApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/ImportsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/MessagesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/ModerationApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/PermissionsV2Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/PushApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/ReactionsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/ServerSideApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/SettingsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/TasksApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/TestingApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/UsersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
16 changes: 8 additions & 8 deletions src/gen/chat/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
50 changes: 50 additions & 0 deletions src/gen/chat/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,12 @@ export interface App {
* @memberof App
*/
custom_action_handler_url: string;
/**
*
* @type {DataDogInfo}
* @memberof App
*/
datadog_info?: DataDogInfo;
/**
*
* @type {boolean}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -13446,6 +13490,12 @@ export interface UpdateAppRequest {
* @memberof UpdateAppRequest
*/
custom_action_handler_url?: string;
/**
*
* @type {DataDogInfoRequest}
* @memberof UpdateAppRequest
*/
datadog_info?: DataDogInfoRequest;
/**
*
* @type {boolean}
Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/video/apis/DefaultApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/video/apis/ServerSideApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/gen/video/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down