ts-twitch-api 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +11 -4
  2. package/package.json +1 -1
  3. package/twitch-api.ts +524 -765
package/twitch-api.ts CHANGED
@@ -339,12 +339,15 @@ const getSearchParams = <T extends Record<string, any>>(params: T) => {
339
339
  type CallApiOptions = {
340
340
  path: string;
341
341
  method?: string;
342
- params?: any;
343
- body?: any;
344
- clientId?: string;
345
- accessToken?: string;
342
+ params?: Record<string, any> | null;
343
+ body?: Record<string, any> | null;
346
344
  requiresAuth?: boolean;
347
- }
345
+ request: [
346
+ clientId?: string | null,
347
+ accessToken?: string | null,
348
+ requestInit?: RequestInit,
349
+ ];
350
+ };
348
351
 
349
352
  export type TwitchApiOptions = {
350
353
  accessToken?: string;
@@ -360,19 +363,22 @@ export class TwitchApi {
360
363
  this._clientId = clientId;
361
364
  }
362
365
 
363
- private async callApi({
366
+ private async callApi<
367
+ TData,
368
+ TSuccessCode extends SuccessCode = SuccessCode,
369
+ TErrorCode extends ErrorCode = ErrorCode,
370
+ >({
364
371
  path,
365
372
  method = 'GET',
366
373
  params,
367
374
  body,
368
- clientId,
369
- accessToken,
370
375
  requiresAuth = true,
371
- }: CallApiOptions): Promise<any> {
376
+ request: [clientId = null, accessToken = null, requestInit = {}],
377
+ }: CallApiOptions): ApiResponse<TData, TSuccessCode, TErrorCode> {
372
378
  const url = params
373
379
  ? `${BASE_URL}${path}?${getSearchParams(params)}`
374
380
  : `${BASE_URL}${path}`;
375
- const options: RequestInit = { method };
381
+ const options: RequestInit = { ...requestInit, method };
376
382
  const headers = new Headers();
377
383
  options.headers = headers;
378
384
  if (body) {
@@ -380,7 +386,10 @@ export class TwitchApi {
380
386
  options.body = JSON.stringify(body);
381
387
  }
382
388
  if (requiresAuth) {
383
- options.headers.set('Authorization', `Bearer ${accessToken || this._accessToken}`);
389
+ options.headers.set(
390
+ 'Authorization',
391
+ `Bearer ${accessToken || this._accessToken}`,
392
+ );
384
393
  options.headers.set('Client-Id', clientId || this._clientId);
385
394
  }
386
395
  const response = await fetch(url, options);
@@ -441,15 +450,13 @@ export class TwitchApi {
441
450
  */
442
451
  startCommercial: async (
443
452
  body: StartCommercialBody,
444
- accessToken = '',
445
- clientId = '',
446
- ): ApiResponse<StartCommercialResponse, 200, 400 | 401 | 404 | 429> =>
447
- this.callApi({
453
+ ...request: CallApiOptions['request']
454
+ ) =>
455
+ this.callApi<StartCommercialResponse, 200, 400 | 401 | 404 | 429>({
448
456
  path: '/channels/commercial',
449
457
  method: 'POST',
450
458
  body,
451
- clientId,
452
- accessToken,
459
+ request,
453
460
  }),
454
461
  /**
455
462
  * This endpoint returns ad schedule related information, including snooze, when the last ad was run, when the next ad is scheduled, and if the channel is currently in pre-roll free time. Note that a new ad cannot be run until 8 minutes after running a previous ad.
@@ -478,14 +485,12 @@ export class TwitchApi {
478
485
  */
479
486
  getAdSchedule: async (
480
487
  params: GetAdScheduleParams,
481
- accessToken = '',
482
- clientId = '',
483
- ): ApiResponse<GetAdScheduleResponse, 200, 400 | 500> =>
484
- this.callApi({
488
+ ...request: CallApiOptions['request']
489
+ ) =>
490
+ this.callApi<GetAdScheduleResponse, 200, 400 | 500>({
485
491
  path: '/channels/ads',
486
492
  params,
487
- clientId,
488
- accessToken,
493
+ request,
489
494
  }),
490
495
  /**
491
496
  * If available, pushes back the timestamp of the upcoming automatic mid-roll ad by 5 minutes. This endpoint duplicates the snooze functionality in the creator dashboard’s Ads Manager.
@@ -520,15 +525,13 @@ export class TwitchApi {
520
525
  */
521
526
  snoozeNextAd: async (
522
527
  params: SnoozeNextAdParams,
523
- accessToken = '',
524
- clientId = '',
525
- ): ApiResponse<SnoozeNextAdResponse, 200, 400 | 429 | 500> =>
526
- this.callApi({
528
+ ...request: CallApiOptions['request']
529
+ ) =>
530
+ this.callApi<SnoozeNextAdResponse, 200, 400 | 429 | 500>({
527
531
  path: '/channels/ads/schedule/snooze',
528
532
  method: 'POST',
529
533
  params,
530
- clientId,
531
- accessToken,
534
+ request,
532
535
  }),
533
536
  };
534
537
  analytics = {
@@ -573,14 +576,12 @@ export class TwitchApi {
573
576
  */
574
577
  getExtensionAnalytics: async (
575
578
  params: GetExtensionAnalyticsParams | null | undefined = null,
576
- accessToken = '',
577
- clientId = '',
578
- ): ApiResponse<GetExtensionAnalyticsResponse, 200, 400 | 401 | 404> =>
579
- this.callApi({
579
+ ...request: CallApiOptions['request']
580
+ ) =>
581
+ this.callApi<GetExtensionAnalyticsResponse, 200, 400 | 401 | 404>({
580
582
  path: '/analytics/extensions',
581
583
  params,
582
- clientId,
583
- accessToken,
584
+ request,
584
585
  }),
585
586
  /**
586
587
  * Gets an analytics report for one or more games. The response contains the URLs used to download the reports (CSV files). [Learn more](https://dev.twitch.tv/docs/insights)
@@ -623,14 +624,12 @@ export class TwitchApi {
623
624
  */
624
625
  getGameAnalytics: async (
625
626
  params: GetGameAnalyticsParams | null | undefined = null,
626
- accessToken = '',
627
- clientId = '',
628
- ): ApiResponse<GetGameAnalyticsResponse, 200, 400 | 401 | 404> =>
629
- this.callApi({
627
+ ...request: CallApiOptions['request']
628
+ ) =>
629
+ this.callApi<GetGameAnalyticsResponse, 200, 400 | 401 | 404>({
630
630
  path: '/analytics/games',
631
631
  params,
632
- clientId,
633
- accessToken,
632
+ request,
634
633
  }),
635
634
  };
636
635
  bits = {
@@ -670,14 +669,12 @@ export class TwitchApi {
670
669
  */
671
670
  getBitsLeaderboard: async (
672
671
  params: GetBitsLeaderboardParams | null | undefined = null,
673
- accessToken = '',
674
- clientId = '',
675
- ): ApiResponse<GetBitsLeaderboardResponse, 200, 400 | 401 | 403> =>
676
- this.callApi({
672
+ ...request: CallApiOptions['request']
673
+ ) =>
674
+ this.callApi<GetBitsLeaderboardResponse, 200, 400 | 401 | 403>({
677
675
  path: '/bits/leaderboard',
678
676
  params,
679
- clientId,
680
- accessToken,
677
+ request,
681
678
  }),
682
679
  /**
683
680
  * Gets a list of Cheermotes that users can use to cheer Bits in any Bits-enabled channel’s chat room. Cheermotes are animated emotes that viewers can assign Bits to.
@@ -705,14 +702,12 @@ export class TwitchApi {
705
702
  */
706
703
  getCheermotes: async (
707
704
  params: GetCheermotesParams | null | undefined = null,
708
- accessToken = '',
709
- clientId = '',
710
- ): ApiResponse<GetCheermotesResponse, 200, 401> =>
711
- this.callApi({
705
+ ...request: CallApiOptions['request']
706
+ ) =>
707
+ this.callApi<GetCheermotesResponse, 200, 401>({
712
708
  path: '/bits/cheermotes',
713
709
  params,
714
- clientId,
715
- accessToken,
710
+ request,
716
711
  }),
717
712
  /**
718
713
  * Gets an extension’s list of transactions. A transaction records the exchange of a currency (for example, Bits) for a digital product.
@@ -752,14 +747,12 @@ export class TwitchApi {
752
747
  */
753
748
  getExtensionTransactions: async (
754
749
  params: GetExtensionTransactionsParams,
755
- accessToken = '',
756
- clientId = '',
757
- ): ApiResponse<GetExtensionTransactionsResponse, 200, 400 | 401 | 404> =>
758
- this.callApi({
750
+ ...request: CallApiOptions['request']
751
+ ) =>
752
+ this.callApi<GetExtensionTransactionsResponse, 200, 400 | 401 | 404>({
759
753
  path: '/extensions/transactions',
760
754
  params,
761
- clientId,
762
- accessToken,
755
+ request,
763
756
  }),
764
757
  };
765
758
  channels = {
@@ -802,14 +795,12 @@ export class TwitchApi {
802
795
  */
803
796
  getChannelInformation: async (
804
797
  params: GetChannelInformationParams,
805
- accessToken = '',
806
- clientId = '',
807
- ): ApiResponse<GetChannelInformationResponse, 200, 400 | 401 | 429 | 500> =>
808
- this.callApi({
798
+ ...request: CallApiOptions['request']
799
+ ) =>
800
+ this.callApi<GetChannelInformationResponse, 200, 400 | 401 | 429 | 500>({
809
801
  path: '/channels',
810
802
  params,
811
- clientId,
812
- accessToken,
803
+ request,
813
804
  }),
814
805
  /**
815
806
  * Updates a channel’s properties.
@@ -871,16 +862,14 @@ export class TwitchApi {
871
862
  modifyChannelInformation: async (
872
863
  params: ModifyChannelInformationParams,
873
864
  body: ModifyChannelInformationBody | null | undefined = null,
874
- accessToken = '',
875
- clientId = '',
876
- ): ApiResponse<void, 204, 400 | 401 | 403 | 409 | 500> =>
877
- this.callApi({
865
+ ...request: CallApiOptions['request']
866
+ ) =>
867
+ this.callApi<void, 204, 400 | 401 | 403 | 409 | 500>({
878
868
  path: '/channels',
879
869
  method: 'PATCH',
880
870
  params,
881
871
  body,
882
- clientId,
883
- accessToken,
872
+ request,
884
873
  }),
885
874
  /**
886
875
  * Gets the broadcaster’s list editors.
@@ -915,14 +904,12 @@ export class TwitchApi {
915
904
  */
916
905
  getChannelEditors: async (
917
906
  params: GetChannelEditorsParams,
918
- accessToken = '',
919
- clientId = '',
920
- ): ApiResponse<GetChannelEditorsResponse, 200, 400 | 401> =>
921
- this.callApi({
907
+ ...request: CallApiOptions['request']
908
+ ) =>
909
+ this.callApi<GetChannelEditorsResponse, 200, 400 | 401>({
922
910
  path: '/channels/editors',
923
911
  params,
924
- clientId,
925
- accessToken,
912
+ request,
926
913
  }),
927
914
  /**
928
915
  * Gets a list of broadcasters that the specified user follows. You can also use this endpoint to see whether a user follows a specific broadcaster.
@@ -963,14 +950,12 @@ export class TwitchApi {
963
950
  */
964
951
  getFollowedChannels: async (
965
952
  params: GetFollowedChannelsParams,
966
- accessToken = '',
967
- clientId = '',
968
- ): ApiResponse<GetFollowedChannelsResponse, 200, 400 | 401> =>
969
- this.callApi({
953
+ ...request: CallApiOptions['request']
954
+ ) =>
955
+ this.callApi<GetFollowedChannelsResponse, 200, 400 | 401>({
970
956
  path: '/channels/followed',
971
957
  params,
972
- clientId,
973
- accessToken,
958
+ request,
974
959
  }),
975
960
  /**
976
961
  * Gets a list of users that follow the specified broadcaster. You can also use this endpoint to see whether a specific user follows the broadcaster.
@@ -1014,14 +999,12 @@ export class TwitchApi {
1014
999
  */
1015
1000
  getChannelFollowers: async (
1016
1001
  params: GetChannelFollowersParams,
1017
- accessToken = '',
1018
- clientId = '',
1019
- ): ApiResponse<GetChannelFollowersResponse, 200, 400 | 401> =>
1020
- this.callApi({
1002
+ ...request: CallApiOptions['request']
1003
+ ) =>
1004
+ this.callApi<GetChannelFollowersResponse, 200, 400 | 401>({
1021
1005
  path: '/channels/followers',
1022
1006
  params,
1023
- clientId,
1024
- accessToken,
1007
+ request,
1025
1008
  }),
1026
1009
  };
1027
1010
  channelPoints = {
@@ -1074,16 +1057,14 @@ export class TwitchApi {
1074
1057
  createCustomRewards: async (
1075
1058
  params: CreateCustomRewardsParams,
1076
1059
  body: CreateCustomRewardsBody,
1077
- accessToken = '',
1078
- clientId = '',
1079
- ): ApiResponse<CreateCustomRewardsResponse, 200, 400 | 401 | 403 | 500> =>
1080
- this.callApi({
1060
+ ...request: CallApiOptions['request']
1061
+ ) =>
1062
+ this.callApi<CreateCustomRewardsResponse, 200, 400 | 401 | 403 | 500>({
1081
1063
  path: '/channel_points/custom_rewards',
1082
1064
  method: 'POST',
1083
1065
  params,
1084
1066
  body,
1085
- clientId,
1086
- accessToken,
1067
+ request,
1087
1068
  }),
1088
1069
  /**
1089
1070
  * Deletes a custom reward that the broadcaster created.
@@ -1131,15 +1112,13 @@ export class TwitchApi {
1131
1112
  */
1132
1113
  deleteCustomReward: async (
1133
1114
  params: DeleteCustomRewardParams,
1134
- accessToken = '',
1135
- clientId = '',
1136
- ): ApiResponse<void, 204, 400 | 401 | 403 | 404 | 500> =>
1137
- this.callApi({
1115
+ ...request: CallApiOptions['request']
1116
+ ) =>
1117
+ this.callApi<void, 204, 400 | 401 | 403 | 404 | 500>({
1138
1118
  path: '/channel_points/custom_rewards',
1139
1119
  method: 'DELETE',
1140
1120
  params,
1141
- clientId,
1142
- accessToken,
1121
+ request,
1143
1122
  }),
1144
1123
  /**
1145
1124
  * Gets a list of custom rewards that the specified broadcaster created.
@@ -1186,14 +1165,12 @@ export class TwitchApi {
1186
1165
  */
1187
1166
  getCustomReward: async (
1188
1167
  params: GetCustomRewardParams,
1189
- accessToken = '',
1190
- clientId = '',
1191
- ): ApiResponse<GetCustomRewardResponse, 200, 400 | 401 | 403 | 404 | 500> =>
1192
- this.callApi({
1168
+ ...request: CallApiOptions['request']
1169
+ ) =>
1170
+ this.callApi<GetCustomRewardResponse, 200, 400 | 401 | 403 | 404 | 500>({
1193
1171
  path: '/channel_points/custom_rewards',
1194
1172
  params,
1195
- clientId,
1196
- accessToken,
1173
+ request,
1197
1174
  }),
1198
1175
  /**
1199
1176
  * Updates a custom reward. The app used to create the reward is the only app that may update the reward.
@@ -1251,16 +1228,14 @@ export class TwitchApi {
1251
1228
  updateCustomReward: async (
1252
1229
  params: UpdateCustomRewardParams,
1253
1230
  body: UpdateCustomRewardBody | null | undefined = null,
1254
- accessToken = '',
1255
- clientId = '',
1256
- ): ApiResponse<UpdateCustomRewardResponse, 200, 400 | 401 | 403 | 404 | 500> =>
1257
- this.callApi({
1231
+ ...request: CallApiOptions['request']
1232
+ ) =>
1233
+ this.callApi<UpdateCustomRewardResponse, 200, 400 | 401 | 403 | 404 | 500>({
1258
1234
  path: '/channel_points/custom_rewards',
1259
1235
  method: 'PATCH',
1260
1236
  params,
1261
1237
  body,
1262
- clientId,
1263
- accessToken,
1238
+ request,
1264
1239
  }),
1265
1240
  /**
1266
1241
  * Gets a list of redemptions for the specified custom reward. The app used to create the reward is the only app that may get the redemptions.
@@ -1309,14 +1284,12 @@ export class TwitchApi {
1309
1284
  */
1310
1285
  getCustomRewardRedemption: async (
1311
1286
  params: GetCustomRewardRedemptionParams,
1312
- accessToken = '',
1313
- clientId = '',
1314
- ): ApiResponse<GetCustomRewardRedemptionResponse, 200, 400 | 401 | 403 | 404 | 500> =>
1315
- this.callApi({
1287
+ ...request: CallApiOptions['request']
1288
+ ) =>
1289
+ this.callApi<GetCustomRewardRedemptionResponse, 200, 400 | 401 | 403 | 404 | 500>({
1316
1290
  path: '/channel_points/custom_rewards/redemptions',
1317
1291
  params,
1318
- clientId,
1319
- accessToken,
1292
+ request,
1320
1293
  }),
1321
1294
  /**
1322
1295
  * Updates a redemption’s status. You may update a redemption only if its status is UNFULFILLED. The app used to create the reward is the only app that may update the redemption.
@@ -1366,16 +1339,14 @@ export class TwitchApi {
1366
1339
  updateRedemptionStatus: async (
1367
1340
  params: UpdateRedemptionStatusParams,
1368
1341
  body: UpdateRedemptionStatusBody,
1369
- accessToken = '',
1370
- clientId = '',
1371
- ): ApiResponse<UpdateRedemptionStatusResponse, 200, 400 | 401 | 403 | 404 | 500> =>
1372
- this.callApi({
1342
+ ...request: CallApiOptions['request']
1343
+ ) =>
1344
+ this.callApi<UpdateRedemptionStatusResponse, 200, 400 | 401 | 403 | 404 | 500>({
1373
1345
  path: '/channel_points/custom_rewards/redemptions',
1374
1346
  method: 'PATCH',
1375
1347
  params,
1376
1348
  body,
1377
- clientId,
1378
- accessToken,
1349
+ request,
1379
1350
  }),
1380
1351
  };
1381
1352
  charity = {
@@ -1419,14 +1390,12 @@ export class TwitchApi {
1419
1390
  */
1420
1391
  getCharityCampaign: async (
1421
1392
  params: GetCharityCampaignParams,
1422
- accessToken = '',
1423
- clientId = '',
1424
- ): ApiResponse<GetCharityCampaignResponse, 200, 400 | 401 | 403> =>
1425
- this.callApi({
1393
+ ...request: CallApiOptions['request']
1394
+ ) =>
1395
+ this.callApi<GetCharityCampaignResponse, 200, 400 | 401 | 403>({
1426
1396
  path: '/charity/campaigns',
1427
1397
  params,
1428
- clientId,
1429
- accessToken,
1398
+ request,
1430
1399
  }),
1431
1400
  /**
1432
1401
  * Gets the list of donations that users have made to the broadcaster’s active charity campaign.
@@ -1468,14 +1437,12 @@ export class TwitchApi {
1468
1437
  */
1469
1438
  getCharityCampaignDonations: async (
1470
1439
  params: GetCharityCampaignDonationsParams,
1471
- accessToken = '',
1472
- clientId = '',
1473
- ): ApiResponse<GetCharityCampaignDonationsResponse, 200, 400 | 401 | 403> =>
1474
- this.callApi({
1440
+ ...request: CallApiOptions['request']
1441
+ ) =>
1442
+ this.callApi<GetCharityCampaignDonationsResponse, 200, 400 | 401 | 403>({
1475
1443
  path: '/charity/donations',
1476
1444
  params,
1477
- clientId,
1478
- accessToken,
1445
+ request,
1479
1446
  }),
1480
1447
  };
1481
1448
  chat = {
@@ -1523,14 +1490,12 @@ export class TwitchApi {
1523
1490
  */
1524
1491
  getChatters: async (
1525
1492
  params: GetChattersParams,
1526
- accessToken = '',
1527
- clientId = '',
1528
- ): ApiResponse<GetChattersResponse, 200, 400 | 401 | 403> =>
1529
- this.callApi({
1493
+ ...request: CallApiOptions['request']
1494
+ ) =>
1495
+ this.callApi<GetChattersResponse, 200, 400 | 401 | 403>({
1530
1496
  path: '/chat/chatters',
1531
1497
  params,
1532
- clientId,
1533
- accessToken,
1498
+ request,
1534
1499
  }),
1535
1500
  /**
1536
1501
  * Gets the broadcaster’s list of custom emotes. Broadcasters create these custom emotes for users who subscribe to or follow the channel or cheer Bits in the channel’s chat window. [Learn More](https://dev.twitch.tv/docs/irc/emotes)
@@ -1567,14 +1532,12 @@ export class TwitchApi {
1567
1532
  */
1568
1533
  getChannelEmotes: async (
1569
1534
  params: GetChannelEmotesParams,
1570
- accessToken = '',
1571
- clientId = '',
1572
- ): ApiResponse<GetChannelEmotesResponse, 200, 400 | 401> =>
1573
- this.callApi({
1535
+ ...request: CallApiOptions['request']
1536
+ ) =>
1537
+ this.callApi<GetChannelEmotesResponse, 200, 400 | 401>({
1574
1538
  path: '/chat/emotes',
1575
1539
  params,
1576
- clientId,
1577
- accessToken,
1540
+ request,
1578
1541
  }),
1579
1542
  /**
1580
1543
  * Gets the list of [global emotes](https://www.twitch.tv/creatorcamp/en/learn-the-basics/emotes/). Global emotes are Twitch-created emotes that users can use in any Twitch chat.
@@ -1607,11 +1570,10 @@ export class TwitchApi {
1607
1570
  *
1608
1571
  * @see https://dev.twitch.tv/docs/api/reference#get-global-emotes
1609
1572
  */
1610
- getGlobalEmotes: async (accessToken = '', clientId = ''): ApiResponse<GetGlobalEmotesResponse, 200, 401> =>
1611
- this.callApi({
1573
+ getGlobalEmotes: async (...request: CallApiOptions['request']) =>
1574
+ this.callApi<GetGlobalEmotesResponse, 200, 401>({
1612
1575
  path: '/chat/emotes/global',
1613
- clientId,
1614
- accessToken,
1576
+ request,
1615
1577
  }),
1616
1578
  /**
1617
1579
  * Gets emotes for one or more specified emote sets.
@@ -1649,14 +1611,12 @@ export class TwitchApi {
1649
1611
  */
1650
1612
  getEmoteSets: async (
1651
1613
  params: GetEmoteSetsParams,
1652
- accessToken = '',
1653
- clientId = '',
1654
- ): ApiResponse<GetEmoteSetsResponse, 200, 400 | 401> =>
1655
- this.callApi({
1614
+ ...request: CallApiOptions['request']
1615
+ ) =>
1616
+ this.callApi<GetEmoteSetsResponse, 200, 400 | 401>({
1656
1617
  path: '/chat/emotes/set',
1657
1618
  params,
1658
- clientId,
1659
- accessToken,
1619
+ request,
1660
1620
  }),
1661
1621
  /**
1662
1622
  * Gets the broadcaster’s list of custom chat badges. The list is empty if the broadcaster hasn’t created custom chat badges. For information about custom badges, see [subscriber badges](https://help.twitch.tv/s/article/subscriber-badge-guide) and [Bits badges](https://help.twitch.tv/s/article/custom-bit-badges-guide).
@@ -1689,14 +1649,12 @@ export class TwitchApi {
1689
1649
  */
1690
1650
  getChannelChatBadges: async (
1691
1651
  params: GetChannelChatBadgesParams,
1692
- accessToken = '',
1693
- clientId = '',
1694
- ): ApiResponse<GetChannelChatBadgesResponse, 200, 400 | 401> =>
1695
- this.callApi({
1652
+ ...request: CallApiOptions['request']
1653
+ ) =>
1654
+ this.callApi<GetChannelChatBadgesResponse, 200, 400 | 401>({
1696
1655
  path: '/chat/badges',
1697
1656
  params,
1698
- clientId,
1699
- accessToken,
1657
+ request,
1700
1658
  }),
1701
1659
  /**
1702
1660
  * Gets Twitch’s list of chat badges, which users may use in any channel’s chat room. For information about chat badges, see [Twitch Chat Badges Guide](https://help.twitch.tv/s/article/twitch-chat-badges-guide).
@@ -1727,11 +1685,10 @@ export class TwitchApi {
1727
1685
  *
1728
1686
  * @see https://dev.twitch.tv/docs/api/reference#get-global-chat-badges
1729
1687
  */
1730
- getGlobalChatBadges: async (accessToken = '', clientId = ''): ApiResponse<GetGlobalChatBadgesResponse, 200, 401> =>
1731
- this.callApi({
1688
+ getGlobalChatBadges: async (...request: CallApiOptions['request']) =>
1689
+ this.callApi<GetGlobalChatBadgesResponse, 200, 401>({
1732
1690
  path: '/chat/badges/global',
1733
- clientId,
1734
- accessToken,
1691
+ request,
1735
1692
  }),
1736
1693
  /**
1737
1694
  * Gets the broadcaster’s chat settings.
@@ -1766,14 +1723,12 @@ export class TwitchApi {
1766
1723
  */
1767
1724
  getChatSettings: async (
1768
1725
  params: GetChatSettingsParams,
1769
- accessToken = '',
1770
- clientId = '',
1771
- ): ApiResponse<GetChatSettingsResponse, 200, 400 | 401> =>
1772
- this.callApi({
1726
+ ...request: CallApiOptions['request']
1727
+ ) =>
1728
+ this.callApi<GetChatSettingsResponse, 200, 400 | 401>({
1773
1729
  path: '/chat/settings',
1774
1730
  params,
1775
- clientId,
1776
- accessToken,
1731
+ request,
1777
1732
  }),
1778
1733
  /**
1779
1734
  * Updates the broadcaster’s chat settings.
@@ -1827,16 +1782,14 @@ export class TwitchApi {
1827
1782
  updateChatSettings: async (
1828
1783
  params: UpdateChatSettingsParams,
1829
1784
  body: UpdateChatSettingsBody | null | undefined = null,
1830
- accessToken = '',
1831
- clientId = '',
1832
- ): ApiResponse<UpdateChatSettingsResponse, 200, 400 | 401 | 403> =>
1833
- this.callApi({
1785
+ ...request: CallApiOptions['request']
1786
+ ) =>
1787
+ this.callApi<UpdateChatSettingsResponse, 200, 400 | 401 | 403>({
1834
1788
  path: '/chat/settings',
1835
1789
  method: 'PATCH',
1836
1790
  params,
1837
1791
  body,
1838
- clientId,
1839
- accessToken,
1792
+ request,
1840
1793
  }),
1841
1794
  /**
1842
1795
  * Sends an announcement to the broadcaster’s chat room.
@@ -1875,16 +1828,14 @@ export class TwitchApi {
1875
1828
  sendChatAnnouncement: async (
1876
1829
  params: SendChatAnnouncementParams,
1877
1830
  body: SendChatAnnouncementBody,
1878
- accessToken = '',
1879
- clientId = '',
1880
- ): ApiResponse<void, 204, 400 | 401> =>
1881
- this.callApi({
1831
+ ...request: CallApiOptions['request']
1832
+ ) =>
1833
+ this.callApi<void, 204, 400 | 401>({
1882
1834
  path: '/chat/announcements',
1883
1835
  method: 'POST',
1884
1836
  params,
1885
1837
  body,
1886
- clientId,
1887
- accessToken,
1838
+ request,
1888
1839
  }),
1889
1840
  /**
1890
1841
  * Sends a Shoutout to the specified broadcaster. Typically, you send Shoutouts when you or one of your moderators notice another broadcaster in your chat, the other broadcaster is coming up in conversation, or after they raid your broadcast.
@@ -1940,15 +1891,13 @@ export class TwitchApi {
1940
1891
  */
1941
1892
  sendShoutout: async (
1942
1893
  params: SendShoutoutParams,
1943
- accessToken = '',
1944
- clientId = '',
1945
- ): ApiResponse<void, 204, 400 | 401 | 403 | 429> =>
1946
- this.callApi({
1894
+ ...request: CallApiOptions['request']
1895
+ ) =>
1896
+ this.callApi<void, 204, 400 | 401 | 403 | 429>({
1947
1897
  path: '/chat/shoutouts',
1948
1898
  method: 'POST',
1949
1899
  params,
1950
- clientId,
1951
- accessToken,
1900
+ request,
1952
1901
  }),
1953
1902
  /**
1954
1903
  * Gets the color used for the user’s name in chat.
@@ -1981,14 +1930,12 @@ export class TwitchApi {
1981
1930
  */
1982
1931
  getUserChatColor: async (
1983
1932
  params: GetUserChatColorParams,
1984
- accessToken = '',
1985
- clientId = '',
1986
- ): ApiResponse<GetUserChatColorResponse, 200, 400 | 401> =>
1987
- this.callApi({
1933
+ ...request: CallApiOptions['request']
1934
+ ) =>
1935
+ this.callApi<GetUserChatColorResponse, 200, 400 | 401>({
1988
1936
  path: '/chat/color',
1989
1937
  params,
1990
- clientId,
1991
- accessToken,
1938
+ request,
1992
1939
  }),
1993
1940
  /**
1994
1941
  * Updates the color used for the user’s name in chat.
@@ -2026,15 +1973,13 @@ export class TwitchApi {
2026
1973
  */
2027
1974
  updateUserChatColor: async (
2028
1975
  params: UpdateUserChatColorParams,
2029
- accessToken = '',
2030
- clientId = '',
2031
- ): ApiResponse<void, 204, 400 | 401> =>
2032
- this.callApi({
1976
+ ...request: CallApiOptions['request']
1977
+ ) =>
1978
+ this.callApi<void, 204, 400 | 401>({
2033
1979
  path: '/chat/color',
2034
1980
  method: 'PUT',
2035
1981
  params,
2036
- clientId,
2037
- accessToken,
1982
+ request,
2038
1983
  }),
2039
1984
  };
2040
1985
  clips = {
@@ -2086,15 +2031,13 @@ export class TwitchApi {
2086
2031
  */
2087
2032
  createClip: async (
2088
2033
  params: CreateClipParams,
2089
- accessToken = '',
2090
- clientId = '',
2091
- ): ApiResponse<CreateClipResponse, 202, 400 | 401 | 403 | 404> =>
2092
- this.callApi({
2034
+ ...request: CallApiOptions['request']
2035
+ ) =>
2036
+ this.callApi<CreateClipResponse, 202, 400 | 401 | 403 | 404>({
2093
2037
  path: '/clips',
2094
2038
  method: 'POST',
2095
2039
  params,
2096
- clientId,
2097
- accessToken,
2040
+ request,
2098
2041
  }),
2099
2042
  /**
2100
2043
  * Gets one or more video clips that were captured from streams. For information about clips, see [How to use clips](https://help.twitch.tv/s/article/how-to-use-clips).
@@ -2136,14 +2079,12 @@ export class TwitchApi {
2136
2079
  */
2137
2080
  getClips: async (
2138
2081
  params: GetClipsParams | null | undefined = null,
2139
- accessToken = '',
2140
- clientId = '',
2141
- ): ApiResponse<GetClipsResponse, 200, 400 | 401 | 404> =>
2142
- this.callApi({
2082
+ ...request: CallApiOptions['request']
2083
+ ) =>
2084
+ this.callApi<GetClipsResponse, 200, 400 | 401 | 404>({
2143
2085
  path: '/clips',
2144
2086
  params,
2145
- clientId,
2146
- accessToken,
2087
+ request,
2147
2088
  }),
2148
2089
  };
2149
2090
  ccls = {
@@ -2174,14 +2115,12 @@ export class TwitchApi {
2174
2115
  */
2175
2116
  getContentClassificationLabels: async (
2176
2117
  params: GetContentClassificationLabelsParams | null | undefined = null,
2177
- accessToken = '',
2178
- clientId = '',
2179
- ): ApiResponse<GetContentClassificationLabelsResponse, 200, 400 | 401 | 500> =>
2180
- this.callApi({
2118
+ ...request: CallApiOptions['request']
2119
+ ) =>
2120
+ this.callApi<GetContentClassificationLabelsResponse, 200, 400 | 401 | 500>({
2181
2121
  path: '/content_classification_labels',
2182
2122
  params,
2183
- clientId,
2184
- accessToken,
2123
+ request,
2185
2124
  }),
2186
2125
  };
2187
2126
  entitlements = {
@@ -2240,14 +2179,12 @@ export class TwitchApi {
2240
2179
  */
2241
2180
  getDropsEntitlements: async (
2242
2181
  params: GetDropsEntitlementsParams | null | undefined = null,
2243
- accessToken = '',
2244
- clientId = '',
2245
- ): ApiResponse<GetDropsEntitlementsResponse, 200, 400 | 401 | 403 | 500> =>
2246
- this.callApi({
2182
+ ...request: CallApiOptions['request']
2183
+ ) =>
2184
+ this.callApi<GetDropsEntitlementsResponse, 200, 400 | 401 | 403 | 500>({
2247
2185
  path: '/entitlements/drops',
2248
2186
  params,
2249
- clientId,
2250
- accessToken,
2187
+ request,
2251
2188
  }),
2252
2189
  /**
2253
2190
  * Updates the Drop entitlement’s fulfillment status.
@@ -2292,15 +2229,13 @@ export class TwitchApi {
2292
2229
  */
2293
2230
  updateDropsEntitlements: async (
2294
2231
  body: UpdateDropsEntitlementsBody | null | undefined = null,
2295
- accessToken = '',
2296
- clientId = '',
2297
- ): ApiResponse<UpdateDropsEntitlementsResponse, 200, 400 | 401 | 500> =>
2298
- this.callApi({
2232
+ ...request: CallApiOptions['request']
2233
+ ) =>
2234
+ this.callApi<UpdateDropsEntitlementsResponse, 200, 400 | 401 | 500>({
2299
2235
  path: '/entitlements/drops',
2300
2236
  method: 'PATCH',
2301
2237
  body,
2302
- clientId,
2303
- accessToken,
2238
+ request,
2304
2239
  }),
2305
2240
  };
2306
2241
  extensions = {
@@ -2343,14 +2278,12 @@ export class TwitchApi {
2343
2278
  */
2344
2279
  getExtensionConfigurationSegment: async (
2345
2280
  params: GetExtensionConfigurationSegmentParams,
2346
- accessToken = '',
2347
- clientId = '',
2348
- ): ApiResponse<GetExtensionConfigurationSegmentResponse, 200, 400 | 401 | 429> =>
2349
- this.callApi({
2281
+ ...request: CallApiOptions['request']
2282
+ ) =>
2283
+ this.callApi<GetExtensionConfigurationSegmentResponse, 200, 400 | 401 | 429>({
2350
2284
  path: '/extensions/configurations',
2351
2285
  params,
2352
- clientId,
2353
- accessToken,
2286
+ request,
2354
2287
  }),
2355
2288
  /**
2356
2289
  * Updates a configuration segment. The segment is limited to 5 KB. Extensions that are active on a channel do not receive the updated configuration.
@@ -2385,15 +2318,13 @@ export class TwitchApi {
2385
2318
  */
2386
2319
  setExtensionConfigurationSegment: async (
2387
2320
  body: SetExtensionConfigurationSegmentBody,
2388
- accessToken = '',
2389
- clientId = '',
2390
- ): ApiResponse<void, 204, 400 | 401> =>
2391
- this.callApi({
2321
+ ...request: CallApiOptions['request']
2322
+ ) =>
2323
+ this.callApi<void, 204, 400 | 401>({
2392
2324
  path: '/extensions/configurations',
2393
2325
  method: 'PUT',
2394
2326
  body,
2395
- clientId,
2396
- accessToken,
2327
+ request,
2397
2328
  }),
2398
2329
  /**
2399
2330
  * Updates the extension’s required\_configuration string. Use this endpoint if your extension requires the broadcaster to configure the extension before activating it (to require configuration, you must select **Custom/My Own Service** in Extension [Capabilities](https://dev.twitch.tv/docs/extensions/life-cycle/#capabilities)). For more information, see [Required Configurations](https://dev.twitch.tv/docs/extensions/building#required-configurations) and [Setting Required Configuration](https://dev.twitch.tv/docs/extensions/building#setting-required-configuration-with-the-configuration-service-optional).
@@ -2430,16 +2361,14 @@ export class TwitchApi {
2430
2361
  setExtensionRequiredConfiguration: async (
2431
2362
  params: SetExtensionRequiredConfigurationParams,
2432
2363
  body: SetExtensionRequiredConfigurationBody,
2433
- accessToken = '',
2434
- clientId = '',
2435
- ): ApiResponse<void, 204, 400 | 401> =>
2436
- this.callApi({
2364
+ ...request: CallApiOptions['request']
2365
+ ) =>
2366
+ this.callApi<void, 204, 400 | 401>({
2437
2367
  path: '/extensions/required_configuration',
2438
2368
  method: 'PUT',
2439
2369
  params,
2440
2370
  body,
2441
- clientId,
2442
- accessToken,
2371
+ request,
2443
2372
  }),
2444
2373
  /**
2445
2374
  * Sends a message to one or more viewers. You can send messages to a specific channel or to all channels where your extension is active. This endpoint uses the same mechanism as the [send](https://dev.twitch.tv/docs/extensions/reference#send) JavaScript helper function used to send messages.
@@ -2512,15 +2441,13 @@ export class TwitchApi {
2512
2441
  */
2513
2442
  sendExtensionPubSubMessage: async (
2514
2443
  body: SendExtensionPubSubMessageBody,
2515
- accessToken = '',
2516
- clientId = '',
2517
- ): ApiResponse<void, 204, 400 | 401 | 422> =>
2518
- this.callApi({
2444
+ ...request: CallApiOptions['request']
2445
+ ) =>
2446
+ this.callApi<void, 204, 400 | 401 | 422>({
2519
2447
  path: '/extensions/pubsub',
2520
2448
  method: 'POST',
2521
2449
  body,
2522
- clientId,
2523
- accessToken,
2450
+ request,
2524
2451
  }),
2525
2452
  /**
2526
2453
  * Gets a list of broadcasters that are streaming live and have installed or activated the extension.
@@ -2560,14 +2487,12 @@ export class TwitchApi {
2560
2487
  */
2561
2488
  getExtensionLiveChannels: async (
2562
2489
  params: GetExtensionLiveChannelsParams,
2563
- accessToken = '',
2564
- clientId = '',
2565
- ): ApiResponse<GetExtensionLiveChannelsResponse, 200, 400 | 401 | 404> =>
2566
- this.callApi({
2490
+ ...request: CallApiOptions['request']
2491
+ ) =>
2492
+ this.callApi<GetExtensionLiveChannelsResponse, 200, 400 | 401 | 404>({
2567
2493
  path: '/extensions/live',
2568
2494
  params,
2569
- clientId,
2570
- accessToken,
2495
+ request,
2571
2496
  }),
2572
2497
  /**
2573
2498
  * Gets an extension’s list of shared secrets.
@@ -2598,11 +2523,10 @@ export class TwitchApi {
2598
2523
  *
2599
2524
  * @see https://dev.twitch.tv/docs/api/reference#get-extension-secrets
2600
2525
  */
2601
- getExtensionSecrets: async (accessToken = '', clientId = ''): ApiResponse<GetExtensionSecretsResponse, 200, 400 | 401> =>
2602
- this.callApi({
2526
+ getExtensionSecrets: async (...request: CallApiOptions['request']) =>
2527
+ this.callApi<GetExtensionSecretsResponse, 200, 400 | 401>({
2603
2528
  path: '/extensions/jwt/secrets',
2604
- clientId,
2605
- accessToken,
2529
+ request,
2606
2530
  }),
2607
2531
  /**
2608
2532
  * Creates a shared secret used to sign and verify JWT tokens. Creating a new secret removes the current secrets from service. Use this function only when you are ready to use the new secret it returns.
@@ -2636,15 +2560,13 @@ export class TwitchApi {
2636
2560
  */
2637
2561
  createExtensionSecret: async (
2638
2562
  params: CreateExtensionSecretParams,
2639
- accessToken = '',
2640
- clientId = '',
2641
- ): ApiResponse<CreateExtensionSecretResponse, 200, 400 | 401> =>
2642
- this.callApi({
2563
+ ...request: CallApiOptions['request']
2564
+ ) =>
2565
+ this.callApi<CreateExtensionSecretResponse, 200, 400 | 401>({
2643
2566
  path: '/extensions/jwt/secrets',
2644
2567
  method: 'POST',
2645
2568
  params,
2646
- clientId,
2647
- accessToken,
2569
+ request,
2648
2570
  }),
2649
2571
  /**
2650
2572
  * Sends a message to the specified broadcaster’s chat room. The extension’s name is used as the username for the message in the chat room. To send a chat message, your extension must enable **Chat Capabilities** (under your extension’s **Capabilities** tab).
@@ -2685,16 +2607,14 @@ export class TwitchApi {
2685
2607
  sendExtensionChatMessage: async (
2686
2608
  params: SendExtensionChatMessageParams,
2687
2609
  body: SendExtensionChatMessageBody,
2688
- accessToken = '',
2689
- clientId = '',
2690
- ): ApiResponse<void, 204, 400 | 401> =>
2691
- this.callApi({
2610
+ ...request: CallApiOptions['request']
2611
+ ) =>
2612
+ this.callApi<void, 204, 400 | 401>({
2692
2613
  path: '/extensions/chat',
2693
2614
  method: 'POST',
2694
2615
  params,
2695
2616
  body,
2696
- clientId,
2697
- accessToken,
2617
+ request,
2698
2618
  }),
2699
2619
  /**
2700
2620
  * Gets information about an extension.
@@ -2732,14 +2652,12 @@ export class TwitchApi {
2732
2652
  */
2733
2653
  getExtensions: async (
2734
2654
  params: GetExtensionsParams,
2735
- accessToken = '',
2736
- clientId = '',
2737
- ): ApiResponse<GetExtensionsResponse, 200, 400 | 401 | 404> =>
2738
- this.callApi({
2655
+ ...request: CallApiOptions['request']
2656
+ ) =>
2657
+ this.callApi<GetExtensionsResponse, 200, 400 | 401 | 404>({
2739
2658
  path: '/extensions',
2740
2659
  params,
2741
- clientId,
2742
- accessToken,
2660
+ request,
2743
2661
  }),
2744
2662
  /**
2745
2663
  * Gets information about a released extension. Returns the extension if its `state` is Released.
@@ -2776,14 +2694,12 @@ export class TwitchApi {
2776
2694
  */
2777
2695
  getReleasedExtensions: async (
2778
2696
  params: GetReleasedExtensionsParams,
2779
- accessToken = '',
2780
- clientId = '',
2781
- ): ApiResponse<GetReleasedExtensionsResponse, 200, 400 | 401 | 404> =>
2782
- this.callApi({
2697
+ ...request: CallApiOptions['request']
2698
+ ) =>
2699
+ this.callApi<GetReleasedExtensionsResponse, 200, 400 | 401 | 404>({
2783
2700
  path: '/extensions/released',
2784
2701
  params,
2785
- clientId,
2786
- accessToken,
2702
+ request,
2787
2703
  }),
2788
2704
  /**
2789
2705
  * Gets the list of Bits products that belongs to the extension. The client ID in the app access token identifies the extension.
@@ -2816,14 +2732,12 @@ export class TwitchApi {
2816
2732
  */
2817
2733
  getExtensionBitsProducts: async (
2818
2734
  params: GetExtensionBitsProductsParams | null | undefined = null,
2819
- accessToken = '',
2820
- clientId = '',
2821
- ): ApiResponse<GetExtensionBitsProductsResponse, 200, 400 | 401> =>
2822
- this.callApi({
2735
+ ...request: CallApiOptions['request']
2736
+ ) =>
2737
+ this.callApi<GetExtensionBitsProductsResponse, 200, 400 | 401>({
2823
2738
  path: '/bits/extensions',
2824
2739
  params,
2825
- clientId,
2826
- accessToken,
2740
+ request,
2827
2741
  }),
2828
2742
  /**
2829
2743
  * Adds or updates a Bits product that the extension created. If the SKU doesn’t exist, the product is added. You may update all fields except the `sku` field.
@@ -2863,15 +2777,13 @@ export class TwitchApi {
2863
2777
  */
2864
2778
  updateExtensionBitsProduct: async (
2865
2779
  body: UpdateExtensionBitsProductBody,
2866
- accessToken = '',
2867
- clientId = '',
2868
- ): ApiResponse<UpdateExtensionBitsProductResponse, 200, 400 | 401> =>
2869
- this.callApi({
2780
+ ...request: CallApiOptions['request']
2781
+ ) =>
2782
+ this.callApi<UpdateExtensionBitsProductResponse, 200, 400 | 401>({
2870
2783
  path: '/bits/extensions',
2871
2784
  method: 'PUT',
2872
2785
  body,
2873
- clientId,
2874
- accessToken,
2786
+ request,
2875
2787
  }),
2876
2788
  };
2877
2789
  eventSub = {
@@ -2930,15 +2842,13 @@ export class TwitchApi {
2930
2842
  */
2931
2843
  createEventSubSubscription: async (
2932
2844
  body: CreateEventSubSubscriptionBody,
2933
- accessToken = '',
2934
- clientId = '',
2935
- ): ApiResponse<CreateEventSubSubscriptionResponse, 202, 400 | 401 | 403 | 409 | 429> =>
2936
- this.callApi({
2845
+ ...request: CallApiOptions['request']
2846
+ ) =>
2847
+ this.callApi<CreateEventSubSubscriptionResponse, 202, 400 | 401 | 403 | 409 | 429>({
2937
2848
  path: '/eventsub/subscriptions',
2938
2849
  method: 'POST',
2939
2850
  body,
2940
- clientId,
2941
- accessToken,
2851
+ request,
2942
2852
  }),
2943
2853
  /**
2944
2854
  * Deletes an EventSub subscription.
@@ -2977,15 +2887,13 @@ export class TwitchApi {
2977
2887
  */
2978
2888
  deleteEventSubSubscription: async (
2979
2889
  params: DeleteEventSubSubscriptionParams,
2980
- accessToken = '',
2981
- clientId = '',
2982
- ): ApiResponse<void, 204, 400 | 401 | 404> =>
2983
- this.callApi({
2890
+ ...request: CallApiOptions['request']
2891
+ ) =>
2892
+ this.callApi<void, 204, 400 | 401 | 404>({
2984
2893
  path: '/eventsub/subscriptions',
2985
2894
  method: 'DELETE',
2986
2895
  params,
2987
- clientId,
2988
- accessToken,
2896
+ request,
2989
2897
  }),
2990
2898
  /**
2991
2899
  * Gets a list of EventSub subscriptions that the client in the access token created.
@@ -3027,14 +2935,12 @@ export class TwitchApi {
3027
2935
  */
3028
2936
  getEventSubSubscriptions: async (
3029
2937
  params: GetEventSubSubscriptionsParams | null | undefined = null,
3030
- accessToken = '',
3031
- clientId = '',
3032
- ): ApiResponse<GetEventSubSubscriptionsResponse, 200, 400 | 401> =>
3033
- this.callApi({
2938
+ ...request: CallApiOptions['request']
2939
+ ) =>
2940
+ this.callApi<GetEventSubSubscriptionsResponse, 200, 400 | 401>({
3034
2941
  path: '/eventsub/subscriptions',
3035
2942
  params,
3036
- clientId,
3037
- accessToken,
2943
+ request,
3038
2944
  }),
3039
2945
  };
3040
2946
  games = {
@@ -3070,14 +2976,12 @@ export class TwitchApi {
3070
2976
  */
3071
2977
  getTopGames: async (
3072
2978
  params: GetTopGamesParams | null | undefined = null,
3073
- accessToken = '',
3074
- clientId = '',
3075
- ): ApiResponse<GetTopGamesResponse, 200, 400 | 401> =>
3076
- this.callApi({
2979
+ ...request: CallApiOptions['request']
2980
+ ) =>
2981
+ this.callApi<GetTopGamesResponse, 200, 400 | 401>({
3077
2982
  path: '/games/top',
3078
2983
  params,
3079
- clientId,
3080
- accessToken,
2984
+ request,
3081
2985
  }),
3082
2986
  /**
3083
2987
  * Gets information about specified categories or games.
@@ -3113,14 +3017,12 @@ export class TwitchApi {
3113
3017
  */
3114
3018
  getGames: async (
3115
3019
  params: GetGamesParams | null | undefined = null,
3116
- accessToken = '',
3117
- clientId = '',
3118
- ): ApiResponse<GetGamesResponse, 200, 400 | 401> =>
3119
- this.callApi({
3020
+ ...request: CallApiOptions['request']
3021
+ ) =>
3022
+ this.callApi<GetGamesResponse, 200, 400 | 401>({
3120
3023
  path: '/games',
3121
3024
  params,
3122
- clientId,
3123
- accessToken,
3025
+ request,
3124
3026
  }),
3125
3027
  };
3126
3028
  goals = {
@@ -3159,14 +3061,12 @@ export class TwitchApi {
3159
3061
  */
3160
3062
  getCreatorGoals: async (
3161
3063
  params: GetCreatorGoalsParams,
3162
- accessToken = '',
3163
- clientId = '',
3164
- ): ApiResponse<GetCreatorGoalsResponse, 200, 400 | 401> =>
3165
- this.callApi({
3064
+ ...request: CallApiOptions['request']
3065
+ ) =>
3066
+ this.callApi<GetCreatorGoalsResponse, 200, 400 | 401>({
3166
3067
  path: '/goals',
3167
3068
  params,
3168
- clientId,
3169
- accessToken,
3069
+ request,
3170
3070
  }),
3171
3071
  };
3172
3072
  guestStar = {
@@ -3199,14 +3099,12 @@ export class TwitchApi {
3199
3099
  */
3200
3100
  getChannelGuestStarSettings: async (
3201
3101
  params: GetChannelGuestStarSettingsParams,
3202
- accessToken = '',
3203
- clientId = '',
3204
- ): ApiResponse<GetChannelGuestStarSettingsResponse, 200, 400 | 403> =>
3205
- this.callApi({
3102
+ ...request: CallApiOptions['request']
3103
+ ) =>
3104
+ this.callApi<GetChannelGuestStarSettingsResponse, 200, 400 | 403>({
3206
3105
  path: '/guest_star/channel_settings',
3207
3106
  params,
3208
- clientId,
3209
- accessToken,
3107
+ request,
3210
3108
  }),
3211
3109
  /**
3212
3110
  * BETA Mutates the channel settings for configuration of the Guest Star feature for a particular host.
@@ -3237,16 +3135,14 @@ export class TwitchApi {
3237
3135
  updateChannelGuestStarSettings: async (
3238
3136
  params: UpdateChannelGuestStarSettingsParams,
3239
3137
  body: UpdateChannelGuestStarSettingsBody | null | undefined = null,
3240
- accessToken = '',
3241
- clientId = '',
3242
- ): ApiResponse<void, 204, 400> =>
3243
- this.callApi({
3138
+ ...request: CallApiOptions['request']
3139
+ ) =>
3140
+ this.callApi<void, 204, 400>({
3244
3141
  path: '/guest_star/channel_settings',
3245
3142
  method: 'PUT',
3246
3143
  params,
3247
3144
  body,
3248
- clientId,
3249
- accessToken,
3145
+ request,
3250
3146
  }),
3251
3147
  /**
3252
3148
  * BETA Gets information about an ongoing Guest Star session for a particular channel.
@@ -3277,14 +3173,12 @@ export class TwitchApi {
3277
3173
  */
3278
3174
  getGuestStarSession: async (
3279
3175
  params: GetGuestStarSessionParams,
3280
- accessToken = '',
3281
- clientId = '',
3282
- ): ApiResponse<GetGuestStarSessionResponse, 200, 400 | 401> =>
3283
- this.callApi({
3176
+ ...request: CallApiOptions['request']
3177
+ ) =>
3178
+ this.callApi<GetGuestStarSessionResponse, 200, 400 | 401>({
3284
3179
  path: '/guest_star/session',
3285
3180
  params,
3286
- clientId,
3287
- accessToken,
3181
+ request,
3288
3182
  }),
3289
3183
  /**
3290
3184
  * BETA Programmatically creates a Guest Star session on behalf of the broadcaster. Requires the broadcaster to be present in the call interface, or the call will be ended automatically.
@@ -3319,15 +3213,13 @@ export class TwitchApi {
3319
3213
  */
3320
3214
  createGuestStarSession: async (
3321
3215
  params: CreateGuestStarSessionParams,
3322
- accessToken = '',
3323
- clientId = '',
3324
- ): ApiResponse<CreateGuestStarSessionResponse, 200, 400 | 401 | 403> =>
3325
- this.callApi({
3216
+ ...request: CallApiOptions['request']
3217
+ ) =>
3218
+ this.callApi<CreateGuestStarSessionResponse, 200, 400 | 401 | 403>({
3326
3219
  path: '/guest_star/session',
3327
3220
  method: 'POST',
3328
3221
  params,
3329
- clientId,
3330
- accessToken,
3222
+ request,
3331
3223
  }),
3332
3224
  /**
3333
3225
  * BETA Programmatically ends a Guest Star session on behalf of the broadcaster. Performs the same action as if the host clicked the “End Call” button in the Guest Star UI.
@@ -3359,15 +3251,13 @@ export class TwitchApi {
3359
3251
  */
3360
3252
  endGuestStarSession: async (
3361
3253
  params: EndGuestStarSessionParams,
3362
- accessToken = '',
3363
- clientId = '',
3364
- ): ApiResponse<void, 204, 400 | 403> =>
3365
- this.callApi({
3254
+ ...request: CallApiOptions['request']
3255
+ ) =>
3256
+ this.callApi<void, 204, 400 | 403>({
3366
3257
  path: '/guest_star/session',
3367
3258
  method: 'DELETE',
3368
3259
  params,
3369
- clientId,
3370
- accessToken,
3260
+ request,
3371
3261
  }),
3372
3262
  /**
3373
3263
  * BETA Provides the caller with a list of pending invites to a Guest Star session, including the invitee’s ready status while joining the waiting room.
@@ -3394,14 +3284,12 @@ export class TwitchApi {
3394
3284
  */
3395
3285
  getGuestStarInvites: async (
3396
3286
  params: GetGuestStarInvitesParams,
3397
- accessToken = '',
3398
- clientId = '',
3399
- ): ApiResponse<GetGuestStarInvitesResponse, 200, 400> =>
3400
- this.callApi({
3287
+ ...request: CallApiOptions['request']
3288
+ ) =>
3289
+ this.callApi<GetGuestStarInvitesResponse, 200, 400>({
3401
3290
  path: '/guest_star/invites',
3402
3291
  params,
3403
- clientId,
3404
- accessToken,
3292
+ request,
3405
3293
  }),
3406
3294
  /**
3407
3295
  * BETA Sends an invite to a specified guest on behalf of the broadcaster for a Guest Star session in progress.
@@ -3436,15 +3324,13 @@ export class TwitchApi {
3436
3324
  */
3437
3325
  sendGuestStarInvite: async (
3438
3326
  params: SendGuestStarInviteParams,
3439
- accessToken = '',
3440
- clientId = '',
3441
- ): ApiResponse<void, 204, 400 | 403> =>
3442
- this.callApi({
3327
+ ...request: CallApiOptions['request']
3328
+ ) =>
3329
+ this.callApi<void, 204, 400 | 403>({
3443
3330
  path: '/guest_star/invites',
3444
3331
  method: 'POST',
3445
3332
  params,
3446
- clientId,
3447
- accessToken,
3333
+ request,
3448
3334
  }),
3449
3335
  /**
3450
3336
  * BETA Revokes a previously sent invite for a Guest Star session.
@@ -3477,15 +3363,13 @@ export class TwitchApi {
3477
3363
  */
3478
3364
  deleteGuestStarInvite: async (
3479
3365
  params: DeleteGuestStarInviteParams,
3480
- accessToken = '',
3481
- clientId = '',
3482
- ): ApiResponse<void, 204, 400 | 404> =>
3483
- this.callApi({
3366
+ ...request: CallApiOptions['request']
3367
+ ) =>
3368
+ this.callApi<void, 204, 400 | 404>({
3484
3369
  path: '/guest_star/invites',
3485
3370
  method: 'DELETE',
3486
3371
  params,
3487
- clientId,
3488
- accessToken,
3372
+ request,
3489
3373
  }),
3490
3374
  /**
3491
3375
  * BETA Allows a previously invited user to be assigned a slot within the active Guest Star session, once that guest has indicated they are ready to join.
@@ -3528,15 +3412,13 @@ export class TwitchApi {
3528
3412
  */
3529
3413
  assignGuestStarSlot: async (
3530
3414
  params: AssignGuestStarSlotParams,
3531
- accessToken = '',
3532
- clientId = '',
3533
- ): ApiResponse<void, 204, 400 | 401 | 403> =>
3534
- this.callApi({
3415
+ ...request: CallApiOptions['request']
3416
+ ) =>
3417
+ this.callApi<void, 204, 400 | 401 | 403>({
3535
3418
  path: '/guest_star/slot',
3536
3419
  method: 'POST',
3537
3420
  params,
3538
- clientId,
3539
- accessToken,
3421
+ request,
3540
3422
  }),
3541
3423
  /**
3542
3424
  * BETA Allows a user to update the assigned slot for a particular user within the active Guest Star session.
@@ -3566,15 +3448,13 @@ export class TwitchApi {
3566
3448
  */
3567
3449
  updateGuestStarSlot: async (
3568
3450
  params: UpdateGuestStarSlotParams,
3569
- accessToken = '',
3570
- clientId = '',
3571
- ): ApiResponse<void, 204, 400> =>
3572
- this.callApi({
3451
+ ...request: CallApiOptions['request']
3452
+ ) =>
3453
+ this.callApi<void, 204, 400>({
3573
3454
  path: '/guest_star/slot',
3574
3455
  method: 'PATCH',
3575
3456
  params,
3576
- clientId,
3577
- accessToken,
3457
+ request,
3578
3458
  }),
3579
3459
  /**
3580
3460
  * BETA Allows a caller to remove a slot assignment from a user participating in an active Guest Star session. This revokes their access to the session immediately and disables their access to publish or subscribe to media within the session.
@@ -3614,15 +3494,13 @@ export class TwitchApi {
3614
3494
  */
3615
3495
  deleteGuestStarSlot: async (
3616
3496
  params: DeleteGuestStarSlotParams,
3617
- accessToken = '',
3618
- clientId = '',
3619
- ): ApiResponse<void, 204, 400 | 403 | 404> =>
3620
- this.callApi({
3497
+ ...request: CallApiOptions['request']
3498
+ ) =>
3499
+ this.callApi<void, 204, 400 | 403 | 404>({
3621
3500
  path: '/guest_star/slot',
3622
3501
  method: 'DELETE',
3623
3502
  params,
3624
- clientId,
3625
- accessToken,
3503
+ request,
3626
3504
  }),
3627
3505
  /**
3628
3506
  * BETA Allows a user to update slot settings for a particular guest within a Guest Star session, such as allowing the user to share audio or video within the call as a host. These settings will be broadcasted to all subscribers which control their view of the guest in that slot. One or more of the optional parameters to this API can be specified at any time.
@@ -3658,15 +3536,13 @@ export class TwitchApi {
3658
3536
  */
3659
3537
  updateGuestStarSlotSettings: async (
3660
3538
  params: UpdateGuestStarSlotSettingsParams,
3661
- accessToken = '',
3662
- clientId = '',
3663
- ): ApiResponse<void, 204, 400 | 403> =>
3664
- this.callApi({
3539
+ ...request: CallApiOptions['request']
3540
+ ) =>
3541
+ this.callApi<void, 204, 400 | 403>({
3665
3542
  path: '/guest_star/slot_settings',
3666
3543
  method: 'PATCH',
3667
3544
  params,
3668
- clientId,
3669
- accessToken,
3545
+ request,
3670
3546
  }),
3671
3547
  };
3672
3548
  hypeTrain = {
@@ -3701,14 +3577,12 @@ export class TwitchApi {
3701
3577
  */
3702
3578
  getHypeTrainEvents: async (
3703
3579
  params: GetHypeTrainEventsParams,
3704
- accessToken = '',
3705
- clientId = '',
3706
- ): ApiResponse<GetHypeTrainEventsResponse, 200, 401> =>
3707
- this.callApi({
3580
+ ...request: CallApiOptions['request']
3581
+ ) =>
3582
+ this.callApi<GetHypeTrainEventsResponse, 200, 401>({
3708
3583
  path: '/hypetrain/events',
3709
3584
  params,
3710
- clientId,
3711
- accessToken,
3585
+ request,
3712
3586
  }),
3713
3587
  };
3714
3588
  moderation = {
@@ -3769,16 +3643,14 @@ export class TwitchApi {
3769
3643
  checkAutoModStatus: async (
3770
3644
  params: CheckAutoModStatusParams,
3771
3645
  body: CheckAutoModStatusBody,
3772
- accessToken = '',
3773
- clientId = '',
3774
- ): ApiResponse<CheckAutoModStatusResponse, 200, 400 | 401 | 403 | 429> =>
3775
- this.callApi({
3646
+ ...request: CallApiOptions['request']
3647
+ ) =>
3648
+ this.callApi<CheckAutoModStatusResponse, 200, 400 | 401 | 403 | 429>({
3776
3649
  path: '/moderation/enforcements/status',
3777
3650
  method: 'POST',
3778
3651
  params,
3779
3652
  body,
3780
- clientId,
3781
- accessToken,
3653
+ request,
3782
3654
  }),
3783
3655
  /**
3784
3656
  * Allow or deny the message that AutoMod flagged for review. For information about AutoMod, see [How to Use AutoMod](https://help.twitch.tv/s/article/how-to-use-automod).
@@ -3826,15 +3698,13 @@ export class TwitchApi {
3826
3698
  */
3827
3699
  manageHeldAutoModMessages: async (
3828
3700
  body: ManageHeldAutoModMessagesBody,
3829
- accessToken = '',
3830
- clientId = '',
3831
- ): ApiResponse<void, 204, 400 | 401 | 403 | 404> =>
3832
- this.callApi({
3701
+ ...request: CallApiOptions['request']
3702
+ ) =>
3703
+ this.callApi<void, 204, 400 | 401 | 403 | 404>({
3833
3704
  path: '/moderation/automod/message',
3834
3705
  method: 'POST',
3835
3706
  body,
3836
- clientId,
3837
- accessToken,
3707
+ request,
3838
3708
  }),
3839
3709
  /**
3840
3710
  * Gets the broadcaster’s AutoMod settings. The settings are used to automatically block inappropriate or harassing messages from appearing in the broadcaster’s chat room.
@@ -3874,14 +3744,12 @@ export class TwitchApi {
3874
3744
  */
3875
3745
  getAutoModSettings: async (
3876
3746
  params: GetAutoModSettingsParams,
3877
- accessToken = '',
3878
- clientId = '',
3879
- ): ApiResponse<GetAutoModSettingsResponse, 200, 400 | 401 | 403> =>
3880
- this.callApi({
3747
+ ...request: CallApiOptions['request']
3748
+ ) =>
3749
+ this.callApi<GetAutoModSettingsResponse, 200, 400 | 401 | 403>({
3881
3750
  path: '/moderation/automod/settings',
3882
3751
  params,
3883
- clientId,
3884
- accessToken,
3752
+ request,
3885
3753
  }),
3886
3754
  /**
3887
3755
  * Updates the broadcaster’s AutoMod settings. The settings are used to automatically block inappropriate or harassing messages from appearing in the broadcaster’s chat room.
@@ -3938,16 +3806,14 @@ export class TwitchApi {
3938
3806
  updateAutoModSettings: async (
3939
3807
  params: UpdateAutoModSettingsParams,
3940
3808
  body: UpdateAutoModSettingsBody | null | undefined = null,
3941
- accessToken = '',
3942
- clientId = '',
3943
- ): ApiResponse<UpdateAutoModSettingsResponse, 200, 400 | 401 | 403> =>
3944
- this.callApi({
3809
+ ...request: CallApiOptions['request']
3810
+ ) =>
3811
+ this.callApi<UpdateAutoModSettingsResponse, 200, 400 | 401 | 403>({
3945
3812
  path: '/moderation/automod/settings',
3946
3813
  method: 'PUT',
3947
3814
  params,
3948
3815
  body,
3949
- clientId,
3950
- accessToken,
3816
+ request,
3951
3817
  }),
3952
3818
  /**
3953
3819
  * Gets all users that the broadcaster banned or put in a timeout.
@@ -3982,14 +3848,12 @@ export class TwitchApi {
3982
3848
  */
3983
3849
  getBannedUsers: async (
3984
3850
  params: GetBannedUsersParams,
3985
- accessToken = '',
3986
- clientId = '',
3987
- ): ApiResponse<GetBannedUsersResponse, 200, 400 | 401> =>
3988
- this.callApi({
3851
+ ...request: CallApiOptions['request']
3852
+ ) =>
3853
+ this.callApi<GetBannedUsersResponse, 200, 400 | 401>({
3989
3854
  path: '/moderation/banned',
3990
3855
  params,
3991
- clientId,
3992
- accessToken,
3856
+ request,
3993
3857
  }),
3994
3858
  /**
3995
3859
  * Bans a user from participating in the specified broadcaster’s chat room or puts them in a timeout.
@@ -4050,16 +3914,14 @@ export class TwitchApi {
4050
3914
  banUser: async (
4051
3915
  params: BanUserParams,
4052
3916
  body: BanUserBody,
4053
- accessToken = '',
4054
- clientId = '',
4055
- ): ApiResponse<BanUserResponse, 200, 400 | 401 | 403 | 409 | 429> =>
4056
- this.callApi({
3917
+ ...request: CallApiOptions['request']
3918
+ ) =>
3919
+ this.callApi<BanUserResponse, 200, 400 | 401 | 403 | 409 | 429>({
4057
3920
  path: '/moderation/bans',
4058
3921
  method: 'POST',
4059
3922
  params,
4060
3923
  body,
4061
- clientId,
4062
- accessToken,
3924
+ request,
4063
3925
  }),
4064
3926
  /**
4065
3927
  * Removes the ban or timeout that was placed on the specified user.
@@ -4111,15 +3973,13 @@ export class TwitchApi {
4111
3973
  */
4112
3974
  unbanUser: async (
4113
3975
  params: UnbanUserParams,
4114
- accessToken = '',
4115
- clientId = '',
4116
- ): ApiResponse<void, 204, 400 | 401 | 403 | 409 | 429> =>
4117
- this.callApi({
3976
+ ...request: CallApiOptions['request']
3977
+ ) =>
3978
+ this.callApi<void, 204, 400 | 401 | 403 | 409 | 429>({
4118
3979
  path: '/moderation/bans',
4119
3980
  method: 'DELETE',
4120
3981
  params,
4121
- clientId,
4122
- accessToken,
3982
+ request,
4123
3983
  }),
4124
3984
  /**
4125
3985
  * Gets the broadcaster’s list of non-private, blocked words or phrases. These are the terms that the broadcaster or moderator added manually or that were denied by AutoMod.
@@ -4159,14 +4019,12 @@ export class TwitchApi {
4159
4019
  */
4160
4020
  getBlockedTerms: async (
4161
4021
  params: GetBlockedTermsParams,
4162
- accessToken = '',
4163
- clientId = '',
4164
- ): ApiResponse<GetBlockedTermsResponse, 200, 400 | 401 | 403> =>
4165
- this.callApi({
4022
+ ...request: CallApiOptions['request']
4023
+ ) =>
4024
+ this.callApi<GetBlockedTermsResponse, 200, 400 | 401 | 403>({
4166
4025
  path: '/moderation/blocked_terms',
4167
4026
  params,
4168
- clientId,
4169
- accessToken,
4027
+ request,
4170
4028
  }),
4171
4029
  /**
4172
4030
  * Adds a word or phrase to the broadcaster’s list of blocked terms. These are the terms that the broadcaster doesn’t want used in their chat room.
@@ -4209,16 +4067,14 @@ export class TwitchApi {
4209
4067
  addBlockedTerm: async (
4210
4068
  params: AddBlockedTermParams,
4211
4069
  body: AddBlockedTermBody,
4212
- accessToken = '',
4213
- clientId = '',
4214
- ): ApiResponse<AddBlockedTermResponse, 200, 400 | 401 | 403> =>
4215
- this.callApi({
4070
+ ...request: CallApiOptions['request']
4071
+ ) =>
4072
+ this.callApi<AddBlockedTermResponse, 200, 400 | 401 | 403>({
4216
4073
  path: '/moderation/blocked_terms',
4217
4074
  method: 'POST',
4218
4075
  params,
4219
4076
  body,
4220
- clientId,
4221
- accessToken,
4077
+ request,
4222
4078
  }),
4223
4079
  /**
4224
4080
  * Removes the word or phrase from the broadcaster’s list of blocked terms.
@@ -4259,15 +4115,13 @@ export class TwitchApi {
4259
4115
  */
4260
4116
  removeBlockedTerm: async (
4261
4117
  params: RemoveBlockedTermParams,
4262
- accessToken = '',
4263
- clientId = '',
4264
- ): ApiResponse<void, 204, 400 | 401 | 403> =>
4265
- this.callApi({
4118
+ ...request: CallApiOptions['request']
4119
+ ) =>
4120
+ this.callApi<void, 204, 400 | 401 | 403>({
4266
4121
  path: '/moderation/blocked_terms',
4267
4122
  method: 'DELETE',
4268
4123
  params,
4269
- clientId,
4270
- accessToken,
4124
+ request,
4271
4125
  }),
4272
4126
  /**
4273
4127
  * Removes a single chat message or all chat messages from the broadcaster’s chat room.
@@ -4311,15 +4165,13 @@ export class TwitchApi {
4311
4165
  */
4312
4166
  deleteChatMessages: async (
4313
4167
  params: DeleteChatMessagesParams,
4314
- accessToken = '',
4315
- clientId = '',
4316
- ): ApiResponse<void, 204, 400 | 401 | 403 | 404> =>
4317
- this.callApi({
4168
+ ...request: CallApiOptions['request']
4169
+ ) =>
4170
+ this.callApi<void, 204, 400 | 401 | 403 | 404>({
4318
4171
  path: '/moderation/chat',
4319
4172
  method: 'DELETE',
4320
4173
  params,
4321
- clientId,
4322
- accessToken,
4174
+ request,
4323
4175
  }),
4324
4176
  /**
4325
4177
  * BETA Gets a list of channels that the specified user has moderator privileges in.
@@ -4349,14 +4201,12 @@ export class TwitchApi {
4349
4201
  */
4350
4202
  getModeratedChannels: async (
4351
4203
  params: GetModeratedChannelsParams,
4352
- accessToken = '',
4353
- clientId = '',
4354
- ): ApiResponse<GetModeratedChannelsResponse, 200, 400 | 401 | 500> =>
4355
- this.callApi({
4204
+ ...request: CallApiOptions['request']
4205
+ ) =>
4206
+ this.callApi<GetModeratedChannelsResponse, 200, 400 | 401 | 500>({
4356
4207
  path: '/moderation/channels',
4357
4208
  params,
4358
- clientId,
4359
- accessToken,
4209
+ request,
4360
4210
  }),
4361
4211
  /**
4362
4212
  * Gets all users allowed to moderate the broadcaster’s chat room.
@@ -4391,14 +4241,12 @@ export class TwitchApi {
4391
4241
  */
4392
4242
  getModerators: async (
4393
4243
  params: GetModeratorsParams,
4394
- accessToken = '',
4395
- clientId = '',
4396
- ): ApiResponse<GetModeratorsResponse, 200, 400 | 401> =>
4397
- this.callApi({
4244
+ ...request: CallApiOptions['request']
4245
+ ) =>
4246
+ this.callApi<GetModeratorsResponse, 200, 400 | 401>({
4398
4247
  path: '/moderation/moderators',
4399
4248
  params,
4400
- clientId,
4401
- accessToken,
4249
+ request,
4402
4250
  }),
4403
4251
  /**
4404
4252
  * Adds a moderator to the broadcaster’s chat room.
@@ -4446,15 +4294,13 @@ export class TwitchApi {
4446
4294
  */
4447
4295
  addChannelModerator: async (
4448
4296
  params: AddChannelModeratorParams,
4449
- accessToken = '',
4450
- clientId = '',
4451
- ): ApiResponse<void, 204, 400 | 401 | 422 | 429> =>
4452
- this.callApi({
4297
+ ...request: CallApiOptions['request']
4298
+ ) =>
4299
+ this.callApi<void, 204, 400 | 401 | 422 | 429>({
4453
4300
  path: '/moderation/moderators',
4454
4301
  method: 'POST',
4455
4302
  params,
4456
- clientId,
4457
- accessToken,
4303
+ request,
4458
4304
  }),
4459
4305
  /**
4460
4306
  * Removes a moderator from the broadcaster’s chat room.
@@ -4497,15 +4343,13 @@ export class TwitchApi {
4497
4343
  */
4498
4344
  removeChannelModerator: async (
4499
4345
  params: RemoveChannelModeratorParams,
4500
- accessToken = '',
4501
- clientId = '',
4502
- ): ApiResponse<void, 204, 400 | 401 | 429> =>
4503
- this.callApi({
4346
+ ...request: CallApiOptions['request']
4347
+ ) =>
4348
+ this.callApi<void, 204, 400 | 401 | 429>({
4504
4349
  path: '/moderation/moderators',
4505
4350
  method: 'DELETE',
4506
4351
  params,
4507
- clientId,
4508
- accessToken,
4352
+ request,
4509
4353
  }),
4510
4354
  /**
4511
4355
  * Gets a list of the broadcaster’s VIPs.
@@ -4542,14 +4386,12 @@ export class TwitchApi {
4542
4386
  */
4543
4387
  getVIPs: async (
4544
4388
  params: GetVIPsParams,
4545
- accessToken = '',
4546
- clientId = '',
4547
- ): ApiResponse<GetVIPsResponse, 200, 400 | 401> =>
4548
- this.callApi({
4389
+ ...request: CallApiOptions['request']
4390
+ ) =>
4391
+ this.callApi<GetVIPsResponse, 200, 400 | 401>({
4549
4392
  path: '/channels/vips',
4550
4393
  params,
4551
- clientId,
4552
- accessToken,
4394
+ request,
4553
4395
  }),
4554
4396
  /**
4555
4397
  * Adds the specified user as a VIP in the broadcaster’s channel.
@@ -4614,15 +4456,13 @@ export class TwitchApi {
4614
4456
  */
4615
4457
  addChannelVIP: async (
4616
4458
  params: AddChannelVIPParams,
4617
- accessToken = '',
4618
- clientId = '',
4619
- ): ApiResponse<void, 204, 400 | 401 | 403 | 404 | 409 | 422 | 425 | 429> =>
4620
- this.callApi({
4459
+ ...request: CallApiOptions['request']
4460
+ ) =>
4461
+ this.callApi<void, 204, 400 | 401 | 403 | 404 | 409 | 422 | 425 | 429>({
4621
4462
  path: '/channels/vips',
4622
4463
  method: 'POST',
4623
4464
  params,
4624
- clientId,
4625
- accessToken,
4465
+ request,
4626
4466
  }),
4627
4467
  /**
4628
4468
  * Removes the specified user as a VIP in the broadcaster’s channel.
@@ -4679,15 +4519,13 @@ export class TwitchApi {
4679
4519
  */
4680
4520
  removeChannelVIP: async (
4681
4521
  params: RemoveChannelVIPParams,
4682
- accessToken = '',
4683
- clientId = '',
4684
- ): ApiResponse<void, 204, 400 | 401 | 403 | 404 | 422 | 429> =>
4685
- this.callApi({
4522
+ ...request: CallApiOptions['request']
4523
+ ) =>
4524
+ this.callApi<void, 204, 400 | 401 | 403 | 404 | 422 | 429>({
4686
4525
  path: '/channels/vips',
4687
4526
  method: 'DELETE',
4688
4527
  params,
4689
- clientId,
4690
- accessToken,
4528
+ request,
4691
4529
  }),
4692
4530
  /**
4693
4531
  * Activates or deactivates the broadcaster’s Shield Mode.
@@ -4732,16 +4570,14 @@ export class TwitchApi {
4732
4570
  updateShieldModeStatus: async (
4733
4571
  params: UpdateShieldModeStatusParams,
4734
4572
  body: UpdateShieldModeStatusBody,
4735
- accessToken = '',
4736
- clientId = '',
4737
- ): ApiResponse<UpdateShieldModeStatusResponse, 200, 400 | 401 | 403> =>
4738
- this.callApi({
4573
+ ...request: CallApiOptions['request']
4574
+ ) =>
4575
+ this.callApi<UpdateShieldModeStatusResponse, 200, 400 | 401 | 403>({
4739
4576
  path: '/moderation/shield_mode',
4740
4577
  method: 'PUT',
4741
4578
  params,
4742
4579
  body,
4743
- clientId,
4744
- accessToken,
4580
+ request,
4745
4581
  }),
4746
4582
  /**
4747
4583
  * Gets the broadcaster’s Shield Mode activation status.
@@ -4783,14 +4619,12 @@ export class TwitchApi {
4783
4619
  */
4784
4620
  getShieldModeStatus: async (
4785
4621
  params: GetShieldModeStatusParams,
4786
- accessToken = '',
4787
- clientId = '',
4788
- ): ApiResponse<GetShieldModeStatusResponse, 200, 400 | 401 | 403> =>
4789
- this.callApi({
4622
+ ...request: CallApiOptions['request']
4623
+ ) =>
4624
+ this.callApi<GetShieldModeStatusResponse, 200, 400 | 401 | 403>({
4790
4625
  path: '/moderation/shield_mode',
4791
4626
  params,
4792
- clientId,
4793
- accessToken,
4627
+ request,
4794
4628
  }),
4795
4629
  };
4796
4630
  polls = {
@@ -4833,14 +4667,12 @@ export class TwitchApi {
4833
4667
  */
4834
4668
  getPolls: async (
4835
4669
  params: GetPollsParams,
4836
- accessToken = '',
4837
- clientId = '',
4838
- ): ApiResponse<GetPollsResponse, 200, 400 | 401 | 404> =>
4839
- this.callApi({
4670
+ ...request: CallApiOptions['request']
4671
+ ) =>
4672
+ this.callApi<GetPollsResponse, 200, 400 | 401 | 404>({
4840
4673
  path: '/polls',
4841
4674
  params,
4842
- clientId,
4843
- accessToken,
4675
+ request,
4844
4676
  }),
4845
4677
  /**
4846
4678
  * Creates a poll that viewers in the broadcaster’s channel can vote on.
@@ -4888,15 +4720,13 @@ export class TwitchApi {
4888
4720
  */
4889
4721
  createPoll: async (
4890
4722
  body: CreatePollBody,
4891
- accessToken = '',
4892
- clientId = '',
4893
- ): ApiResponse<CreatePollResponse, 200, 400 | 401> =>
4894
- this.callApi({
4723
+ ...request: CallApiOptions['request']
4724
+ ) =>
4725
+ this.callApi<CreatePollResponse, 200, 400 | 401>({
4895
4726
  path: '/polls',
4896
4727
  method: 'POST',
4897
4728
  body,
4898
- clientId,
4899
- accessToken,
4729
+ request,
4900
4730
  }),
4901
4731
  /**
4902
4732
  * Ends an active poll. You have the option to end it or end it and archive it.
@@ -4935,15 +4765,13 @@ export class TwitchApi {
4935
4765
  */
4936
4766
  endPoll: async (
4937
4767
  body: EndPollBody,
4938
- accessToken = '',
4939
- clientId = '',
4940
- ): ApiResponse<EndPollResponse, 200, 400 | 401> =>
4941
- this.callApi({
4768
+ ...request: CallApiOptions['request']
4769
+ ) =>
4770
+ this.callApi<EndPollResponse, 200, 400 | 401>({
4942
4771
  path: '/polls',
4943
4772
  method: 'PATCH',
4944
4773
  body,
4945
- clientId,
4946
- accessToken,
4774
+ request,
4947
4775
  }),
4948
4776
  };
4949
4777
  predictions = {
@@ -4980,14 +4808,12 @@ export class TwitchApi {
4980
4808
  */
4981
4809
  getPredictions: async (
4982
4810
  params: GetPredictionsParams,
4983
- accessToken = '',
4984
- clientId = '',
4985
- ): ApiResponse<GetPredictionsResponse, 200, 400 | 401> =>
4986
- this.callApi({
4811
+ ...request: CallApiOptions['request']
4812
+ ) =>
4813
+ this.callApi<GetPredictionsResponse, 200, 400 | 401>({
4987
4814
  path: '/predictions',
4988
4815
  params,
4989
- clientId,
4990
- accessToken,
4816
+ request,
4991
4817
  }),
4992
4818
  /**
4993
4819
  * Creates a Channel Points Prediction.
@@ -5035,15 +4861,13 @@ export class TwitchApi {
5035
4861
  */
5036
4862
  createPrediction: async (
5037
4863
  body: CreatePredictionBody,
5038
- accessToken = '',
5039
- clientId = '',
5040
- ): ApiResponse<CreatePredictionResponse, 200, 400 | 401 | 429> =>
5041
- this.callApi({
4864
+ ...request: CallApiOptions['request']
4865
+ ) =>
4866
+ this.callApi<CreatePredictionResponse, 200, 400 | 401 | 429>({
5042
4867
  path: '/predictions',
5043
4868
  method: 'POST',
5044
4869
  body,
5045
- clientId,
5046
- accessToken,
4870
+ request,
5047
4871
  }),
5048
4872
  /**
5049
4873
  * Locks, resolves, or cancels a Channel Points Prediction.
@@ -5089,15 +4913,13 @@ export class TwitchApi {
5089
4913
  */
5090
4914
  endPrediction: async (
5091
4915
  body: EndPredictionBody,
5092
- accessToken = '',
5093
- clientId = '',
5094
- ): ApiResponse<EndPredictionResponse, 200, 400 | 401 | 404> =>
5095
- this.callApi({
4916
+ ...request: CallApiOptions['request']
4917
+ ) =>
4918
+ this.callApi<EndPredictionResponse, 200, 400 | 401 | 404>({
5096
4919
  path: '/predictions',
5097
4920
  method: 'PATCH',
5098
4921
  body,
5099
- clientId,
5100
- accessToken,
4922
+ request,
5101
4923
  }),
5102
4924
  };
5103
4925
  raids = {
@@ -5159,15 +4981,13 @@ export class TwitchApi {
5159
4981
  */
5160
4982
  startRaid: async (
5161
4983
  params: StartRaidParams | null | undefined = null,
5162
- accessToken = '',
5163
- clientId = '',
5164
- ): ApiResponse<StartRaidResponse, 200, 400 | 401 | 404 | 409 | 429> =>
5165
- this.callApi({
4984
+ ...request: CallApiOptions['request']
4985
+ ) =>
4986
+ this.callApi<StartRaidResponse, 200, 400 | 401 | 404 | 409 | 429>({
5166
4987
  path: '/raids',
5167
4988
  method: 'POST',
5168
4989
  params,
5169
- clientId,
5170
- accessToken,
4990
+ request,
5171
4991
  }),
5172
4992
  /**
5173
4993
  * Cancel a pending raid.
@@ -5214,15 +5034,13 @@ export class TwitchApi {
5214
5034
  */
5215
5035
  cancelRaid: async (
5216
5036
  params: CancelRaidParams,
5217
- accessToken = '',
5218
- clientId = '',
5219
- ): ApiResponse<void, 204, 400 | 401 | 404 | 429> =>
5220
- this.callApi({
5037
+ ...request: CallApiOptions['request']
5038
+ ) =>
5039
+ this.callApi<void, 204, 400 | 401 | 404 | 429>({
5221
5040
  path: '/raids',
5222
5041
  method: 'DELETE',
5223
5042
  params,
5224
- clientId,
5225
- accessToken,
5043
+ request,
5226
5044
  }),
5227
5045
  };
5228
5046
  schedule = {
@@ -5268,14 +5086,12 @@ export class TwitchApi {
5268
5086
  */
5269
5087
  getChannelStreamSchedule: async (
5270
5088
  params: GetChannelStreamScheduleParams,
5271
- accessToken = '',
5272
- clientId = '',
5273
- ): ApiResponse<GetChannelStreamScheduleResponse, 200, 400 | 401 | 403 | 404> =>
5274
- this.callApi({
5089
+ ...request: CallApiOptions['request']
5090
+ ) =>
5091
+ this.callApi<GetChannelStreamScheduleResponse, 200, 400 | 401 | 403 | 404>({
5275
5092
  path: '/schedule',
5276
5093
  params,
5277
- clientId,
5278
- accessToken,
5094
+ request,
5279
5095
  }),
5280
5096
  /**
5281
5097
  * Gets the broadcaster’s streaming schedule as an [iCalendar](https://datatracker.ietf.org/doc/html/rfc5545).
@@ -5309,14 +5125,12 @@ export class TwitchApi {
5309
5125
  */
5310
5126
  getChannelICalendar: async (
5311
5127
  params: GetChannelICalendarParams,
5312
- accessToken = '',
5313
- clientId = '',
5314
- ): ApiResponse<string, 200, 400> =>
5315
- this.callApi({
5128
+ ...request: CallApiOptions['request']
5129
+ ) =>
5130
+ this.callApi<string, 200, 400>({
5316
5131
  path: '/schedule/icalendar',
5317
5132
  params,
5318
- clientId,
5319
- accessToken,
5133
+ request,
5320
5134
  }),
5321
5135
  /**
5322
5136
  * Updates the broadcaster’s schedule settings, such as scheduling a vacation.
@@ -5359,15 +5173,13 @@ export class TwitchApi {
5359
5173
  */
5360
5174
  updateChannelStreamSchedule: async (
5361
5175
  params: UpdateChannelStreamScheduleParams,
5362
- accessToken = '',
5363
- clientId = '',
5364
- ): ApiResponse<void, 204, 400 | 401 | 404> =>
5365
- this.callApi({
5176
+ ...request: CallApiOptions['request']
5177
+ ) =>
5178
+ this.callApi<void, 204, 400 | 401 | 404>({
5366
5179
  path: '/schedule/settings',
5367
5180
  method: 'PATCH',
5368
5181
  params,
5369
- clientId,
5370
- accessToken,
5182
+ request,
5371
5183
  }),
5372
5184
  /**
5373
5185
  * Adds a single or recurring broadcast to the broadcaster’s streaming schedule. For information about scheduling broadcasts, see [Stream Schedule](https://help.twitch.tv/s/article/channel-page-setup#Schedule).
@@ -5413,16 +5225,14 @@ export class TwitchApi {
5413
5225
  createChannelStreamScheduleSegment: async (
5414
5226
  params: CreateChannelStreamScheduleSegmentParams,
5415
5227
  body: CreateChannelStreamScheduleSegmentBody,
5416
- accessToken = '',
5417
- clientId = '',
5418
- ): ApiResponse<CreateChannelStreamScheduleSegmentResponse, 200, 400 | 401 | 403> =>
5419
- this.callApi({
5228
+ ...request: CallApiOptions['request']
5229
+ ) =>
5230
+ this.callApi<CreateChannelStreamScheduleSegmentResponse, 200, 400 | 401 | 403>({
5420
5231
  path: '/schedule/segment',
5421
5232
  method: 'POST',
5422
5233
  params,
5423
5234
  body,
5424
- clientId,
5425
- accessToken,
5235
+ request,
5426
5236
  }),
5427
5237
  /**
5428
5238
  * Updates a scheduled broadcast segment.
@@ -5472,16 +5282,14 @@ export class TwitchApi {
5472
5282
  updateChannelStreamScheduleSegment: async (
5473
5283
  params: UpdateChannelStreamScheduleSegmentParams,
5474
5284
  body: UpdateChannelStreamScheduleSegmentBody | null | undefined = null,
5475
- accessToken = '',
5476
- clientId = '',
5477
- ): ApiResponse<UpdateChannelStreamScheduleSegmentResponse, 200, 400 | 401 | 404> =>
5478
- this.callApi({
5285
+ ...request: CallApiOptions['request']
5286
+ ) =>
5287
+ this.callApi<UpdateChannelStreamScheduleSegmentResponse, 200, 400 | 401 | 404>({
5479
5288
  path: '/schedule/segment',
5480
5289
  method: 'PATCH',
5481
5290
  params,
5482
5291
  body,
5483
- clientId,
5484
- accessToken,
5292
+ request,
5485
5293
  }),
5486
5294
  /**
5487
5295
  * Removes a broadcast segment from the broadcaster’s streaming schedule.
@@ -5521,15 +5329,13 @@ export class TwitchApi {
5521
5329
  */
5522
5330
  deleteChannelStreamScheduleSegment: async (
5523
5331
  params: DeleteChannelStreamScheduleSegmentParams,
5524
- accessToken = '',
5525
- clientId = '',
5526
- ): ApiResponse<void, 204, 400 | 401> =>
5527
- this.callApi({
5332
+ ...request: CallApiOptions['request']
5333
+ ) =>
5334
+ this.callApi<void, 204, 400 | 401>({
5528
5335
  path: '/schedule/segment',
5529
5336
  method: 'DELETE',
5530
5337
  params,
5531
- clientId,
5532
- accessToken,
5338
+ request,
5533
5339
  }),
5534
5340
  };
5535
5341
  search = {
@@ -5566,14 +5372,12 @@ export class TwitchApi {
5566
5372
  */
5567
5373
  searchCategories: async (
5568
5374
  params: SearchCategoriesParams,
5569
- accessToken = '',
5570
- clientId = '',
5571
- ): ApiResponse<SearchCategoriesResponse, 200, 400 | 401> =>
5572
- this.callApi({
5375
+ ...request: CallApiOptions['request']
5376
+ ) =>
5377
+ this.callApi<SearchCategoriesResponse, 200, 400 | 401>({
5573
5378
  path: '/search/categories',
5574
5379
  params,
5575
- clientId,
5576
- accessToken,
5380
+ request,
5577
5381
  }),
5578
5382
  /**
5579
5383
  * Gets the channels that match the specified query and have streamed content within the past 6 months.
@@ -5612,14 +5416,12 @@ export class TwitchApi {
5612
5416
  */
5613
5417
  searchChannels: async (
5614
5418
  params: SearchChannelsParams,
5615
- accessToken = '',
5616
- clientId = '',
5617
- ): ApiResponse<SearchChannelsResponse, 200, 400 | 401> =>
5618
- this.callApi({
5419
+ ...request: CallApiOptions['request']
5420
+ ) =>
5421
+ this.callApi<SearchChannelsResponse, 200, 400 | 401>({
5619
5422
  path: '/search/channels',
5620
5423
  params,
5621
- clientId,
5622
- accessToken,
5424
+ request,
5623
5425
  }),
5624
5426
  };
5625
5427
  streams = {
@@ -5657,14 +5459,12 @@ export class TwitchApi {
5657
5459
  */
5658
5460
  getStreamKey: async (
5659
5461
  params: GetStreamKeyParams,
5660
- accessToken = '',
5661
- clientId = '',
5662
- ): ApiResponse<GetStreamKeyResponse, 200, 400 | 401> =>
5663
- this.callApi({
5462
+ ...request: CallApiOptions['request']
5463
+ ) =>
5464
+ this.callApi<GetStreamKeyResponse, 200, 400 | 401>({
5664
5465
  path: '/streams/key',
5665
5466
  params,
5666
- clientId,
5667
- accessToken,
5467
+ request,
5668
5468
  }),
5669
5469
  /**
5670
5470
  * Gets a list of all streams. The list is in descending order by the number of viewers watching the stream. Because viewers come and go during a stream, it’s possible to find duplicate or missing streams in the list as you page through the results.
@@ -5697,14 +5497,12 @@ export class TwitchApi {
5697
5497
  */
5698
5498
  getStreams: async (
5699
5499
  params: GetStreamsParams | null | undefined = null,
5700
- accessToken = '',
5701
- clientId = '',
5702
- ): ApiResponse<GetStreamsResponse, 200, 400 | 401> =>
5703
- this.callApi({
5500
+ ...request: CallApiOptions['request']
5501
+ ) =>
5502
+ this.callApi<GetStreamsResponse, 200, 400 | 401>({
5704
5503
  path: '/streams',
5705
5504
  params,
5706
- clientId,
5707
- accessToken,
5505
+ request,
5708
5506
  }),
5709
5507
  /**
5710
5508
  * Gets the list of broadcasters that the user follows and that are streaming live.
@@ -5739,14 +5537,12 @@ export class TwitchApi {
5739
5537
  */
5740
5538
  getFollowedStreams: async (
5741
5539
  params: GetFollowedStreamsParams,
5742
- accessToken = '',
5743
- clientId = '',
5744
- ): ApiResponse<GetFollowedStreamsResponse, 200, 400 | 401> =>
5745
- this.callApi({
5540
+ ...request: CallApiOptions['request']
5541
+ ) =>
5542
+ this.callApi<GetFollowedStreamsResponse, 200, 400 | 401>({
5746
5543
  path: '/streams/followed',
5747
5544
  params,
5748
- clientId,
5749
- accessToken,
5545
+ request,
5750
5546
  }),
5751
5547
  /**
5752
5548
  * Adds a marker to a live stream. A marker is an arbitrary point in a live stream that the broadcaster or editor wants to mark, so they can return to that spot later to create video highlights (see Video Producer, Highlights in the Twitch UX).
@@ -5798,15 +5594,13 @@ export class TwitchApi {
5798
5594
  */
5799
5595
  createStreamMarker: async (
5800
5596
  body: CreateStreamMarkerBody,
5801
- accessToken = '',
5802
- clientId = '',
5803
- ): ApiResponse<CreateStreamMarkerResponse, 200, 400 | 401 | 403 | 404> =>
5804
- this.callApi({
5597
+ ...request: CallApiOptions['request']
5598
+ ) =>
5599
+ this.callApi<CreateStreamMarkerResponse, 200, 400 | 401 | 403 | 404>({
5805
5600
  path: '/streams/markers',
5806
5601
  method: 'POST',
5807
5602
  body,
5808
- clientId,
5809
- accessToken,
5603
+ request,
5810
5604
  }),
5811
5605
  /**
5812
5606
  * Gets a list of markers from the user’s most recent stream or from the specified VOD/video. A marker is an arbitrary point in a live stream that the broadcaster or editor marked, so they can return to that spot later to create video highlights (see Video Producer, Highlights in the Twitch UX).
@@ -5848,14 +5642,12 @@ export class TwitchApi {
5848
5642
  */
5849
5643
  getStreamMarkers: async (
5850
5644
  params: GetStreamMarkersParams | null | undefined = null,
5851
- accessToken = '',
5852
- clientId = '',
5853
- ): ApiResponse<GetStreamMarkersResponse, 200, 400 | 401 | 403 | 404> =>
5854
- this.callApi({
5645
+ ...request: CallApiOptions['request']
5646
+ ) =>
5647
+ this.callApi<GetStreamMarkersResponse, 200, 400 | 401 | 403 | 404>({
5855
5648
  path: '/streams/markers',
5856
5649
  params,
5857
- clientId,
5858
- accessToken,
5650
+ request,
5859
5651
  }),
5860
5652
  };
5861
5653
  subscriptions = {
@@ -5894,14 +5686,12 @@ export class TwitchApi {
5894
5686
  */
5895
5687
  getBroadcasterSubscriptions: async (
5896
5688
  params: GetBroadcasterSubscriptionsParams,
5897
- accessToken = '',
5898
- clientId = '',
5899
- ): ApiResponse<GetBroadcasterSubscriptionsResponse, 200, 400 | 401> =>
5900
- this.callApi({
5689
+ ...request: CallApiOptions['request']
5690
+ ) =>
5691
+ this.callApi<GetBroadcasterSubscriptionsResponse, 200, 400 | 401>({
5901
5692
  path: '/subscriptions',
5902
5693
  params,
5903
- clientId,
5904
- accessToken,
5694
+ request,
5905
5695
  }),
5906
5696
  /**
5907
5697
  * Checks whether the user subscribes to the broadcaster’s channel.
@@ -5943,14 +5733,12 @@ export class TwitchApi {
5943
5733
  */
5944
5734
  checkUserSubscription: async (
5945
5735
  params: CheckUserSubscriptionParams,
5946
- accessToken = '',
5947
- clientId = '',
5948
- ): ApiResponse<CheckUserSubscriptionResponse, 200, 400 | 401 | 404> =>
5949
- this.callApi({
5736
+ ...request: CallApiOptions['request']
5737
+ ) =>
5738
+ this.callApi<CheckUserSubscriptionResponse, 200, 400 | 401 | 404>({
5950
5739
  path: '/subscriptions/user',
5951
5740
  params,
5952
- clientId,
5953
- accessToken,
5741
+ request,
5954
5742
  }),
5955
5743
  };
5956
5744
  tags = {
@@ -5988,14 +5776,12 @@ export class TwitchApi {
5988
5776
  */
5989
5777
  getAllStreamTags: async (
5990
5778
  params: GetAllStreamTagsParams | null | undefined = null,
5991
- accessToken = '',
5992
- clientId = '',
5993
- ): ApiResponse<GetAllStreamTagsResponse, 200, 400 | 401> =>
5994
- this.callApi({
5779
+ ...request: CallApiOptions['request']
5780
+ ) =>
5781
+ this.callApi<GetAllStreamTagsResponse, 200, 400 | 401>({
5995
5782
  path: '/tags/streams',
5996
5783
  params,
5997
- clientId,
5998
- accessToken,
5784
+ request,
5999
5785
  }),
6000
5786
  /**
6001
5787
  * **IMPORTANT** Twitch is moving from Twitch-defined tags to channel-defined tags. **IMPORTANT** As of February 28, 2023, this endpoint returns an empty array. On July 13, 2023, it will return a 410 response. If you use this endpoint, please update your code to use [Get Channel Information](https://dev.twitch.tv/docs/api/reference#get-channel-information).
@@ -6031,14 +5817,12 @@ export class TwitchApi {
6031
5817
  */
6032
5818
  getStreamTags: async (
6033
5819
  params: GetStreamTagsParams,
6034
- accessToken = '',
6035
- clientId = '',
6036
- ): ApiResponse<GetStreamTagsResponse, 200, 400 | 401> =>
6037
- this.callApi({
5820
+ ...request: CallApiOptions['request']
5821
+ ) =>
5822
+ this.callApi<GetStreamTagsResponse, 200, 400 | 401>({
6038
5823
  path: '/streams/tags',
6039
5824
  params,
6040
- clientId,
6041
- accessToken,
5825
+ request,
6042
5826
  }),
6043
5827
  };
6044
5828
  teams = {
@@ -6077,14 +5861,12 @@ export class TwitchApi {
6077
5861
  */
6078
5862
  getChannelTeams: async (
6079
5863
  params: GetChannelTeamsParams,
6080
- accessToken = '',
6081
- clientId = '',
6082
- ): ApiResponse<GetChannelTeamsResponse, 200, 400 | 401 | 404> =>
6083
- this.callApi({
5864
+ ...request: CallApiOptions['request']
5865
+ ) =>
5866
+ this.callApi<GetChannelTeamsResponse, 200, 400 | 401 | 404>({
6084
5867
  path: '/teams/channel',
6085
5868
  params,
6086
- clientId,
6087
- accessToken,
5869
+ request,
6088
5870
  }),
6089
5871
  /**
6090
5872
  * Gets information about the specified Twitch team. [Read More](https://help.twitch.tv/s/article/twitch-teams)
@@ -6123,14 +5905,12 @@ export class TwitchApi {
6123
5905
  */
6124
5906
  getTeams: async (
6125
5907
  params: GetTeamsParams | null | undefined = null,
6126
- accessToken = '',
6127
- clientId = '',
6128
- ): ApiResponse<GetTeamsResponse, 200, 400 | 401 | 404> =>
6129
- this.callApi({
5908
+ ...request: CallApiOptions['request']
5909
+ ) =>
5910
+ this.callApi<GetTeamsResponse, 200, 400 | 401 | 404>({
6130
5911
  path: '/teams',
6131
5912
  params,
6132
- clientId,
6133
- accessToken,
5913
+ request,
6134
5914
  }),
6135
5915
  };
6136
5916
  users = {
@@ -6172,14 +5952,12 @@ export class TwitchApi {
6172
5952
  */
6173
5953
  getUsers: async (
6174
5954
  params: GetUsersParams | null | undefined = null,
6175
- accessToken = '',
6176
- clientId = '',
6177
- ): ApiResponse<GetUsersResponse, 200, 400 | 401> =>
6178
- this.callApi({
5955
+ ...request: CallApiOptions['request']
5956
+ ) =>
5957
+ this.callApi<GetUsersResponse, 200, 400 | 401>({
6179
5958
  path: '/users',
6180
5959
  params,
6181
- clientId,
6182
- accessToken,
5960
+ request,
6183
5961
  }),
6184
5962
  /**
6185
5963
  * Updates the specified user’s information. The user ID in the OAuth token identifies the user whose information you want to update.
@@ -6215,15 +5993,13 @@ export class TwitchApi {
6215
5993
  */
6216
5994
  updateUser: async (
6217
5995
  params: UpdateUserParams | null | undefined = null,
6218
- accessToken = '',
6219
- clientId = '',
6220
- ): ApiResponse<UpdateUserResponse, 200, 400 | 401> =>
6221
- this.callApi({
5996
+ ...request: CallApiOptions['request']
5997
+ ) =>
5998
+ this.callApi<UpdateUserResponse, 200, 400 | 401>({
6222
5999
  path: '/users',
6223
6000
  method: 'PUT',
6224
6001
  params,
6225
- clientId,
6226
- accessToken,
6002
+ request,
6227
6003
  }),
6228
6004
  /**
6229
6005
  * Gets the list of users that the broadcaster has blocked. [Read More](https://help.twitch.tv/s/article/how-to-manage-harassment-in-chat?language=en%5FUS#BlockWhispersandMessagesfromStrangers)
@@ -6258,14 +6034,12 @@ export class TwitchApi {
6258
6034
  */
6259
6035
  getUserBlockList: async (
6260
6036
  params: GetUserBlockListParams,
6261
- accessToken = '',
6262
- clientId = '',
6263
- ): ApiResponse<GetUserBlockListResponse, 200, 400 | 401> =>
6264
- this.callApi({
6037
+ ...request: CallApiOptions['request']
6038
+ ) =>
6039
+ this.callApi<GetUserBlockListResponse, 200, 400 | 401>({
6265
6040
  path: '/users/blocks',
6266
6041
  params,
6267
- clientId,
6268
- accessToken,
6042
+ request,
6269
6043
  }),
6270
6044
  /**
6271
6045
  * Blocks the specified user from interacting with or having contact with the broadcaster. The user ID in the OAuth token identifies the broadcaster who is blocking the user.
@@ -6304,15 +6078,13 @@ export class TwitchApi {
6304
6078
  */
6305
6079
  blockUser: async (
6306
6080
  params: BlockUserParams,
6307
- accessToken = '',
6308
- clientId = '',
6309
- ): ApiResponse<void, 204, 400 | 401> =>
6310
- this.callApi({
6081
+ ...request: CallApiOptions['request']
6082
+ ) =>
6083
+ this.callApi<void, 204, 400 | 401>({
6311
6084
  path: '/users/blocks',
6312
6085
  method: 'PUT',
6313
6086
  params,
6314
- clientId,
6315
- accessToken,
6087
+ request,
6316
6088
  }),
6317
6089
  /**
6318
6090
  * Removes the user from the broadcaster’s list of blocked users. The user ID in the OAuth token identifies the broadcaster who’s removing the block.
@@ -6346,15 +6118,13 @@ export class TwitchApi {
6346
6118
  */
6347
6119
  unblockUser: async (
6348
6120
  params: UnblockUserParams,
6349
- accessToken = '',
6350
- clientId = '',
6351
- ): ApiResponse<void, 204, 400 | 401> =>
6352
- this.callApi({
6121
+ ...request: CallApiOptions['request']
6122
+ ) =>
6123
+ this.callApi<void, 204, 400 | 401>({
6353
6124
  path: '/users/blocks',
6354
6125
  method: 'DELETE',
6355
6126
  params,
6356
- clientId,
6357
- accessToken,
6127
+ request,
6358
6128
  }),
6359
6129
  /**
6360
6130
  * Gets a list of all extensions (both active and inactive) that the broadcaster has installed. The user ID in the access token identifies the broadcaster.
@@ -6382,11 +6152,10 @@ export class TwitchApi {
6382
6152
  *
6383
6153
  * @see https://dev.twitch.tv/docs/api/reference#get-user-extensions
6384
6154
  */
6385
- getUserExtensions: async (accessToken = '', clientId = ''): ApiResponse<GetUserExtensionsResponse, 200, 401> =>
6386
- this.callApi({
6155
+ getUserExtensions: async (...request: CallApiOptions['request']) =>
6156
+ this.callApi<GetUserExtensionsResponse, 200, 401>({
6387
6157
  path: '/users/extensions/list',
6388
- clientId,
6389
- accessToken,
6158
+ request,
6390
6159
  }),
6391
6160
  /**
6392
6161
  * Gets the active extensions that the broadcaster has installed for each configuration.
@@ -6421,14 +6190,12 @@ export class TwitchApi {
6421
6190
  */
6422
6191
  getUserActiveExtensions: async (
6423
6192
  params: GetUserActiveExtensionsParams | null | undefined = null,
6424
- accessToken = '',
6425
- clientId = '',
6426
- ): ApiResponse<GetUserActiveExtensionsResponse, 200, 400 | 401> =>
6427
- this.callApi({
6193
+ ...request: CallApiOptions['request']
6194
+ ) =>
6195
+ this.callApi<GetUserActiveExtensionsResponse, 200, 400 | 401>({
6428
6196
  path: '/users/extensions',
6429
6197
  params,
6430
- clientId,
6431
- accessToken,
6198
+ request,
6432
6199
  }),
6433
6200
  /**
6434
6201
  * Updates an installed extension’s information. You can update the extension’s activation state, ID, and version number. The user ID in the access token identifies the broadcaster whose extensions you’re updating.
@@ -6468,15 +6235,13 @@ export class TwitchApi {
6468
6235
  */
6469
6236
  updateUserExtensions: async (
6470
6237
  body: UpdateUserExtensionsBody,
6471
- accessToken = '',
6472
- clientId = '',
6473
- ): ApiResponse<UpdateUserExtensionsResponse, 200, 400 | 401 | 404> =>
6474
- this.callApi({
6238
+ ...request: CallApiOptions['request']
6239
+ ) =>
6240
+ this.callApi<UpdateUserExtensionsResponse, 200, 400 | 401 | 404>({
6475
6241
  path: '/users/extensions',
6476
6242
  method: 'PUT',
6477
6243
  body,
6478
- clientId,
6479
- accessToken,
6244
+ request,
6480
6245
  }),
6481
6246
  };
6482
6247
  videos = {
@@ -6524,14 +6289,12 @@ export class TwitchApi {
6524
6289
  */
6525
6290
  getVideos: async (
6526
6291
  params: GetVideosParams | null | undefined = null,
6527
- accessToken = '',
6528
- clientId = '',
6529
- ): ApiResponse<GetVideosResponse, 200, 400 | 401 | 404> =>
6530
- this.callApi({
6292
+ ...request: CallApiOptions['request']
6293
+ ) =>
6294
+ this.callApi<GetVideosResponse, 200, 400 | 401 | 404>({
6531
6295
  path: '/videos',
6532
6296
  params,
6533
- clientId,
6534
- accessToken,
6297
+ request,
6535
6298
  }),
6536
6299
  /**
6537
6300
  * Deletes one or more videos. You may delete past broadcasts, highlights, or uploads.
@@ -6567,15 +6330,13 @@ export class TwitchApi {
6567
6330
  */
6568
6331
  deleteVideos: async (
6569
6332
  params: DeleteVideosParams,
6570
- accessToken = '',
6571
- clientId = '',
6572
- ): ApiResponse<DeleteVideosResponse, 200, 400 | 401> =>
6573
- this.callApi({
6333
+ ...request: CallApiOptions['request']
6334
+ ) =>
6335
+ this.callApi<DeleteVideosResponse, 200, 400 | 401>({
6574
6336
  path: '/videos',
6575
6337
  method: 'DELETE',
6576
6338
  params,
6577
- clientId,
6578
- accessToken,
6339
+ request,
6579
6340
  }),
6580
6341
  };
6581
6342
  whispers = {
@@ -6638,16 +6399,14 @@ export class TwitchApi {
6638
6399
  sendWhisper: async (
6639
6400
  params: SendWhisperParams,
6640
6401
  body: SendWhisperBody,
6641
- accessToken = '',
6642
- clientId = '',
6643
- ): ApiResponse<void, 204, 400 | 401 | 403 | 404 | 429> =>
6644
- this.callApi({
6402
+ ...request: CallApiOptions['request']
6403
+ ) =>
6404
+ this.callApi<void, 204, 400 | 401 | 403 | 404 | 429>({
6645
6405
  path: '/whispers',
6646
6406
  method: 'POST',
6647
6407
  params,
6648
6408
  body,
6649
- clientId,
6650
- accessToken,
6409
+ request,
6651
6410
  }),
6652
6411
  };
6653
6412
  }