Skip to content

Commit

Permalink
feat: Update video open API
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Feb 7, 2024
1 parent 21b4f92 commit b3ba400
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 1,384 deletions.
6 changes: 1 addition & 5 deletions src/StreamCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ export class StreamCall {
private readonly id: string,
) {
this.baseRequest = { id: this.id, type: this.type };
const configuration = this.streamClient.getConfiguration({
basePath:
this.streamClient.options.basePath ??
'https://video.stream-io-api.com/video',
});
const configuration = this.streamClient.getConfiguration('video');
this.apiClient = new DefaultApi(configuration);
}

Expand Down
8 changes: 6 additions & 2 deletions src/StreamClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ export class StreamClient {
}
};

getConfiguration = (options?: { basePath?: string }) => {
getConfiguration = (product: 'chat' | 'video' = 'chat') => {
return new Configuration({
apiKey: (name: string) => {
const mapping: Record<string, string> = {
Expand All @@ -454,7 +454,11 @@ export class StreamClient {

return mapping[name];
},
basePath: options?.basePath ?? this.options.basePath,
basePath:
this.options.basePath ||
(product === 'chat'
? 'https://chat.stream-io-api.com'
: 'https://video.stream-io-api.com'),
headers: {
'X-Stream-Client': 'stream-node-' + process.env.PKG_VERSION,
},
Expand Down
6 changes: 1 addition & 5 deletions src/StreamVideoClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ export class StreamVideoClient {
private readonly videoServerSideApiClient: ServerSideApi;

constructor(private readonly streamClient: StreamClient) {
const configuration = this.streamClient.getConfiguration({
basePath:
this.streamClient.options.basePath ??
'https://video.stream-io-api.com/video',
});
const configuration = this.streamClient.getConfiguration('video');
this.apiClient = new DefaultApi(configuration);
this.videoServerSideApiClient = new ServerSideApi(configuration);
}
Expand Down
60 changes: 30 additions & 30 deletions src/gen/video/apis/DefaultApi.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* tslint:disable */
/* eslint-disable */
/**
* Stream Video API
* Stream API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v92.7.0
* The version of the OpenAPI document: v96.8.0-ingress-dbg.5
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -253,7 +253,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/block`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/block`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -300,7 +300,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/devices`,
path: `/video/devices`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -347,7 +347,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/guest`,
path: `/video/guest`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -396,7 +396,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/devices`,
path: `/video/devices`,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -444,7 +444,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/mark_ended`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/mark_ended`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -508,7 +508,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -548,7 +548,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/edges`,
path: `/video/edges`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -606,7 +606,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -661,7 +661,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/go_live`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/go_live`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -706,7 +706,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/devices`,
path: `/video/devices`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -754,7 +754,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/recordings`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/recordings`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -808,7 +808,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/mute_users`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/mute_users`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -859,7 +859,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/calls`,
path: `/video/calls`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -906,7 +906,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/members`,
path: `/video/call/members`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -961,7 +961,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/event`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/event`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1010,7 +1010,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/start_broadcasting`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/start_broadcasting`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1058,7 +1058,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/start_recording`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/start_recording`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1106,7 +1106,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/start_transcription`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/start_transcription`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1154,7 +1154,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/stop_broadcasting`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/stop_broadcasting`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1202,7 +1202,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/stop_live`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/stop_live`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1250,7 +1250,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/stop_recording`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/stop_recording`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1298,7 +1298,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/stop_transcription`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/stop_transcription`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1352,7 +1352,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/unblock`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/unblock`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1407,7 +1407,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1462,7 +1462,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/members`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/members`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1517,7 +1517,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/user_permissions`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/user_permissions`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1618,7 +1618,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/pin`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/pin`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -1673,7 +1673,7 @@ export class DefaultApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/call/{type}/{id}/unpin`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
path: `/video/call/{type}/{id}/unpin`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down
14 changes: 7 additions & 7 deletions src/gen/video/apis/ServerSideApi.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* tslint:disable */
/* eslint-disable */
/**
* Stream Video API
* Stream API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v92.7.0
* The version of the OpenAPI document: v96.8.0-ingress-dbg.5
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -75,7 +75,7 @@ export class ServerSideApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/calltypes`,
path: `/video/calltypes`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -120,7 +120,7 @@ export class ServerSideApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/calltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
path: `/video/calltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -164,7 +164,7 @@ export class ServerSideApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/calltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
path: `/video/calltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -204,7 +204,7 @@ export class ServerSideApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/calltypes`,
path: `/video/calltypes`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
Expand Down Expand Up @@ -254,7 +254,7 @@ export class ServerSideApi extends runtime.BaseAPI {
}

const response = await this.request({
path: `/calltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
path: `/video/calltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
Expand Down
Loading

0 comments on commit b3ba400

Please sign in to comment.