@yuniruyuni/n8n-nodes-twitch 0.1.4 → 0.1.5
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/TwitchAnnouncements/TwitchAnnouncements.node.js +11 -8
- package/dist/nodes/TwitchAnnouncements/TwitchAnnouncements.node.js.map +1 -1
- package/dist/nodes/TwitchBans/TwitchBans.node.js +50 -34
- package/dist/nodes/TwitchBans/TwitchBans.node.js.map +1 -1
- package/dist/nodes/TwitchBitsLeaderboard/TwitchBitsLeaderboard.node.js +8 -6
- package/dist/nodes/TwitchBitsLeaderboard/TwitchBitsLeaderboard.node.js.map +1 -1
- package/dist/nodes/TwitchChannels/TwitchChannels.node.js +16 -6
- package/dist/nodes/TwitchChannels/TwitchChannels.node.js.map +1 -1
- package/dist/nodes/TwitchChatMessages/TwitchChatMessages.node.js +11 -8
- package/dist/nodes/TwitchChatMessages/TwitchChatMessages.node.js.map +1 -1
- package/dist/nodes/TwitchChatters/TwitchChatters.node.js +24 -9
- package/dist/nodes/TwitchChatters/TwitchChatters.node.js.map +1 -1
- package/dist/nodes/TwitchCheermotes/TwitchCheermotes.node.js +19 -3
- package/dist/nodes/TwitchCheermotes/TwitchCheermotes.node.js.map +1 -1
- package/dist/nodes/TwitchClips/TwitchClips.node.js +24 -11
- package/dist/nodes/TwitchClips/TwitchClips.node.js.map +1 -1
- package/dist/nodes/TwitchCustomRewards/TwitchCustomRewards.node.js +12 -7
- package/dist/nodes/TwitchCustomRewards/TwitchCustomRewards.node.js.map +1 -1
- package/dist/nodes/TwitchEmotes/TwitchEmotes.node.js +6 -4
- package/dist/nodes/TwitchEmotes/TwitchEmotes.node.js.map +1 -1
- package/dist/nodes/TwitchModerators/TwitchModerators.node.js +44 -37
- package/dist/nodes/TwitchModerators/TwitchModerators.node.js.map +1 -1
- package/dist/nodes/TwitchPolls/TwitchPolls.node.js +16 -12
- package/dist/nodes/TwitchPolls/TwitchPolls.node.js.map +1 -1
- package/dist/nodes/TwitchPredictions/TwitchPredictions.node.js +16 -12
- package/dist/nodes/TwitchPredictions/TwitchPredictions.node.js.map +1 -1
- package/dist/nodes/TwitchRaids/TwitchRaids.node.js +37 -16
- package/dist/nodes/TwitchRaids/TwitchRaids.node.js.map +1 -1
- package/dist/nodes/TwitchRedemptions/TwitchRedemptions.node.js +8 -5
- package/dist/nodes/TwitchRedemptions/TwitchRedemptions.node.js.map +1 -1
- package/dist/nodes/TwitchSchedule/TwitchSchedule.node.js +12 -7
- package/dist/nodes/TwitchSchedule/TwitchSchedule.node.js.map +1 -1
- package/dist/nodes/TwitchSubscriptions/TwitchSubscriptions.node.js +21 -15
- package/dist/nodes/TwitchSubscriptions/TwitchSubscriptions.node.js.map +1 -1
- package/dist/nodes/TwitchTeams/TwitchTeams.node.js +6 -4
- package/dist/nodes/TwitchTeams/TwitchTeams.node.js.map +1 -1
- package/dist/nodes/TwitchTrigger/TwitchTrigger.node.js +6 -4
- package/dist/nodes/TwitchTrigger/TwitchTrigger.node.js.map +1 -1
- package/dist/nodes/TwitchVideos/TwitchVideos.node.js +6 -4
- package/dist/nodes/TwitchVideos/TwitchVideos.node.js.map +1 -1
- package/dist/nodes/shared/userIdConverter.d.ts +2 -0
- package/dist/nodes/shared/userIdConverter.js +32 -0
- package/dist/nodes/shared/userIdConverter.js.map +1 -0
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { Icon, ICredentialDataDecryptedObject, ICredentialType, IHttpRequestHelper, INodeProperties } from 'n8n-workflow';
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialDataDecryptedObject, ICredentialType, IHttpRequestHelper, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
export declare class TwitchOAuth2Api implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
extends: string[];
|
|
5
5
|
displayName: string;
|
|
6
6
|
icon: Icon;
|
|
7
7
|
documentationUrl: string;
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
8
9
|
properties: INodeProperties[];
|
|
9
10
|
preAuthentication(this: IHttpRequestHelper, credentials: ICredentialDataDecryptedObject): Promise<{
|
|
10
11
|
clientId: import("n8n-workflow").CredentialInformation;
|
|
@@ -8,6 +8,14 @@ class TwitchOAuth2Api {
|
|
|
8
8
|
this.displayName = 'Twitch OAuth2 API';
|
|
9
9
|
this.icon = { light: 'file:../icons/twitch.svg', dark: 'file:../icons/twitch.dark.svg' };
|
|
10
10
|
this.documentationUrl = 'https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/';
|
|
11
|
+
this.authenticate = {
|
|
12
|
+
type: 'generic',
|
|
13
|
+
properties: {
|
|
14
|
+
headers: {
|
|
15
|
+
'Client-ID': '={{$credentials.clientId}}',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
11
19
|
this.properties = [
|
|
12
20
|
{
|
|
13
21
|
displayName: 'Grant Type',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwitchOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/TwitchOAuth2Api.credentials.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"TwitchOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/TwitchOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AASA,MAAa,eAAe;IAA5B;QACC,SAAI,GAAG,iBAAiB,CAAC;QAEzB,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QAExB,gBAAW,GAAG,mBAAmB,CAAC;QAElC,SAAI,GAAS,EAAE,KAAK,EAAE,0BAA0B,EAAE,IAAI,EAAE,+BAA+B,EAAE,CAAC;QAE1F,qBAAgB,GAAG,iEAA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AC,cAAc;YAC1C,KAAK;YACL,mBAAmB,EAAE,WAAW,CAAC,mBAAmB;YACpD,cAAc,EAAE,WAAW,CAAC,cAAc;SAC1C,CAAC;IACH,CAAC;CACD;AAtdD,0CAsdC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TwitchAnnouncements = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const userIdConverter_1 = require("../shared/userIdConverter");
|
|
5
6
|
class TwitchAnnouncements {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.description = {
|
|
@@ -51,10 +52,12 @@ class TwitchAnnouncements {
|
|
|
51
52
|
send: {
|
|
52
53
|
preSend: [
|
|
53
54
|
async function (requestOptions) {
|
|
54
|
-
const
|
|
55
|
-
const
|
|
55
|
+
const broadcasterIdInput = this.getNodeParameter('broadcasterId');
|
|
56
|
+
const moderatorIdInput = this.getNodeParameter('moderatorId');
|
|
56
57
|
const message = this.getNodeParameter('message');
|
|
57
58
|
const color = this.getNodeParameter('color', 'primary');
|
|
59
|
+
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
60
|
+
const moderatorId = await userIdConverter_1.resolveUserIdOrUsername.call(this, moderatorIdInput);
|
|
58
61
|
requestOptions.qs = {
|
|
59
62
|
broadcaster_id: broadcasterId,
|
|
60
63
|
moderator_id: moderatorId,
|
|
@@ -83,7 +86,7 @@ class TwitchAnnouncements {
|
|
|
83
86
|
default: 'send',
|
|
84
87
|
},
|
|
85
88
|
{
|
|
86
|
-
displayName: 'Broadcaster ID',
|
|
89
|
+
displayName: 'Broadcaster ID or Username',
|
|
87
90
|
name: 'broadcasterId',
|
|
88
91
|
type: 'string',
|
|
89
92
|
displayOptions: {
|
|
@@ -93,11 +96,11 @@ class TwitchAnnouncements {
|
|
|
93
96
|
},
|
|
94
97
|
default: '',
|
|
95
98
|
required: true,
|
|
96
|
-
placeholder: 'e.g. 123456789',
|
|
97
|
-
description: 'The ID
|
|
99
|
+
placeholder: 'e.g. 123456789 or username',
|
|
100
|
+
description: 'The broadcaster user ID or username. If a username is provided, it will be automatically converted to user ID.',
|
|
98
101
|
},
|
|
99
102
|
{
|
|
100
|
-
displayName: 'Moderator ID',
|
|
103
|
+
displayName: 'Moderator ID or Username',
|
|
101
104
|
name: 'moderatorId',
|
|
102
105
|
type: 'string',
|
|
103
106
|
displayOptions: {
|
|
@@ -107,8 +110,8 @@ class TwitchAnnouncements {
|
|
|
107
110
|
},
|
|
108
111
|
default: '',
|
|
109
112
|
required: true,
|
|
110
|
-
placeholder: 'e.g. 987654321',
|
|
111
|
-
description: 'The
|
|
113
|
+
placeholder: 'e.g. 987654321 or username',
|
|
114
|
+
description: 'The moderator user ID or username (must match the user access token). If a username is provided, it will be automatically converted to user ID.',
|
|
112
115
|
},
|
|
113
116
|
{
|
|
114
117
|
displayName: 'Message',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwitchAnnouncements.node.js","sourceRoot":"","sources":["../../../nodes/TwitchAnnouncements/TwitchAnnouncements.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;
|
|
1
|
+
{"version":3,"file":"TwitchAnnouncements.node.js","sourceRoot":"","sources":["../../../nodes/TwitchAnnouncements/TwitchAnnouncements.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;AAC9F,+DAAoE;AAEpE,MAAa,mBAAmB;IAAhC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,sBAAsB,EAAE;YAChE,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE;gBACT,IAAI,EAAE,sBAAsB;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,EAAE,+CAA+C;iBAC5D;gBACD;oBACC,WAAW,EAAE,OAAO;oBACpB,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,SAAS;oBACf,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,SAAS,EAAE,CAAC,MAAM,CAAC;yBACnB;qBACD;oBACD,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,MAAM;yBACb;wBACD;4BACC,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,OAAO;yBACd;wBACD;4BACC,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,QAAQ;yBACf;wBACD;4BACC,IAAI,EAAE,SAAS;4BACf,KAAK,EAAE,SAAS;yBAChB;wBACD;4BACC,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,QAAQ;yBACf;qBACD;oBACD,OAAO,EAAE,SAAS;oBAClB,WAAW,EAAE,+BAA+B;iBAC5C;aACD;SACD,CAAC;IACH,CAAC;CAAA;AApKD,kDAoKC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TwitchBans = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const userIdConverter_1 = require("../shared/userIdConverter");
|
|
5
6
|
class TwitchBans {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.description = {
|
|
@@ -51,12 +52,18 @@ class TwitchBans {
|
|
|
51
52
|
send: {
|
|
52
53
|
preSend: [
|
|
53
54
|
async function (requestOptions) {
|
|
55
|
+
const broadcasterIdInput = this.getNodeParameter('broadcasterId');
|
|
56
|
+
const moderatorIdInput = this.getNodeParameter('moderatorId');
|
|
57
|
+
const userIdInput = this.getNodeParameter('userId');
|
|
58
|
+
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
59
|
+
const moderatorId = await userIdConverter_1.resolveUserIdOrUsername.call(this, moderatorIdInput);
|
|
60
|
+
const userId = await userIdConverter_1.resolveUserIdOrUsername.call(this, userIdInput);
|
|
54
61
|
const qs = {
|
|
55
|
-
broadcaster_id:
|
|
56
|
-
moderator_id:
|
|
62
|
+
broadcaster_id: broadcasterId,
|
|
63
|
+
moderator_id: moderatorId,
|
|
57
64
|
};
|
|
58
65
|
const data = {
|
|
59
|
-
user_id:
|
|
66
|
+
user_id: userId,
|
|
60
67
|
};
|
|
61
68
|
const duration = this.getNodeParameter('duration', 0);
|
|
62
69
|
if (duration > 0) {
|
|
@@ -100,10 +107,16 @@ class TwitchBans {
|
|
|
100
107
|
send: {
|
|
101
108
|
preSend: [
|
|
102
109
|
async function (requestOptions) {
|
|
110
|
+
const broadcasterIdInput = this.getNodeParameter('broadcasterId');
|
|
111
|
+
const moderatorIdInput = this.getNodeParameter('moderatorId');
|
|
112
|
+
const userIdInput = this.getNodeParameter('userId');
|
|
113
|
+
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
114
|
+
const moderatorId = await userIdConverter_1.resolveUserIdOrUsername.call(this, moderatorIdInput);
|
|
115
|
+
const userId = await userIdConverter_1.resolveUserIdOrUsername.call(this, userIdInput);
|
|
103
116
|
const qs = {
|
|
104
|
-
broadcaster_id:
|
|
105
|
-
moderator_id:
|
|
106
|
-
user_id:
|
|
117
|
+
broadcaster_id: broadcasterId,
|
|
118
|
+
moderator_id: moderatorId,
|
|
119
|
+
user_id: userId,
|
|
107
120
|
};
|
|
108
121
|
requestOptions.qs = qs;
|
|
109
122
|
return requestOptions;
|
|
@@ -125,14 +138,17 @@ class TwitchBans {
|
|
|
125
138
|
send: {
|
|
126
139
|
preSend: [
|
|
127
140
|
async function (requestOptions) {
|
|
141
|
+
const broadcasterIdInput = this.getNodeParameter('broadcasterId');
|
|
142
|
+
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
128
143
|
const qs = {
|
|
129
|
-
broadcaster_id:
|
|
144
|
+
broadcaster_id: broadcasterId,
|
|
130
145
|
};
|
|
131
146
|
const userIds = this.getNodeParameter('userIds', '');
|
|
132
147
|
if (userIds) {
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
|
|
148
|
+
const userIdInputs = userIds.split(',').map(id => id.trim()).filter(id => id);
|
|
149
|
+
if (userIdInputs.length > 0) {
|
|
150
|
+
const resolvedUserIds = await Promise.all(userIdInputs.map(input => userIdConverter_1.resolveUserIdOrUsername.call(this, input)));
|
|
151
|
+
qs.user_id = resolvedUserIds;
|
|
136
152
|
}
|
|
137
153
|
}
|
|
138
154
|
const first = this.getNodeParameter('first', 20);
|
|
@@ -160,7 +176,7 @@ class TwitchBans {
|
|
|
160
176
|
default: 'getBannedUsers',
|
|
161
177
|
},
|
|
162
178
|
{
|
|
163
|
-
displayName: 'Broadcaster ID',
|
|
179
|
+
displayName: 'Broadcaster ID or Username',
|
|
164
180
|
name: 'broadcasterId',
|
|
165
181
|
type: 'string',
|
|
166
182
|
displayOptions: {
|
|
@@ -170,11 +186,11 @@ class TwitchBans {
|
|
|
170
186
|
},
|
|
171
187
|
default: '',
|
|
172
188
|
required: true,
|
|
173
|
-
placeholder: 'e.g. 123456789',
|
|
174
|
-
description: 'The ID
|
|
189
|
+
placeholder: 'e.g. 123456789 or username',
|
|
190
|
+
description: 'The broadcaster user ID or username. If a username is provided, it will be automatically converted to user ID.',
|
|
175
191
|
},
|
|
176
192
|
{
|
|
177
|
-
displayName: 'Moderator ID',
|
|
193
|
+
displayName: 'Moderator ID or Username',
|
|
178
194
|
name: 'moderatorId',
|
|
179
195
|
type: 'string',
|
|
180
196
|
displayOptions: {
|
|
@@ -184,11 +200,11 @@ class TwitchBans {
|
|
|
184
200
|
},
|
|
185
201
|
default: '',
|
|
186
202
|
required: true,
|
|
187
|
-
placeholder: 'e.g. 987654321',
|
|
188
|
-
description: 'The
|
|
203
|
+
placeholder: 'e.g. 987654321 or username',
|
|
204
|
+
description: 'The moderator user ID or username (must match the user access token). If a username is provided, it will be automatically converted to user ID.',
|
|
189
205
|
},
|
|
190
206
|
{
|
|
191
|
-
displayName: 'User ID',
|
|
207
|
+
displayName: 'User ID or Username',
|
|
192
208
|
name: 'userId',
|
|
193
209
|
type: 'string',
|
|
194
210
|
displayOptions: {
|
|
@@ -198,8 +214,8 @@ class TwitchBans {
|
|
|
198
214
|
},
|
|
199
215
|
default: '',
|
|
200
216
|
required: true,
|
|
201
|
-
placeholder: 'e.g. 555666777',
|
|
202
|
-
description: 'The ID
|
|
217
|
+
placeholder: 'e.g. 555666777 or username',
|
|
218
|
+
description: 'The user ID or username to ban. If a username is provided, it will be automatically converted to user ID.',
|
|
203
219
|
},
|
|
204
220
|
{
|
|
205
221
|
displayName: 'Duration',
|
|
@@ -232,7 +248,7 @@ class TwitchBans {
|
|
|
232
248
|
description: 'The reason for the ban (max 500 characters)',
|
|
233
249
|
},
|
|
234
250
|
{
|
|
235
|
-
displayName: 'Broadcaster ID',
|
|
251
|
+
displayName: 'Broadcaster ID or Username',
|
|
236
252
|
name: 'broadcasterId',
|
|
237
253
|
type: 'string',
|
|
238
254
|
displayOptions: {
|
|
@@ -242,11 +258,11 @@ class TwitchBans {
|
|
|
242
258
|
},
|
|
243
259
|
default: '',
|
|
244
260
|
required: true,
|
|
245
|
-
placeholder: 'e.g. 123456789',
|
|
246
|
-
description: 'The ID
|
|
261
|
+
placeholder: 'e.g. 123456789 or username',
|
|
262
|
+
description: 'The broadcaster user ID or username. If a username is provided, it will be automatically converted to user ID.',
|
|
247
263
|
},
|
|
248
264
|
{
|
|
249
|
-
displayName: 'Moderator ID',
|
|
265
|
+
displayName: 'Moderator ID or Username',
|
|
250
266
|
name: 'moderatorId',
|
|
251
267
|
type: 'string',
|
|
252
268
|
displayOptions: {
|
|
@@ -256,11 +272,11 @@ class TwitchBans {
|
|
|
256
272
|
},
|
|
257
273
|
default: '',
|
|
258
274
|
required: true,
|
|
259
|
-
placeholder: 'e.g. 987654321',
|
|
260
|
-
description: 'The
|
|
275
|
+
placeholder: 'e.g. 987654321 or username',
|
|
276
|
+
description: 'The moderator user ID or username (must match the user access token). If a username is provided, it will be automatically converted to user ID.',
|
|
261
277
|
},
|
|
262
278
|
{
|
|
263
|
-
displayName: 'User ID',
|
|
279
|
+
displayName: 'User ID or Username',
|
|
264
280
|
name: 'userId',
|
|
265
281
|
type: 'string',
|
|
266
282
|
displayOptions: {
|
|
@@ -270,11 +286,11 @@ class TwitchBans {
|
|
|
270
286
|
},
|
|
271
287
|
default: '',
|
|
272
288
|
required: true,
|
|
273
|
-
placeholder: 'e.g. 555666777',
|
|
274
|
-
description: 'The ID
|
|
289
|
+
placeholder: 'e.g. 555666777 or username',
|
|
290
|
+
description: 'The user ID or username to unban. If a username is provided, it will be automatically converted to user ID.',
|
|
275
291
|
},
|
|
276
292
|
{
|
|
277
|
-
displayName: 'Broadcaster ID',
|
|
293
|
+
displayName: 'Broadcaster ID or Username',
|
|
278
294
|
name: 'broadcasterId',
|
|
279
295
|
type: 'string',
|
|
280
296
|
displayOptions: {
|
|
@@ -284,11 +300,11 @@ class TwitchBans {
|
|
|
284
300
|
},
|
|
285
301
|
default: '',
|
|
286
302
|
required: true,
|
|
287
|
-
placeholder: 'e.g. 123456789',
|
|
288
|
-
description: 'The ID
|
|
303
|
+
placeholder: 'e.g. 123456789 or username',
|
|
304
|
+
description: 'The broadcaster user ID or username. If a username is provided, it will be automatically converted to user ID.',
|
|
289
305
|
},
|
|
290
306
|
{
|
|
291
|
-
displayName: 'User IDs',
|
|
307
|
+
displayName: 'User IDs or Usernames',
|
|
292
308
|
name: 'userIds',
|
|
293
309
|
type: 'string',
|
|
294
310
|
displayOptions: {
|
|
@@ -297,8 +313,8 @@ class TwitchBans {
|
|
|
297
313
|
},
|
|
298
314
|
},
|
|
299
315
|
default: '',
|
|
300
|
-
placeholder: 'e.g. 555666777,888999000',
|
|
301
|
-
description: 'Comma-separated list of user IDs to filter results',
|
|
316
|
+
placeholder: 'e.g. 555666777,888999000 or user1,user2',
|
|
317
|
+
description: 'Comma-separated list of user IDs or usernames to filter results. Usernames will be automatically converted to user IDs.',
|
|
302
318
|
},
|
|
303
319
|
{
|
|
304
320
|
displayName: 'First',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwitchBans.node.js","sourceRoot":"","sources":["../../../nodes/TwitchBans/TwitchBans.node.ts"],"names":[],"mappings":";;;AAAA,+CAAgH;
|
|
1
|
+
{"version":3,"file":"TwitchBans.node.js","sourceRoot":"","sources":["../../../nodes/TwitchBans/TwitchBans.node.ts"],"names":[],"mappings":";;;AAAA,+CAAgH;AAChH,+DAAoE;AAEpE,MAAa,UAAU;IAAvB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,sBAAsB,EAAE;YAChE,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE;gBACT,IAAI,EAAE,aAAa;aACnB;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;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,I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itsLeaderboard = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const userIdConverter_1 = require("../shared/userIdConverter");
|
|
5
6
|
class TwitchBitsLeaderboard {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.description = {
|
|
@@ -53,7 +54,7 @@ class TwitchBitsLeaderboard {
|
|
|
53
54
|
const count = this.getNodeParameter('count', 0);
|
|
54
55
|
const period = this.getNodeParameter('period', 0);
|
|
55
56
|
const startedAt = this.getNodeParameter('startedAt', 0);
|
|
56
|
-
const
|
|
57
|
+
const userIdInput = this.getNodeParameter('userId', 0);
|
|
57
58
|
const qs = {};
|
|
58
59
|
if (count) {
|
|
59
60
|
qs.count = count;
|
|
@@ -64,8 +65,9 @@ class TwitchBitsLeaderboard {
|
|
|
64
65
|
if (startedAt && startedAt.trim() !== '') {
|
|
65
66
|
qs.started_at = startedAt.trim();
|
|
66
67
|
}
|
|
67
|
-
if (
|
|
68
|
-
|
|
68
|
+
if (userIdInput && userIdInput.trim() !== '') {
|
|
69
|
+
const userId = await userIdConverter_1.resolveUserIdOrUsername.call(this, userIdInput.trim());
|
|
70
|
+
qs.user_id = userId;
|
|
69
71
|
}
|
|
70
72
|
requestOptions.qs = qs;
|
|
71
73
|
return requestOptions;
|
|
@@ -152,12 +154,12 @@ class TwitchBitsLeaderboard {
|
|
|
152
154
|
},
|
|
153
155
|
},
|
|
154
156
|
{
|
|
155
|
-
displayName: 'User ID',
|
|
157
|
+
displayName: 'User ID or Username',
|
|
156
158
|
name: 'userId',
|
|
157
159
|
type: 'string',
|
|
158
160
|
default: '',
|
|
159
|
-
placeholder: 'e.g. 123456789',
|
|
160
|
-
description: 'Filter results to a specific user ID',
|
|
161
|
+
placeholder: 'e.g. 123456789 or username',
|
|
162
|
+
description: 'Filter results to a specific user ID or username. If a username is provided, it will be automatically converted to user ID.',
|
|
161
163
|
displayOptions: {
|
|
162
164
|
show: {
|
|
163
165
|
operation: ['get'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwitchBitsLeaderboard.node.js","sourceRoot":"","sources":["../../../nodes/TwitchBitsLeaderboard/TwitchBitsLeaderboard.node.ts"],"names":[],"mappings":";;;AAAA,+CAAgH;
|
|
1
|
+
{"version":3,"file":"TwitchBitsLeaderboard.node.js","sourceRoot":"","sources":["../../../nodes/TwitchBitsLeaderboard/TwitchBitsLeaderboard.node.ts"],"names":[],"mappings":";;;AAAA,+CAAgH;AAChH,+DAAoE;AAEpE,MAAa,qBAAqB;IAAlC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,uBAAuB;YAC7B,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,sBAAsB,EAAE;YAChE,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE;gBACT,IAAI,EAAE,yBAAyB;aAC/B;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;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,KAAK;4BACX,KAAK,EAAE,KAAK;4BACZ,MAAM,EAAE,sBAAsB;4BAC9B,WAAW,EAAE,+CAA+C;4BAC5D,OAA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CAAC;yBAClB;qBACD;iBACD;gBACD;oBACC,WAAW,EAAE,qBAAqB;oBAClC,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,4BAA4B;oBACzC,WAAW,EAAE,6HAA6H;oBAC1I,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,SAAS,EAAE,CAAC,KAAK,CAAC;yBAClB;qBACD;iBACD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAvKD,sDAuKC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TwitchChannels = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const userIdConverter_1 = require("../shared/userIdConverter");
|
|
5
6
|
class TwitchChannels {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.description = {
|
|
@@ -47,9 +48,18 @@ class TwitchChannels {
|
|
|
47
48
|
request: {
|
|
48
49
|
method: 'GET',
|
|
49
50
|
url: '/channels',
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
},
|
|
52
|
+
send: {
|
|
53
|
+
preSend: [
|
|
54
|
+
async function (requestOptions) {
|
|
55
|
+
const broadcasterIdInput = this.getNodeParameter('broadcasterId');
|
|
56
|
+
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
57
|
+
requestOptions.qs = {
|
|
58
|
+
broadcaster_id: broadcasterId,
|
|
59
|
+
};
|
|
60
|
+
return requestOptions;
|
|
61
|
+
},
|
|
62
|
+
],
|
|
53
63
|
},
|
|
54
64
|
output: {
|
|
55
65
|
postReceive: [
|
|
@@ -73,7 +83,7 @@ class TwitchChannels {
|
|
|
73
83
|
default: 'getInfo',
|
|
74
84
|
},
|
|
75
85
|
{
|
|
76
|
-
displayName: 'Broadcaster ID',
|
|
86
|
+
displayName: 'Broadcaster ID or Username',
|
|
77
87
|
name: 'broadcasterId',
|
|
78
88
|
type: 'string',
|
|
79
89
|
displayOptions: {
|
|
@@ -83,8 +93,8 @@ class TwitchChannels {
|
|
|
83
93
|
},
|
|
84
94
|
default: '',
|
|
85
95
|
required: true,
|
|
86
|
-
placeholder: 'e.g. 123456789',
|
|
87
|
-
description: 'The broadcaster user ID',
|
|
96
|
+
placeholder: 'e.g. 123456789 or username',
|
|
97
|
+
description: 'The broadcaster user ID or username. If a username is provided, it will be automatically converted to user ID.',
|
|
88
98
|
},
|
|
89
99
|
],
|
|
90
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwitchChannels.node.js","sourceRoot":"","sources":["../../../nodes/TwitchChannels/TwitchChannels.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;
|
|
1
|
+
{"version":3,"file":"TwitchChannels.node.js","sourceRoot":"","sources":["../../../nodes/TwitchChannels/TwitchChannels.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;AAC9F,+DAAoE;AAEpE,MAAa,cAAc;IAA3B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,gBAAgB;YACtB,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,mCAAmC;YAChD,QAAQ,EAAE;gBACT,IAAI,EAAE,iBAAiB;aACvB;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;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OAAO,EAAE,EAAE;oBACX,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,4BAA4B;oBACzC,WAAW,EAAE,gHAAgH;iBAC7H;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAhGD,wCAgGC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TwitchChatMessages = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const userIdConverter_1 = require("../shared/userIdConverter");
|
|
5
6
|
class TwitchChatMessages {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.description = {
|
|
@@ -50,9 +51,11 @@ class TwitchChatMessages {
|
|
|
50
51
|
send: {
|
|
51
52
|
preSend: [
|
|
52
53
|
async function (requestOptions) {
|
|
53
|
-
const
|
|
54
|
-
const
|
|
54
|
+
const broadcasterIdInput = this.getNodeParameter('broadcasterId');
|
|
55
|
+
const senderIdInput = this.getNodeParameter('senderId');
|
|
55
56
|
const message = this.getNodeParameter('message');
|
|
57
|
+
const broadcasterId = await userIdConverter_1.resolveUserIdOrUsername.call(this, broadcasterIdInput);
|
|
58
|
+
const senderId = await userIdConverter_1.resolveUserIdOrUsername.call(this, senderIdInput);
|
|
56
59
|
requestOptions.body = {
|
|
57
60
|
broadcaster_id: broadcasterId,
|
|
58
61
|
sender_id: senderId,
|
|
@@ -78,7 +81,7 @@ class TwitchChatMessages {
|
|
|
78
81
|
default: 'sendMessage',
|
|
79
82
|
},
|
|
80
83
|
{
|
|
81
|
-
displayName: 'Broadcaster ID',
|
|
84
|
+
displayName: 'Broadcaster ID or Username',
|
|
82
85
|
name: 'broadcasterId',
|
|
83
86
|
type: 'string',
|
|
84
87
|
displayOptions: {
|
|
@@ -88,11 +91,11 @@ class TwitchChatMessages {
|
|
|
88
91
|
},
|
|
89
92
|
default: '',
|
|
90
93
|
required: true,
|
|
91
|
-
placeholder: 'e.g. 123456789',
|
|
92
|
-
description: 'The ID
|
|
94
|
+
placeholder: 'e.g. 123456789 or username',
|
|
95
|
+
description: 'The broadcaster user ID or username. If a username is provided, it will be automatically converted to user ID.',
|
|
93
96
|
},
|
|
94
97
|
{
|
|
95
|
-
displayName: 'Sender ID',
|
|
98
|
+
displayName: 'Sender ID or Username',
|
|
96
99
|
name: 'senderId',
|
|
97
100
|
type: 'string',
|
|
98
101
|
displayOptions: {
|
|
@@ -102,8 +105,8 @@ class TwitchChatMessages {
|
|
|
102
105
|
},
|
|
103
106
|
default: '',
|
|
104
107
|
required: true,
|
|
105
|
-
placeholder: 'e.g. 987654321',
|
|
106
|
-
description: 'The ID
|
|
108
|
+
placeholder: 'e.g. 987654321 or username',
|
|
109
|
+
description: 'The sender user ID or username (must match the user access token). If a username is provided, it will be automatically converted to user ID.',
|
|
107
110
|
},
|
|
108
111
|
{
|
|
109
112
|
displayName: 'Message',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwitchChatMessages.node.js","sourceRoot":"","sources":["../../../nodes/TwitchChatMessages/TwitchChatMessages.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;
|
|
1
|
+
{"version":3,"file":"TwitchChatMessages.node.js","sourceRoot":"","sources":["../../../nodes/TwitchChatMessages/TwitchChatMessages.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;AAC9F,+DAAoE;AAEpE,MAAa,kBAAkB;IAA/B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,oBAAoB;YAC1B,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,sBAAsB,EAAE;YAChE,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE;gBACT,IAAI,EAAE,sBAAsB;aAC5B;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;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