Skip to content

Commit 3b78d30

Browse files
Update openapi (#171)
## Description Removed the name clash ## Motivation and Context Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
1 parent 8f5fc53 commit 3b78d30

2 files changed

Lines changed: 82 additions & 20 deletions

File tree

packages/fishjam-openapi/src/generated/api.ts

Lines changed: 80 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,6 +1353,36 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
13531353

13541354

13551355

1356+
setSearchParams(localVarUrlObj, localVarQueryParameter);
1357+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1358+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1359+
1360+
return {
1361+
url: toPathString(localVarUrlObj),
1362+
options: localVarRequestOptions,
1363+
};
1364+
},
1365+
/**
1366+
*
1367+
* @summary Handle notification from broadcaster
1368+
* @param {*} [options] Override http request option.
1369+
* @throws {RequiredError}
1370+
*/
1371+
notification: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1372+
const localVarPath = `/notifications`;
1373+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
1374+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1375+
let baseOptions;
1376+
if (configuration) {
1377+
baseOptions = configuration.baseOptions;
1378+
}
1379+
1380+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
1381+
const localVarHeaderParameter = {} as any;
1382+
const localVarQueryParameter = {} as any;
1383+
1384+
1385+
13561386
setSearchParams(localVarUrlObj, localVarQueryParameter);
13571387
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
13581388
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -1418,6 +1448,18 @@ export const DefaultApiFp = function(configuration?: Configuration) {
14181448
const localVarOperationServerBasePath = operationServerMap['DefaultApi.drainNode']?.[localVarOperationServerIndex]?.url;
14191449
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
14201450
},
1451+
/**
1452+
*
1453+
* @summary Handle notification from broadcaster
1454+
* @param {*} [options] Override http request option.
1455+
* @throws {RequiredError}
1456+
*/
1457+
async notification(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
1458+
const localVarAxiosArgs = await localVarAxiosParamCreator.notification(options);
1459+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1460+
const localVarOperationServerBasePath = operationServerMap['DefaultApi.notification']?.[localVarOperationServerIndex]?.url;
1461+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1462+
},
14211463
/**
14221464
*
14231465
* @summary Returns status information for the shutdown process of Fishjam.
@@ -1449,6 +1491,15 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa
14491491
drainNode(options?: any): AxiosPromise<void> {
14501492
return localVarFp.drainNode(options).then((request) => request(axios, basePath));
14511493
},
1494+
/**
1495+
*
1496+
* @summary Handle notification from broadcaster
1497+
* @param {*} [options] Override http request option.
1498+
* @throws {RequiredError}
1499+
*/
1500+
notification(options?: any): AxiosPromise<void> {
1501+
return localVarFp.notification(options).then((request) => request(axios, basePath));
1502+
},
14521503
/**
14531504
*
14541505
* @summary Returns status information for the shutdown process of Fishjam.
@@ -1479,6 +1530,17 @@ export class DefaultApi extends BaseAPI {
14791530
return DefaultApiFp(this.configuration).drainNode(options).then((request) => request(this.axios, this.basePath));
14801531
}
14811532

1533+
/**
1534+
*
1535+
* @summary Handle notification from broadcaster
1536+
* @param {*} [options] Override http request option.
1537+
* @throws {RequiredError}
1538+
* @memberof DefaultApi
1539+
*/
1540+
public notification(options?: RawAxiosRequestConfig) {
1541+
return DefaultApiFp(this.configuration).notification(options).then((request) => request(this.axios, this.basePath));
1542+
}
1543+
14821544
/**
14831545
*
14841546
* @summary Returns status information for the shutdown process of Fishjam.
@@ -3029,9 +3091,9 @@ export const StreamerApiAxiosParamCreator = function (configuration?: Configurat
30293091
* @param {*} [options] Override http request option.
30303092
* @throws {RequiredError}
30313093
*/
3032-
generateToken: async (roomId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3094+
generateStreamerToken: async (roomId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
30333095
// verify required parameter 'roomId' is not null or undefined
3034-
assertParamExists('generateToken', 'roomId', roomId)
3096+
assertParamExists('generateStreamerToken', 'roomId', roomId)
30353097
const localVarPath = `/room/{room_id}/streamer`
30363098
.replace(`{${"room_id"}}`, encodeURIComponent(String(roomId)));
30373099
// use dummy base URL string because the URL constructor only accepts absolute URLs.
@@ -3073,10 +3135,10 @@ export const StreamerApiFp = function(configuration?: Configuration) {
30733135
* @param {*} [options] Override http request option.
30743136
* @throws {RequiredError}
30753137
*/
3076-
async generateToken(roomId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<StreamerToken>> {
3077-
const localVarAxiosArgs = await localVarAxiosParamCreator.generateToken(roomId, options);
3138+
async generateStreamerToken(roomId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<StreamerToken>> {
3139+
const localVarAxiosArgs = await localVarAxiosParamCreator.generateStreamerToken(roomId, options);
30783140
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
3079-
const localVarOperationServerBasePath = operationServerMap['StreamerApi.generateToken']?.[localVarOperationServerIndex]?.url;
3141+
const localVarOperationServerBasePath = operationServerMap['StreamerApi.generateStreamerToken']?.[localVarOperationServerIndex]?.url;
30803142
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
30813143
},
30823144
}
@@ -3096,8 +3158,8 @@ export const StreamerApiFactory = function (configuration?: Configuration, baseP
30963158
* @param {*} [options] Override http request option.
30973159
* @throws {RequiredError}
30983160
*/
3099-
generateToken(roomId: string, options?: any): AxiosPromise<StreamerToken> {
3100-
return localVarFp.generateToken(roomId, options).then((request) => request(axios, basePath));
3161+
generateStreamerToken(roomId: string, options?: any): AxiosPromise<StreamerToken> {
3162+
return localVarFp.generateStreamerToken(roomId, options).then((request) => request(axios, basePath));
31013163
},
31023164
};
31033165
};
@@ -3117,8 +3179,8 @@ export class StreamerApi extends BaseAPI {
31173179
* @throws {RequiredError}
31183180
* @memberof StreamerApi
31193181
*/
3120-
public generateToken(roomId: string, options?: RawAxiosRequestConfig) {
3121-
return StreamerApiFp(this.configuration).generateToken(roomId, options).then((request) => request(this.axios, this.basePath));
3182+
public generateStreamerToken(roomId: string, options?: RawAxiosRequestConfig) {
3183+
return StreamerApiFp(this.configuration).generateStreamerToken(roomId, options).then((request) => request(this.axios, this.basePath));
31223184
}
31233185
}
31243186

@@ -3395,9 +3457,9 @@ export const ViewerApiAxiosParamCreator = function (configuration?: Configuratio
33953457
* @param {*} [options] Override http request option.
33963458
* @throws {RequiredError}
33973459
*/
3398-
generateToken2: async (roomId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3460+
generateViewerToken: async (roomId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
33993461
// verify required parameter 'roomId' is not null or undefined
3400-
assertParamExists('generateToken2', 'roomId', roomId)
3462+
assertParamExists('generateViewerToken', 'roomId', roomId)
34013463
const localVarPath = `/room/{room_id}/viewer`
34023464
.replace(`{${"room_id"}}`, encodeURIComponent(String(roomId)));
34033465
// use dummy base URL string because the URL constructor only accepts absolute URLs.
@@ -3439,10 +3501,10 @@ export const ViewerApiFp = function(configuration?: Configuration) {
34393501
* @param {*} [options] Override http request option.
34403502
* @throws {RequiredError}
34413503
*/
3442-
async generateToken2(roomId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ViewerToken>> {
3443-
const localVarAxiosArgs = await localVarAxiosParamCreator.generateToken2(roomId, options);
3504+
async generateViewerToken(roomId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ViewerToken>> {
3505+
const localVarAxiosArgs = await localVarAxiosParamCreator.generateViewerToken(roomId, options);
34443506
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
3445-
const localVarOperationServerBasePath = operationServerMap['ViewerApi.generateToken2']?.[localVarOperationServerIndex]?.url;
3507+
const localVarOperationServerBasePath = operationServerMap['ViewerApi.generateViewerToken']?.[localVarOperationServerIndex]?.url;
34463508
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
34473509
},
34483510
}
@@ -3462,8 +3524,8 @@ export const ViewerApiFactory = function (configuration?: Configuration, basePat
34623524
* @param {*} [options] Override http request option.
34633525
* @throws {RequiredError}
34643526
*/
3465-
generateToken2(roomId: string, options?: any): AxiosPromise<ViewerToken> {
3466-
return localVarFp.generateToken2(roomId, options).then((request) => request(axios, basePath));
3527+
generateViewerToken(roomId: string, options?: any): AxiosPromise<ViewerToken> {
3528+
return localVarFp.generateViewerToken(roomId, options).then((request) => request(axios, basePath));
34673529
},
34683530
};
34693531
};
@@ -3483,8 +3545,8 @@ export class ViewerApi extends BaseAPI {
34833545
* @throws {RequiredError}
34843546
* @memberof ViewerApi
34853547
*/
3486-
public generateToken2(roomId: string, options?: RawAxiosRequestConfig) {
3487-
return ViewerApiFp(this.configuration).generateToken2(roomId, options).then((request) => request(this.axios, this.basePath));
3548+
public generateViewerToken(roomId: string, options?: RawAxiosRequestConfig) {
3549+
return ViewerApiFp(this.configuration).generateViewerToken(roomId, options).then((request) => request(this.axios, this.basePath));
34883550
}
34893551
}
34903552

packages/js-server-sdk/src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class FishjamClient {
144144
*/
145145
async createLivestreamViewerToken(roomId: RoomId) {
146146
try {
147-
const tokenResponse = await this.viewerApi.generateToken2(roomId);
147+
const tokenResponse = await this.viewerApi.generateViewerToken(roomId);
148148
return tokenResponse.data;
149149
} catch (error) {
150150
throw mapException(error);
@@ -157,7 +157,7 @@ export class FishjamClient {
157157
*/
158158
async createLivestreamStreamerToken(roomId: RoomId) {
159159
try {
160-
const tokenResponse = await this.streamerApi.generateToken(roomId);
160+
const tokenResponse = await this.streamerApi.generateStreamerToken(roomId);
161161
return tokenResponse.data;
162162
} catch (error) {
163163
throw mapException(error);

0 commit comments

Comments
 (0)