Skip to content

Commit 82833cb

Browse files
committed
Update sdk based on new events and comments swagger
1 parent d1f2be8 commit 82833cb

8 files changed

Lines changed: 94 additions & 16 deletions

File tree

packages/common/src/api/tan-query/users/useUserAlbums.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ export const useUserAlbums = (
9797
return {
9898
data: collections,
9999
isPending: queryRes.isPending || hasPendingCollections,
100-
isLoading: queryRes.isLoading || (hasPendingCollections && isCollectionsLoading),
100+
isLoading:
101+
queryRes.isLoading || (hasPendingCollections && isCollectionsLoading),
101102
hasNextPage: queryRes.hasNextPage,
102103
isFetchingNextPage: queryRes.isFetchingNextPage,
103104
fetchNextPage: queryRes.fetchNextPage

packages/common/src/api/tan-query/users/useUserPlaylists.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ export const useUserPlaylists = (
9797
return {
9898
data: collections,
9999
isPending: queryRes.isPending || hasPendingCollections,
100-
isLoading: queryRes.isLoading || (hasPendingCollections && isCollectionsLoading),
100+
isLoading:
101+
queryRes.isLoading || (hasPendingCollections && isCollectionsLoading),
101102
hasNextPage: queryRes.hasNextPage,
102103
isFetchingNextPage: queryRes.isFetchingNextPage,
103104
fetchNextPage: queryRes.fetchNextPage

packages/common/src/store/pages/chat/sagas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import { Name } from '~/models/Analytics'
2929
import { Feature } from '~/models/ErrorReporting'
3030
import { ID } from '~/models/Identifiers'
3131
import { Status } from '~/models/Status'
32-
import * as toastActions from '~/store/ui/toast/slice'
3332
import { inboxUnavailableModalActions } from '~/store/ui/modals'
33+
import * as toastActions from '~/store/ui/toast/slice'
3434
import dayjs from '~/utils/dayjs'
3535

3636
import {

packages/mobile/src/components/bottom-tab-bar/bottom-tab-bar-buttons/BottomTabBarButton.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ import { Pressable, StyleSheet } from 'react-native'
88
import LinearGradient from 'react-native-linear-gradient'
99
import { usePrevious } from 'react-use'
1010

11-
import {
12-
BOTTOM_BAR_BUTTON_HEIGHT,
13-
BOTTOM_BAR_TOP_PADDING
14-
} from '../constants'
11+
import { BOTTOM_BAR_BUTTON_HEIGHT, BOTTOM_BAR_TOP_PADDING } from '../constants'
1512

1613
export type BaseBottomTabBarButtonProps = {
1714
name: string

packages/sdk/src/sdk/api/generated/default/apis/EventsApi.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ export interface GetEntityEventsRequest {
4848
filterDeleted?: boolean;
4949
}
5050

51+
export interface GetRemixContestsRequest {
52+
offset?: number;
53+
limit?: number;
54+
status?: GetRemixContestsStatusEnum;
55+
}
56+
5157
/**
5258
*
5359
*/
@@ -219,6 +225,54 @@ export class EventsApi extends runtime.BaseAPI {
219225
return await response.value();
220226
}
221227

228+
/**
229+
* @hidden
230+
* Get remix contest events ordered with currently-active contests first (by soonest-ending), followed by ended contests (most-recently-ended first). Active contests are those whose end_date is null or in the future.
231+
* Get all remix contests
232+
*/
233+
async getRemixContestsRaw(params: GetRemixContestsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EventsResponse>> {
234+
const queryParameters: any = {};
235+
236+
if (params.offset !== undefined) {
237+
queryParameters['offset'] = params.offset;
238+
}
239+
240+
if (params.limit !== undefined) {
241+
queryParameters['limit'] = params.limit;
242+
}
243+
244+
if (params.status !== undefined) {
245+
queryParameters['status'] = params.status;
246+
}
247+
248+
const headerParameters: runtime.HTTPHeaders = {};
249+
250+
if (!headerParameters["Authorization"] && this.configuration && this.configuration.accessToken) {
251+
const token = await this.configuration.accessToken("OAuth2", ["read"]);
252+
if (token) {
253+
headerParameters["Authorization"] = token;
254+
}
255+
}
256+
257+
const response = await this.request({
258+
path: `/events/remix-contests`,
259+
method: 'GET',
260+
headers: headerParameters,
261+
query: queryParameters,
262+
}, initOverrides);
263+
264+
return new runtime.JSONApiResponse(response, (jsonValue) => EventsResponseFromJSON(jsonValue));
265+
}
266+
267+
/**
268+
* Get remix contest events ordered with currently-active contests first (by soonest-ending), followed by ended contests (most-recently-ended first). Active contests are those whose end_date is null or in the future.
269+
* Get all remix contests
270+
*/
271+
async getRemixContests(params: GetRemixContestsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EventsResponse> {
272+
const response = await this.getRemixContestsRaw(params, initOverrides);
273+
return await response.value();
274+
}
275+
222276
/**
223277
* @hidden
224278
* Gets an unclaimed blockchain event ID
@@ -283,3 +337,12 @@ export const GetEntityEventsEntityTypeEnum = {
283337
User: 'user'
284338
} as const;
285339
export type GetEntityEventsEntityTypeEnum = typeof GetEntityEventsEntityTypeEnum[keyof typeof GetEntityEventsEntityTypeEnum];
340+
/**
341+
* @export
342+
*/
343+
export const GetRemixContestsStatusEnum = {
344+
Active: 'active',
345+
Ended: 'ended',
346+
All: 'all'
347+
} as const;
348+
export type GetRemixContestsStatusEnum = typeof GetRemixContestsStatusEnum[keyof typeof GetRemixContestsStatusEnum];

packages/sdk/src/sdk/api/generated/default/models/Comment.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ export interface Comment {
122122
* @memberof Comment
123123
*/
124124
isMembersOnly?: boolean;
125+
/**
126+
* Optional URL for a video attachment on this comment
127+
* @type {string}
128+
* @memberof Comment
129+
*/
130+
videoUrl?: string | null;
125131
/**
126132
*
127133
* @type {boolean}
@@ -147,17 +153,11 @@ export interface Comment {
147153
*/
148154
replies?: Array<ReplyComment>;
149155
/**
150-
*
156+
*
151157
* @type {number}
152158
* @memberof Comment
153159
*/
154160
parentCommentId?: number;
155-
/**
156-
*
157-
* @type {string}
158-
* @memberof Comment
159-
*/
160-
videoUrl?: string;
161161
}
162162

163163
/**
@@ -201,12 +201,12 @@ export function CommentFromJSONTyped(json: any, ignoreDiscriminator: boolean): C
201201
'isArtistReacted': !exists(json, 'is_artist_reacted') ? undefined : json['is_artist_reacted'],
202202
'isTombstone': !exists(json, 'is_tombstone') ? undefined : json['is_tombstone'],
203203
'isMembersOnly': !exists(json, 'is_members_only') ? undefined : json['is_members_only'],
204+
'videoUrl': !exists(json, 'video_url') ? undefined : json['video_url'],
204205
'isMuted': !exists(json, 'is_muted') ? undefined : json['is_muted'],
205206
'createdAt': json['created_at'],
206207
'updatedAt': !exists(json, 'updated_at') ? undefined : json['updated_at'],
207208
'replies': !exists(json, 'replies') ? undefined : ((json['replies'] as Array<any>).map(ReplyCommentFromJSON)),
208209
'parentCommentId': !exists(json, 'parent_comment_id') ? undefined : json['parent_comment_id'],
209-
'videoUrl': !exists(json, 'video_url') ? undefined : json['video_url'],
210210
};
211211
}
212212

@@ -233,12 +233,12 @@ export function CommentToJSON(value?: Comment | null): any {
233233
'is_artist_reacted': value.isArtistReacted,
234234
'is_tombstone': value.isTombstone,
235235
'is_members_only': value.isMembersOnly,
236+
'video_url': value.videoUrl,
236237
'is_muted': value.isMuted,
237238
'created_at': value.createdAt,
238239
'updated_at': value.updatedAt,
239240
'replies': value.replies === undefined ? undefined : ((value.replies as Array<any>).map(ReplyCommentToJSON)),
240241
'parent_comment_id': value.parentCommentId,
241-
'video_url': value.videoUrl,
242242
};
243243
}
244244

packages/sdk/src/sdk/api/generated/default/models/CreateCommentRequestBody.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ export interface CreateCommentRequestBody {
6868
* @memberof CreateCommentRequestBody
6969
*/
7070
mentions?: Array<number>;
71+
/**
72+
* Optional URL for a video attachment (stored on the comment record)
73+
* @type {string}
74+
* @memberof CreateCommentRequestBody
75+
*/
76+
videoUrl?: string | null;
7177
}
7278

7379
/**
@@ -99,6 +105,7 @@ export function CreateCommentRequestBodyFromJSONTyped(json: any, ignoreDiscrimin
99105
'parentId': !exists(json, 'parentId') ? undefined : json['parentId'],
100106
'trackTimestampS': !exists(json, 'trackTimestampS') ? undefined : json['trackTimestampS'],
101107
'mentions': !exists(json, 'mentions') ? undefined : json['mentions'],
108+
'videoUrl': !exists(json, 'videoUrl') ? undefined : json['videoUrl'],
102109
};
103110
}
104111

@@ -118,6 +125,7 @@ export function CreateCommentRequestBodyToJSON(value?: CreateCommentRequestBody
118125
'parentId': value.parentId,
119126
'trackTimestampS': value.trackTimestampS,
120127
'mentions': value.mentions,
128+
'videoUrl': value.videoUrl,
121129
};
122130
}
123131

packages/sdk/src/sdk/api/generated/default/models/ReplyComment.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ export interface ReplyComment {
110110
* @memberof ReplyComment
111111
*/
112112
updatedAt?: string;
113+
/**
114+
* Optional URL for a video attachment on this reply
115+
* @type {string}
116+
* @memberof ReplyComment
117+
*/
118+
videoUrl?: string | null;
113119
/**
114120
*
115121
* @type {number}
@@ -158,6 +164,7 @@ export function ReplyCommentFromJSONTyped(json: any, ignoreDiscriminator: boolea
158164
'isArtistReacted': !exists(json, 'is_artist_reacted') ? undefined : json['is_artist_reacted'],
159165
'createdAt': json['created_at'],
160166
'updatedAt': !exists(json, 'updated_at') ? undefined : json['updated_at'],
167+
'videoUrl': !exists(json, 'video_url') ? undefined : json['video_url'],
161168
'parentCommentId': !exists(json, 'parent_comment_id') ? undefined : json['parent_comment_id'],
162169
};
163170
}
@@ -184,6 +191,7 @@ export function ReplyCommentToJSON(value?: ReplyComment | null): any {
184191
'is_artist_reacted': value.isArtistReacted,
185192
'created_at': value.createdAt,
186193
'updated_at': value.updatedAt,
194+
'video_url': value.videoUrl,
187195
'parent_comment_id': value.parentCommentId,
188196
};
189197
}

0 commit comments

Comments
 (0)