Skip to content

Commit

Permalink
feat: update chat and video open api
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Jun 20, 2024
1 parent 4c3aabe commit 25a34f6
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 45 deletions.
4 changes: 1 addition & 3 deletions __tests__/users.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand Down
2 changes: 1 addition & 1 deletion src/gen/chat/apis/ProductchatApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
72 changes: 34 additions & 38 deletions src/gen/chat/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,12 @@ export interface BackstageSettings {
* @memberof BackstageSettings
*/
enabled: boolean;
/**
*
* @type {number}
* @memberof BackstageSettings
*/
join_ahead_time_seconds?: number;
}
/**
*
Expand Down Expand Up @@ -1069,10 +1075,22 @@ export interface BlockUsersRequest {
export interface BlockUsersResponse {
/**
*
* @type {Array<UserBlock>}
* @type {string}
* @memberof BlockUsersResponse
*/
blocked_by_user_id: string;
/**
*
* @type {string}
* @memberof BlockUsersResponse
*/
blocked_user_id: string;
/**
*
* @type {string}
* @memberof BlockUsersResponse
*/
blocks: Array<UserBlock>;
created_at: string;
/**
* Duration of the request in human-readable format
* @type {string}
Expand Down Expand Up @@ -1959,7 +1977,6 @@ export interface ChannelGetOrCreateRequest {
* @interface ChannelInput
*/
export interface ChannelInput {
[key: string]: any;
/**
* Enable or disable auto translation
* @type {boolean}
Expand Down Expand Up @@ -2019,7 +2036,7 @@ export interface ChannelInput {
* @type {Array<ChannelMember>}
* @memberof ChannelInput
*/
members?: Array<Partial<ChannelMember>>;
members?: Array<ChannelMember>;
/**
* Team the channel belongs to (if multi-tenant mode is enabled)
* @type {string}
Expand Down Expand Up @@ -2173,7 +2190,6 @@ export interface ChannelMute {
* @interface ChannelResponse
*/
export interface ChannelResponse {
[key: string]: any;
/**
* Whether auto translation is enabled or not
* @type {boolean}
Expand Down Expand Up @@ -2281,7 +2297,7 @@ export interface ChannelResponse {
* @type {Array<ChannelMember>}
* @memberof ChannelResponse
*/
members?: Array<Partial<ChannelMember>>;
members?: Array<ChannelMember>;
/**
* Date of mute expiration
* @type {string}
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -12957,7 +12978,7 @@ export interface UpdateChannelRequest {
* @type {Array<ChannelMember>}
* @memberof UpdateChannelRequest
*/
add_members?: Array<Partial<ChannelMember>>;
add_members?: Array<ChannelMember>;
/**
* List of user IDs to make channel moderators
* @type {Array<string>}
Expand All @@ -12969,7 +12990,7 @@ export interface UpdateChannelRequest {
* @type {Array<ChannelMember>}
* @memberof UpdateChannelRequest
*/
assign_roles?: Array<Partial<ChannelMember>>;
assign_roles?: Array<ChannelMember>;
/**
* Sets cool down period for the channel in seconds
* @type {number}
Expand Down Expand Up @@ -12999,7 +13020,7 @@ export interface UpdateChannelRequest {
* @type {Array<ChannelMember>}
* @memberof UpdateChannelRequest
*/
invites?: Array<Partial<ChannelMember>>;
invites?: Array<ChannelMember>;
/**
*
* @type {MessageRequest}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -14156,7 +14152,7 @@ export interface UserObject {
* @type {boolean}
* @memberof UserObject
*/
banned?: boolean;
banned: boolean;
/**
* Date/time of creation
* @type {string}
Expand All @@ -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}
Expand Down Expand Up @@ -14210,7 +14206,7 @@ export interface UserObject {
* @type {boolean}
* @memberof UserObject
*/
readonly online?: boolean;
readonly online: boolean;
/**
*
* @type {PrivacySettings}
Expand All @@ -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<string>}
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 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).
Expand Down
65 changes: 64 additions & 1 deletion src/gen/video/apis/ProductvideoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -28,6 +28,8 @@ import type {
VideoCreateExternalStorageResponse,
VideoCreateGuestRequest,
VideoCreateGuestResponse,
VideoDeleteCallRequest,
VideoDeleteCallResponse,
VideoDeleteExternalStorageResponse,
VideoDeleteRecordingResponse,
VideoDeleteTranscriptionResponse,
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<runtime.ApiResponse<VideoDeleteCallResponse>> {
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<VideoDeleteCallResponse> {
const response = await this.deleteCallRaw(requestParameters, initOverrides);
return await response.value();
}

/**
*
* Delete Call Type
Expand Down
56 changes: 56 additions & 0 deletions src/gen/video/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ export interface VideoBackstageSettingsRequest {
* @memberof VideoBackstageSettingsRequest
*/
enabled?: boolean;
/**
*
* @type {number}
* @memberof VideoBackstageSettingsRequest
*/
join_ahead_time_seconds?: number;
}
/**
*
Expand All @@ -244,6 +250,12 @@ export interface VideoBackstageSettingsResponse {
* @memberof VideoBackstageSettingsResponse
*/
enabled: boolean;
/**
*
* @type {number}
* @memberof VideoBackstageSettingsResponse
*/
join_ahead_time_seconds?: number;
}
/**
*
Expand Down Expand Up @@ -542,6 +554,12 @@ export interface VideoCallResponse {
* @memberof VideoCallResponse
*/
ingress: VideoCallIngressResponse;
/**
*
* @type {number}
* @memberof VideoCallResponse
*/
join_ahead_time_seconds?: number;
/**
*
* @type {boolean}
Expand Down Expand Up @@ -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
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 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).
Expand Down

0 comments on commit 25a34f6

Please sign in to comment.