From 25a34f679b02762d44a6545bf60a3abbbbc308b9 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Thu, 20 Jun 2024 11:17:23 +0200 Subject: [PATCH] feat: update chat and video open api --- __tests__/users.test.ts | 4 +- src/gen/chat/apis/ProductchatApi.ts | 2 +- src/gen/chat/models/index.ts | 72 +++++++++++++-------------- src/gen/chat/runtime.ts | 2 +- src/gen/video/apis/ProductvideoApi.ts | 65 +++++++++++++++++++++++- src/gen/video/models/index.ts | 56 +++++++++++++++++++++ src/gen/video/runtime.ts | 2 +- 7 files changed, 158 insertions(+), 45 deletions(-) diff --git a/__tests__/users.test.ts b/__tests__/users.test.ts index e883685..4463761 100644 --- a/__tests__/users.test.ts +++ b/__tests__/users.test.ts @@ -151,9 +151,7 @@ describe('user API', () => { user_id: user.id, }); - expect( - blockResponse.blocks.find((b) => b.blocked_user_id === badUser.id), - ).toBeDefined(); + expect(blockResponse.blocked_user_id).toBe(badUser.id); const blockedUsers = await client.getBlockedUsers({ userId: user.id }); diff --git a/src/gen/chat/apis/ProductchatApi.ts b/src/gen/chat/apis/ProductchatApi.ts index 6ef3121..f560384 100644 --- a/src/gen/chat/apis/ProductchatApi.ts +++ b/src/gen/chat/apis/ProductchatApi.ts @@ -4,7 +4,7 @@ * Stream API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v117.0.1 + * The version of the OpenAPI document: v120.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/chat/models/index.ts b/src/gen/chat/models/index.ts index a361599..41b4c8a 100644 --- a/src/gen/chat/models/index.ts +++ b/src/gen/chat/models/index.ts @@ -851,6 +851,12 @@ export interface BackstageSettings { * @memberof BackstageSettings */ enabled: boolean; + /** + * + * @type {number} + * @memberof BackstageSettings + */ + join_ahead_time_seconds?: number; } /** * @@ -1069,10 +1075,22 @@ export interface BlockUsersRequest { export interface BlockUsersResponse { /** * - * @type {Array} + * @type {string} + * @memberof BlockUsersResponse + */ + blocked_by_user_id: string; + /** + * + * @type {string} + * @memberof BlockUsersResponse + */ + blocked_user_id: string; + /** + * + * @type {string} * @memberof BlockUsersResponse */ - blocks: Array; + created_at: string; /** * Duration of the request in human-readable format * @type {string} @@ -1959,7 +1977,6 @@ export interface ChannelGetOrCreateRequest { * @interface ChannelInput */ export interface ChannelInput { - [key: string]: any; /** * Enable or disable auto translation * @type {boolean} @@ -2019,7 +2036,7 @@ export interface ChannelInput { * @type {Array} * @memberof ChannelInput */ - members?: Array>; + members?: Array; /** * Team the channel belongs to (if multi-tenant mode is enabled) * @type {string} @@ -2173,7 +2190,6 @@ export interface ChannelMute { * @interface ChannelResponse */ export interface ChannelResponse { - [key: string]: any; /** * Whether auto translation is enabled or not * @type {boolean} @@ -2281,7 +2297,7 @@ export interface ChannelResponse { * @type {Array} * @memberof ChannelResponse */ - members?: Array>; + members?: Array; /** * Date of mute expiration * @type {string} @@ -4318,7 +4334,12 @@ export interface DeleteMessageResponse { */ export interface DeleteUsersRequest { /** + * Calls delete mode. + * Affected calls are those that include exactly two members, one of whom is the user being deleted. * + * * null or empty string - doesn't delete any calls + * * soft - marks user's calls and their related data as deleted (soft-delete) + * * hard - deletes user's calls and their data completely (hard-delete) * @type {string} * @memberof DeleteUsersRequest */ @@ -12957,7 +12978,7 @@ export interface UpdateChannelRequest { * @type {Array} * @memberof UpdateChannelRequest */ - add_members?: Array>; + add_members?: Array; /** * List of user IDs to make channel moderators * @type {Array} @@ -12969,7 +12990,7 @@ export interface UpdateChannelRequest { * @type {Array} * @memberof UpdateChannelRequest */ - assign_roles?: Array>; + assign_roles?: Array; /** * Sets cool down period for the channel in seconds * @type {number} @@ -12999,7 +13020,7 @@ export interface UpdateChannelRequest { * @type {Array} * @memberof UpdateChannelRequest */ - invites?: Array>; + invites?: Array; /** * * @type {MessageRequest} @@ -14058,31 +14079,6 @@ export interface UpsertPushProviderResponse { */ push_provider: PushProviderResponse; } -/** - * - * @export - * @interface UserBlock - */ -export interface UserBlock { - /** - * - * @type {string} - * @memberof UserBlock - */ - blocked_by_user_id: string; - /** - * - * @type {string} - * @memberof UserBlock - */ - blocked_user_id: string; - /** - * - * @type {string} - * @memberof UserBlock - */ - created_at: string; -} /** * * @export @@ -14156,7 +14152,7 @@ export interface UserObject { * @type {boolean} * @memberof UserObject */ - banned?: boolean; + banned: boolean; /** * Date/time of creation * @type {string} @@ -14168,7 +14164,7 @@ export interface UserObject { * @type {{ [key: string]: any; }} * @memberof UserObject */ - custom?: { [key: string]: any; }; + custom: { [key: string]: any; }; /** * Date of deactivation * @type {string} @@ -14210,7 +14206,7 @@ export interface UserObject { * @type {boolean} * @memberof UserObject */ - readonly online?: boolean; + readonly online: boolean; /** * * @type {PrivacySettings} @@ -14234,7 +14230,7 @@ export interface UserObject { * @type {string} * @memberof UserObject */ - role?: string; + role: string; /** * List of teams user is a part of * @type {Array} diff --git a/src/gen/chat/runtime.ts b/src/gen/chat/runtime.ts index 54c32b4..8ae6774 100644 --- a/src/gen/chat/runtime.ts +++ b/src/gen/chat/runtime.ts @@ -4,7 +4,7 @@ * Stream API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v117.0.1 + * The version of the OpenAPI document: v120.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/video/apis/ProductvideoApi.ts b/src/gen/video/apis/ProductvideoApi.ts index 016b325..81606be 100644 --- a/src/gen/video/apis/ProductvideoApi.ts +++ b/src/gen/video/apis/ProductvideoApi.ts @@ -4,7 +4,7 @@ * Stream API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v117.0.1 + * The version of the OpenAPI document: v120.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,6 +28,8 @@ import type { VideoCreateExternalStorageResponse, VideoCreateGuestRequest, VideoCreateGuestResponse, + VideoDeleteCallRequest, + VideoDeleteCallResponse, VideoDeleteExternalStorageResponse, VideoDeleteRecordingResponse, VideoDeleteTranscriptionResponse, @@ -116,6 +118,12 @@ export interface CreateGuestRequest { videoCreateGuestRequest: VideoCreateGuestRequest | null; } +export interface DeleteCallRequest { + type: string; + id: string; + videoDeleteCallRequest: VideoDeleteCallRequest | null; +} + export interface DeleteCallTypeRequest { name: string; } @@ -650,6 +658,61 @@ export class ProductvideoApi extends runtime.BaseAPI { return await response.value(); } + /** + * Sends events: - call.deleted Required permissions: - DeleteCall + * Delete Call + */ + async deleteCallRaw(requestParameters: DeleteCallRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteCall.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteCall.'); + } + + if (requestParameters.videoDeleteCallRequest === null || requestParameters.videoDeleteCallRequest === undefined) { + throw new runtime.RequiredError('videoDeleteCallRequest','Required parameter requestParameters.videoDeleteCallRequest was null or undefined when calling deleteCall.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/video/call/{type}/{id}/delete`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.videoDeleteCallRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Sends events: - call.deleted Required permissions: - DeleteCall + * Delete Call + */ + async deleteCall(requestParameters: DeleteCallRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteCallRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * * Delete Call Type diff --git a/src/gen/video/models/index.ts b/src/gen/video/models/index.ts index 59e3e27..f3568c8 100644 --- a/src/gen/video/models/index.ts +++ b/src/gen/video/models/index.ts @@ -231,6 +231,12 @@ export interface VideoBackstageSettingsRequest { * @memberof VideoBackstageSettingsRequest */ enabled?: boolean; + /** + * + * @type {number} + * @memberof VideoBackstageSettingsRequest + */ + join_ahead_time_seconds?: number; } /** * @@ -244,6 +250,12 @@ export interface VideoBackstageSettingsResponse { * @memberof VideoBackstageSettingsResponse */ enabled: boolean; + /** + * + * @type {number} + * @memberof VideoBackstageSettingsResponse + */ + join_ahead_time_seconds?: number; } /** * @@ -542,6 +554,12 @@ export interface VideoCallResponse { * @memberof VideoCallResponse */ ingress: VideoCallIngressResponse; + /** + * + * @type {number} + * @memberof VideoCallResponse + */ + join_ahead_time_seconds?: number; /** * * @type {boolean} @@ -1337,6 +1355,44 @@ export interface VideoCreateGuestResponse { */ user: VideoUserResponse; } +/** + * + * @export + * @interface VideoDeleteCallRequest + */ +export interface VideoDeleteCallRequest { + /** + * if true the call will be hard deleted along with all related data + * @type {boolean} + * @memberof VideoDeleteCallRequest + */ + hard?: boolean; +} +/** + * + * @export + * @interface VideoDeleteCallResponse + */ +export interface VideoDeleteCallResponse { + /** + * + * @type {VideoCallResponse} + * @memberof VideoDeleteCallResponse + */ + call: VideoCallResponse; + /** + * Duration of the request in human-readable format + * @type {string} + * @memberof VideoDeleteCallResponse + */ + duration: string; + /** + * + * @type {string} + * @memberof VideoDeleteCallResponse + */ + task_id?: string; +} /** * * @export diff --git a/src/gen/video/runtime.ts b/src/gen/video/runtime.ts index 54c32b4..8ae6774 100644 --- a/src/gen/video/runtime.ts +++ b/src/gen/video/runtime.ts @@ -4,7 +4,7 @@ * Stream API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v117.0.1 + * The version of the OpenAPI document: v120.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).