@yuniruyuni/n8n-nodes-twitch 0.1.5 → 0.1.7
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/nodes/{TwitchBans/TwitchBans.node.d.ts → Twitch/Twitch.node.d.ts} +1 -1
- package/dist/nodes/Twitch/Twitch.node.js +147 -0
- package/dist/nodes/Twitch/Twitch.node.js.map +1 -0
- package/dist/nodes/Twitch/resources/Announcement.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Announcement.js +116 -0
- package/dist/nodes/Twitch/resources/Announcement.js.map +1 -0
- package/dist/nodes/Twitch/resources/Ban.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Ban.js +202 -0
- package/dist/nodes/Twitch/resources/Ban.js.map +1 -0
- package/dist/nodes/Twitch/resources/BitsLeaderboard.d.ts +3 -0
- package/dist/nodes/Twitch/resources/BitsLeaderboard.js +138 -0
- package/dist/nodes/Twitch/resources/BitsLeaderboard.js.map +1 -0
- package/dist/nodes/Twitch/resources/Channel.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Channel.js +62 -0
- package/dist/nodes/Twitch/resources/Channel.js.map +1 -0
- package/dist/nodes/Twitch/resources/ChatMessage.d.ts +3 -0
- package/dist/nodes/Twitch/resources/ChatMessage.js +95 -0
- package/dist/nodes/Twitch/resources/ChatMessage.js.map +1 -0
- package/dist/nodes/Twitch/resources/Chatter.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Chatter.js +61 -0
- package/dist/nodes/Twitch/resources/Chatter.js.map +1 -0
- package/dist/nodes/Twitch/resources/Cheermote.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Cheermote.js +58 -0
- package/dist/nodes/Twitch/resources/Cheermote.js.map +1 -0
- package/dist/nodes/Twitch/resources/Clip.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Clip.js +224 -0
- package/dist/nodes/Twitch/resources/Clip.js.map +1 -0
- package/dist/nodes/Twitch/resources/CommonFields.d.ts +2 -0
- package/dist/nodes/Twitch/resources/CommonFields.js +241 -0
- package/dist/nodes/Twitch/resources/CommonFields.js.map +1 -0
- package/dist/nodes/Twitch/resources/CustomReward.d.ts +3 -0
- package/dist/nodes/Twitch/resources/CustomReward.js +550 -0
- package/dist/nodes/Twitch/resources/CustomReward.js.map +1 -0
- package/dist/nodes/Twitch/resources/Emote.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Emote.js +56 -0
- package/dist/nodes/Twitch/resources/Emote.js.map +1 -0
- package/dist/nodes/Twitch/resources/Game.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Game.js +191 -0
- package/dist/nodes/Twitch/resources/Game.js.map +1 -0
- package/dist/nodes/Twitch/resources/Moderator.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Moderator.js +175 -0
- package/dist/nodes/Twitch/resources/Moderator.js.map +1 -0
- package/dist/nodes/Twitch/resources/Poll.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Poll.js +349 -0
- package/dist/nodes/Twitch/resources/Poll.js.map +1 -0
- package/dist/nodes/Twitch/resources/Prediction.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Prediction.js +305 -0
- package/dist/nodes/Twitch/resources/Prediction.js.map +1 -0
- package/dist/nodes/Twitch/resources/Raid.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Raid.js +146 -0
- package/dist/nodes/Twitch/resources/Raid.js.map +1 -0
- package/dist/nodes/Twitch/resources/Redemption.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Redemption.js +235 -0
- package/dist/nodes/Twitch/resources/Redemption.js.map +1 -0
- package/dist/nodes/Twitch/resources/Schedule.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Schedule.js +388 -0
- package/dist/nodes/Twitch/resources/Schedule.js.map +1 -0
- package/dist/nodes/Twitch/resources/Search.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Search.js +97 -0
- package/dist/nodes/Twitch/resources/Search.js.map +1 -0
- package/dist/nodes/Twitch/resources/Stream.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Stream.js +68 -0
- package/dist/nodes/Twitch/resources/Stream.js.map +1 -0
- package/dist/nodes/Twitch/resources/Subscription.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Subscription.js +144 -0
- package/dist/nodes/Twitch/resources/Subscription.js.map +1 -0
- package/dist/nodes/Twitch/resources/Team.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Team.js +153 -0
- package/dist/nodes/Twitch/resources/Team.js.map +1 -0
- package/dist/nodes/Twitch/resources/User.d.ts +3 -0
- package/dist/nodes/Twitch/resources/User.js +68 -0
- package/dist/nodes/Twitch/resources/User.js.map +1 -0
- package/dist/nodes/Twitch/resources/Video.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Video.js +296 -0
- package/dist/nodes/Twitch/resources/Video.js.map +1 -0
- package/dist/nodes/Twitch/resources/Whisper.d.ts +3 -0
- package/dist/nodes/Twitch/resources/Whisper.js +78 -0
- package/dist/nodes/Twitch/resources/Whisper.js.map +1 -0
- package/dist/nodes/Twitch/shared/userIdConverter.js.map +1 -0
- package/dist/nodes/TwitchTrigger/TwitchTrigger.node.js +1 -1
- package/dist/nodes/TwitchTrigger/TwitchTrigger.node.js.map +1 -1
- package/dist/package.json +3 -26
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -26
- package/dist/nodes/TwitchAnnouncements/TwitchAnnouncements.node.d.ts +0 -4
- package/dist/nodes/TwitchAnnouncements/TwitchAnnouncements.node.js +0 -169
- package/dist/nodes/TwitchAnnouncements/TwitchAnnouncements.node.js.map +0 -1
- package/dist/nodes/TwitchBans/TwitchBans.node.js +0 -340
- package/dist/nodes/TwitchBans/TwitchBans.node.js.map +0 -1
- package/dist/nodes/TwitchBans/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchBans/twitch.svg +0 -1
- package/dist/nodes/TwitchBitsLeaderboard/TwitchBitsLeaderboard.node.d.ts +0 -4
- package/dist/nodes/TwitchBitsLeaderboard/TwitchBitsLeaderboard.node.js +0 -174
- package/dist/nodes/TwitchBitsLeaderboard/TwitchBitsLeaderboard.node.js.map +0 -1
- package/dist/nodes/TwitchBitsLeaderboard/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchBitsLeaderboard/twitch.svg +0 -1
- package/dist/nodes/TwitchChannels/TwitchChannels.node.d.ts +0 -4
- package/dist/nodes/TwitchChannels/TwitchChannels.node.js +0 -104
- package/dist/nodes/TwitchChannels/TwitchChannels.node.js.map +0 -1
- package/dist/nodes/TwitchChannels/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchChannels/twitch.svg +0 -1
- package/dist/nodes/TwitchChatMessages/TwitchChatMessages.node.d.ts +0 -4
- package/dist/nodes/TwitchChatMessages/TwitchChatMessages.node.js +0 -133
- package/dist/nodes/TwitchChatMessages/TwitchChatMessages.node.js.map +0 -1
- package/dist/nodes/TwitchChatMessages/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchChatMessages/twitch.svg +0 -1
- package/dist/nodes/TwitchChatters/TwitchChatters.node.d.ts +0 -4
- package/dist/nodes/TwitchChatters/TwitchChatters.node.js +0 -133
- package/dist/nodes/TwitchChatters/TwitchChatters.node.js.map +0 -1
- package/dist/nodes/TwitchChatters/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchChatters/twitch.svg +0 -1
- package/dist/nodes/TwitchCheermotes/TwitchCheermotes.node.d.ts +0 -4
- package/dist/nodes/TwitchCheermotes/TwitchCheermotes.node.js +0 -99
- package/dist/nodes/TwitchCheermotes/TwitchCheermotes.node.js.map +0 -1
- package/dist/nodes/TwitchCheermotes/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchCheermotes/twitch.svg +0 -1
- package/dist/nodes/TwitchClips/TwitchClips.node.d.ts +0 -4
- package/dist/nodes/TwitchClips/TwitchClips.node.js +0 -291
- package/dist/nodes/TwitchClips/TwitchClips.node.js.map +0 -1
- package/dist/nodes/TwitchClips/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchClips/twitch.svg +0 -1
- package/dist/nodes/TwitchCustomRewards/TwitchCustomRewards.node.d.ts +0 -4
- package/dist/nodes/TwitchCustomRewards/TwitchCustomRewards.node.js +0 -581
- package/dist/nodes/TwitchCustomRewards/TwitchCustomRewards.node.js.map +0 -1
- package/dist/nodes/TwitchCustomRewards/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchCustomRewards/twitch.svg +0 -1
- package/dist/nodes/TwitchEmotes/TwitchEmotes.node.d.ts +0 -4
- package/dist/nodes/TwitchEmotes/TwitchEmotes.node.js +0 -97
- package/dist/nodes/TwitchEmotes/TwitchEmotes.node.js.map +0 -1
- package/dist/nodes/TwitchEmotes/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchEmotes/twitch.svg +0 -1
- package/dist/nodes/TwitchGames/TwitchGames.node.d.ts +0 -4
- package/dist/nodes/TwitchGames/TwitchGames.node.js +0 -230
- package/dist/nodes/TwitchGames/TwitchGames.node.js.map +0 -1
- package/dist/nodes/TwitchGames/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchGames/twitch.svg +0 -1
- package/dist/nodes/TwitchModerators/TwitchModerators.node.d.ts +0 -4
- package/dist/nodes/TwitchModerators/TwitchModerators.node.js +0 -287
- package/dist/nodes/TwitchModerators/TwitchModerators.node.js.map +0 -1
- package/dist/nodes/TwitchModerators/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchModerators/twitch.svg +0 -1
- package/dist/nodes/TwitchPolls/TwitchPolls.node.d.ts +0 -4
- package/dist/nodes/TwitchPolls/TwitchPolls.node.js +0 -426
- package/dist/nodes/TwitchPolls/TwitchPolls.node.js.map +0 -1
- package/dist/nodes/TwitchPolls/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchPolls/twitch.svg +0 -1
- package/dist/nodes/TwitchPredictions/TwitchPredictions.node.d.ts +0 -4
- package/dist/nodes/TwitchPredictions/TwitchPredictions.node.js +0 -382
- package/dist/nodes/TwitchPredictions/TwitchPredictions.node.js.map +0 -1
- package/dist/nodes/TwitchPredictions/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchPredictions/twitch.svg +0 -1
- package/dist/nodes/TwitchRaids/TwitchRaids.node.d.ts +0 -4
- package/dist/nodes/TwitchRaids/TwitchRaids.node.js +0 -183
- package/dist/nodes/TwitchRaids/TwitchRaids.node.js.map +0 -1
- package/dist/nodes/TwitchRaids/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchRaids/twitch.svg +0 -1
- package/dist/nodes/TwitchRedemptions/TwitchRedemptions.node.d.ts +0 -4
- package/dist/nodes/TwitchRedemptions/TwitchRedemptions.node.js +0 -274
- package/dist/nodes/TwitchRedemptions/TwitchRedemptions.node.js.map +0 -1
- package/dist/nodes/TwitchRedemptions/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchRedemptions/twitch.svg +0 -1
- package/dist/nodes/TwitchSchedule/TwitchSchedule.node.d.ts +0 -4
- package/dist/nodes/TwitchSchedule/TwitchSchedule.node.js +0 -432
- package/dist/nodes/TwitchSchedule/TwitchSchedule.node.js.map +0 -1
- package/dist/nodes/TwitchSchedule/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchSchedule/twitch.svg +0 -1
- package/dist/nodes/TwitchSearch/TwitchSearch.node.d.ts +0 -4
- package/dist/nodes/TwitchSearch/TwitchSearch.node.js +0 -134
- package/dist/nodes/TwitchSearch/TwitchSearch.node.js.map +0 -1
- package/dist/nodes/TwitchSearch/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchSearch/twitch.svg +0 -1
- package/dist/nodes/TwitchStreams/TwitchStreams.node.d.ts +0 -4
- package/dist/nodes/TwitchStreams/TwitchStreams.node.js +0 -94
- package/dist/nodes/TwitchStreams/TwitchStreams.node.js.map +0 -1
- package/dist/nodes/TwitchStreams/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchStreams/twitch.svg +0 -1
- package/dist/nodes/TwitchSubscriptions/TwitchSubscriptions.node.d.ts +0 -4
- package/dist/nodes/TwitchSubscriptions/TwitchSubscriptions.node.js +0 -208
- package/dist/nodes/TwitchSubscriptions/TwitchSubscriptions.node.js.map +0 -1
- package/dist/nodes/TwitchSubscriptions/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchSubscriptions/twitch.svg +0 -1
- package/dist/nodes/TwitchTeams/TwitchTeams.node.d.ts +0 -4
- package/dist/nodes/TwitchTeams/TwitchTeams.node.js +0 -191
- package/dist/nodes/TwitchTeams/TwitchTeams.node.js.map +0 -1
- package/dist/nodes/TwitchTeams/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchTeams/twitch.svg +0 -1
- package/dist/nodes/TwitchUsers/TwitchUsers.node.d.ts +0 -4
- package/dist/nodes/TwitchUsers/TwitchUsers.node.js +0 -94
- package/dist/nodes/TwitchUsers/TwitchUsers.node.js.map +0 -1
- package/dist/nodes/TwitchUsers/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchUsers/twitch.svg +0 -1
- package/dist/nodes/TwitchVideos/TwitchVideos.node.d.ts +0 -4
- package/dist/nodes/TwitchVideos/TwitchVideos.node.js +0 -343
- package/dist/nodes/TwitchVideos/TwitchVideos.node.js.map +0 -1
- package/dist/nodes/TwitchVideos/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchVideos/twitch.svg +0 -1
- package/dist/nodes/TwitchWhispers/TwitchWhispers.node.d.ts +0 -4
- package/dist/nodes/TwitchWhispers/TwitchWhispers.node.js +0 -105
- package/dist/nodes/TwitchWhispers/TwitchWhispers.node.js.map +0 -1
- package/dist/nodes/TwitchWhispers/twitch.dark.svg +0 -1
- package/dist/nodes/TwitchWhispers/twitch.svg +0 -1
- package/dist/nodes/shared/userIdConverter.js.map +0 -1
- /package/dist/nodes/{shared → Twitch/shared}/userIdConverter.d.ts +0 -0
- /package/dist/nodes/{shared → Twitch/shared}/userIdConverter.js +0 -0
- /package/dist/nodes/{TwitchAnnouncements → Twitch}/twitch.dark.svg +0 -0
- /package/dist/nodes/{TwitchAnnouncements → Twitch}/twitch.svg +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TwitchEmotes = void 0;
|
|
4
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
-
const userIdConverter_1 = require("../shared/userIdConverter");
|
|
6
|
-
class TwitchEmotes {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.description = {
|
|
9
|
-
displayName: 'Twitch Emotes',
|
|
10
|
-
name: 'twitchEmotes',
|
|
11
|
-
icon: { light: 'file:twitch.svg', dark: 'file:twitch.dark.svg' },
|
|
12
|
-
group: ['output'],
|
|
13
|
-
version: 1,
|
|
14
|
-
description: 'Get emotes for a Twitch channel',
|
|
15
|
-
defaults: {
|
|
16
|
-
name: 'Twitch Emotes',
|
|
17
|
-
},
|
|
18
|
-
usableAsTool: true,
|
|
19
|
-
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
20
|
-
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
21
|
-
credentials: [
|
|
22
|
-
{
|
|
23
|
-
name: 'twitchOAuth2Api',
|
|
24
|
-
required: true,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
requestDefaults: {
|
|
28
|
-
baseURL: 'https://api.twitch.tv/helix',
|
|
29
|
-
headers: {
|
|
30
|
-
Accept: 'application/json',
|
|
31
|
-
'Content-Type': 'application/json',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
properties: [
|
|
35
|
-
{
|
|
36
|
-
displayName: 'Operation',
|
|
37
|
-
name: 'operation',
|
|
38
|
-
type: 'options',
|
|
39
|
-
noDataExpression: true,
|
|
40
|
-
options: [
|
|
41
|
-
{
|
|
42
|
-
name: 'Get Channel Emotes',
|
|
43
|
-
value: 'getChannelEmotes',
|
|
44
|
-
action: 'Get channel emotes',
|
|
45
|
-
description: 'Get emotes for a specific Twitch channel',
|
|
46
|
-
routing: {
|
|
47
|
-
request: {
|
|
48
|
-
method: 'GET',
|
|
49
|
-
url: '/chat/emotes',
|
|
50
|
-
},
|
|
51
|
-
send: {
|
|
52
|
-
preSend: [
|
|
53
|
-
async function (requestOptions) {
|
|
54
|
-
const broadcasterIdInput = this.getNodeParameter('broadcasterId');
|
|
55
|
-
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
56
|
-
requestOptions.qs = {
|
|
57
|
-
broadcaster_id: broadcasterId,
|
|
58
|
-
};
|
|
59
|
-
return requestOptions;
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
output: {
|
|
64
|
-
postReceive: [
|
|
65
|
-
{
|
|
66
|
-
type: 'rootProperty',
|
|
67
|
-
properties: {
|
|
68
|
-
property: 'data',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
default: 'getChannelEmotes',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
displayName: 'Broadcaster ID or Username',
|
|
80
|
-
name: 'broadcasterId',
|
|
81
|
-
type: 'string',
|
|
82
|
-
displayOptions: {
|
|
83
|
-
show: {
|
|
84
|
-
operation: ['getChannelEmotes'],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
default: '',
|
|
88
|
-
required: true,
|
|
89
|
-
placeholder: 'e.g. 123456789 or username',
|
|
90
|
-
description: 'The broadcaster user ID or username whose emotes you want to get. If a username is provided, it will be automatically converted to user ID.',
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.TwitchEmotes = TwitchEmotes;
|
|
97
|
-
//# sourceMappingURL=TwitchEmotes.node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TwitchEmotes.node.js","sourceRoot":"","sources":["../../../nodes/TwitchEmotes/TwitchEmotes.node.ts"],"names":[],"mappings":";;;AAAA,+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E,kBAAkB,CAAC,CAAC;4CACnF,cAAc,CAAC,EAAE,GAAG;gDACnB,cAAc,EAAE,aAAa;6CAC7B,CAAC;4CACF,OAAO,cAAc,CAAC;wCACvB,CAAC;qCACD;iCACD;gCACD,MAAM,EAAE;oCACP,WAAW,EAAE;wCACZ;4CACC,IAAI,EAAE,cAAc;4CACpB,UAAU,EAAE;gDACX,QAAQ,EAAE,MAAM;6CAChB;yCACD;qCACD;iCACD;6BACD;yBACD;qBACD;oBACD,OAAO,EAAE,kBAAkB;iBAC3B;gBACD;oBACC,WAAW,EAAE,4BAA4B;oBACzC,IAAI,EAAE,eAAe;oBACrB,IAAI,EAAE,QAAQ;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,SAAS,EAAE,CAAC,kBAAkB,CAAC;yBAC/B;qBACD;oBACD,OAAO,EAAE,EAAE;oBACX,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,4BAA4B;oBACzC,WAAW,EAAE,6IAA6I;iBAC1J;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAvFD,oCAuFC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Twitch</title><path fill="#FFFFFF" d="M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Twitch</title><path d="M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"/></svg>
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TwitchGames = void 0;
|
|
4
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
-
class TwitchGames {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.description = {
|
|
8
|
-
displayName: 'Twitch Games',
|
|
9
|
-
name: 'twitchGames',
|
|
10
|
-
icon: { light: 'file:twitch.svg', dark: 'file:twitch.dark.svg' },
|
|
11
|
-
group: ['transform'],
|
|
12
|
-
version: 1,
|
|
13
|
-
subtitle: '={{$parameter["operation"]}}',
|
|
14
|
-
description: 'Interact with Twitch Games API',
|
|
15
|
-
defaults: {
|
|
16
|
-
name: 'Twitch Games',
|
|
17
|
-
},
|
|
18
|
-
usableAsTool: true,
|
|
19
|
-
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
20
|
-
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
21
|
-
credentials: [
|
|
22
|
-
{
|
|
23
|
-
name: 'twitchOAuth2Api',
|
|
24
|
-
required: true,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
requestDefaults: {
|
|
28
|
-
baseURL: 'https://api.twitch.tv/helix',
|
|
29
|
-
headers: {
|
|
30
|
-
Accept: 'application/json',
|
|
31
|
-
'Content-Type': 'application/json',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
properties: [
|
|
35
|
-
{
|
|
36
|
-
displayName: 'Operation',
|
|
37
|
-
name: 'operation',
|
|
38
|
-
type: 'options',
|
|
39
|
-
noDataExpression: true,
|
|
40
|
-
options: [
|
|
41
|
-
{
|
|
42
|
-
name: 'Get Games',
|
|
43
|
-
value: 'getGames',
|
|
44
|
-
action: 'Get games by ID or name',
|
|
45
|
-
description: 'Get games by ID, name, or IGDB ID',
|
|
46
|
-
routing: {
|
|
47
|
-
request: {
|
|
48
|
-
method: 'GET',
|
|
49
|
-
url: '/games',
|
|
50
|
-
},
|
|
51
|
-
send: {
|
|
52
|
-
preSend: [
|
|
53
|
-
async function (requestOptions) {
|
|
54
|
-
const searchBy = this.getNodeParameter('searchBy', 0);
|
|
55
|
-
const searchValue = this.getNodeParameter('searchValue', 0);
|
|
56
|
-
if (!searchValue || searchValue.trim() === '') {
|
|
57
|
-
throw new n8n_workflow_1.ApplicationError('Search value is required');
|
|
58
|
-
}
|
|
59
|
-
const values = searchValue.split(',').map((v) => v.trim()).filter((v) => v !== '');
|
|
60
|
-
if (values.length === 0) {
|
|
61
|
-
throw new n8n_workflow_1.ApplicationError('At least one search value is required');
|
|
62
|
-
}
|
|
63
|
-
const qs = {};
|
|
64
|
-
if (searchBy === 'id') {
|
|
65
|
-
qs.id = values;
|
|
66
|
-
}
|
|
67
|
-
else if (searchBy === 'name') {
|
|
68
|
-
qs.name = values;
|
|
69
|
-
}
|
|
70
|
-
else if (searchBy === 'igdb_id') {
|
|
71
|
-
qs.igdb_id = values;
|
|
72
|
-
}
|
|
73
|
-
requestOptions.qs = qs;
|
|
74
|
-
return requestOptions;
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
output: {
|
|
79
|
-
postReceive: [
|
|
80
|
-
{
|
|
81
|
-
type: 'rootProperty',
|
|
82
|
-
properties: {
|
|
83
|
-
property: 'data',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: 'Get Top Games',
|
|
92
|
-
value: 'getTopGames',
|
|
93
|
-
action: 'Get top games by viewer count',
|
|
94
|
-
description: 'Get top games sorted by viewer count',
|
|
95
|
-
routing: {
|
|
96
|
-
request: {
|
|
97
|
-
method: 'GET',
|
|
98
|
-
url: '/games/top',
|
|
99
|
-
},
|
|
100
|
-
send: {
|
|
101
|
-
preSend: [
|
|
102
|
-
async function (requestOptions) {
|
|
103
|
-
const first = this.getNodeParameter('first', 0);
|
|
104
|
-
const after = this.getNodeParameter('after', 0);
|
|
105
|
-
const before = this.getNodeParameter('before', 0);
|
|
106
|
-
const qs = {};
|
|
107
|
-
if (first) {
|
|
108
|
-
if (first < 1 || first > 100) {
|
|
109
|
-
throw new n8n_workflow_1.ApplicationError('First parameter must be between 1 and 100');
|
|
110
|
-
}
|
|
111
|
-
qs.first = first;
|
|
112
|
-
}
|
|
113
|
-
if (after && after.trim() !== '') {
|
|
114
|
-
qs.after = after.trim();
|
|
115
|
-
}
|
|
116
|
-
if (before && before.trim() !== '') {
|
|
117
|
-
qs.before = before.trim();
|
|
118
|
-
}
|
|
119
|
-
requestOptions.qs = qs;
|
|
120
|
-
return requestOptions;
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
},
|
|
124
|
-
output: {
|
|
125
|
-
postReceive: [
|
|
126
|
-
{
|
|
127
|
-
type: 'rootProperty',
|
|
128
|
-
properties: {
|
|
129
|
-
property: 'data',
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
default: 'getGames',
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
displayName: 'Search By',
|
|
141
|
-
name: 'searchBy',
|
|
142
|
-
type: 'options',
|
|
143
|
-
displayOptions: {
|
|
144
|
-
show: {
|
|
145
|
-
operation: ['getGames'],
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
options: [
|
|
149
|
-
{
|
|
150
|
-
name: 'Game ID',
|
|
151
|
-
value: 'id',
|
|
152
|
-
description: 'Search by Twitch game ID',
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
name: 'Game Name',
|
|
156
|
-
value: 'name',
|
|
157
|
-
description: 'Search by game name',
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: 'IGDB ID',
|
|
161
|
-
value: 'igdb_id',
|
|
162
|
-
description: 'Search by IGDB (Internet Game Database) ID',
|
|
163
|
-
},
|
|
164
|
-
],
|
|
165
|
-
default: 'name',
|
|
166
|
-
description: 'The field to search games by',
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
displayName: 'Search Value',
|
|
170
|
-
name: 'searchValue',
|
|
171
|
-
type: 'string',
|
|
172
|
-
displayOptions: {
|
|
173
|
-
show: {
|
|
174
|
-
operation: ['getGames'],
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
default: '',
|
|
178
|
-
required: true,
|
|
179
|
-
placeholder: 'e.g. Fortnite or 33214,493057',
|
|
180
|
-
description: 'The value to search for. Supports multiple values separated by commas (max 100).',
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
displayName: 'First',
|
|
184
|
-
name: 'first',
|
|
185
|
-
type: 'number',
|
|
186
|
-
displayOptions: {
|
|
187
|
-
show: {
|
|
188
|
-
operation: ['getTopGames'],
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
default: 20,
|
|
192
|
-
typeOptions: {
|
|
193
|
-
minValue: 1,
|
|
194
|
-
maxValue: 100,
|
|
195
|
-
},
|
|
196
|
-
placeholder: 'e.g. 20',
|
|
197
|
-
description: 'Maximum number of games to return (1-100). Default is 20.',
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
displayName: 'After',
|
|
201
|
-
name: 'after',
|
|
202
|
-
type: 'string',
|
|
203
|
-
displayOptions: {
|
|
204
|
-
show: {
|
|
205
|
-
operation: ['getTopGames'],
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
default: '',
|
|
209
|
-
placeholder: 'e.g. eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6MjB9fQ',
|
|
210
|
-
description: 'Cursor for forward pagination. Get this from the pagination object in the previous response.',
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
displayName: 'Before',
|
|
214
|
-
name: 'before',
|
|
215
|
-
type: 'string',
|
|
216
|
-
displayOptions: {
|
|
217
|
-
show: {
|
|
218
|
-
operation: ['getTopGames'],
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
default: '',
|
|
222
|
-
placeholder: 'e.g. eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6MjB9fQ',
|
|
223
|
-
description: 'Cursor for backward pagination. Get this from the pagination object in the previous response.',
|
|
224
|
-
},
|
|
225
|
-
],
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
exports.TwitchGames = TwitchGames;
|
|
230
|
-
//# sourceMappingURL=TwitchGames.node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TwitchGames.node.js","sourceRoot":"","sources":["../../../nodes/TwitchGames/TwitchGames.node.ts"],"names":[],"mappings":";;;AAAA,+CAAgH;AAEhH,MAAa,WAAW;IAAxB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,sBAAsB,EAAE;YAChE,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE;gBACT,IAAI,EAAE,cAAc;aACpB;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,iBAAiB;oBACvB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,eAAe,EAAE;gBAChB,OAAO,EAAE,6BAA6B;gBACtC,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBAClC;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;o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/F;gBAED;oBACC,WAAW,EAAE,OAAO;oBACpB,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,QAAQ;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,SAAS,EAAE,CAAC,aAAa,CAAC;yBAC1B;qBACD;oBACD,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE;wBACZ,QAAQ,EAAE,CAAC;wBACX,QAAQ,EAAE,GAAG;qBACb;oBACD,WAAW,EAAE,SAAS;oBACtB,WAAW,EAAE,2DAA2D;iBACxE;gBACD;oBACC,WAAW,EAAE,OAAO;oBACpB,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,QAAQ;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,SAAS,EAAE,CAAC,aAAa,CAAC;yBAC1B;qBACD;oBACD,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,6CAA6C;oBAC1D,WAAW,EAAE,8FAA8F;iBAC3G;gBACD;oBACC,WAAW,EAAE,QAAQ;oBACrB,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,QAAQ;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,SAAS,EAAE,CAAC,aAAa,CAAC;yBAC1B;qBACD;oBACD,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,6CAA6C;oBAC1D,WAAW,EAAE,+FAA+F;iBAC5G;aACD;SACD,CAAC;IACH,CAAC;CAAA;AA7OD,kCA6OC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Twitch</title><path fill="#FFFFFF" d="M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Twitch</title><path d="M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"/></svg>
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TwitchModerators = void 0;
|
|
4
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
-
const userIdConverter_1 = require("../shared/userIdConverter");
|
|
6
|
-
class TwitchModerators {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.description = {
|
|
9
|
-
displayName: 'Twitch Moderators',
|
|
10
|
-
name: 'twitchModerators',
|
|
11
|
-
icon: { light: 'file:twitch.svg', dark: 'file:twitch.dark.svg' },
|
|
12
|
-
group: ['output'],
|
|
13
|
-
version: 1,
|
|
14
|
-
subtitle: '={{$parameter["operation"]}}',
|
|
15
|
-
description: 'Manage moderators in a Twitch channel',
|
|
16
|
-
defaults: {
|
|
17
|
-
name: 'Twitch Moderators',
|
|
18
|
-
},
|
|
19
|
-
usableAsTool: true,
|
|
20
|
-
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
21
|
-
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
22
|
-
credentials: [
|
|
23
|
-
{
|
|
24
|
-
name: 'twitchOAuth2Api',
|
|
25
|
-
required: true,
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
requestDefaults: {
|
|
29
|
-
baseURL: 'https://api.twitch.tv/helix',
|
|
30
|
-
headers: {
|
|
31
|
-
Accept: 'application/json',
|
|
32
|
-
'Content-Type': 'application/json',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
properties: [
|
|
36
|
-
{
|
|
37
|
-
displayName: 'Operation',
|
|
38
|
-
name: 'operation',
|
|
39
|
-
type: 'options',
|
|
40
|
-
noDataExpression: true,
|
|
41
|
-
options: [
|
|
42
|
-
{
|
|
43
|
-
name: 'Get',
|
|
44
|
-
value: 'get',
|
|
45
|
-
action: 'Get moderators in a channel',
|
|
46
|
-
description: 'Get all moderators in a broadcaster\'s channel',
|
|
47
|
-
routing: {
|
|
48
|
-
request: {
|
|
49
|
-
method: 'GET',
|
|
50
|
-
url: '/moderation/moderators',
|
|
51
|
-
},
|
|
52
|
-
send: {
|
|
53
|
-
preSend: [
|
|
54
|
-
async function (requestOptions) {
|
|
55
|
-
const broadcasterIdInput = this.getNodeParameter('broadcasterId', 0);
|
|
56
|
-
const userIdsInput = this.getNodeParameter('userIds', 0);
|
|
57
|
-
const first = this.getNodeParameter('first', 0);
|
|
58
|
-
if (!broadcasterIdInput || broadcasterIdInput.trim() === '') {
|
|
59
|
-
throw new n8n_workflow_1.ApplicationError('Broadcaster ID is required');
|
|
60
|
-
}
|
|
61
|
-
if (first < 1 || first > 100) {
|
|
62
|
-
throw new n8n_workflow_1.ApplicationError('First parameter must be between 1 and 100');
|
|
63
|
-
}
|
|
64
|
-
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput.trim());
|
|
65
|
-
const qs = {
|
|
66
|
-
broadcaster_id: broadcasterId,
|
|
67
|
-
first,
|
|
68
|
-
};
|
|
69
|
-
if (userIdsInput && userIdsInput.trim() !== '') {
|
|
70
|
-
const userIdList = userIdsInput.split(',').map((v) => v.trim()).filter((v) => v !== '');
|
|
71
|
-
if (userIdList.length > 0) {
|
|
72
|
-
const resolvedUserIds = await Promise.all(userIdList.map((id) => userIdConverter_1.resolveUserIdOrUsername.call(this, id)));
|
|
73
|
-
qs.user_id = resolvedUserIds;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
requestOptions.qs = qs;
|
|
77
|
-
return requestOptions;
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
output: {
|
|
82
|
-
postReceive: [
|
|
83
|
-
{
|
|
84
|
-
type: 'rootProperty',
|
|
85
|
-
properties: {
|
|
86
|
-
property: 'data',
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'Add',
|
|
95
|
-
value: 'add',
|
|
96
|
-
action: 'Add a moderator to a channel',
|
|
97
|
-
description: 'Add a moderator to the broadcaster\'s chat room',
|
|
98
|
-
routing: {
|
|
99
|
-
request: {
|
|
100
|
-
method: 'POST',
|
|
101
|
-
url: '/moderation/moderators',
|
|
102
|
-
},
|
|
103
|
-
send: {
|
|
104
|
-
preSend: [
|
|
105
|
-
async function (requestOptions) {
|
|
106
|
-
const broadcasterIdInput = this.getNodeParameter('broadcasterId', 0);
|
|
107
|
-
const userIdInput = this.getNodeParameter('userId', 0);
|
|
108
|
-
if (!broadcasterIdInput || broadcasterIdInput.trim() === '') {
|
|
109
|
-
throw new n8n_workflow_1.ApplicationError('Broadcaster ID is required');
|
|
110
|
-
}
|
|
111
|
-
if (!userIdInput || userIdInput.trim() === '') {
|
|
112
|
-
throw new n8n_workflow_1.ApplicationError('User ID is required');
|
|
113
|
-
}
|
|
114
|
-
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput.trim());
|
|
115
|
-
const userId = await userIdConverter_1.resolveUserIdOrUsername.call(this, userIdInput.trim());
|
|
116
|
-
requestOptions.qs = {
|
|
117
|
-
broadcaster_id: broadcasterId,
|
|
118
|
-
user_id: userId,
|
|
119
|
-
};
|
|
120
|
-
return requestOptions;
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
},
|
|
124
|
-
output: {
|
|
125
|
-
postReceive: [
|
|
126
|
-
{
|
|
127
|
-
type: 'set',
|
|
128
|
-
properties: {
|
|
129
|
-
value: '={{ { "success": true } }}',
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
name: 'Remove',
|
|
138
|
-
value: 'remove',
|
|
139
|
-
action: 'Remove a moderator from a channel',
|
|
140
|
-
description: 'Remove a moderator from the broadcaster\'s chat room',
|
|
141
|
-
routing: {
|
|
142
|
-
request: {
|
|
143
|
-
method: 'DELETE',
|
|
144
|
-
url: '/moderation/moderators',
|
|
145
|
-
},
|
|
146
|
-
send: {
|
|
147
|
-
preSend: [
|
|
148
|
-
async function (requestOptions) {
|
|
149
|
-
const broadcasterIdInput = this.getNodeParameter('broadcasterId', 0);
|
|
150
|
-
const userIdInput = this.getNodeParameter('userId', 0);
|
|
151
|
-
if (!broadcasterIdInput || broadcasterIdInput.trim() === '') {
|
|
152
|
-
throw new n8n_workflow_1.ApplicationError('Broadcaster ID is required');
|
|
153
|
-
}
|
|
154
|
-
if (!userIdInput || userIdInput.trim() === '') {
|
|
155
|
-
throw new n8n_workflow_1.ApplicationError('User ID is required');
|
|
156
|
-
}
|
|
157
|
-
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput.trim());
|
|
158
|
-
const userId = await userIdConverter_1.resolveUserIdOrUsername.call(this, userIdInput.trim());
|
|
159
|
-
requestOptions.qs = {
|
|
160
|
-
broadcaster_id: broadcasterId,
|
|
161
|
-
user_id: userId,
|
|
162
|
-
};
|
|
163
|
-
return requestOptions;
|
|
164
|
-
},
|
|
165
|
-
],
|
|
166
|
-
},
|
|
167
|
-
output: {
|
|
168
|
-
postReceive: [
|
|
169
|
-
{
|
|
170
|
-
type: 'set',
|
|
171
|
-
properties: {
|
|
172
|
-
value: '={{ { "success": true } }}',
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
],
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
],
|
|
180
|
-
default: 'get',
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
displayName: 'Broadcaster ID or Username',
|
|
184
|
-
name: 'broadcasterId',
|
|
185
|
-
type: 'string',
|
|
186
|
-
displayOptions: {
|
|
187
|
-
show: {
|
|
188
|
-
operation: ['get'],
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
default: '',
|
|
192
|
-
required: true,
|
|
193
|
-
placeholder: 'e.g. 141981764 or username',
|
|
194
|
-
description: 'The broadcaster user ID or username whose list of moderators you want to get. If a username is provided, it will be automatically converted to user ID.',
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
displayName: 'User IDs or Usernames',
|
|
198
|
-
name: 'userIds',
|
|
199
|
-
type: 'string',
|
|
200
|
-
displayOptions: {
|
|
201
|
-
show: {
|
|
202
|
-
operation: ['get'],
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
default: '',
|
|
206
|
-
placeholder: 'e.g. 123456,789012 or username1,username2',
|
|
207
|
-
description: 'Filters the list for specific moderators. Comma-separated list of user IDs or usernames. Maximum 100.',
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
displayName: 'First',
|
|
211
|
-
name: 'first',
|
|
212
|
-
type: 'number',
|
|
213
|
-
displayOptions: {
|
|
214
|
-
show: {
|
|
215
|
-
operation: ['get'],
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
default: 20,
|
|
219
|
-
typeOptions: {
|
|
220
|
-
minValue: 1,
|
|
221
|
-
maxValue: 100,
|
|
222
|
-
},
|
|
223
|
-
placeholder: 'e.g. 20',
|
|
224
|
-
description: 'Maximum number of moderators to return (1-100). Default is 20.',
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
displayName: 'Broadcaster ID or Username',
|
|
228
|
-
name: 'broadcasterId',
|
|
229
|
-
type: 'string',
|
|
230
|
-
displayOptions: {
|
|
231
|
-
show: {
|
|
232
|
-
operation: ['add'],
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
default: '',
|
|
236
|
-
required: true,
|
|
237
|
-
placeholder: 'e.g. 141981764 or username',
|
|
238
|
-
description: 'The broadcaster user ID or username that owns the chat room. If a username is provided, it will be automatically converted to user ID.',
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
displayName: 'User ID or Username',
|
|
242
|
-
name: 'userId',
|
|
243
|
-
type: 'string',
|
|
244
|
-
displayOptions: {
|
|
245
|
-
show: {
|
|
246
|
-
operation: ['add'],
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
default: '',
|
|
250
|
-
required: true,
|
|
251
|
-
placeholder: 'e.g. 123456 or username',
|
|
252
|
-
description: 'The user ID or username to add as a moderator. If a username is provided, it will be automatically converted to user ID.',
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
displayName: 'Broadcaster ID or Username',
|
|
256
|
-
name: 'broadcasterId',
|
|
257
|
-
type: 'string',
|
|
258
|
-
displayOptions: {
|
|
259
|
-
show: {
|
|
260
|
-
operation: ['remove'],
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
default: '',
|
|
264
|
-
required: true,
|
|
265
|
-
placeholder: 'e.g. 141981764 or username',
|
|
266
|
-
description: 'The broadcaster user ID or username that owns the chat room. If a username is provided, it will be automatically converted to user ID.',
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
displayName: 'User ID or Username',
|
|
270
|
-
name: 'userId',
|
|
271
|
-
type: 'string',
|
|
272
|
-
displayOptions: {
|
|
273
|
-
show: {
|
|
274
|
-
operation: ['remove'],
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
default: '',
|
|
278
|
-
required: true,
|
|
279
|
-
placeholder: 'e.g. 123456 or username',
|
|
280
|
-
description: 'The user ID or username to remove as a moderator. If a username is provided, it will be automatically converted to user ID.',
|
|
281
|
-
},
|
|
282
|
-
],
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
exports.TwitchModerators = TwitchModerators;
|
|
287
|
-
//# sourceMappingURL=TwitchModerators.node.js.map
|