Skip to content

Commit 94ba02d

Browse files
authored
feat: add topic_ids space expansion (#609)
1 parent 723269b commit 94ba02d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/types/v2/spaces.v2.types.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@ import type { DataAndIncludeV2, DataMetaAndIncludeV2 } from './shared.v2.types';
33
import type { TTweetv2UserField } from './tweet.v2.types';
44
import type { UsersV2Params, UsersV2Result, UserV2 } from './user.v2.types';
55

6+
export interface TopicV2 {
7+
/** The description of the given topic. */
8+
description?: string;
9+
/** Unique identifier of this Topic. */
10+
id: string;
11+
/** The name of the given topic. */
12+
name: string;
13+
}
14+
615
export interface SpaceV2FieldsParams {
716
expansions: TypeOrArrayOf<TSpaceV2Expansion> | string;
817
'space.fields': TypeOrArrayOf<TSpaceV2SpaceField> | string;
918
'user.fields': TypeOrArrayOf<TTweetv2UserField> | string;
1019
}
1120

12-
export type TSpaceV2Expansion = 'invited_user_ids' | 'speaker_ids' | 'creator_id' | 'host_ids';
21+
export type TSpaceV2Expansion = 'invited_user_ids' | 'speaker_ids' | 'creator_id' | 'host_ids' | 'topic_ids';
1322
export type TSpaceV2SpaceField = 'host_ids' | 'created_at' | 'creator_id' | 'id' | 'lang'
1423
| 'invited_user_ids' | 'participant_count' | 'speaker_ids' | 'started_at' | 'state' | 'title'
1524
| 'updated_at' | 'scheduled_start' | 'is_ticketed' | 'topic_ids' | 'ended_at' | 'subscriber_count';
@@ -32,7 +41,7 @@ export interface SpaceV2BuyersParams extends Partial<UsersV2Params> {}
3241

3342
// - Responses -
3443

35-
type SpaceV2Includes = { users?: UserV2[] };
44+
type SpaceV2Includes = { users?: UserV2[]; topics?: TopicV2[] };
3645

3746
export type SpaceV2SingleResult = DataAndIncludeV2<SpaceV2, SpaceV2Includes>;
3847
export type SpaceV2LookupResult = DataMetaAndIncludeV2<SpaceV2[], { result_count: number }, SpaceV2Includes>;

0 commit comments

Comments
 (0)