ts-twitch-api 0.2.2 → 0.2.3
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.
- package/dist/index.cjs +9 -2
- package/dist/index.d.cts +290 -145
- package/dist/index.d.ts +290 -145
- package/dist/index.js +9 -2
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -73,10 +73,17 @@ var TwitchApi = class {
|
|
|
73
73
|
options.headers.set("Client-Id", clientId || this._clientId);
|
|
74
74
|
}
|
|
75
75
|
const response = await fetch(url, options);
|
|
76
|
+
const status = response.status;
|
|
77
|
+
let data = null;
|
|
78
|
+
if (status === 200 && path === "/schedule/icalendar") {
|
|
79
|
+
data = await response.text();
|
|
80
|
+
} else if (status !== 204) {
|
|
81
|
+
data = await response.json();
|
|
82
|
+
}
|
|
76
83
|
return {
|
|
77
84
|
ok: response.ok,
|
|
78
|
-
status
|
|
79
|
-
data
|
|
85
|
+
status,
|
|
86
|
+
data
|
|
80
87
|
};
|
|
81
88
|
}
|
|
82
89
|
ads = {
|
package/dist/index.d.cts
CHANGED
|
@@ -12264,7 +12264,61 @@ declare class TwitchApi {
|
|
|
12264
12264
|
date_range: {
|
|
12265
12265
|
started_at: string;
|
|
12266
12266
|
ended_at: string;
|
|
12267
|
-
};
|
|
12267
|
+
}; /**
|
|
12268
|
+
* Gets an organization’s list of entitlements that have been granted to a game, a user, or both.
|
|
12269
|
+
*
|
|
12270
|
+
* **NOTE:** Entitlements returned in the response body data are not guaranteed to be sorted by any field returned by the API. To retrieve **CLAIMED** or **FULFILLED** entitlements, use the `fulfillment_status` query parameter to filter results. To retrieve entitlements for a specific game, use the `game_id` query parameter to filter results.
|
|
12271
|
+
*
|
|
12272
|
+
* The following table identifies the request parameters that you may specify based on the type of access token used.
|
|
12273
|
+
*
|
|
12274
|
+
* | Access token type | Parameter | Description |
|
|
12275
|
+
* | - | - | - |
|
|
12276
|
+
* | App | None | If you don’t specify request parameters, the request returns all entitlements that your organization owns. |
|
|
12277
|
+
* | App | user_id | The request returns all entitlements for any game that the organization granted to the specified user. |
|
|
12278
|
+
* | App | user_id, game_id | The request returns all entitlements that the specified game granted to the specified user. |
|
|
12279
|
+
* | App | game_id | The request returns all entitlements that the specified game granted to all entitled users. |
|
|
12280
|
+
* | User | None | If you don’t specify request parameters, the request returns all entitlements for any game that the organization granted to the user identified in the access token. |
|
|
12281
|
+
* | User | user_id | Invalid. |
|
|
12282
|
+
* | User | user_id, game_id | Invalid. |
|
|
12283
|
+
* | User | game_id | The request returns all entitlements that the specified game granted to the user identified in the access token. |
|
|
12284
|
+
*
|
|
12285
|
+
*
|
|
12286
|
+
* __Authorization:__
|
|
12287
|
+
*
|
|
12288
|
+
* Requires an [app access token](https://dev.twitch.tv/docs/authentication#app-access-tokens) or [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens). The client ID in the access token must own the game.
|
|
12289
|
+
*
|
|
12290
|
+
* __URL:__
|
|
12291
|
+
*
|
|
12292
|
+
* `GET https://api.twitch.tv/helix/entitlements/drops`
|
|
12293
|
+
*
|
|
12294
|
+
* __Response Codes:__
|
|
12295
|
+
*
|
|
12296
|
+
* _200 OK_
|
|
12297
|
+
*
|
|
12298
|
+
* Successfully retrieved the entitlements.
|
|
12299
|
+
*
|
|
12300
|
+
* _400 Bad Request_
|
|
12301
|
+
*
|
|
12302
|
+
* * The value in the _fulfillment\_status_ query parameter is not valid.
|
|
12303
|
+
* * The ID in the _user\_id_ query parameter must match the user ID in the user access token.
|
|
12304
|
+
* * The client in the access token is not associated with a known organization.
|
|
12305
|
+
* * The owner of the client in the access token is not a member of the organization.
|
|
12306
|
+
*
|
|
12307
|
+
* _401 Unauthorized_
|
|
12308
|
+
*
|
|
12309
|
+
* * The ID in the Client-Id header must match the Client ID in the access token.
|
|
12310
|
+
* * The Authorization header is required and must specify an app access token or user access token.
|
|
12311
|
+
* * The access token is not valid.
|
|
12312
|
+
*
|
|
12313
|
+
* _403 Forbidden_
|
|
12314
|
+
*
|
|
12315
|
+
* * The organization associated with the client in the access token must own the game specified in the _game\_id_ query parameter.
|
|
12316
|
+
* * The organization associated with the client in the access token must own the entitlements specified in the _id_ query parameter.
|
|
12317
|
+
*
|
|
12318
|
+
* _500 Internal Server Error_
|
|
12319
|
+
*
|
|
12320
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-drops-entitlements
|
|
12321
|
+
*/
|
|
12268
12322
|
total: number;
|
|
12269
12323
|
};
|
|
12270
12324
|
} | {
|
|
@@ -12407,7 +12461,43 @@ declare class TwitchApi {
|
|
|
12407
12461
|
user_id: string;
|
|
12408
12462
|
user_login: string;
|
|
12409
12463
|
user_name: string;
|
|
12410
|
-
product_type: "BITS_IN_EXTENSION";
|
|
12464
|
+
product_type: "BITS_IN_EXTENSION"; /**
|
|
12465
|
+
* Gets the specified configuration segment from the specified extension.
|
|
12466
|
+
*
|
|
12467
|
+
* **Rate Limits**: You may retrieve each segment a maximum of 20 times per minute.
|
|
12468
|
+
*
|
|
12469
|
+
* __Authorization:__
|
|
12470
|
+
*
|
|
12471
|
+
* Requires a signed JSON Web Token (JWT) created by an Extension Backend Service (EBS). For signing requirements, see [Signing the JWT](https://dev.twitch.tv/docs/extensions/building/#signing-the-jwt). The signed JWT must include the `role`, `user_id`, and `exp` fields (see [JWT Schema](https://dev.twitch.tv/docs/extensions/reference/#jwt-schema)). The `role` field must be set to _external_.
|
|
12472
|
+
*
|
|
12473
|
+
* __URL:__
|
|
12474
|
+
*
|
|
12475
|
+
* `GET https://api.twitch.tv/helix/extensions/configurations`
|
|
12476
|
+
*
|
|
12477
|
+
* __Response Codes:__
|
|
12478
|
+
*
|
|
12479
|
+
* _200 OK_
|
|
12480
|
+
*
|
|
12481
|
+
* Successfully retrieved the configurations.
|
|
12482
|
+
*
|
|
12483
|
+
* _400 Bad Request_
|
|
12484
|
+
*
|
|
12485
|
+
* * The _extension\_id_ query parameter is required.
|
|
12486
|
+
* * The value in the _segment_ query parameter is not valid.
|
|
12487
|
+
* * The _broadcaster\_id_ query parameter is required if the _segment_ query parameter is set to broadcaster or developer.
|
|
12488
|
+
*
|
|
12489
|
+
* _401 Unauthorized_
|
|
12490
|
+
*
|
|
12491
|
+
* * The Authorization header is required and must specify a JWT token.
|
|
12492
|
+
* * The JWT token is not valid.
|
|
12493
|
+
* * The Client-Id header is required.
|
|
12494
|
+
*
|
|
12495
|
+
* _429 Too Many Requests_
|
|
12496
|
+
*
|
|
12497
|
+
* * The app exceeded the number of requests that it may make per minute. See Rate Limits above.
|
|
12498
|
+
*
|
|
12499
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-extension-configuration-segment
|
|
12500
|
+
*/
|
|
12411
12501
|
product_data: {
|
|
12412
12502
|
sku: string;
|
|
12413
12503
|
domain: string;
|
|
@@ -13117,7 +13207,9 @@ declare class TwitchApi {
|
|
|
13117
13207
|
data: {
|
|
13118
13208
|
broadcaster_id: string;
|
|
13119
13209
|
broadcaster_login: string;
|
|
13120
|
-
broadcaster_name: string;
|
|
13210
|
+
broadcaster_name: string;
|
|
13211
|
+
id: string;
|
|
13212
|
+
user_id: string; /**
|
|
13121
13213
|
* 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.
|
|
13122
13214
|
*
|
|
13123
13215
|
* __Authorization:__
|
|
@@ -13153,8 +13245,6 @@ declare class TwitchApi {
|
|
|
13153
13245
|
*
|
|
13154
13246
|
* @see https://dev.twitch.tv/docs/api/reference#update-extension-bits-product
|
|
13155
13247
|
*/
|
|
13156
|
-
id: string;
|
|
13157
|
-
user_id: string;
|
|
13158
13248
|
user_name: string;
|
|
13159
13249
|
user_login: string;
|
|
13160
13250
|
reward: {
|
|
@@ -13225,7 +13315,9 @@ declare class TwitchApi {
|
|
|
13225
13315
|
data: {
|
|
13226
13316
|
broadcaster_id: string;
|
|
13227
13317
|
broadcaster_login: string;
|
|
13228
|
-
broadcaster_name: string;
|
|
13318
|
+
broadcaster_name: string;
|
|
13319
|
+
id: string;
|
|
13320
|
+
user_id: string; /**
|
|
13229
13321
|
* 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.
|
|
13230
13322
|
*
|
|
13231
13323
|
* __Authorization:__
|
|
@@ -13261,8 +13353,6 @@ declare class TwitchApi {
|
|
|
13261
13353
|
*
|
|
13262
13354
|
* @see https://dev.twitch.tv/docs/api/reference#update-extension-bits-product
|
|
13263
13355
|
*/
|
|
13264
|
-
id: string;
|
|
13265
|
-
user_id: string;
|
|
13266
13356
|
user_name: string;
|
|
13267
13357
|
user_login: string;
|
|
13268
13358
|
reward: {
|
|
@@ -14303,37 +14393,7 @@ declare class TwitchApi {
|
|
|
14303
14393
|
creator_id: string;
|
|
14304
14394
|
creator_name: string;
|
|
14305
14395
|
video_id: string;
|
|
14306
|
-
game_id: string;
|
|
14307
|
-
* Gets all users that the broadcaster banned or put in a timeout.
|
|
14308
|
-
*
|
|
14309
|
-
* __Authorization:__
|
|
14310
|
-
*
|
|
14311
|
-
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **moderation:read** or **moderator:manage:banned\_users** scope.
|
|
14312
|
-
*
|
|
14313
|
-
* __URL:__
|
|
14314
|
-
*
|
|
14315
|
-
* `GET https://api.twitch.tv/helix/moderation/banned`
|
|
14316
|
-
*
|
|
14317
|
-
* __Response Codes:__
|
|
14318
|
-
*
|
|
14319
|
-
* _200 OK_
|
|
14320
|
-
*
|
|
14321
|
-
* Successfully retrieved the list of banned users.
|
|
14322
|
-
*
|
|
14323
|
-
* _400 Bad Request_
|
|
14324
|
-
*
|
|
14325
|
-
* * The _broadcaster\_id_ query parameter is required.
|
|
14326
|
-
*
|
|
14327
|
-
* _401 Unauthorized_
|
|
14328
|
-
*
|
|
14329
|
-
* * The ID in _broadcaster\_id_ must match the user ID in the user access token.
|
|
14330
|
-
* * The Authorization header is required and must contain a user access token.
|
|
14331
|
-
* * The user access token must include the **moderation:read** scope.
|
|
14332
|
-
* * The access token is not valid.
|
|
14333
|
-
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
14334
|
-
*
|
|
14335
|
-
* @see https://dev.twitch.tv/docs/api/reference#get-banned-users
|
|
14336
|
-
*/
|
|
14396
|
+
game_id: string;
|
|
14337
14397
|
language: string;
|
|
14338
14398
|
title: string;
|
|
14339
14399
|
view_count: number;
|
|
@@ -14569,42 +14629,7 @@ declare class TwitchApi {
|
|
|
14569
14629
|
session_id?: string;
|
|
14570
14630
|
connected_at?: string;
|
|
14571
14631
|
disconnected_at?: string;
|
|
14572
|
-
};
|
|
14573
|
-
* BETA Gets a list of unban requests for a broadcaster’s channel.
|
|
14574
|
-
*
|
|
14575
|
-
* __Authorization:__
|
|
14576
|
-
*
|
|
14577
|
-
* * Requires a user access token that includes the **moderator:read:unban\_requests** or **moderator:manage:unban\_requests** scope.
|
|
14578
|
-
* * Query parameter `moderator_id` must match the `user_id` in the [user access token](https://dev.twitch.tv/docs/authentication/#user-access-tokens).
|
|
14579
|
-
*
|
|
14580
|
-
* __URL:__
|
|
14581
|
-
*
|
|
14582
|
-
* `GET https://api.twitch.tv/helix/moderation/unban_requests`
|
|
14583
|
-
*
|
|
14584
|
-
* __Response Codes:__
|
|
14585
|
-
*
|
|
14586
|
-
* _200 OK_
|
|
14587
|
-
*
|
|
14588
|
-
* Successfully retrieved the list of unban requests.
|
|
14589
|
-
*
|
|
14590
|
-
* _400 Bad Request_
|
|
14591
|
-
*
|
|
14592
|
-
* * The _broadcaster\_id_ query parameter is required.
|
|
14593
|
-
* * The ID in the _broadcaster\_id_ query parameter is not valid.
|
|
14594
|
-
* * The _moderator\_id_ query parameter is required.
|
|
14595
|
-
* * The ID in the _moderator\_id_ query parameter is not valid.
|
|
14596
|
-
* * The pagination cursor is not valid.
|
|
14597
|
-
*
|
|
14598
|
-
* _401 Unauthorized_
|
|
14599
|
-
*
|
|
14600
|
-
* * The ID in _moderator\_id_ must match the user ID in the user access token.
|
|
14601
|
-
* * The Authorization header is required and must contain a user access token.
|
|
14602
|
-
* * The user access token must include the **moderator:read:unban\_requests** or **moderator:manage:unban\_requests** scope.
|
|
14603
|
-
* * The access token is not valid.
|
|
14604
|
-
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
14605
|
-
*
|
|
14606
|
-
* @see https://dev.twitch.tv/docs/api/reference#get-unban-requests
|
|
14607
|
-
*/
|
|
14632
|
+
};
|
|
14608
14633
|
}[];
|
|
14609
14634
|
pagination?: {
|
|
14610
14635
|
cursor?: string;
|
|
@@ -15349,6 +15374,46 @@ declare class TwitchApi {
|
|
|
15349
15374
|
can_link_external_content: boolean;
|
|
15350
15375
|
};
|
|
15351
15376
|
};
|
|
15377
|
+
/**
|
|
15378
|
+
* Activates or deactivates the broadcaster’s Shield Mode.
|
|
15379
|
+
*
|
|
15380
|
+
* Twitch’s Shield Mode feature is like a panic button that broadcasters can push to protect themselves from chat abuse coming from one or more accounts. When activated, Shield Mode applies the overrides that the broadcaster configured in the Twitch UX. If the broadcaster hasn’t configured Shield Mode, it applies default overrides.
|
|
15381
|
+
*
|
|
15382
|
+
* __Authorization:__
|
|
15383
|
+
*
|
|
15384
|
+
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **moderator:manage:shield\_mode** scope.
|
|
15385
|
+
*
|
|
15386
|
+
* __URL:__
|
|
15387
|
+
*
|
|
15388
|
+
* `PUT https://api.twitch.tv/helix/moderation/shield_mode`
|
|
15389
|
+
*
|
|
15390
|
+
* __Response Codes:__
|
|
15391
|
+
*
|
|
15392
|
+
* _200 OK_
|
|
15393
|
+
*
|
|
15394
|
+
* Successfully updated the broadcaster’s Shield Mode status.
|
|
15395
|
+
*
|
|
15396
|
+
* _400 Bad Request_
|
|
15397
|
+
*
|
|
15398
|
+
* * The _broadcaster\_id_ query parameter is required.
|
|
15399
|
+
* * The ID in the _broadcaster\_id_ query parameter is not valid.
|
|
15400
|
+
* * The `is_active` field is required.
|
|
15401
|
+
* * The value in the `is_active` field is not valid.
|
|
15402
|
+
*
|
|
15403
|
+
* _401 Unauthorized_
|
|
15404
|
+
*
|
|
15405
|
+
* * The ID in _moderator\_id_ must match the user ID in the user access token.
|
|
15406
|
+
* * The Authorization header is required and must contain a user access token.
|
|
15407
|
+
* * The user access token must include the **moderator:manage:shield\_mode** scope.
|
|
15408
|
+
* * The access token is not valid.
|
|
15409
|
+
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
15410
|
+
*
|
|
15411
|
+
* _403 Forbidden_
|
|
15412
|
+
*
|
|
15413
|
+
* * The user in _moderator\_id_ is not one of the broadcaster's moderators.
|
|
15414
|
+
*
|
|
15415
|
+
* @see https://dev.twitch.tv/docs/api/reference#update-shield-mode-status
|
|
15416
|
+
*/
|
|
15352
15417
|
allowlisted_config_urls: string[];
|
|
15353
15418
|
allowlisted_panel_urls: string[];
|
|
15354
15419
|
}[];
|
|
@@ -15447,6 +15512,46 @@ declare class TwitchApi {
|
|
|
15447
15512
|
can_link_external_content: boolean;
|
|
15448
15513
|
};
|
|
15449
15514
|
};
|
|
15515
|
+
/**
|
|
15516
|
+
* Activates or deactivates the broadcaster’s Shield Mode.
|
|
15517
|
+
*
|
|
15518
|
+
* Twitch’s Shield Mode feature is like a panic button that broadcasters can push to protect themselves from chat abuse coming from one or more accounts. When activated, Shield Mode applies the overrides that the broadcaster configured in the Twitch UX. If the broadcaster hasn’t configured Shield Mode, it applies default overrides.
|
|
15519
|
+
*
|
|
15520
|
+
* __Authorization:__
|
|
15521
|
+
*
|
|
15522
|
+
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **moderator:manage:shield\_mode** scope.
|
|
15523
|
+
*
|
|
15524
|
+
* __URL:__
|
|
15525
|
+
*
|
|
15526
|
+
* `PUT https://api.twitch.tv/helix/moderation/shield_mode`
|
|
15527
|
+
*
|
|
15528
|
+
* __Response Codes:__
|
|
15529
|
+
*
|
|
15530
|
+
* _200 OK_
|
|
15531
|
+
*
|
|
15532
|
+
* Successfully updated the broadcaster’s Shield Mode status.
|
|
15533
|
+
*
|
|
15534
|
+
* _400 Bad Request_
|
|
15535
|
+
*
|
|
15536
|
+
* * The _broadcaster\_id_ query parameter is required.
|
|
15537
|
+
* * The ID in the _broadcaster\_id_ query parameter is not valid.
|
|
15538
|
+
* * The `is_active` field is required.
|
|
15539
|
+
* * The value in the `is_active` field is not valid.
|
|
15540
|
+
*
|
|
15541
|
+
* _401 Unauthorized_
|
|
15542
|
+
*
|
|
15543
|
+
* * The ID in _moderator\_id_ must match the user ID in the user access token.
|
|
15544
|
+
* * The Authorization header is required and must contain a user access token.
|
|
15545
|
+
* * The user access token must include the **moderator:manage:shield\_mode** scope.
|
|
15546
|
+
* * The access token is not valid.
|
|
15547
|
+
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
15548
|
+
*
|
|
15549
|
+
* _403 Forbidden_
|
|
15550
|
+
*
|
|
15551
|
+
* * The user in _moderator\_id_ is not one of the broadcaster's moderators.
|
|
15552
|
+
*
|
|
15553
|
+
* @see https://dev.twitch.tv/docs/api/reference#update-shield-mode-status
|
|
15554
|
+
*/
|
|
15450
15555
|
allowlisted_config_urls: string[];
|
|
15451
15556
|
allowlisted_panel_urls: string[];
|
|
15452
15557
|
}[];
|
|
@@ -16494,41 +16599,7 @@ declare class TwitchApi {
|
|
|
16494
16599
|
id: string;
|
|
16495
16600
|
last_contribution: {
|
|
16496
16601
|
total: number;
|
|
16497
|
-
type: "BITS" | "SUBS" | "OTHER";
|
|
16498
|
-
* Gets the channels that match the specified query and have streamed content within the past 6 months.
|
|
16499
|
-
*
|
|
16500
|
-
* The fields that the API uses for comparison depends on the value that the _live\_only_ query parameter is set to. If _live\_only_ is **false**, the API matches on the broadcaster’s login name. However, if _live\_only_ is **true**, the API matches on the broadcaster’s name and category name.
|
|
16501
|
-
*
|
|
16502
|
-
* To match, the beginning of the broadcaster’s name or category must match the query string. The comparison is case insensitive. If the query string is angel\_of\_death, it matches all names that begin with angel\_of\_death. However, if the query string is a phrase like _angel of death_, it matches to names starting with angelofdeath or names starting with angel\_of\_death.
|
|
16503
|
-
*
|
|
16504
|
-
* By default, the results include both live and offline channels. To get only live channels set the _live\_only_ query parameter to **true**.
|
|
16505
|
-
*
|
|
16506
|
-
* __Authorization:__
|
|
16507
|
-
*
|
|
16508
|
-
* Requires an [app access token](https://dev.twitch.tv/docs/authentication#app-access-tokens) or [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens).
|
|
16509
|
-
*
|
|
16510
|
-
* __URL:__
|
|
16511
|
-
*
|
|
16512
|
-
* `GET https://api.twitch.tv/helix/search/channels`
|
|
16513
|
-
*
|
|
16514
|
-
* __Response Codes:__
|
|
16515
|
-
*
|
|
16516
|
-
* _200 OK_
|
|
16517
|
-
*
|
|
16518
|
-
* Successfully retrieved the list of category names that matched the specified query string.
|
|
16519
|
-
*
|
|
16520
|
-
* _400 Bad Request_
|
|
16521
|
-
*
|
|
16522
|
-
* * The _query_ query parameter is required.
|
|
16523
|
-
*
|
|
16524
|
-
* _401 Unauthorized_
|
|
16525
|
-
*
|
|
16526
|
-
* * The Authorization header is required and must contain an app access token or user access token.
|
|
16527
|
-
* * The access token is not valid.
|
|
16528
|
-
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
16529
|
-
*
|
|
16530
|
-
* @see https://dev.twitch.tv/docs/api/reference#search-channels
|
|
16531
|
-
*/
|
|
16602
|
+
type: "BITS" | "SUBS" | "OTHER";
|
|
16532
16603
|
user: string;
|
|
16533
16604
|
};
|
|
16534
16605
|
level: number;
|
|
@@ -17817,38 +17888,7 @@ declare class TwitchApi {
|
|
|
17817
17888
|
is_active: boolean;
|
|
17818
17889
|
moderator_id: string;
|
|
17819
17890
|
moderator_login: string;
|
|
17820
|
-
moderator_name: string;
|
|
17821
|
-
* Updates the specified user’s information. The user ID in the OAuth token identifies the user whose information you want to update.
|
|
17822
|
-
*
|
|
17823
|
-
* To include the user’s verified email address in the response, the user access token must also include the **user:read:email** scope.
|
|
17824
|
-
*
|
|
17825
|
-
* __Authorization:__
|
|
17826
|
-
*
|
|
17827
|
-
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **user:edit** scope.
|
|
17828
|
-
*
|
|
17829
|
-
* __URL:__
|
|
17830
|
-
*
|
|
17831
|
-
* `PUT https://api.twitch.tv/helix/users`
|
|
17832
|
-
*
|
|
17833
|
-
* __Response Codes:__
|
|
17834
|
-
*
|
|
17835
|
-
* _200 OK_
|
|
17836
|
-
*
|
|
17837
|
-
* Successfully updated the specified user's information.
|
|
17838
|
-
*
|
|
17839
|
-
* _400 Bad Request_
|
|
17840
|
-
*
|
|
17841
|
-
* * The string in the _description_ query parameter is too long.
|
|
17842
|
-
*
|
|
17843
|
-
* _401 Unauthorized_
|
|
17844
|
-
*
|
|
17845
|
-
* * The Authorization header is required and must contain a user access token.
|
|
17846
|
-
* * The user access token must include the **user:edit** scope.
|
|
17847
|
-
* * The access token is not valid.
|
|
17848
|
-
* * The ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
17849
|
-
*
|
|
17850
|
-
* @see https://dev.twitch.tv/docs/api/reference#update-user
|
|
17851
|
-
*/
|
|
17891
|
+
moderator_name: string;
|
|
17852
17892
|
last_activated_at: string;
|
|
17853
17893
|
}[];
|
|
17854
17894
|
};
|
|
@@ -18116,7 +18156,42 @@ declare class TwitchApi {
|
|
|
18116
18156
|
broadcaster_id: string;
|
|
18117
18157
|
broadcaster_name: string;
|
|
18118
18158
|
broadcaster_login: string;
|
|
18119
|
-
title: string;
|
|
18159
|
+
title: string; /**
|
|
18160
|
+
* 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.
|
|
18161
|
+
*
|
|
18162
|
+
* NOTE: If you try to activate an extension under multiple extension types, the last write wins (and there is no guarantee of write order).
|
|
18163
|
+
*
|
|
18164
|
+
* __Authorization:__
|
|
18165
|
+
*
|
|
18166
|
+
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **user:edit:broadcast** scope.
|
|
18167
|
+
*
|
|
18168
|
+
* __URL:__
|
|
18169
|
+
*
|
|
18170
|
+
* `PUT https://api.twitch.tv/helix/users/extensions`
|
|
18171
|
+
*
|
|
18172
|
+
* __Response Codes:__
|
|
18173
|
+
*
|
|
18174
|
+
* _200 OK_
|
|
18175
|
+
*
|
|
18176
|
+
* Successfully updated the active extensions.
|
|
18177
|
+
*
|
|
18178
|
+
* _400 Bad Request_
|
|
18179
|
+
*
|
|
18180
|
+
* * The JSON payload is malformed.
|
|
18181
|
+
*
|
|
18182
|
+
* _401 Unauthorized_
|
|
18183
|
+
*
|
|
18184
|
+
* * The Authorization header is required and must contain a user access token.
|
|
18185
|
+
* * The user access token must include the **user:edit:broadcast** scope.
|
|
18186
|
+
* * The access token is not valid.
|
|
18187
|
+
* * The ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
18188
|
+
*
|
|
18189
|
+
* _404 Not Found_
|
|
18190
|
+
*
|
|
18191
|
+
* * An extension with the specified `id` and `version` values was not found.
|
|
18192
|
+
*
|
|
18193
|
+
* @see https://dev.twitch.tv/docs/api/reference#update-user-extensions
|
|
18194
|
+
*/
|
|
18120
18195
|
winning_outcome_id: string | null;
|
|
18121
18196
|
outcomes: {
|
|
18122
18197
|
id: string;
|
|
@@ -18200,7 +18275,42 @@ declare class TwitchApi {
|
|
|
18200
18275
|
broadcaster_id: string;
|
|
18201
18276
|
broadcaster_name: string;
|
|
18202
18277
|
broadcaster_login: string;
|
|
18203
|
-
title: string;
|
|
18278
|
+
title: string; /**
|
|
18279
|
+
* 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.
|
|
18280
|
+
*
|
|
18281
|
+
* NOTE: If you try to activate an extension under multiple extension types, the last write wins (and there is no guarantee of write order).
|
|
18282
|
+
*
|
|
18283
|
+
* __Authorization:__
|
|
18284
|
+
*
|
|
18285
|
+
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **user:edit:broadcast** scope.
|
|
18286
|
+
*
|
|
18287
|
+
* __URL:__
|
|
18288
|
+
*
|
|
18289
|
+
* `PUT https://api.twitch.tv/helix/users/extensions`
|
|
18290
|
+
*
|
|
18291
|
+
* __Response Codes:__
|
|
18292
|
+
*
|
|
18293
|
+
* _200 OK_
|
|
18294
|
+
*
|
|
18295
|
+
* Successfully updated the active extensions.
|
|
18296
|
+
*
|
|
18297
|
+
* _400 Bad Request_
|
|
18298
|
+
*
|
|
18299
|
+
* * The JSON payload is malformed.
|
|
18300
|
+
*
|
|
18301
|
+
* _401 Unauthorized_
|
|
18302
|
+
*
|
|
18303
|
+
* * The Authorization header is required and must contain a user access token.
|
|
18304
|
+
* * The user access token must include the **user:edit:broadcast** scope.
|
|
18305
|
+
* * The access token is not valid.
|
|
18306
|
+
* * The ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
18307
|
+
*
|
|
18308
|
+
* _404 Not Found_
|
|
18309
|
+
*
|
|
18310
|
+
* * An extension with the specified `id` and `version` values was not found.
|
|
18311
|
+
*
|
|
18312
|
+
* @see https://dev.twitch.tv/docs/api/reference#update-user-extensions
|
|
18313
|
+
*/
|
|
18204
18314
|
winning_outcome_id: string | null;
|
|
18205
18315
|
outcomes: {
|
|
18206
18316
|
id: string;
|
|
@@ -18279,7 +18389,42 @@ declare class TwitchApi {
|
|
|
18279
18389
|
broadcaster_id: string;
|
|
18280
18390
|
broadcaster_name: string;
|
|
18281
18391
|
broadcaster_login: string;
|
|
18282
|
-
title: string;
|
|
18392
|
+
title: string; /**
|
|
18393
|
+
* 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.
|
|
18394
|
+
*
|
|
18395
|
+
* NOTE: If you try to activate an extension under multiple extension types, the last write wins (and there is no guarantee of write order).
|
|
18396
|
+
*
|
|
18397
|
+
* __Authorization:__
|
|
18398
|
+
*
|
|
18399
|
+
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **user:edit:broadcast** scope.
|
|
18400
|
+
*
|
|
18401
|
+
* __URL:__
|
|
18402
|
+
*
|
|
18403
|
+
* `PUT https://api.twitch.tv/helix/users/extensions`
|
|
18404
|
+
*
|
|
18405
|
+
* __Response Codes:__
|
|
18406
|
+
*
|
|
18407
|
+
* _200 OK_
|
|
18408
|
+
*
|
|
18409
|
+
* Successfully updated the active extensions.
|
|
18410
|
+
*
|
|
18411
|
+
* _400 Bad Request_
|
|
18412
|
+
*
|
|
18413
|
+
* * The JSON payload is malformed.
|
|
18414
|
+
*
|
|
18415
|
+
* _401 Unauthorized_
|
|
18416
|
+
*
|
|
18417
|
+
* * The Authorization header is required and must contain a user access token.
|
|
18418
|
+
* * The user access token must include the **user:edit:broadcast** scope.
|
|
18419
|
+
* * The access token is not valid.
|
|
18420
|
+
* * The ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
18421
|
+
*
|
|
18422
|
+
* _404 Not Found_
|
|
18423
|
+
*
|
|
18424
|
+
* * An extension with the specified `id` and `version` values was not found.
|
|
18425
|
+
*
|
|
18426
|
+
* @see https://dev.twitch.tv/docs/api/reference#update-user-extensions
|
|
18427
|
+
*/
|
|
18283
18428
|
winning_outcome_id: string | null;
|
|
18284
18429
|
outcomes: {
|
|
18285
18430
|
id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -12264,7 +12264,61 @@ declare class TwitchApi {
|
|
|
12264
12264
|
date_range: {
|
|
12265
12265
|
started_at: string;
|
|
12266
12266
|
ended_at: string;
|
|
12267
|
-
};
|
|
12267
|
+
}; /**
|
|
12268
|
+
* Gets an organization’s list of entitlements that have been granted to a game, a user, or both.
|
|
12269
|
+
*
|
|
12270
|
+
* **NOTE:** Entitlements returned in the response body data are not guaranteed to be sorted by any field returned by the API. To retrieve **CLAIMED** or **FULFILLED** entitlements, use the `fulfillment_status` query parameter to filter results. To retrieve entitlements for a specific game, use the `game_id` query parameter to filter results.
|
|
12271
|
+
*
|
|
12272
|
+
* The following table identifies the request parameters that you may specify based on the type of access token used.
|
|
12273
|
+
*
|
|
12274
|
+
* | Access token type | Parameter | Description |
|
|
12275
|
+
* | - | - | - |
|
|
12276
|
+
* | App | None | If you don’t specify request parameters, the request returns all entitlements that your organization owns. |
|
|
12277
|
+
* | App | user_id | The request returns all entitlements for any game that the organization granted to the specified user. |
|
|
12278
|
+
* | App | user_id, game_id | The request returns all entitlements that the specified game granted to the specified user. |
|
|
12279
|
+
* | App | game_id | The request returns all entitlements that the specified game granted to all entitled users. |
|
|
12280
|
+
* | User | None | If you don’t specify request parameters, the request returns all entitlements for any game that the organization granted to the user identified in the access token. |
|
|
12281
|
+
* | User | user_id | Invalid. |
|
|
12282
|
+
* | User | user_id, game_id | Invalid. |
|
|
12283
|
+
* | User | game_id | The request returns all entitlements that the specified game granted to the user identified in the access token. |
|
|
12284
|
+
*
|
|
12285
|
+
*
|
|
12286
|
+
* __Authorization:__
|
|
12287
|
+
*
|
|
12288
|
+
* Requires an [app access token](https://dev.twitch.tv/docs/authentication#app-access-tokens) or [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens). The client ID in the access token must own the game.
|
|
12289
|
+
*
|
|
12290
|
+
* __URL:__
|
|
12291
|
+
*
|
|
12292
|
+
* `GET https://api.twitch.tv/helix/entitlements/drops`
|
|
12293
|
+
*
|
|
12294
|
+
* __Response Codes:__
|
|
12295
|
+
*
|
|
12296
|
+
* _200 OK_
|
|
12297
|
+
*
|
|
12298
|
+
* Successfully retrieved the entitlements.
|
|
12299
|
+
*
|
|
12300
|
+
* _400 Bad Request_
|
|
12301
|
+
*
|
|
12302
|
+
* * The value in the _fulfillment\_status_ query parameter is not valid.
|
|
12303
|
+
* * The ID in the _user\_id_ query parameter must match the user ID in the user access token.
|
|
12304
|
+
* * The client in the access token is not associated with a known organization.
|
|
12305
|
+
* * The owner of the client in the access token is not a member of the organization.
|
|
12306
|
+
*
|
|
12307
|
+
* _401 Unauthorized_
|
|
12308
|
+
*
|
|
12309
|
+
* * The ID in the Client-Id header must match the Client ID in the access token.
|
|
12310
|
+
* * The Authorization header is required and must specify an app access token or user access token.
|
|
12311
|
+
* * The access token is not valid.
|
|
12312
|
+
*
|
|
12313
|
+
* _403 Forbidden_
|
|
12314
|
+
*
|
|
12315
|
+
* * The organization associated with the client in the access token must own the game specified in the _game\_id_ query parameter.
|
|
12316
|
+
* * The organization associated with the client in the access token must own the entitlements specified in the _id_ query parameter.
|
|
12317
|
+
*
|
|
12318
|
+
* _500 Internal Server Error_
|
|
12319
|
+
*
|
|
12320
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-drops-entitlements
|
|
12321
|
+
*/
|
|
12268
12322
|
total: number;
|
|
12269
12323
|
};
|
|
12270
12324
|
} | {
|
|
@@ -12407,7 +12461,43 @@ declare class TwitchApi {
|
|
|
12407
12461
|
user_id: string;
|
|
12408
12462
|
user_login: string;
|
|
12409
12463
|
user_name: string;
|
|
12410
|
-
product_type: "BITS_IN_EXTENSION";
|
|
12464
|
+
product_type: "BITS_IN_EXTENSION"; /**
|
|
12465
|
+
* Gets the specified configuration segment from the specified extension.
|
|
12466
|
+
*
|
|
12467
|
+
* **Rate Limits**: You may retrieve each segment a maximum of 20 times per minute.
|
|
12468
|
+
*
|
|
12469
|
+
* __Authorization:__
|
|
12470
|
+
*
|
|
12471
|
+
* Requires a signed JSON Web Token (JWT) created by an Extension Backend Service (EBS). For signing requirements, see [Signing the JWT](https://dev.twitch.tv/docs/extensions/building/#signing-the-jwt). The signed JWT must include the `role`, `user_id`, and `exp` fields (see [JWT Schema](https://dev.twitch.tv/docs/extensions/reference/#jwt-schema)). The `role` field must be set to _external_.
|
|
12472
|
+
*
|
|
12473
|
+
* __URL:__
|
|
12474
|
+
*
|
|
12475
|
+
* `GET https://api.twitch.tv/helix/extensions/configurations`
|
|
12476
|
+
*
|
|
12477
|
+
* __Response Codes:__
|
|
12478
|
+
*
|
|
12479
|
+
* _200 OK_
|
|
12480
|
+
*
|
|
12481
|
+
* Successfully retrieved the configurations.
|
|
12482
|
+
*
|
|
12483
|
+
* _400 Bad Request_
|
|
12484
|
+
*
|
|
12485
|
+
* * The _extension\_id_ query parameter is required.
|
|
12486
|
+
* * The value in the _segment_ query parameter is not valid.
|
|
12487
|
+
* * The _broadcaster\_id_ query parameter is required if the _segment_ query parameter is set to broadcaster or developer.
|
|
12488
|
+
*
|
|
12489
|
+
* _401 Unauthorized_
|
|
12490
|
+
*
|
|
12491
|
+
* * The Authorization header is required and must specify a JWT token.
|
|
12492
|
+
* * The JWT token is not valid.
|
|
12493
|
+
* * The Client-Id header is required.
|
|
12494
|
+
*
|
|
12495
|
+
* _429 Too Many Requests_
|
|
12496
|
+
*
|
|
12497
|
+
* * The app exceeded the number of requests that it may make per minute. See Rate Limits above.
|
|
12498
|
+
*
|
|
12499
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-extension-configuration-segment
|
|
12500
|
+
*/
|
|
12411
12501
|
product_data: {
|
|
12412
12502
|
sku: string;
|
|
12413
12503
|
domain: string;
|
|
@@ -13117,7 +13207,9 @@ declare class TwitchApi {
|
|
|
13117
13207
|
data: {
|
|
13118
13208
|
broadcaster_id: string;
|
|
13119
13209
|
broadcaster_login: string;
|
|
13120
|
-
broadcaster_name: string;
|
|
13210
|
+
broadcaster_name: string;
|
|
13211
|
+
id: string;
|
|
13212
|
+
user_id: string; /**
|
|
13121
13213
|
* 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.
|
|
13122
13214
|
*
|
|
13123
13215
|
* __Authorization:__
|
|
@@ -13153,8 +13245,6 @@ declare class TwitchApi {
|
|
|
13153
13245
|
*
|
|
13154
13246
|
* @see https://dev.twitch.tv/docs/api/reference#update-extension-bits-product
|
|
13155
13247
|
*/
|
|
13156
|
-
id: string;
|
|
13157
|
-
user_id: string;
|
|
13158
13248
|
user_name: string;
|
|
13159
13249
|
user_login: string;
|
|
13160
13250
|
reward: {
|
|
@@ -13225,7 +13315,9 @@ declare class TwitchApi {
|
|
|
13225
13315
|
data: {
|
|
13226
13316
|
broadcaster_id: string;
|
|
13227
13317
|
broadcaster_login: string;
|
|
13228
|
-
broadcaster_name: string;
|
|
13318
|
+
broadcaster_name: string;
|
|
13319
|
+
id: string;
|
|
13320
|
+
user_id: string; /**
|
|
13229
13321
|
* 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.
|
|
13230
13322
|
*
|
|
13231
13323
|
* __Authorization:__
|
|
@@ -13261,8 +13353,6 @@ declare class TwitchApi {
|
|
|
13261
13353
|
*
|
|
13262
13354
|
* @see https://dev.twitch.tv/docs/api/reference#update-extension-bits-product
|
|
13263
13355
|
*/
|
|
13264
|
-
id: string;
|
|
13265
|
-
user_id: string;
|
|
13266
13356
|
user_name: string;
|
|
13267
13357
|
user_login: string;
|
|
13268
13358
|
reward: {
|
|
@@ -14303,37 +14393,7 @@ declare class TwitchApi {
|
|
|
14303
14393
|
creator_id: string;
|
|
14304
14394
|
creator_name: string;
|
|
14305
14395
|
video_id: string;
|
|
14306
|
-
game_id: string;
|
|
14307
|
-
* Gets all users that the broadcaster banned or put in a timeout.
|
|
14308
|
-
*
|
|
14309
|
-
* __Authorization:__
|
|
14310
|
-
*
|
|
14311
|
-
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **moderation:read** or **moderator:manage:banned\_users** scope.
|
|
14312
|
-
*
|
|
14313
|
-
* __URL:__
|
|
14314
|
-
*
|
|
14315
|
-
* `GET https://api.twitch.tv/helix/moderation/banned`
|
|
14316
|
-
*
|
|
14317
|
-
* __Response Codes:__
|
|
14318
|
-
*
|
|
14319
|
-
* _200 OK_
|
|
14320
|
-
*
|
|
14321
|
-
* Successfully retrieved the list of banned users.
|
|
14322
|
-
*
|
|
14323
|
-
* _400 Bad Request_
|
|
14324
|
-
*
|
|
14325
|
-
* * The _broadcaster\_id_ query parameter is required.
|
|
14326
|
-
*
|
|
14327
|
-
* _401 Unauthorized_
|
|
14328
|
-
*
|
|
14329
|
-
* * The ID in _broadcaster\_id_ must match the user ID in the user access token.
|
|
14330
|
-
* * The Authorization header is required and must contain a user access token.
|
|
14331
|
-
* * The user access token must include the **moderation:read** scope.
|
|
14332
|
-
* * The access token is not valid.
|
|
14333
|
-
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
14334
|
-
*
|
|
14335
|
-
* @see https://dev.twitch.tv/docs/api/reference#get-banned-users
|
|
14336
|
-
*/
|
|
14396
|
+
game_id: string;
|
|
14337
14397
|
language: string;
|
|
14338
14398
|
title: string;
|
|
14339
14399
|
view_count: number;
|
|
@@ -14569,42 +14629,7 @@ declare class TwitchApi {
|
|
|
14569
14629
|
session_id?: string;
|
|
14570
14630
|
connected_at?: string;
|
|
14571
14631
|
disconnected_at?: string;
|
|
14572
|
-
};
|
|
14573
|
-
* BETA Gets a list of unban requests for a broadcaster’s channel.
|
|
14574
|
-
*
|
|
14575
|
-
* __Authorization:__
|
|
14576
|
-
*
|
|
14577
|
-
* * Requires a user access token that includes the **moderator:read:unban\_requests** or **moderator:manage:unban\_requests** scope.
|
|
14578
|
-
* * Query parameter `moderator_id` must match the `user_id` in the [user access token](https://dev.twitch.tv/docs/authentication/#user-access-tokens).
|
|
14579
|
-
*
|
|
14580
|
-
* __URL:__
|
|
14581
|
-
*
|
|
14582
|
-
* `GET https://api.twitch.tv/helix/moderation/unban_requests`
|
|
14583
|
-
*
|
|
14584
|
-
* __Response Codes:__
|
|
14585
|
-
*
|
|
14586
|
-
* _200 OK_
|
|
14587
|
-
*
|
|
14588
|
-
* Successfully retrieved the list of unban requests.
|
|
14589
|
-
*
|
|
14590
|
-
* _400 Bad Request_
|
|
14591
|
-
*
|
|
14592
|
-
* * The _broadcaster\_id_ query parameter is required.
|
|
14593
|
-
* * The ID in the _broadcaster\_id_ query parameter is not valid.
|
|
14594
|
-
* * The _moderator\_id_ query parameter is required.
|
|
14595
|
-
* * The ID in the _moderator\_id_ query parameter is not valid.
|
|
14596
|
-
* * The pagination cursor is not valid.
|
|
14597
|
-
*
|
|
14598
|
-
* _401 Unauthorized_
|
|
14599
|
-
*
|
|
14600
|
-
* * The ID in _moderator\_id_ must match the user ID in the user access token.
|
|
14601
|
-
* * The Authorization header is required and must contain a user access token.
|
|
14602
|
-
* * The user access token must include the **moderator:read:unban\_requests** or **moderator:manage:unban\_requests** scope.
|
|
14603
|
-
* * The access token is not valid.
|
|
14604
|
-
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
14605
|
-
*
|
|
14606
|
-
* @see https://dev.twitch.tv/docs/api/reference#get-unban-requests
|
|
14607
|
-
*/
|
|
14632
|
+
};
|
|
14608
14633
|
}[];
|
|
14609
14634
|
pagination?: {
|
|
14610
14635
|
cursor?: string;
|
|
@@ -15349,6 +15374,46 @@ declare class TwitchApi {
|
|
|
15349
15374
|
can_link_external_content: boolean;
|
|
15350
15375
|
};
|
|
15351
15376
|
};
|
|
15377
|
+
/**
|
|
15378
|
+
* Activates or deactivates the broadcaster’s Shield Mode.
|
|
15379
|
+
*
|
|
15380
|
+
* Twitch’s Shield Mode feature is like a panic button that broadcasters can push to protect themselves from chat abuse coming from one or more accounts. When activated, Shield Mode applies the overrides that the broadcaster configured in the Twitch UX. If the broadcaster hasn’t configured Shield Mode, it applies default overrides.
|
|
15381
|
+
*
|
|
15382
|
+
* __Authorization:__
|
|
15383
|
+
*
|
|
15384
|
+
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **moderator:manage:shield\_mode** scope.
|
|
15385
|
+
*
|
|
15386
|
+
* __URL:__
|
|
15387
|
+
*
|
|
15388
|
+
* `PUT https://api.twitch.tv/helix/moderation/shield_mode`
|
|
15389
|
+
*
|
|
15390
|
+
* __Response Codes:__
|
|
15391
|
+
*
|
|
15392
|
+
* _200 OK_
|
|
15393
|
+
*
|
|
15394
|
+
* Successfully updated the broadcaster’s Shield Mode status.
|
|
15395
|
+
*
|
|
15396
|
+
* _400 Bad Request_
|
|
15397
|
+
*
|
|
15398
|
+
* * The _broadcaster\_id_ query parameter is required.
|
|
15399
|
+
* * The ID in the _broadcaster\_id_ query parameter is not valid.
|
|
15400
|
+
* * The `is_active` field is required.
|
|
15401
|
+
* * The value in the `is_active` field is not valid.
|
|
15402
|
+
*
|
|
15403
|
+
* _401 Unauthorized_
|
|
15404
|
+
*
|
|
15405
|
+
* * The ID in _moderator\_id_ must match the user ID in the user access token.
|
|
15406
|
+
* * The Authorization header is required and must contain a user access token.
|
|
15407
|
+
* * The user access token must include the **moderator:manage:shield\_mode** scope.
|
|
15408
|
+
* * The access token is not valid.
|
|
15409
|
+
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
15410
|
+
*
|
|
15411
|
+
* _403 Forbidden_
|
|
15412
|
+
*
|
|
15413
|
+
* * The user in _moderator\_id_ is not one of the broadcaster's moderators.
|
|
15414
|
+
*
|
|
15415
|
+
* @see https://dev.twitch.tv/docs/api/reference#update-shield-mode-status
|
|
15416
|
+
*/
|
|
15352
15417
|
allowlisted_config_urls: string[];
|
|
15353
15418
|
allowlisted_panel_urls: string[];
|
|
15354
15419
|
}[];
|
|
@@ -15447,6 +15512,46 @@ declare class TwitchApi {
|
|
|
15447
15512
|
can_link_external_content: boolean;
|
|
15448
15513
|
};
|
|
15449
15514
|
};
|
|
15515
|
+
/**
|
|
15516
|
+
* Activates or deactivates the broadcaster’s Shield Mode.
|
|
15517
|
+
*
|
|
15518
|
+
* Twitch’s Shield Mode feature is like a panic button that broadcasters can push to protect themselves from chat abuse coming from one or more accounts. When activated, Shield Mode applies the overrides that the broadcaster configured in the Twitch UX. If the broadcaster hasn’t configured Shield Mode, it applies default overrides.
|
|
15519
|
+
*
|
|
15520
|
+
* __Authorization:__
|
|
15521
|
+
*
|
|
15522
|
+
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **moderator:manage:shield\_mode** scope.
|
|
15523
|
+
*
|
|
15524
|
+
* __URL:__
|
|
15525
|
+
*
|
|
15526
|
+
* `PUT https://api.twitch.tv/helix/moderation/shield_mode`
|
|
15527
|
+
*
|
|
15528
|
+
* __Response Codes:__
|
|
15529
|
+
*
|
|
15530
|
+
* _200 OK_
|
|
15531
|
+
*
|
|
15532
|
+
* Successfully updated the broadcaster’s Shield Mode status.
|
|
15533
|
+
*
|
|
15534
|
+
* _400 Bad Request_
|
|
15535
|
+
*
|
|
15536
|
+
* * The _broadcaster\_id_ query parameter is required.
|
|
15537
|
+
* * The ID in the _broadcaster\_id_ query parameter is not valid.
|
|
15538
|
+
* * The `is_active` field is required.
|
|
15539
|
+
* * The value in the `is_active` field is not valid.
|
|
15540
|
+
*
|
|
15541
|
+
* _401 Unauthorized_
|
|
15542
|
+
*
|
|
15543
|
+
* * The ID in _moderator\_id_ must match the user ID in the user access token.
|
|
15544
|
+
* * The Authorization header is required and must contain a user access token.
|
|
15545
|
+
* * The user access token must include the **moderator:manage:shield\_mode** scope.
|
|
15546
|
+
* * The access token is not valid.
|
|
15547
|
+
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
15548
|
+
*
|
|
15549
|
+
* _403 Forbidden_
|
|
15550
|
+
*
|
|
15551
|
+
* * The user in _moderator\_id_ is not one of the broadcaster's moderators.
|
|
15552
|
+
*
|
|
15553
|
+
* @see https://dev.twitch.tv/docs/api/reference#update-shield-mode-status
|
|
15554
|
+
*/
|
|
15450
15555
|
allowlisted_config_urls: string[];
|
|
15451
15556
|
allowlisted_panel_urls: string[];
|
|
15452
15557
|
}[];
|
|
@@ -16494,41 +16599,7 @@ declare class TwitchApi {
|
|
|
16494
16599
|
id: string;
|
|
16495
16600
|
last_contribution: {
|
|
16496
16601
|
total: number;
|
|
16497
|
-
type: "BITS" | "SUBS" | "OTHER";
|
|
16498
|
-
* Gets the channels that match the specified query and have streamed content within the past 6 months.
|
|
16499
|
-
*
|
|
16500
|
-
* The fields that the API uses for comparison depends on the value that the _live\_only_ query parameter is set to. If _live\_only_ is **false**, the API matches on the broadcaster’s login name. However, if _live\_only_ is **true**, the API matches on the broadcaster’s name and category name.
|
|
16501
|
-
*
|
|
16502
|
-
* To match, the beginning of the broadcaster’s name or category must match the query string. The comparison is case insensitive. If the query string is angel\_of\_death, it matches all names that begin with angel\_of\_death. However, if the query string is a phrase like _angel of death_, it matches to names starting with angelofdeath or names starting with angel\_of\_death.
|
|
16503
|
-
*
|
|
16504
|
-
* By default, the results include both live and offline channels. To get only live channels set the _live\_only_ query parameter to **true**.
|
|
16505
|
-
*
|
|
16506
|
-
* __Authorization:__
|
|
16507
|
-
*
|
|
16508
|
-
* Requires an [app access token](https://dev.twitch.tv/docs/authentication#app-access-tokens) or [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens).
|
|
16509
|
-
*
|
|
16510
|
-
* __URL:__
|
|
16511
|
-
*
|
|
16512
|
-
* `GET https://api.twitch.tv/helix/search/channels`
|
|
16513
|
-
*
|
|
16514
|
-
* __Response Codes:__
|
|
16515
|
-
*
|
|
16516
|
-
* _200 OK_
|
|
16517
|
-
*
|
|
16518
|
-
* Successfully retrieved the list of category names that matched the specified query string.
|
|
16519
|
-
*
|
|
16520
|
-
* _400 Bad Request_
|
|
16521
|
-
*
|
|
16522
|
-
* * The _query_ query parameter is required.
|
|
16523
|
-
*
|
|
16524
|
-
* _401 Unauthorized_
|
|
16525
|
-
*
|
|
16526
|
-
* * The Authorization header is required and must contain an app access token or user access token.
|
|
16527
|
-
* * The access token is not valid.
|
|
16528
|
-
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
16529
|
-
*
|
|
16530
|
-
* @see https://dev.twitch.tv/docs/api/reference#search-channels
|
|
16531
|
-
*/
|
|
16602
|
+
type: "BITS" | "SUBS" | "OTHER";
|
|
16532
16603
|
user: string;
|
|
16533
16604
|
};
|
|
16534
16605
|
level: number;
|
|
@@ -17817,38 +17888,7 @@ declare class TwitchApi {
|
|
|
17817
17888
|
is_active: boolean;
|
|
17818
17889
|
moderator_id: string;
|
|
17819
17890
|
moderator_login: string;
|
|
17820
|
-
moderator_name: string;
|
|
17821
|
-
* Updates the specified user’s information. The user ID in the OAuth token identifies the user whose information you want to update.
|
|
17822
|
-
*
|
|
17823
|
-
* To include the user’s verified email address in the response, the user access token must also include the **user:read:email** scope.
|
|
17824
|
-
*
|
|
17825
|
-
* __Authorization:__
|
|
17826
|
-
*
|
|
17827
|
-
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **user:edit** scope.
|
|
17828
|
-
*
|
|
17829
|
-
* __URL:__
|
|
17830
|
-
*
|
|
17831
|
-
* `PUT https://api.twitch.tv/helix/users`
|
|
17832
|
-
*
|
|
17833
|
-
* __Response Codes:__
|
|
17834
|
-
*
|
|
17835
|
-
* _200 OK_
|
|
17836
|
-
*
|
|
17837
|
-
* Successfully updated the specified user's information.
|
|
17838
|
-
*
|
|
17839
|
-
* _400 Bad Request_
|
|
17840
|
-
*
|
|
17841
|
-
* * The string in the _description_ query parameter is too long.
|
|
17842
|
-
*
|
|
17843
|
-
* _401 Unauthorized_
|
|
17844
|
-
*
|
|
17845
|
-
* * The Authorization header is required and must contain a user access token.
|
|
17846
|
-
* * The user access token must include the **user:edit** scope.
|
|
17847
|
-
* * The access token is not valid.
|
|
17848
|
-
* * The ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
17849
|
-
*
|
|
17850
|
-
* @see https://dev.twitch.tv/docs/api/reference#update-user
|
|
17851
|
-
*/
|
|
17891
|
+
moderator_name: string;
|
|
17852
17892
|
last_activated_at: string;
|
|
17853
17893
|
}[];
|
|
17854
17894
|
};
|
|
@@ -18116,7 +18156,42 @@ declare class TwitchApi {
|
|
|
18116
18156
|
broadcaster_id: string;
|
|
18117
18157
|
broadcaster_name: string;
|
|
18118
18158
|
broadcaster_login: string;
|
|
18119
|
-
title: string;
|
|
18159
|
+
title: string; /**
|
|
18160
|
+
* 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.
|
|
18161
|
+
*
|
|
18162
|
+
* NOTE: If you try to activate an extension under multiple extension types, the last write wins (and there is no guarantee of write order).
|
|
18163
|
+
*
|
|
18164
|
+
* __Authorization:__
|
|
18165
|
+
*
|
|
18166
|
+
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **user:edit:broadcast** scope.
|
|
18167
|
+
*
|
|
18168
|
+
* __URL:__
|
|
18169
|
+
*
|
|
18170
|
+
* `PUT https://api.twitch.tv/helix/users/extensions`
|
|
18171
|
+
*
|
|
18172
|
+
* __Response Codes:__
|
|
18173
|
+
*
|
|
18174
|
+
* _200 OK_
|
|
18175
|
+
*
|
|
18176
|
+
* Successfully updated the active extensions.
|
|
18177
|
+
*
|
|
18178
|
+
* _400 Bad Request_
|
|
18179
|
+
*
|
|
18180
|
+
* * The JSON payload is malformed.
|
|
18181
|
+
*
|
|
18182
|
+
* _401 Unauthorized_
|
|
18183
|
+
*
|
|
18184
|
+
* * The Authorization header is required and must contain a user access token.
|
|
18185
|
+
* * The user access token must include the **user:edit:broadcast** scope.
|
|
18186
|
+
* * The access token is not valid.
|
|
18187
|
+
* * The ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
18188
|
+
*
|
|
18189
|
+
* _404 Not Found_
|
|
18190
|
+
*
|
|
18191
|
+
* * An extension with the specified `id` and `version` values was not found.
|
|
18192
|
+
*
|
|
18193
|
+
* @see https://dev.twitch.tv/docs/api/reference#update-user-extensions
|
|
18194
|
+
*/
|
|
18120
18195
|
winning_outcome_id: string | null;
|
|
18121
18196
|
outcomes: {
|
|
18122
18197
|
id: string;
|
|
@@ -18200,7 +18275,42 @@ declare class TwitchApi {
|
|
|
18200
18275
|
broadcaster_id: string;
|
|
18201
18276
|
broadcaster_name: string;
|
|
18202
18277
|
broadcaster_login: string;
|
|
18203
|
-
title: string;
|
|
18278
|
+
title: string; /**
|
|
18279
|
+
* 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.
|
|
18280
|
+
*
|
|
18281
|
+
* NOTE: If you try to activate an extension under multiple extension types, the last write wins (and there is no guarantee of write order).
|
|
18282
|
+
*
|
|
18283
|
+
* __Authorization:__
|
|
18284
|
+
*
|
|
18285
|
+
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **user:edit:broadcast** scope.
|
|
18286
|
+
*
|
|
18287
|
+
* __URL:__
|
|
18288
|
+
*
|
|
18289
|
+
* `PUT https://api.twitch.tv/helix/users/extensions`
|
|
18290
|
+
*
|
|
18291
|
+
* __Response Codes:__
|
|
18292
|
+
*
|
|
18293
|
+
* _200 OK_
|
|
18294
|
+
*
|
|
18295
|
+
* Successfully updated the active extensions.
|
|
18296
|
+
*
|
|
18297
|
+
* _400 Bad Request_
|
|
18298
|
+
*
|
|
18299
|
+
* * The JSON payload is malformed.
|
|
18300
|
+
*
|
|
18301
|
+
* _401 Unauthorized_
|
|
18302
|
+
*
|
|
18303
|
+
* * The Authorization header is required and must contain a user access token.
|
|
18304
|
+
* * The user access token must include the **user:edit:broadcast** scope.
|
|
18305
|
+
* * The access token is not valid.
|
|
18306
|
+
* * The ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
18307
|
+
*
|
|
18308
|
+
* _404 Not Found_
|
|
18309
|
+
*
|
|
18310
|
+
* * An extension with the specified `id` and `version` values was not found.
|
|
18311
|
+
*
|
|
18312
|
+
* @see https://dev.twitch.tv/docs/api/reference#update-user-extensions
|
|
18313
|
+
*/
|
|
18204
18314
|
winning_outcome_id: string | null;
|
|
18205
18315
|
outcomes: {
|
|
18206
18316
|
id: string;
|
|
@@ -18279,7 +18389,42 @@ declare class TwitchApi {
|
|
|
18279
18389
|
broadcaster_id: string;
|
|
18280
18390
|
broadcaster_name: string;
|
|
18281
18391
|
broadcaster_login: string;
|
|
18282
|
-
title: string;
|
|
18392
|
+
title: string; /**
|
|
18393
|
+
* 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.
|
|
18394
|
+
*
|
|
18395
|
+
* NOTE: If you try to activate an extension under multiple extension types, the last write wins (and there is no guarantee of write order).
|
|
18396
|
+
*
|
|
18397
|
+
* __Authorization:__
|
|
18398
|
+
*
|
|
18399
|
+
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **user:edit:broadcast** scope.
|
|
18400
|
+
*
|
|
18401
|
+
* __URL:__
|
|
18402
|
+
*
|
|
18403
|
+
* `PUT https://api.twitch.tv/helix/users/extensions`
|
|
18404
|
+
*
|
|
18405
|
+
* __Response Codes:__
|
|
18406
|
+
*
|
|
18407
|
+
* _200 OK_
|
|
18408
|
+
*
|
|
18409
|
+
* Successfully updated the active extensions.
|
|
18410
|
+
*
|
|
18411
|
+
* _400 Bad Request_
|
|
18412
|
+
*
|
|
18413
|
+
* * The JSON payload is malformed.
|
|
18414
|
+
*
|
|
18415
|
+
* _401 Unauthorized_
|
|
18416
|
+
*
|
|
18417
|
+
* * The Authorization header is required and must contain a user access token.
|
|
18418
|
+
* * The user access token must include the **user:edit:broadcast** scope.
|
|
18419
|
+
* * The access token is not valid.
|
|
18420
|
+
* * The ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
18421
|
+
*
|
|
18422
|
+
* _404 Not Found_
|
|
18423
|
+
*
|
|
18424
|
+
* * An extension with the specified `id` and `version` values was not found.
|
|
18425
|
+
*
|
|
18426
|
+
* @see https://dev.twitch.tv/docs/api/reference#update-user-extensions
|
|
18427
|
+
*/
|
|
18283
18428
|
winning_outcome_id: string | null;
|
|
18284
18429
|
outcomes: {
|
|
18285
18430
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -47,10 +47,17 @@ var TwitchApi = class {
|
|
|
47
47
|
options.headers.set("Client-Id", clientId || this._clientId);
|
|
48
48
|
}
|
|
49
49
|
const response = await fetch(url, options);
|
|
50
|
+
const status = response.status;
|
|
51
|
+
let data = null;
|
|
52
|
+
if (status === 200 && path === "/schedule/icalendar") {
|
|
53
|
+
data = await response.text();
|
|
54
|
+
} else if (status !== 204) {
|
|
55
|
+
data = await response.json();
|
|
56
|
+
}
|
|
50
57
|
return {
|
|
51
58
|
ok: response.ok,
|
|
52
|
-
status
|
|
53
|
-
data
|
|
59
|
+
status,
|
|
60
|
+
data
|
|
54
61
|
};
|
|
55
62
|
}
|
|
56
63
|
ads = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-twitch-api",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Very simple TwitchApi class and TypeScript interfaces for all Twitch API endpoints",
|
|
5
5
|
"author": "DmitryScaletta",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"gen": "pnpm dlx openapi-typescript https://github.com/DmitryScaletta/twitch-api-swagger/raw/main/openapi.json --output twitch-api.generated.ts"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^20.11.
|
|
38
|
-
"tsup": "^8.0.
|
|
39
|
-
"tsx": "^4.7.
|
|
40
|
-
"typescript": "^5.
|
|
37
|
+
"@types/node": "^20.11.28",
|
|
38
|
+
"tsup": "^8.0.2",
|
|
39
|
+
"tsx": "^4.7.1",
|
|
40
|
+
"typescript": "^5.4.2"
|
|
41
41
|
}
|
|
42
42
|
}
|