@ac-codeprod/n8n-nodes-alexa-remote 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.fr.md +300 -0
- package/README.md +300 -0
- package/dist/credentials/AlexaRemoteApi.credentials.d.ts +9 -0
- package/dist/credentials/AlexaRemoteApi.credentials.js +162 -0
- package/dist/credentials/AlexaRemoteApi.credentials.js.map +1 -0
- package/dist/credentials/alexa.svg +15 -0
- package/dist/nodes/AlexaRemote/AlexaRemote.node.d.ts +18 -0
- package/dist/nodes/AlexaRemote/AlexaRemote.node.js +330 -0
- package/dist/nodes/AlexaRemote/AlexaRemote.node.js.map +1 -0
- package/dist/nodes/AlexaRemote/AlexaRemote.node.json +18 -0
- package/dist/nodes/AlexaRemote/AlexaRemoteTrigger.node.d.ts +5 -0
- package/dist/nodes/AlexaRemote/AlexaRemoteTrigger.node.js +131 -0
- package/dist/nodes/AlexaRemote/AlexaRemoteTrigger.node.js.map +1 -0
- package/dist/nodes/AlexaRemote/AlexaRemoteTrigger.node.json +18 -0
- package/dist/nodes/AlexaRemote/alexa.svg +15 -0
- package/dist/nodes/AlexaRemote/lib/alexa-remote-ext.d.ts +57 -0
- package/dist/nodes/AlexaRemote/lib/alexa-remote-ext.js +667 -0
- package/dist/nodes/AlexaRemote/lib/alexa-remote-ext.js.map +1 -0
- package/dist/nodes/AlexaRemote/lib/cookie-crypto.d.ts +2 -0
- package/dist/nodes/AlexaRemote/lib/cookie-crypto.js +65 -0
- package/dist/nodes/AlexaRemote/lib/cookie-crypto.js.map +1 -0
- package/dist/nodes/AlexaRemote/lib/helpers.d.ts +14 -0
- package/dist/nodes/AlexaRemote/lib/helpers.js +174 -0
- package/dist/nodes/AlexaRemote/lib/helpers.js.map +1 -0
- package/dist/nodes/AlexaRemote/lib/types.d.ts +208 -0
- package/dist/nodes/AlexaRemote/lib/types.js +3 -0
- package/dist/nodes/AlexaRemote/lib/types.js.map +1 -0
- package/dist/nodes/AlexaRemote/properties/index.d.ts +14 -0
- package/dist/nodes/AlexaRemote/properties/index.js +90 -0
- package/dist/nodes/AlexaRemote/properties/index.js.map +1 -0
- package/dist/nodes/AlexaRemote/resources/account/index.d.ts +4 -0
- package/dist/nodes/AlexaRemote/resources/account/index.js +56 -0
- package/dist/nodes/AlexaRemote/resources/account/index.js.map +1 -0
- package/dist/nodes/AlexaRemote/resources/auth/index.d.ts +4 -0
- package/dist/nodes/AlexaRemote/resources/auth/index.js +108 -0
- package/dist/nodes/AlexaRemote/resources/auth/index.js.map +1 -0
- package/dist/nodes/AlexaRemote/resources/bluetooth/index.d.ts +4 -0
- package/dist/nodes/AlexaRemote/resources/bluetooth/index.js +108 -0
- package/dist/nodes/AlexaRemote/resources/bluetooth/index.js.map +1 -0
- package/dist/nodes/AlexaRemote/resources/conversation/index.d.ts +4 -0
- package/dist/nodes/AlexaRemote/resources/conversation/index.js +86 -0
- package/dist/nodes/AlexaRemote/resources/conversation/index.js.map +1 -0
- package/dist/nodes/AlexaRemote/resources/device/index.d.ts +4 -0
- package/dist/nodes/AlexaRemote/resources/device/index.js +164 -0
- package/dist/nodes/AlexaRemote/resources/device/index.js.map +1 -0
- package/dist/nodes/AlexaRemote/resources/interaction/index.d.ts +4 -0
- package/dist/nodes/AlexaRemote/resources/interaction/index.js +365 -0
- package/dist/nodes/AlexaRemote/resources/interaction/index.js.map +1 -0
- package/dist/nodes/AlexaRemote/resources/list/index.d.ts +4 -0
- package/dist/nodes/AlexaRemote/resources/list/index.js +142 -0
- package/dist/nodes/AlexaRemote/resources/list/index.js.map +1 -0
- package/dist/nodes/AlexaRemote/resources/notification/index.d.ts +4 -0
- package/dist/nodes/AlexaRemote/resources/notification/index.js +146 -0
- package/dist/nodes/AlexaRemote/resources/notification/index.js.map +1 -0
- package/dist/nodes/AlexaRemote/resources/routine/index.d.ts +4 -0
- package/dist/nodes/AlexaRemote/resources/routine/index.js +49 -0
- package/dist/nodes/AlexaRemote/resources/routine/index.js.map +1 -0
- package/dist/nodes/AlexaRemote/resources/smarthome/index.d.ts +4 -0
- package/dist/nodes/AlexaRemote/resources/smarthome/index.js +92 -0
- package/dist/nodes/AlexaRemote/resources/smarthome/index.js.map +1 -0
- package/dist/package.json +71 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const helpers_1 = require("../../lib/helpers");
|
|
7
|
+
exports.description = [
|
|
8
|
+
{
|
|
9
|
+
displayName: 'Operation',
|
|
10
|
+
name: 'operation',
|
|
11
|
+
type: 'options',
|
|
12
|
+
noDataExpression: true,
|
|
13
|
+
displayOptions: {
|
|
14
|
+
show: {
|
|
15
|
+
resource: ['interaction'],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
options: [
|
|
19
|
+
{
|
|
20
|
+
name: 'Builtin',
|
|
21
|
+
value: 'builtin',
|
|
22
|
+
description: 'Play a built-in Alexa action (weather, traffic, Good Morning...)',
|
|
23
|
+
action: 'Play built in alexa action',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Play Music',
|
|
27
|
+
value: 'music',
|
|
28
|
+
description: 'Play music from provider',
|
|
29
|
+
action: 'Play music',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Set Volume',
|
|
33
|
+
value: 'volume',
|
|
34
|
+
description: 'Set device volume',
|
|
35
|
+
action: 'Set volume',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'Sound',
|
|
39
|
+
value: 'sound',
|
|
40
|
+
description: 'Play a sound effect',
|
|
41
|
+
action: 'Play sound effect',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Speak',
|
|
45
|
+
value: 'speak',
|
|
46
|
+
description: 'Make Alexa speak text',
|
|
47
|
+
action: 'Make alexa speak',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Speak All (Multi-Device)',
|
|
51
|
+
value: 'speakAll',
|
|
52
|
+
description: 'Make multiple Echo devices speak in parallel',
|
|
53
|
+
action: 'Speak on multiple devices',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Speak At Volume',
|
|
57
|
+
value: 'speakAtVolume',
|
|
58
|
+
description: 'Make Alexa speak at specific volume',
|
|
59
|
+
action: 'Make alexa speak at a volume',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'Stop',
|
|
63
|
+
value: 'stop',
|
|
64
|
+
description: 'Stop playback on device',
|
|
65
|
+
action: 'Stop playback',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'Text Command',
|
|
69
|
+
value: 'textCommand',
|
|
70
|
+
description: 'Send a text command to Alexa',
|
|
71
|
+
action: 'Send text command',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'Wait',
|
|
75
|
+
value: 'wait',
|
|
76
|
+
description: 'Wait a given number of seconds',
|
|
77
|
+
action: 'Wait seconds',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
default: 'speak',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Device Name or ID',
|
|
84
|
+
name: 'device',
|
|
85
|
+
type: 'options',
|
|
86
|
+
typeOptions: { loadOptionsMethod: 'getEchoDevices' },
|
|
87
|
+
default: '',
|
|
88
|
+
required: true,
|
|
89
|
+
displayOptions: {
|
|
90
|
+
show: {
|
|
91
|
+
resource: ['interaction'],
|
|
92
|
+
operation: ['speak', 'speakAtVolume', 'textCommand', 'stop', 'volume', 'builtin', 'sound', 'music'],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
displayName: 'Text',
|
|
99
|
+
name: 'text',
|
|
100
|
+
type: 'string',
|
|
101
|
+
default: '',
|
|
102
|
+
required: true,
|
|
103
|
+
displayOptions: {
|
|
104
|
+
show: {
|
|
105
|
+
resource: ['interaction'],
|
|
106
|
+
operation: ['speak', 'speakAtVolume', 'textCommand', 'speakAll'],
|
|
107
|
+
},
|
|
108
|
+
hide: {
|
|
109
|
+
speakType: ['ssml'],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
description: 'Text to speak or command to send',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
displayName: 'SSML Content',
|
|
116
|
+
name: 'ssmlContent',
|
|
117
|
+
type: 'string',
|
|
118
|
+
typeOptions: { rows: 8 },
|
|
119
|
+
default: '<speak>\n Hello! <break time="500ms"/> This is an SSML message.\n</speak>',
|
|
120
|
+
required: true,
|
|
121
|
+
displayOptions: {
|
|
122
|
+
show: {
|
|
123
|
+
resource: ['interaction'],
|
|
124
|
+
operation: ['speak', 'speakAtVolume', 'speakAll'],
|
|
125
|
+
speakType: ['ssml'],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
description: 'SSML markup to send. Must be wrapped in <speak> tags. Supported tags: <break time="500ms"/>, <emphasis>, <prosody rate="slow">, <say-as interpret-as="characters">',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
displayName: 'Speak Type',
|
|
132
|
+
name: 'speakType',
|
|
133
|
+
type: 'options',
|
|
134
|
+
options: [
|
|
135
|
+
{ name: 'Regular', value: 'regular' },
|
|
136
|
+
{ name: 'SSML', value: 'ssml' },
|
|
137
|
+
{ name: 'Announcement', value: 'announcement' },
|
|
138
|
+
],
|
|
139
|
+
default: 'regular',
|
|
140
|
+
displayOptions: {
|
|
141
|
+
show: {
|
|
142
|
+
resource: ['interaction'],
|
|
143
|
+
operation: ['speak', 'speakAtVolume', 'speakAll'],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
description: 'Type of speech',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
displayName: 'Device Names or IDs',
|
|
150
|
+
name: 'devices',
|
|
151
|
+
type: 'multiOptions',
|
|
152
|
+
typeOptions: { loadOptionsMethod: 'getEchoDevices' },
|
|
153
|
+
default: [],
|
|
154
|
+
required: true,
|
|
155
|
+
displayOptions: {
|
|
156
|
+
show: {
|
|
157
|
+
resource: ['interaction'],
|
|
158
|
+
operation: ['speakAll'],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
displayName: 'Volume',
|
|
165
|
+
name: 'volumeValue',
|
|
166
|
+
type: 'number',
|
|
167
|
+
typeOptions: {
|
|
168
|
+
minValue: 0,
|
|
169
|
+
maxValue: 100,
|
|
170
|
+
},
|
|
171
|
+
default: 50,
|
|
172
|
+
required: true,
|
|
173
|
+
displayOptions: {
|
|
174
|
+
show: {
|
|
175
|
+
resource: ['interaction'],
|
|
176
|
+
operation: ['speakAtVolume', 'volume'],
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
description: 'Volume level (0-100)',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
displayName: 'Music Provider',
|
|
183
|
+
name: 'musicProvider',
|
|
184
|
+
type: 'options',
|
|
185
|
+
options: [
|
|
186
|
+
{ name: 'Amazon Music', value: 'AMAZON_MUSIC' },
|
|
187
|
+
{ name: 'Spotify', value: 'SPOTIFY' },
|
|
188
|
+
{ name: 'TuneIn', value: 'TUNEIN' },
|
|
189
|
+
{ name: 'Cloud Player', value: 'CLOUDPLAYER' },
|
|
190
|
+
],
|
|
191
|
+
default: 'AMAZON_MUSIC',
|
|
192
|
+
displayOptions: {
|
|
193
|
+
show: {
|
|
194
|
+
resource: ['interaction'],
|
|
195
|
+
operation: ['music'],
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
description: 'Music streaming provider',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
displayName: 'Search Query',
|
|
202
|
+
name: 'searchQuery',
|
|
203
|
+
type: 'string',
|
|
204
|
+
default: '',
|
|
205
|
+
displayOptions: {
|
|
206
|
+
show: {
|
|
207
|
+
resource: ['interaction'],
|
|
208
|
+
operation: ['music'],
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
description: 'Search query for music',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
displayName: 'Duration (Seconds)',
|
|
215
|
+
name: 'duration',
|
|
216
|
+
type: 'number',
|
|
217
|
+
default: 0,
|
|
218
|
+
displayOptions: {
|
|
219
|
+
show: {
|
|
220
|
+
resource: ['interaction'],
|
|
221
|
+
operation: ['music'],
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
description: 'Duration to play music (0 = unlimited)',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
displayName: 'Builtin Type',
|
|
228
|
+
name: 'builtinType',
|
|
229
|
+
type: 'options',
|
|
230
|
+
options: [
|
|
231
|
+
{ name: 'Calendar - Next', value: 'calendarNext' },
|
|
232
|
+
{ name: 'Calendar - Today', value: 'calendarToday' },
|
|
233
|
+
{ name: 'Calendar - Tomorrow', value: 'calendarTomorrow' },
|
|
234
|
+
{ name: 'Clean Up', value: 'cleanup' },
|
|
235
|
+
{ name: 'Flash Briefing', value: 'flashbriefing' },
|
|
236
|
+
{ name: 'Fun Fact', value: 'funfact' },
|
|
237
|
+
{ name: 'Good Morning', value: 'goodmorning' },
|
|
238
|
+
{ name: 'Good Night', value: 'goodnight' },
|
|
239
|
+
{ name: 'Joke', value: 'joke' },
|
|
240
|
+
{ name: 'Sing a Song', value: 'singasong' },
|
|
241
|
+
{ name: 'Tell Story', value: 'tellstory' },
|
|
242
|
+
{ name: 'Traffic', value: 'traffic' },
|
|
243
|
+
{ name: 'Weather', value: 'weather' },
|
|
244
|
+
],
|
|
245
|
+
default: 'weather',
|
|
246
|
+
required: true,
|
|
247
|
+
displayOptions: {
|
|
248
|
+
show: {
|
|
249
|
+
resource: ['interaction'],
|
|
250
|
+
operation: ['builtin'],
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
description: 'Built-in Alexa action to execute',
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
displayName: 'Sound ID',
|
|
257
|
+
name: 'soundId',
|
|
258
|
+
type: 'string',
|
|
259
|
+
default: 'amzn1.ask.1p.sound/nature/crickets_01',
|
|
260
|
+
required: true,
|
|
261
|
+
displayOptions: {
|
|
262
|
+
show: {
|
|
263
|
+
resource: ['interaction'],
|
|
264
|
+
operation: ['sound'],
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
description: 'Sound string ID (e.g. amzn1.ask.1p.sound/nature/crickets_01)',
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
displayName: 'Duration (Seconds)',
|
|
271
|
+
name: 'waitDuration',
|
|
272
|
+
type: 'number',
|
|
273
|
+
typeOptions: { minValue: 1 },
|
|
274
|
+
default: 5,
|
|
275
|
+
required: true,
|
|
276
|
+
displayOptions: {
|
|
277
|
+
show: {
|
|
278
|
+
resource: ['interaction'],
|
|
279
|
+
operation: ['wait'],
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
description: 'Number of seconds to wait',
|
|
283
|
+
},
|
|
284
|
+
];
|
|
285
|
+
async function execute(alexa, operation, itemIndex, credentials) {
|
|
286
|
+
const locale = credentials.acceptLanguage;
|
|
287
|
+
if (operation === 'speak') {
|
|
288
|
+
const device = this.getNodeParameter('device', itemIndex);
|
|
289
|
+
if (!device) {
|
|
290
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Device is required — select an Echo device from the dropdown or provide a serial number via an expression.', { itemIndex });
|
|
291
|
+
}
|
|
292
|
+
const speakType = this.getNodeParameter('speakType', itemIndex);
|
|
293
|
+
const text = speakType === 'ssml'
|
|
294
|
+
? this.getNodeParameter('ssmlContent', itemIndex)
|
|
295
|
+
: this.getNodeParameter('text', itemIndex);
|
|
296
|
+
if (speakType === 'announcement') {
|
|
297
|
+
return alexa.sendAnnouncement([device], text, locale);
|
|
298
|
+
}
|
|
299
|
+
return alexa.sendSequenceCommand((0, helpers_1.buildSingleSequence)((0, helpers_1.buildSpeakNode)(device, text, locale)));
|
|
300
|
+
}
|
|
301
|
+
if (operation === 'speakAll') {
|
|
302
|
+
const devices = this.getNodeParameter('devices', itemIndex);
|
|
303
|
+
const speakType = this.getNodeParameter('speakType', itemIndex);
|
|
304
|
+
const text = speakType === 'ssml'
|
|
305
|
+
? this.getNodeParameter('ssmlContent', itemIndex)
|
|
306
|
+
: this.getNodeParameter('text', itemIndex);
|
|
307
|
+
if (speakType === 'announcement') {
|
|
308
|
+
return alexa.sendAnnouncement(devices, text, locale);
|
|
309
|
+
}
|
|
310
|
+
return alexa.sendSequenceCommand((0, helpers_1.buildParallelSequence)(devices.map((device) => (0, helpers_1.buildSpeakNode)(device, text, locale))));
|
|
311
|
+
}
|
|
312
|
+
if (operation === 'stop') {
|
|
313
|
+
const device = this.getNodeParameter('device', itemIndex);
|
|
314
|
+
return alexa.sendSequenceCommandStr(device, 'deviceStop', null);
|
|
315
|
+
}
|
|
316
|
+
if (operation === 'music') {
|
|
317
|
+
const device = this.getNodeParameter('device', itemIndex);
|
|
318
|
+
const provider = this.getNodeParameter('musicProvider', itemIndex);
|
|
319
|
+
const search = this.getNodeParameter('searchQuery', itemIndex);
|
|
320
|
+
return alexa.playMusic(device, provider, search);
|
|
321
|
+
}
|
|
322
|
+
if (operation === 'speakAtVolume') {
|
|
323
|
+
const device = this.getNodeParameter('device', itemIndex);
|
|
324
|
+
const speakType = this.getNodeParameter('speakType', itemIndex);
|
|
325
|
+
const text = speakType === 'ssml'
|
|
326
|
+
? this.getNodeParameter('ssmlContent', itemIndex)
|
|
327
|
+
: this.getNodeParameter('text', itemIndex);
|
|
328
|
+
const volumeValue = this.getNodeParameter('volumeValue', itemIndex);
|
|
329
|
+
if (speakType === 'announcement') {
|
|
330
|
+
await alexa.sendSequenceCommand((0, helpers_1.buildSingleSequence)((0, helpers_1.buildVolumeNode)(device, volumeValue, locale)));
|
|
331
|
+
return alexa.sendAnnouncement([device], text, locale);
|
|
332
|
+
}
|
|
333
|
+
return alexa.sendSequenceCommand((0, helpers_1.buildSerialSequence)([
|
|
334
|
+
(0, helpers_1.buildVolumeNode)(device, volumeValue, locale),
|
|
335
|
+
(0, helpers_1.buildWaitNode)(1),
|
|
336
|
+
(0, helpers_1.buildSpeakNode)(device, text, locale),
|
|
337
|
+
]));
|
|
338
|
+
}
|
|
339
|
+
if (operation === 'textCommand') {
|
|
340
|
+
const device = this.getNodeParameter('device', itemIndex);
|
|
341
|
+
const text = this.getNodeParameter('text', itemIndex);
|
|
342
|
+
return alexa.sendSequenceCommandStr(device, 'textCommand', text);
|
|
343
|
+
}
|
|
344
|
+
if (operation === 'volume') {
|
|
345
|
+
const device = this.getNodeParameter('device', itemIndex);
|
|
346
|
+
const volumeValue = this.getNodeParameter('volumeValue', itemIndex);
|
|
347
|
+
return alexa.setVolume(device, volumeValue);
|
|
348
|
+
}
|
|
349
|
+
if (operation === 'builtin') {
|
|
350
|
+
const device = this.getNodeParameter('device', itemIndex);
|
|
351
|
+
const builtinType = this.getNodeParameter('builtinType', itemIndex);
|
|
352
|
+
return alexa.sendSequenceCommand((0, helpers_1.buildSingleSequence)((0, helpers_1.buildBuiltinNode)(device, builtinType, locale)));
|
|
353
|
+
}
|
|
354
|
+
if (operation === 'sound') {
|
|
355
|
+
const device = this.getNodeParameter('device', itemIndex);
|
|
356
|
+
const soundId = this.getNodeParameter('soundId', itemIndex);
|
|
357
|
+
return alexa.sendSequenceCommand((0, helpers_1.buildSingleSequence)((0, helpers_1.buildSoundNode)(device, soundId, locale)));
|
|
358
|
+
}
|
|
359
|
+
if (operation === 'wait') {
|
|
360
|
+
const waitDuration = this.getNodeParameter('waitDuration', itemIndex);
|
|
361
|
+
return alexa.sendSequenceCommand((0, helpers_1.buildSingleSequence)((0, helpers_1.buildWaitNode)(waitDuration)));
|
|
362
|
+
}
|
|
363
|
+
return undefined;
|
|
364
|
+
}
|
|
365
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/AlexaRemote/resources/interaction/index.ts"],"names":[],"mappings":";;;AAySA,0BAqHC;AA7ZD,+CAAkD;AAGlD,+CAU2B;AAEd,QAAA,WAAW,GAAsB;IAC5C;QACE,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACd,IAAI,EAAE;gBACJ,QAAQ,EAAE,CAAC,aAAa,CAAC;aAC1B;SACF;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,kEAAkE;gBAC/E,MAAM,EAAE,4BAA4B;aACrC;YACD;gBACE,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,0BAA0B;gBACvC,MAAM,EAAE,YAAY;aACrB;YACD;gBACE,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,mBAAmB;gBAChC,MAAM,EAAE,YAAY;aACrB;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,qBAAqB;gBAClC,MAAM,EAAE,mBAAmB;aAC5B;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,uBAAuB;gBACpC,MAAM,EAAE,kBAAkB;aAC3B;YACD;gBACE,IAAI,EAAE,0BAA0B;gBAChC,KAAK,EAAE,UAAU;gBACjB,WA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,CAAC;IACJ,CAAC;IAED,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,CAAW,CAAC;QACpE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAW,CAAC;QACtE,OAAO,KAAK,CAAC,mBAAmB,CAC9B,IAAA,6BAAmB,EAAC,IAAA,wBAAc,EAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAC7D,CAAC;IACJ,CAAC;IAED,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;QACzB,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,SAAS,CAAW,CAAC;QAChF,OAAO,KAAK,CAAC,mBAAmB,CAAC,IAAA,6BAAmB,EAAC,IAAA,uBAAa,EAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { INodeProperties, IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
import type { AlexaRemoteExt } from '../../lib/alexa-remote-ext';
|
|
3
|
+
export declare const description: INodeProperties[];
|
|
4
|
+
export declare function execute(this: IExecuteFunctions, alexa: AlexaRemoteExt, operation: string, itemIndex: number): Promise<unknown>;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
exports.description = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Operation',
|
|
8
|
+
name: 'operation',
|
|
9
|
+
type: 'options',
|
|
10
|
+
noDataExpression: true,
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['list'],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
options: [
|
|
17
|
+
{
|
|
18
|
+
name: 'Add Item',
|
|
19
|
+
value: 'addItem',
|
|
20
|
+
description: 'Add item to a list',
|
|
21
|
+
action: 'Add item to list',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'Create List',
|
|
25
|
+
value: 'createList',
|
|
26
|
+
description: 'Create a new custom list',
|
|
27
|
+
action: 'Create list',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Delete List',
|
|
31
|
+
value: 'deleteList',
|
|
32
|
+
description: 'Delete a list',
|
|
33
|
+
action: 'Delete list',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Get Lists',
|
|
37
|
+
value: 'getLists',
|
|
38
|
+
description: 'Get all lists',
|
|
39
|
+
action: 'Get lists',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Remove Item',
|
|
43
|
+
value: 'removeItem',
|
|
44
|
+
description: 'Remove item from a list',
|
|
45
|
+
action: 'Remove item from list',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
default: 'getLists',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: 'List Name',
|
|
52
|
+
name: 'listName',
|
|
53
|
+
type: 'string',
|
|
54
|
+
default: '',
|
|
55
|
+
required: true,
|
|
56
|
+
displayOptions: {
|
|
57
|
+
show: {
|
|
58
|
+
resource: ['list'],
|
|
59
|
+
operation: ['createList'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
description: 'Name of the list to create',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
displayName: 'List Name or ID',
|
|
66
|
+
name: 'listId',
|
|
67
|
+
type: 'options',
|
|
68
|
+
typeOptions: {
|
|
69
|
+
loadOptionsMethod: 'getAlexaLists',
|
|
70
|
+
},
|
|
71
|
+
default: '',
|
|
72
|
+
required: true,
|
|
73
|
+
displayOptions: {
|
|
74
|
+
show: {
|
|
75
|
+
resource: ['list'],
|
|
76
|
+
operation: ['addItem', 'removeItem', 'deleteList'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
description: 'List to act on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
displayName: 'Item Text',
|
|
83
|
+
name: 'itemText',
|
|
84
|
+
type: 'string',
|
|
85
|
+
default: '',
|
|
86
|
+
required: true,
|
|
87
|
+
displayOptions: {
|
|
88
|
+
show: {
|
|
89
|
+
resource: ['list'],
|
|
90
|
+
operation: ['addItem'],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
description: 'Text of the item to add',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
displayName: 'Item Name or ID',
|
|
97
|
+
name: 'itemId',
|
|
98
|
+
type: 'options',
|
|
99
|
+
typeOptions: {
|
|
100
|
+
loadOptionsMethod: 'getAlexaListItems',
|
|
101
|
+
loadOptionsDependsOn: ['listId'],
|
|
102
|
+
},
|
|
103
|
+
default: '',
|
|
104
|
+
required: true,
|
|
105
|
+
displayOptions: {
|
|
106
|
+
show: {
|
|
107
|
+
resource: ['list'],
|
|
108
|
+
operation: ['removeItem'],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
description: 'Item to remove. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
async function execute(alexa, operation, itemIndex) {
|
|
115
|
+
if (operation === 'createList') {
|
|
116
|
+
const listName = this.getNodeParameter('listName', itemIndex);
|
|
117
|
+
return alexa.createList(listName);
|
|
118
|
+
}
|
|
119
|
+
if (operation === 'deleteList') {
|
|
120
|
+
const listRaw = this.getNodeParameter('listId', itemIndex);
|
|
121
|
+
const [listId, versionStr] = listRaw.split('|');
|
|
122
|
+
return alexa.deleteList(listId, Number(versionStr));
|
|
123
|
+
}
|
|
124
|
+
if (operation === 'getLists') {
|
|
125
|
+
return alexa.getLists();
|
|
126
|
+
}
|
|
127
|
+
if (operation === 'addItem') {
|
|
128
|
+
const listRaw = this.getNodeParameter('listId', itemIndex);
|
|
129
|
+
const [listId] = listRaw.split('|');
|
|
130
|
+
const itemText = this.getNodeParameter('itemText', itemIndex);
|
|
131
|
+
return alexa.addListItem(listId, itemText);
|
|
132
|
+
}
|
|
133
|
+
if (operation === 'removeItem') {
|
|
134
|
+
const listRaw = this.getNodeParameter('listId', itemIndex);
|
|
135
|
+
const [listId] = listRaw.split('|');
|
|
136
|
+
const itemRaw = this.getNodeParameter('itemId', itemIndex);
|
|
137
|
+
const [itemId, versionStr] = itemRaw.split('|');
|
|
138
|
+
return alexa.removeListItem(listId, itemId, Number(versionStr));
|
|
139
|
+
}
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/AlexaRemote/resources/list/index.ts"],"names":[],"mappings":";;;AAkHA,0BAgCC;AA9IY,QAAA,WAAW,GAAsB;IAC5C;QACE,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACd,IAAI,EAAE;gBACJ,QAAQ,EAAE,CAAC,MAAM,CAAC;aACnB;SACF;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,oBAAoB;gBACjC,MAAM,EAAE,kBAAkB;aAC3B;YACD;gBACE,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,0BAA0B;gBACvC,MAAM,EAAE,aAAa;aACtB;YACD;gBACE,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,eAAe;g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Q,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAW,CAAC;QACxE,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,CAAW,CAAC;QACrE,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,CAAW,CAAC;QACrE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { INodeProperties, IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
import type { AlexaRemoteExt } from '../../lib/alexa-remote-ext';
|
|
3
|
+
export declare const description: INodeProperties[];
|
|
4
|
+
export declare function execute(this: IExecuteFunctions, alexa: AlexaRemoteExt, operation: string, itemIndex: number): Promise<unknown>;
|