ts-twitch-api 0.2.8 → 0.3.0
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 +91 -5
- package/dist/index.d.cts +347 -40
- package/dist/index.d.ts +347 -40
- package/dist/index.js +91 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1510,7 +1510,7 @@ var TwitchApi = class {
|
|
|
1510
1510
|
*
|
|
1511
1511
|
* @see https://dev.twitch.tv/docs/api/reference#send-a-shoutout
|
|
1512
1512
|
*/
|
|
1513
|
-
|
|
1513
|
+
sendAShoutout: (params, options = {}) => this.callApi({
|
|
1514
1514
|
path: "/chat/shoutouts",
|
|
1515
1515
|
method: "POST",
|
|
1516
1516
|
params,
|
|
@@ -3128,7 +3128,7 @@ var TwitchApi = class {
|
|
|
3128
3128
|
*
|
|
3129
3129
|
* __Response Codes:__
|
|
3130
3130
|
*
|
|
3131
|
-
*
|
|
3131
|
+
* _200 OK_
|
|
3132
3132
|
*
|
|
3133
3133
|
* _400 Bad Request_
|
|
3134
3134
|
*
|
|
@@ -4529,7 +4529,7 @@ var TwitchApi = class {
|
|
|
4529
4529
|
options
|
|
4530
4530
|
}),
|
|
4531
4531
|
/**
|
|
4532
|
-
*
|
|
4532
|
+
* Warns a user in the specified broadcaster’s chat room, preventing them from chat interaction until the warning is acknowledged. New warnings can be issued to a user when they already have a warning in the channel (new warning will replace old warning).
|
|
4533
4533
|
*
|
|
4534
4534
|
* __Authorization:__
|
|
4535
4535
|
*
|
|
@@ -4586,6 +4586,92 @@ var TwitchApi = class {
|
|
|
4586
4586
|
params,
|
|
4587
4587
|
body,
|
|
4588
4588
|
options
|
|
4589
|
+
}),
|
|
4590
|
+
/**
|
|
4591
|
+
* BETA Adds a suspicious user status to a chatter on the broadcaster’s channel.
|
|
4592
|
+
*
|
|
4593
|
+
* __Authorization:__
|
|
4594
|
+
*
|
|
4595
|
+
* 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) that includes the **moderator:manage:suspicious\_users** scope.
|
|
4596
|
+
*
|
|
4597
|
+
* __URL:__
|
|
4598
|
+
*
|
|
4599
|
+
* `POST https://api.twitch.tv/helix/moderation/suspicious_users`
|
|
4600
|
+
*
|
|
4601
|
+
* __Response Codes:__
|
|
4602
|
+
*
|
|
4603
|
+
* _200 OK_
|
|
4604
|
+
*
|
|
4605
|
+
* Successfully applied a suspicious user status.
|
|
4606
|
+
*
|
|
4607
|
+
* _400 Bad Request_
|
|
4608
|
+
*
|
|
4609
|
+
* * Validation errors: Missing required fields.
|
|
4610
|
+
* * The ID in the broadcaster\_id query parameter was not found.
|
|
4611
|
+
* * The status specified was invalid. Must either be ACTIVE\_MONITORING or RESTRICTED
|
|
4612
|
+
* * The status update is not allowed for this user.
|
|
4613
|
+
*
|
|
4614
|
+
* _401 Unauthorized_
|
|
4615
|
+
*
|
|
4616
|
+
* * The Authorization header is required and must specify user access token.
|
|
4617
|
+
* * The user access token must include the **moderator:manage:suspicious\_users** scope.
|
|
4618
|
+
* * The OAuth token is not valid.
|
|
4619
|
+
* * The ID in the Client-Id header must match the Client ID in the OAuth token.
|
|
4620
|
+
*
|
|
4621
|
+
* _403 Forbidden_
|
|
4622
|
+
*
|
|
4623
|
+
* * The user in the moderator\_id query parameter is not one of the broadcaster's moderators.
|
|
4624
|
+
*
|
|
4625
|
+
* @see https://dev.twitch.tv/docs/api/reference#add-suspicious-status-to-chat-user
|
|
4626
|
+
*/
|
|
4627
|
+
addSuspiciousStatusToChatUser: (params, body, options = {}) => this.callApi({
|
|
4628
|
+
path: "/moderation/suspicious_users",
|
|
4629
|
+
method: "POST",
|
|
4630
|
+
params,
|
|
4631
|
+
body,
|
|
4632
|
+
options
|
|
4633
|
+
}),
|
|
4634
|
+
/**
|
|
4635
|
+
* BETA Remove a suspicious user status from a chatter on broadcaster’s channel.
|
|
4636
|
+
*
|
|
4637
|
+
* __Authorization:__
|
|
4638
|
+
*
|
|
4639
|
+
* 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) that includes the **moderator:manage:suspicious\_users** scope.
|
|
4640
|
+
*
|
|
4641
|
+
* __URL:__
|
|
4642
|
+
*
|
|
4643
|
+
* `DELETE https://api.twitch.tv/helix/moderation/suspicious_users`
|
|
4644
|
+
*
|
|
4645
|
+
* __Response Codes:__
|
|
4646
|
+
*
|
|
4647
|
+
* _200 OK_
|
|
4648
|
+
*
|
|
4649
|
+
* Successfully removed a suspicious user status.
|
|
4650
|
+
*
|
|
4651
|
+
* _400 Bad Request_
|
|
4652
|
+
*
|
|
4653
|
+
* * Validation errors: Missing required fields.
|
|
4654
|
+
* * The ID in the broadcaster\_id query parameter was not found.
|
|
4655
|
+
* * The status update is not allowed for this user.
|
|
4656
|
+
*
|
|
4657
|
+
* _401 Unauthorized_
|
|
4658
|
+
*
|
|
4659
|
+
* * The Authorization header is required and must specify user access token.
|
|
4660
|
+
* * The user access token must include the **moderator:manage:suspicious\_users** scope.
|
|
4661
|
+
* * The OAuth token is not valid.
|
|
4662
|
+
* * The ID in the Client-Id header must match the Client ID in the OAuth token.
|
|
4663
|
+
*
|
|
4664
|
+
* _403 Forbidden_
|
|
4665
|
+
*
|
|
4666
|
+
* * The user in the moderator\_id query parameter is not one of the broadcaster's moderators.
|
|
4667
|
+
*
|
|
4668
|
+
* @see https://dev.twitch.tv/docs/api/reference#remove-suspicious-status-from-chat-user
|
|
4669
|
+
*/
|
|
4670
|
+
removeSuspiciousStatusFromChatUser: (params, options = {}) => this.callApi({
|
|
4671
|
+
path: "/moderation/suspicious_users",
|
|
4672
|
+
method: "DELETE",
|
|
4673
|
+
params,
|
|
4674
|
+
options
|
|
4589
4675
|
})
|
|
4590
4676
|
};
|
|
4591
4677
|
polls = {
|
|
@@ -4916,7 +5002,7 @@ var TwitchApi = class {
|
|
|
4916
5002
|
*
|
|
4917
5003
|
* @see https://dev.twitch.tv/docs/api/reference#start-a-raid
|
|
4918
5004
|
*/
|
|
4919
|
-
|
|
5005
|
+
startARaid: (params = null, options = {}) => this.callApi({
|
|
4920
5006
|
path: "/raids",
|
|
4921
5007
|
method: "POST",
|
|
4922
5008
|
params,
|
|
@@ -4965,7 +5051,7 @@ var TwitchApi = class {
|
|
|
4965
5051
|
*
|
|
4966
5052
|
* @see https://dev.twitch.tv/docs/api/reference#cancel-a-raid
|
|
4967
5053
|
*/
|
|
4968
|
-
|
|
5054
|
+
cancelARaid: (params, options = {}) => this.callApi({
|
|
4969
5055
|
path: "/raids",
|
|
4970
5056
|
method: "DELETE",
|
|
4971
5057
|
params,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-twitch-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Very simple TwitchApi class and TypeScript interfaces for all Twitch API endpoints",
|
|
5
5
|
"author": "DmitryScaletta",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "pnpm build:src && tsup",
|
|
38
38
|
"build:src": "node ./scripts/build.ts",
|
|
39
|
-
"gen": "
|
|
39
|
+
"gen": "pnpx openapi-typescript@6 https://github.com/DmitryScaletta/twitch-api-swagger/raw/main/openapi.json --output twitch-api.generated.ts"
|
|
40
40
|
}
|
|
41
41
|
}
|