@yuniruyuni/n8n-nodes-twitch 0.1.4 → 0.1.6
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/credentials/TwitchOAuth2Api.credentials.d.ts +2 -1
- package/dist/credentials/TwitchOAuth2Api.credentials.js +8 -0
- package/dist/credentials/TwitchOAuth2Api.credentials.js.map +1 -1
- package/dist/nodes/{TwitchBans/TwitchBans.node.d.ts → Twitch/Twitch.node.d.ts} +1 -1
- package/dist/nodes/Twitch/Twitch.node.js +145 -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 +146 -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 +324 -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 +152 -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 +78 -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 +110 -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 +109 -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 +73 -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 +273 -0
- package/dist/nodes/Twitch/resources/Clip.js.map +1 -0
- package/dist/nodes/Twitch/resources/CustomReward.d.ts +3 -0
- package/dist/nodes/Twitch/resources/CustomReward.js +564 -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 +72 -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 +209 -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 +268 -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 +411 -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 +367 -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 +161 -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 +260 -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 +415 -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 +108 -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 +190 -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 +168 -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 +323 -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.d.ts +2 -0
- package/dist/nodes/Twitch/shared/userIdConverter.js +32 -0
- package/dist/nodes/Twitch/shared/userIdConverter.js.map +1 -0
- package/dist/nodes/TwitchTrigger/TwitchTrigger.node.js +6 -4
- 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 -166
- package/dist/nodes/TwitchAnnouncements/TwitchAnnouncements.node.js.map +0 -1
- package/dist/nodes/TwitchBans/TwitchBans.node.js +0 -324
- 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 -172
- 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 -94
- 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 -130
- 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 -118
- 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 -83
- 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 -278
- 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 -576
- 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 -95
- 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 -280
- 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 -422
- 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 -378
- 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 -162
- 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 -271
- 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 -427
- 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 -202
- 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 -189
- 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 -341
- 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/{TwitchAnnouncements → Twitch}/twitch.dark.svg +0 -0
- /package/dist/nodes/{TwitchAnnouncements → Twitch}/twitch.svg +0 -0
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.predictionFields = exports.predictionOperations = void 0;
|
|
4
|
+
const userIdConverter_1 = require("../shared/userIdConverter");
|
|
5
|
+
exports.predictionOperations = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Operation',
|
|
8
|
+
name: 'operation',
|
|
9
|
+
type: 'options',
|
|
10
|
+
noDataExpression: true,
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['prediction'],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
options: [
|
|
17
|
+
{
|
|
18
|
+
name: 'Create Prediction',
|
|
19
|
+
value: 'createPrediction',
|
|
20
|
+
action: 'Create a prediction',
|
|
21
|
+
description: 'Create a Channel Points Prediction',
|
|
22
|
+
routing: {
|
|
23
|
+
request: {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
url: '/predictions',
|
|
26
|
+
},
|
|
27
|
+
send: {
|
|
28
|
+
preSend: [
|
|
29
|
+
async function (requestOptions) {
|
|
30
|
+
const broadcasterIdInput = this.getNodeParameter('broadcasterId', 0);
|
|
31
|
+
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
32
|
+
const title = this.getNodeParameter('title', 0);
|
|
33
|
+
const predictionWindow = this.getNodeParameter('predictionWindow', 0);
|
|
34
|
+
const outcome1Title = this.getNodeParameter('outcome1Title', 0);
|
|
35
|
+
const outcome2Title = this.getNodeParameter('outcome2Title', 0);
|
|
36
|
+
const body = {
|
|
37
|
+
broadcaster_id: broadcasterId,
|
|
38
|
+
title: title,
|
|
39
|
+
outcomes: [
|
|
40
|
+
{ title: outcome1Title },
|
|
41
|
+
{ title: outcome2Title },
|
|
42
|
+
],
|
|
43
|
+
prediction_window: predictionWindow,
|
|
44
|
+
};
|
|
45
|
+
requestOptions.body = body;
|
|
46
|
+
return requestOptions;
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
output: {
|
|
51
|
+
postReceive: [
|
|
52
|
+
{
|
|
53
|
+
type: 'rootProperty',
|
|
54
|
+
properties: {
|
|
55
|
+
property: 'data',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: 'setKeyValue',
|
|
60
|
+
properties: {
|
|
61
|
+
index: 0,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Get Predictions',
|
|
70
|
+
value: 'getPredictions',
|
|
71
|
+
action: 'Get predictions',
|
|
72
|
+
description: 'Get Channel Points Predictions',
|
|
73
|
+
routing: {
|
|
74
|
+
request: {
|
|
75
|
+
method: 'GET',
|
|
76
|
+
url: '/predictions',
|
|
77
|
+
},
|
|
78
|
+
send: {
|
|
79
|
+
preSend: [
|
|
80
|
+
async function (requestOptions) {
|
|
81
|
+
const broadcasterIdInput = this.getNodeParameter('broadcasterId', 0);
|
|
82
|
+
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
83
|
+
const qs = {
|
|
84
|
+
broadcaster_id: broadcasterId,
|
|
85
|
+
};
|
|
86
|
+
const predictionId = this.getNodeParameter('predictionId', '');
|
|
87
|
+
if (predictionId) {
|
|
88
|
+
qs.id = predictionId;
|
|
89
|
+
}
|
|
90
|
+
const first = this.getNodeParameter('first', '');
|
|
91
|
+
if (first) {
|
|
92
|
+
qs.first = first;
|
|
93
|
+
}
|
|
94
|
+
requestOptions.qs = qs;
|
|
95
|
+
return requestOptions;
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
output: {
|
|
100
|
+
postReceive: [
|
|
101
|
+
{
|
|
102
|
+
type: 'rootProperty',
|
|
103
|
+
properties: {
|
|
104
|
+
property: 'data',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'End Prediction',
|
|
113
|
+
value: 'endPrediction',
|
|
114
|
+
action: 'End a prediction',
|
|
115
|
+
description: 'End a Channel Points Prediction',
|
|
116
|
+
routing: {
|
|
117
|
+
request: {
|
|
118
|
+
method: 'PATCH',
|
|
119
|
+
url: '/predictions',
|
|
120
|
+
},
|
|
121
|
+
send: {
|
|
122
|
+
preSend: [
|
|
123
|
+
async function (requestOptions) {
|
|
124
|
+
const broadcasterIdInput = this.getNodeParameter('broadcasterId', 0);
|
|
125
|
+
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
126
|
+
const predictionId = this.getNodeParameter('endPredictionId', 0);
|
|
127
|
+
const status = this.getNodeParameter('status', 0);
|
|
128
|
+
const body = {
|
|
129
|
+
broadcaster_id: broadcasterId,
|
|
130
|
+
id: predictionId,
|
|
131
|
+
status: status,
|
|
132
|
+
};
|
|
133
|
+
if (status === 'RESOLVED') {
|
|
134
|
+
const winningOutcomeId = this.getNodeParameter('winningOutcomeId', 0);
|
|
135
|
+
body.winning_outcome_id = winningOutcomeId;
|
|
136
|
+
}
|
|
137
|
+
requestOptions.body = body;
|
|
138
|
+
return requestOptions;
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
output: {
|
|
143
|
+
postReceive: [
|
|
144
|
+
{
|
|
145
|
+
type: 'rootProperty',
|
|
146
|
+
properties: {
|
|
147
|
+
property: 'data',
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
type: 'setKeyValue',
|
|
152
|
+
properties: {
|
|
153
|
+
index: 0,
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
default: 'getPredictions',
|
|
162
|
+
},
|
|
163
|
+
];
|
|
164
|
+
exports.predictionFields = [
|
|
165
|
+
{
|
|
166
|
+
displayName: 'Broadcaster ID or Username',
|
|
167
|
+
name: 'broadcasterId',
|
|
168
|
+
type: 'string',
|
|
169
|
+
displayOptions: {
|
|
170
|
+
show: {
|
|
171
|
+
resource: ['prediction'],
|
|
172
|
+
operation: ['createPrediction'],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
default: '',
|
|
176
|
+
required: true,
|
|
177
|
+
placeholder: 'e.g. 123456789 or username',
|
|
178
|
+
description: 'The broadcaster user ID or username running the prediction. If a username is provided, it will be automatically converted to user ID.',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
displayName: 'Title',
|
|
182
|
+
name: 'title',
|
|
183
|
+
type: 'string',
|
|
184
|
+
displayOptions: {
|
|
185
|
+
show: {
|
|
186
|
+
resource: ['prediction'],
|
|
187
|
+
operation: ['createPrediction'],
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
default: '',
|
|
191
|
+
required: true,
|
|
192
|
+
placeholder: 'e.g. Will I win this match?',
|
|
193
|
+
description: 'The question that viewers are predicting. Maximum: 45 characters.',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
displayName: 'Outcome 1 Title',
|
|
197
|
+
name: 'outcome1Title',
|
|
198
|
+
type: 'string',
|
|
199
|
+
displayOptions: {
|
|
200
|
+
show: {
|
|
201
|
+
resource: ['prediction'],
|
|
202
|
+
operation: ['createPrediction'],
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
default: '',
|
|
206
|
+
required: true,
|
|
207
|
+
placeholder: 'e.g. Yes',
|
|
208
|
+
description: 'The title for the first outcome. Maximum: 25 characters.',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
displayName: 'Outcome 2 Title',
|
|
212
|
+
name: 'outcome2Title',
|
|
213
|
+
type: 'string',
|
|
214
|
+
displayOptions: {
|
|
215
|
+
show: {
|
|
216
|
+
resource: ['prediction'],
|
|
217
|
+
operation: ['createPrediction'],
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
default: '',
|
|
221
|
+
required: true,
|
|
222
|
+
placeholder: 'e.g. No',
|
|
223
|
+
description: 'The title for the second outcome. Maximum: 25 characters.',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
displayName: 'Prediction Window',
|
|
227
|
+
name: 'predictionWindow',
|
|
228
|
+
type: 'number',
|
|
229
|
+
displayOptions: {
|
|
230
|
+
show: {
|
|
231
|
+
resource: ['prediction'],
|
|
232
|
+
operation: ['createPrediction'],
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
default: 120,
|
|
236
|
+
required: true,
|
|
237
|
+
typeOptions: {
|
|
238
|
+
minValue: 30,
|
|
239
|
+
maxValue: 1800,
|
|
240
|
+
},
|
|
241
|
+
description: 'The length of time (in seconds) that viewers have to make a prediction. Minimum: 30. Maximum: 1800.',
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
displayName: 'Broadcaster ID or Username',
|
|
245
|
+
name: 'broadcasterId',
|
|
246
|
+
type: 'string',
|
|
247
|
+
displayOptions: {
|
|
248
|
+
show: {
|
|
249
|
+
resource: ['prediction'],
|
|
250
|
+
operation: ['getPredictions'],
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
default: '',
|
|
254
|
+
required: true,
|
|
255
|
+
placeholder: 'e.g. 123456789 or username',
|
|
256
|
+
description: 'The broadcaster user ID or username whose predictions you want to get. If a username is provided, it will be automatically converted to user ID.',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
displayName: 'Prediction ID',
|
|
260
|
+
name: 'predictionId',
|
|
261
|
+
type: 'string',
|
|
262
|
+
displayOptions: {
|
|
263
|
+
show: {
|
|
264
|
+
resource: ['prediction'],
|
|
265
|
+
operation: ['getPredictions'],
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
default: '',
|
|
269
|
+
placeholder: 'e.g. abc123-def456-ghi789',
|
|
270
|
+
description: 'The ID of the prediction to get. If not specified, returns all predictions for the broadcaster.',
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
displayName: 'First',
|
|
274
|
+
name: 'first',
|
|
275
|
+
type: 'number',
|
|
276
|
+
displayOptions: {
|
|
277
|
+
show: {
|
|
278
|
+
resource: ['prediction'],
|
|
279
|
+
operation: ['getPredictions'],
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
default: 20,
|
|
283
|
+
typeOptions: {
|
|
284
|
+
minValue: 1,
|
|
285
|
+
maxValue: 20,
|
|
286
|
+
},
|
|
287
|
+
description: 'Maximum number of predictions to return (1-20)',
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
displayName: 'Broadcaster ID or Username',
|
|
291
|
+
name: 'broadcasterId',
|
|
292
|
+
type: 'string',
|
|
293
|
+
displayOptions: {
|
|
294
|
+
show: {
|
|
295
|
+
resource: ['prediction'],
|
|
296
|
+
operation: ['endPrediction'],
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
default: '',
|
|
300
|
+
required: true,
|
|
301
|
+
placeholder: 'e.g. 123456789 or username',
|
|
302
|
+
description: 'The broadcaster user ID or username running the prediction. If a username is provided, it will be automatically converted to user ID.',
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
displayName: 'Prediction ID',
|
|
306
|
+
name: 'endPredictionId',
|
|
307
|
+
type: 'string',
|
|
308
|
+
displayOptions: {
|
|
309
|
+
show: {
|
|
310
|
+
resource: ['prediction'],
|
|
311
|
+
operation: ['endPrediction'],
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
default: '',
|
|
315
|
+
required: true,
|
|
316
|
+
placeholder: 'e.g. abc123-def456-ghi789',
|
|
317
|
+
description: 'The ID of the prediction to end',
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
displayName: 'Status',
|
|
321
|
+
name: 'status',
|
|
322
|
+
type: 'options',
|
|
323
|
+
displayOptions: {
|
|
324
|
+
show: {
|
|
325
|
+
resource: ['prediction'],
|
|
326
|
+
operation: ['endPrediction'],
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
options: [
|
|
330
|
+
{
|
|
331
|
+
name: 'RESOLVED',
|
|
332
|
+
value: 'RESOLVED',
|
|
333
|
+
description: 'The winning outcome is determined and points are distributed',
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: 'CANCELED',
|
|
337
|
+
value: 'CANCELED',
|
|
338
|
+
description: 'The prediction is canceled and points are refunded',
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: 'LOCKED',
|
|
342
|
+
value: 'LOCKED',
|
|
343
|
+
description: 'The prediction is locked and viewers can no longer make predictions',
|
|
344
|
+
},
|
|
345
|
+
],
|
|
346
|
+
default: 'RESOLVED',
|
|
347
|
+
required: true,
|
|
348
|
+
description: 'The status to set the prediction to',
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
displayName: 'Winning Outcome ID',
|
|
352
|
+
name: 'winningOutcomeId',
|
|
353
|
+
type: 'string',
|
|
354
|
+
displayOptions: {
|
|
355
|
+
show: {
|
|
356
|
+
resource: ['prediction'],
|
|
357
|
+
operation: ['endPrediction'],
|
|
358
|
+
status: ['RESOLVED'],
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
default: '',
|
|
362
|
+
required: true,
|
|
363
|
+
placeholder: 'e.g. outcome123',
|
|
364
|
+
description: 'The ID of the winning outcome (required when status is RESOLVED)',
|
|
365
|
+
},
|
|
366
|
+
];
|
|
367
|
+
//# sourceMappingURL=Prediction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prediction.js","sourceRoot":"","sources":["../../../../nodes/Twitch/resources/Prediction.ts"],"names":[],"mappings":";;;AACA,+DAAoE;AAEvD,QAAA,oBAAoB,GAAsB;IACtD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,Q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SACD;QACD,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,qCAAqC;KAClD;IACD;QACC,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,YAAY,CAAC;gBACxB,SAAS,EAAE,CAAC,eAAe,CAAC;gBAC5B,MAAM,EAAE,CAAC,UAAU,CAAC;aACpB;SACD;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,kEAAkE;KAC/E;CACD,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.raidFields = exports.raidOperations = void 0;
|
|
4
|
+
const userIdConverter_1 = require("../shared/userIdConverter");
|
|
5
|
+
exports.raidOperations = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Operation',
|
|
8
|
+
name: 'operation',
|
|
9
|
+
type: 'options',
|
|
10
|
+
noDataExpression: true,
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['raid'],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
options: [
|
|
17
|
+
{
|
|
18
|
+
name: 'Start Raid',
|
|
19
|
+
value: 'startRaid',
|
|
20
|
+
action: 'Start a raid',
|
|
21
|
+
description: 'Start a raid from one broadcaster to another',
|
|
22
|
+
routing: {
|
|
23
|
+
request: {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
url: '/raids',
|
|
26
|
+
},
|
|
27
|
+
send: {
|
|
28
|
+
preSend: [
|
|
29
|
+
async function (requestOptions) {
|
|
30
|
+
const fromBroadcasterIdInput = this.getNodeParameter('fromBroadcasterId');
|
|
31
|
+
const toBroadcasterIdInput = this.getNodeParameter('toBroadcasterId');
|
|
32
|
+
const fromBroadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, fromBroadcasterIdInput);
|
|
33
|
+
const toBroadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, toBroadcasterIdInput);
|
|
34
|
+
requestOptions.qs = {
|
|
35
|
+
from_broadcaster_id: fromBroadcasterId,
|
|
36
|
+
to_broadcaster_id: toBroadcasterId,
|
|
37
|
+
};
|
|
38
|
+
return requestOptions;
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
output: {
|
|
43
|
+
postReceive: [
|
|
44
|
+
{
|
|
45
|
+
type: 'rootProperty',
|
|
46
|
+
properties: {
|
|
47
|
+
property: 'data',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'setKeyValue',
|
|
52
|
+
properties: {
|
|
53
|
+
index: 0,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Cancel Raid',
|
|
62
|
+
value: 'cancelRaid',
|
|
63
|
+
action: 'Cancel a raid',
|
|
64
|
+
description: 'Cancel a pending raid',
|
|
65
|
+
routing: {
|
|
66
|
+
request: {
|
|
67
|
+
method: 'DELETE',
|
|
68
|
+
url: '/raids',
|
|
69
|
+
},
|
|
70
|
+
send: {
|
|
71
|
+
preSend: [
|
|
72
|
+
async function (requestOptions) {
|
|
73
|
+
const broadcasterIdInput = this.getNodeParameter('broadcasterId');
|
|
74
|
+
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
75
|
+
requestOptions.qs = {
|
|
76
|
+
broadcaster_id: broadcasterId,
|
|
77
|
+
};
|
|
78
|
+
return requestOptions;
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
default: 'startRaid',
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
exports.raidFields = [
|
|
89
|
+
{
|
|
90
|
+
displayName: 'From Broadcaster ID or Username',
|
|
91
|
+
name: 'fromBroadcasterId',
|
|
92
|
+
type: 'string',
|
|
93
|
+
displayOptions: {
|
|
94
|
+
show: {
|
|
95
|
+
resource: ['raid'],
|
|
96
|
+
operation: ['startRaid'],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
default: '',
|
|
100
|
+
required: true,
|
|
101
|
+
placeholder: 'e.g. 123456789 or username',
|
|
102
|
+
description: 'The broadcaster user ID or username that is starting the raid (must be the authenticated user). If a username is provided, it will be automatically converted to user ID.',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
displayName: 'To Broadcaster ID or Username',
|
|
106
|
+
name: 'toBroadcasterId',
|
|
107
|
+
type: 'string',
|
|
108
|
+
displayOptions: {
|
|
109
|
+
show: {
|
|
110
|
+
resource: ['raid'],
|
|
111
|
+
operation: ['startRaid'],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
default: '',
|
|
115
|
+
required: true,
|
|
116
|
+
placeholder: 'e.g. 987654321 or username',
|
|
117
|
+
description: 'The broadcaster user ID or username to raid. If a username is provided, it will be automatically converted to user ID.',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
displayName: 'Note',
|
|
121
|
+
name: 'startRaidNote',
|
|
122
|
+
type: 'notice',
|
|
123
|
+
default: '',
|
|
124
|
+
displayOptions: {
|
|
125
|
+
show: {
|
|
126
|
+
resource: ['raid'],
|
|
127
|
+
operation: ['startRaid'],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
description: 'Requires OAuth2 authentication with channel:manage:raids scope. The authenticated user must match the from_broadcaster_id.',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
displayName: 'Broadcaster ID or Username',
|
|
134
|
+
name: 'broadcasterId',
|
|
135
|
+
type: 'string',
|
|
136
|
+
displayOptions: {
|
|
137
|
+
show: {
|
|
138
|
+
resource: ['raid'],
|
|
139
|
+
operation: ['cancelRaid'],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
default: '',
|
|
143
|
+
required: true,
|
|
144
|
+
placeholder: 'e.g. 123456789 or username',
|
|
145
|
+
description: 'The broadcaster user ID or username that initiated the raid (must be the authenticated user). If a username is provided, it will be automatically converted to user ID.',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
displayName: 'Note',
|
|
149
|
+
name: 'cancelRaidNote',
|
|
150
|
+
type: 'notice',
|
|
151
|
+
default: '',
|
|
152
|
+
displayOptions: {
|
|
153
|
+
show: {
|
|
154
|
+
resource: ['raid'],
|
|
155
|
+
operation: ['cancelRaid'],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
description: 'Requires OAuth2 authentication with channel:manage:raids scope. You can only cancel a raid that has not been completed.',
|
|
159
|
+
},
|
|
160
|
+
];
|
|
161
|
+
//# sourceMappingURL=Raid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Raid.js","sourceRoot":"","sources":["../../../../nodes/Twitch/resources/Raid.ts"],"names":[],"mappings":";;;AACA,+DAAoE;AAEvD,QAAA,cAAc,GAAsB;IAChD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,MAAM,CAAC;aAClB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,WAAW;gBAClB,MAAM,EAAE,cAAc;gBACtB,WAAW,EAAE,8CAA8C;gBAC3D,OAAO,EAAE;oBACR,OAAO,EAAE;wBACR,MAAM,EAAE,MAAM;wBACd,GAAG,EAAE,QAAQ;qBACb;oBACD,IAAI,EAAE;wBACL,OAAO,EAAE;4BACR,KAAK,WAA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