Skip to content

Commit 9e24199

Browse files
committed
feat: define ItemGetManyRelations and ItemGetManyRelationsWithChannel types for improved type safety
1 parent a8d2cec commit 9e24199

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/services/item/item.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,22 @@ export class ItemService {
487487
}
488488
}
489489

490-
export const itemGetManyRelations = [
490+
export type ItemGetManyRelations =
491+
| 'item_about'
492+
| 'item_about.item_itunes_episode_type'
493+
| 'item_chat'
494+
| 'item_description'
495+
| 'item_enclosures'
496+
| 'item_enclosures.item_enclosure_integrity'
497+
| 'item_enclosures.item_enclosure_sources'
498+
| 'item_images'
499+
| 'item_persons'
500+
| 'item_season'
501+
| 'item_season.channel_season'
502+
| 'live_item'
503+
| 'live_item.live_item_status';
504+
505+
export const itemGetManyRelations: ItemGetManyRelations[] = [
491506
'item_about',
492507
'item_about.item_itunes_episode_type',
493508
'item_chat',
@@ -503,6 +518,17 @@ export const itemGetManyRelations = [
503518
'live_item.live_item_status'
504519
];
505520

521+
export type ItemGetManyRelationsWithChannel =
522+
| ItemGetManyRelations
523+
| 'channel'
524+
| 'channel.channel_images';
525+
526+
export const itemGetManyRelationsWithChannel: ItemGetManyRelationsWithChannel[] = [
527+
...itemGetManyRelations,
528+
'channel',
529+
'channel.channel_images'
530+
];
531+
506532
export type SubItemGetManyRelations =
507533
| 'item'
508534
| 'item.item_about'

0 commit comments

Comments
 (0)