Skip to content

Commit 05fbbf6

Browse files
authored
feat: update open api (#10)
1 parent 078efeb commit 05fbbf6

26 files changed

+150
-33
lines changed

CONTRIBUTING.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# :recycle: Contributing
2+
3+
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.
4+
5+
## Getting started
6+
7+
### Install dependencies
8+
9+
```shell
10+
$ yarn install
11+
```
12+
13+
### Run tests
14+
15+
```shell
16+
$ yarn test
17+
```
18+
19+
## Linting and code formatting
20+
21+
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.
22+
23+
## Commit message convention
24+
25+
Since we're autogenerating our [CHANGELOG](./CHANGELOG.md), we need to follow a specific commit message convention.
26+
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`.
27+
28+
## Generating code from Open API
29+
30+
Checkout the [protocol](https://github.com/GetStream/protocol) or [chat](https://github.com/GetStream/chat) reporisitories and run one of the following commands:
31+
32+
```shell
33+
# if you have protocol repo:
34+
$ yarn generate:open-api
35+
# if you have chat repo
36+
$ yarn generate:open-api:dev
37+
```
38+
39+
Fix manually the known issues issues in the generated code:
40+
41+
- Add `// @ts-expect-error` for imports for `ImageSizeRequest`, `OnlyUserIDRequest` in the `gen/chat/FilesApi.ts` and `gen/chat/MessagesApi.ts` files
42+
- Add `// @ts-expect-error` for duplicate exports in `gen/chat/index.ts`
43+
- Fix the query param serizalization in the `gen/chat/MessagesApi.ts` file's `getManyMessagesRaw` function. This is the correct serialization:
44+
45+
```typescript
46+
if (requestParameters.ids) {
47+
queryParameters["ids"] = requestParameters.ids.join(",");
48+
}
49+
```
50+
51+
To check your work, run the following commands:
52+
53+
```
54+
yarn start
55+
yarn test
56+
```
57+
58+
If these commands run fine, we're good to go.
59+
60+
## Release (for Stream developers)
61+
62+
Releasing this package involves two GitHub Action steps:
63+
64+
- 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`.
65+
- When you're ready to release, merge the release PR
66+
67+
Once the PR is merged, it automatically kicks off another job which will release the pacakge to npm.

src/gen/chat/apis/ChannelTypesApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Stream Chat API
55
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
66
*
7-
* The version of the OpenAPI document: v92.5.0
7+
* The version of the OpenAPI document: v92.7.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

src/gen/chat/apis/ChannelsApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Stream Chat API
55
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
66
*
7-
* The version of the OpenAPI document: v92.5.0
7+
* The version of the OpenAPI document: v92.7.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

src/gen/chat/apis/CustomCommandsApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Stream Chat API
55
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
66
*
7-
* The version of the OpenAPI document: v92.5.0
7+
* The version of the OpenAPI document: v92.7.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

src/gen/chat/apis/DefaultApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Stream Chat API
55
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
66
*
7-
* The version of the OpenAPI document: v92.5.0
7+
* The version of the OpenAPI document: v92.7.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

src/gen/chat/apis/DevicesApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Stream Chat API
55
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
66
*
7-
* The version of the OpenAPI document: v92.5.0
7+
* The version of the OpenAPI document: v92.7.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

src/gen/chat/apis/EventsApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Stream Chat API
55
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
66
*
7-
* The version of the OpenAPI document: v92.5.0
7+
* The version of the OpenAPI document: v92.7.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

src/gen/chat/apis/FilesApi.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Stream Chat API
55
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
66
*
7-
* The version of the OpenAPI document: v92.5.0
7+
* The version of the OpenAPI document: v92.7.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -18,10 +18,10 @@ import type {
1818
APIError,
1919
FileDeleteResponse,
2020
FileUploadResponse,
21-
//@ts-expect-error
21+
// @ts-expect-error
2222
ImageSizeRequest,
2323
ImageUploadResponse,
24-
//@ts-expect-error
24+
// @ts-expect-error
2525
OnlyUserIDRequest,
2626
} from '../models';
2727

src/gen/chat/apis/GDPRApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Stream Chat API
55
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
66
*
7-
* The version of the OpenAPI document: v92.5.0
7+
* The version of the OpenAPI document: v92.7.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

src/gen/chat/apis/ImportsApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Stream Chat API
55
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
66
*
7-
* The version of the OpenAPI document: v92.5.0
7+
* The version of the OpenAPI document: v92.7.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

0 commit comments

Comments
 (0)