@posty5/n8n-nodes-posty5 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +356 -0
- package/dist/credentials/Posty5Api.credentials.d.ts +10 -0
- package/dist/credentials/Posty5Api.credentials.d.ts.map +1 -0
- package/dist/credentials/Posty5Api.credentials.js +43 -0
- package/dist/credentials/Posty5Api.credentials.js.map +1 -0
- package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.d.ts +6 -0
- package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.d.ts.map +1 -0
- package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.js +331 -0
- package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.js.map +1 -0
- package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.d.ts +6 -0
- package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.d.ts.map +1 -0
- package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.js +445 -0
- package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.js.map +1 -0
- package/dist/nodes/Posty5HtmlHostingVariables/Posty5HtmlHostingVariables.node.d.ts +6 -0
- package/dist/nodes/Posty5HtmlHostingVariables/Posty5HtmlHostingVariables.node.d.ts.map +1 -0
- package/dist/nodes/Posty5HtmlHostingVariables/Posty5HtmlHostingVariables.node.js +285 -0
- package/dist/nodes/Posty5HtmlHostingVariables/Posty5HtmlHostingVariables.node.js.map +1 -0
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.d.ts +6 -0
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.d.ts.map +1 -0
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js +717 -0
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js.map +1 -0
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.d.ts +6 -0
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.d.ts.map +1 -0
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.js +396 -0
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.js.map +1 -0
- package/dist/nodes/Posty5SocialPublisherTask/Posty5SocialPublisherTask.node.d.ts +6 -0
- package/dist/nodes/Posty5SocialPublisherTask/Posty5SocialPublisherTask.node.d.ts.map +1 -0
- package/dist/nodes/Posty5SocialPublisherTask/Posty5SocialPublisherTask.node.js +598 -0
- package/dist/nodes/Posty5SocialPublisherTask/Posty5SocialPublisherTask.node.js.map +1 -0
- package/dist/nodes/Posty5SocialPublisherWorkspace/Posty5SocialPublisherWorkspace.node.d.ts +6 -0
- package/dist/nodes/Posty5SocialPublisherWorkspace/Posty5SocialPublisherWorkspace.node.d.ts.map +1 -0
- package/dist/nodes/Posty5SocialPublisherWorkspace/Posty5SocialPublisherWorkspace.node.js +289 -0
- package/dist/nodes/Posty5SocialPublisherWorkspace/Posty5SocialPublisherWorkspace.node.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,717 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Posty5QrCode = void 0;
|
|
37
|
+
const qr_code_1 = require("@posty5/qr-code");
|
|
38
|
+
class Posty5QrCode {
|
|
39
|
+
constructor() {
|
|
40
|
+
this.description = {
|
|
41
|
+
displayName: 'Posty5 QR Code',
|
|
42
|
+
name: 'posty5QrCode',
|
|
43
|
+
icon: 'file:posty5.svg',
|
|
44
|
+
group: ['transform'],
|
|
45
|
+
version: 1,
|
|
46
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["qrType"]}}',
|
|
47
|
+
description: 'Create and manage QR codes with Posty5',
|
|
48
|
+
defaults: {
|
|
49
|
+
name: 'Posty5 QR Code',
|
|
50
|
+
},
|
|
51
|
+
inputs: ['main'],
|
|
52
|
+
outputs: ['main'],
|
|
53
|
+
credentials: [
|
|
54
|
+
{
|
|
55
|
+
name: 'posty5Api',
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
properties: [
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Operation',
|
|
62
|
+
name: 'operation',
|
|
63
|
+
type: 'options',
|
|
64
|
+
noDataExpression: true,
|
|
65
|
+
options: [
|
|
66
|
+
{
|
|
67
|
+
name: 'Create',
|
|
68
|
+
value: 'create',
|
|
69
|
+
description: 'Create a new QR code',
|
|
70
|
+
action: 'Create a QR code',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Delete',
|
|
74
|
+
value: 'delete',
|
|
75
|
+
description: 'Delete a QR code',
|
|
76
|
+
action: 'Delete a QR code',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'Get',
|
|
80
|
+
value: 'get',
|
|
81
|
+
description: 'Get a QR code by ID',
|
|
82
|
+
action: 'Get a QR code',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'List',
|
|
86
|
+
value: 'list',
|
|
87
|
+
description: 'List all QR codes',
|
|
88
|
+
action: 'List QR codes',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'Update',
|
|
92
|
+
value: 'update',
|
|
93
|
+
description: 'Update a QR code',
|
|
94
|
+
action: 'Update a QR code',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
default: 'create',
|
|
98
|
+
},
|
|
99
|
+
// QR Type selection for Create/Update
|
|
100
|
+
{
|
|
101
|
+
displayName: 'QR Type',
|
|
102
|
+
name: 'qrType',
|
|
103
|
+
type: 'options',
|
|
104
|
+
displayOptions: {
|
|
105
|
+
show: {
|
|
106
|
+
operation: ['create', 'update'],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
options: [
|
|
110
|
+
{
|
|
111
|
+
name: 'URL',
|
|
112
|
+
value: 'url',
|
|
113
|
+
description: 'Link to a website',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'Free Text',
|
|
117
|
+
value: 'freeText',
|
|
118
|
+
description: 'Plain text content',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'Email',
|
|
122
|
+
value: 'email',
|
|
123
|
+
description: 'Email address with optional subject and body',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'WiFi',
|
|
127
|
+
value: 'wifi',
|
|
128
|
+
description: 'WiFi network credentials',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'Phone Call',
|
|
132
|
+
value: 'call',
|
|
133
|
+
description: 'Phone number to call',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'SMS',
|
|
137
|
+
value: 'sms',
|
|
138
|
+
description: 'SMS message',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'Geolocation',
|
|
142
|
+
value: 'geolocation',
|
|
143
|
+
description: 'Geographic coordinates',
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
default: 'url',
|
|
147
|
+
},
|
|
148
|
+
// Common fields
|
|
149
|
+
{
|
|
150
|
+
displayName: 'Name',
|
|
151
|
+
name: 'name',
|
|
152
|
+
type: 'string',
|
|
153
|
+
displayOptions: {
|
|
154
|
+
show: {
|
|
155
|
+
operation: ['create', 'update'],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
default: '',
|
|
159
|
+
description: 'A friendly name for the QR code',
|
|
160
|
+
},
|
|
161
|
+
// URL Type fields
|
|
162
|
+
{
|
|
163
|
+
displayName: 'URL',
|
|
164
|
+
name: 'url',
|
|
165
|
+
type: 'string',
|
|
166
|
+
required: true,
|
|
167
|
+
displayOptions: {
|
|
168
|
+
show: {
|
|
169
|
+
operation: ['create', 'update'],
|
|
170
|
+
qrType: ['url'],
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
default: '',
|
|
174
|
+
description: 'The URL to encode in the QR code',
|
|
175
|
+
},
|
|
176
|
+
// Free Text fields
|
|
177
|
+
{
|
|
178
|
+
displayName: 'Text',
|
|
179
|
+
name: 'text',
|
|
180
|
+
type: 'string',
|
|
181
|
+
required: true,
|
|
182
|
+
displayOptions: {
|
|
183
|
+
show: {
|
|
184
|
+
operation: ['create', 'update'],
|
|
185
|
+
qrType: ['freeText'],
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
default: '',
|
|
189
|
+
description: 'The text to encode in the QR code',
|
|
190
|
+
},
|
|
191
|
+
// Email fields
|
|
192
|
+
{
|
|
193
|
+
displayName: 'Email Address',
|
|
194
|
+
name: 'email',
|
|
195
|
+
type: 'string',
|
|
196
|
+
required: true,
|
|
197
|
+
displayOptions: {
|
|
198
|
+
show: {
|
|
199
|
+
operation: ['create', 'update'],
|
|
200
|
+
qrType: ['email'],
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
default: '',
|
|
204
|
+
description: 'The email address',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
displayName: 'Subject',
|
|
208
|
+
name: 'emailSubject',
|
|
209
|
+
type: 'string',
|
|
210
|
+
displayOptions: {
|
|
211
|
+
show: {
|
|
212
|
+
operation: ['create', 'update'],
|
|
213
|
+
qrType: ['email'],
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
default: '',
|
|
217
|
+
description: 'Email subject line',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
displayName: 'Body',
|
|
221
|
+
name: 'emailBody',
|
|
222
|
+
type: 'string',
|
|
223
|
+
displayOptions: {
|
|
224
|
+
show: {
|
|
225
|
+
operation: ['create', 'update'],
|
|
226
|
+
qrType: ['email'],
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
default: '',
|
|
230
|
+
description: 'Email body text',
|
|
231
|
+
},
|
|
232
|
+
// WiFi fields
|
|
233
|
+
{
|
|
234
|
+
displayName: 'Network Name (SSID)',
|
|
235
|
+
name: 'wifiName',
|
|
236
|
+
type: 'string',
|
|
237
|
+
required: true,
|
|
238
|
+
displayOptions: {
|
|
239
|
+
show: {
|
|
240
|
+
operation: ['create', 'update'],
|
|
241
|
+
qrType: ['wifi'],
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
default: '',
|
|
245
|
+
description: 'WiFi network name',
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
displayName: 'Authentication Type',
|
|
249
|
+
name: 'wifiAuthType',
|
|
250
|
+
type: 'options',
|
|
251
|
+
displayOptions: {
|
|
252
|
+
show: {
|
|
253
|
+
operation: ['create', 'update'],
|
|
254
|
+
qrType: ['wifi'],
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
options: [
|
|
258
|
+
{ name: 'WPA/WPA2', value: 'WPA' },
|
|
259
|
+
{ name: 'WEP', value: 'WEP' },
|
|
260
|
+
{ name: 'No Password', value: 'nopass' },
|
|
261
|
+
],
|
|
262
|
+
default: 'WPA',
|
|
263
|
+
description: 'WiFi security type',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
displayName: 'Password',
|
|
267
|
+
name: 'wifiPassword',
|
|
268
|
+
type: 'string',
|
|
269
|
+
displayOptions: {
|
|
270
|
+
show: {
|
|
271
|
+
operation: ['create', 'update'],
|
|
272
|
+
qrType: ['wifi'],
|
|
273
|
+
wifiAuthType: ['WPA', 'WEP'],
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
default: '',
|
|
277
|
+
description: 'WiFi password',
|
|
278
|
+
},
|
|
279
|
+
// Phone Call fields
|
|
280
|
+
{
|
|
281
|
+
displayName: 'Phone Number',
|
|
282
|
+
name: 'phoneNumber',
|
|
283
|
+
type: 'string',
|
|
284
|
+
required: true,
|
|
285
|
+
displayOptions: {
|
|
286
|
+
show: {
|
|
287
|
+
operation: ['create', 'update'],
|
|
288
|
+
qrType: ['call'],
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
default: '',
|
|
292
|
+
description: 'Phone number to call',
|
|
293
|
+
},
|
|
294
|
+
// SMS fields
|
|
295
|
+
{
|
|
296
|
+
displayName: 'Phone Number',
|
|
297
|
+
name: 'smsPhoneNumber',
|
|
298
|
+
type: 'string',
|
|
299
|
+
required: true,
|
|
300
|
+
displayOptions: {
|
|
301
|
+
show: {
|
|
302
|
+
operation: ['create', 'update'],
|
|
303
|
+
qrType: ['sms'],
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
default: '',
|
|
307
|
+
description: 'Phone number for SMS',
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
displayName: 'Message',
|
|
311
|
+
name: 'smsMessage',
|
|
312
|
+
type: 'string',
|
|
313
|
+
displayOptions: {
|
|
314
|
+
show: {
|
|
315
|
+
operation: ['create', 'update'],
|
|
316
|
+
qrType: ['sms'],
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
default: '',
|
|
320
|
+
description: 'Pre-filled SMS message',
|
|
321
|
+
},
|
|
322
|
+
// Geolocation fields
|
|
323
|
+
{
|
|
324
|
+
displayName: 'Latitude',
|
|
325
|
+
name: 'latitude',
|
|
326
|
+
type: 'number',
|
|
327
|
+
required: true,
|
|
328
|
+
displayOptions: {
|
|
329
|
+
show: {
|
|
330
|
+
operation: ['create', 'update'],
|
|
331
|
+
qrType: ['geolocation'],
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
default: 0,
|
|
335
|
+
description: 'Latitude coordinate',
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
displayName: 'Longitude',
|
|
339
|
+
name: 'longitude',
|
|
340
|
+
type: 'number',
|
|
341
|
+
required: true,
|
|
342
|
+
displayOptions: {
|
|
343
|
+
show: {
|
|
344
|
+
operation: ['create', 'update'],
|
|
345
|
+
qrType: ['geolocation'],
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
default: 0,
|
|
349
|
+
description: 'Longitude coordinate',
|
|
350
|
+
},
|
|
351
|
+
// Additional fields for Create/Update
|
|
352
|
+
{
|
|
353
|
+
displayName: 'Additional Fields',
|
|
354
|
+
name: 'additionalFields',
|
|
355
|
+
type: 'collection',
|
|
356
|
+
placeholder: 'Add Field',
|
|
357
|
+
default: {},
|
|
358
|
+
displayOptions: {
|
|
359
|
+
show: {
|
|
360
|
+
operation: ['create', 'update'],
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
options: [
|
|
364
|
+
{
|
|
365
|
+
displayName: 'Tag',
|
|
366
|
+
name: 'tag',
|
|
367
|
+
type: 'string',
|
|
368
|
+
default: '',
|
|
369
|
+
description: 'Organization tag for filtering',
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
displayName: 'Reference ID',
|
|
373
|
+
name: 'refId',
|
|
374
|
+
type: 'string',
|
|
375
|
+
default: '',
|
|
376
|
+
description: 'External reference ID',
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
displayName: 'Template ID',
|
|
380
|
+
name: 'templateId',
|
|
381
|
+
type: 'string',
|
|
382
|
+
default: '',
|
|
383
|
+
description: 'QR code template/style ID',
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
displayName: 'Enable Monetization',
|
|
387
|
+
name: 'isEnableMonetization',
|
|
388
|
+
type: 'boolean',
|
|
389
|
+
default: false,
|
|
390
|
+
description: 'Whether to enable monetization for this QR code',
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
displayName: 'Page Title',
|
|
394
|
+
name: 'pageTitle',
|
|
395
|
+
type: 'string',
|
|
396
|
+
default: '',
|
|
397
|
+
description: 'Landing page title',
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
displayName: 'Page Description',
|
|
401
|
+
name: 'pageDescription',
|
|
402
|
+
type: 'string',
|
|
403
|
+
default: '',
|
|
404
|
+
description: 'Landing page description',
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
},
|
|
408
|
+
// Get, Update, Delete operation fields
|
|
409
|
+
{
|
|
410
|
+
displayName: 'QR Code ID',
|
|
411
|
+
name: 'qrCodeId',
|
|
412
|
+
type: 'string',
|
|
413
|
+
required: true,
|
|
414
|
+
displayOptions: {
|
|
415
|
+
show: {
|
|
416
|
+
operation: ['get', 'update', 'delete'],
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
default: '',
|
|
420
|
+
description: 'The ID of the QR code',
|
|
421
|
+
},
|
|
422
|
+
// List operation fields
|
|
423
|
+
{
|
|
424
|
+
displayName: 'Return All',
|
|
425
|
+
name: 'returnAll',
|
|
426
|
+
type: 'boolean',
|
|
427
|
+
displayOptions: {
|
|
428
|
+
show: {
|
|
429
|
+
operation: ['list'],
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
default: false,
|
|
433
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
displayName: 'Limit',
|
|
437
|
+
name: 'limit',
|
|
438
|
+
type: 'number',
|
|
439
|
+
displayOptions: {
|
|
440
|
+
show: {
|
|
441
|
+
operation: ['list'],
|
|
442
|
+
returnAll: [false],
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
typeOptions: {
|
|
446
|
+
minValue: 1,
|
|
447
|
+
maxValue: 100,
|
|
448
|
+
},
|
|
449
|
+
default: 50,
|
|
450
|
+
description: 'Max number of results to return',
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
displayName: 'Filters',
|
|
454
|
+
name: 'filters',
|
|
455
|
+
type: 'collection',
|
|
456
|
+
placeholder: 'Add Filter',
|
|
457
|
+
default: {},
|
|
458
|
+
displayOptions: {
|
|
459
|
+
show: {
|
|
460
|
+
operation: ['list'],
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
options: [
|
|
464
|
+
{
|
|
465
|
+
displayName: 'Tag',
|
|
466
|
+
name: 'tag',
|
|
467
|
+
type: 'string',
|
|
468
|
+
default: '',
|
|
469
|
+
description: 'Filter by tag',
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
displayName: 'Reference ID',
|
|
473
|
+
name: 'refId',
|
|
474
|
+
type: 'string',
|
|
475
|
+
default: '',
|
|
476
|
+
description: 'Filter by reference ID',
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
displayName: 'Search',
|
|
480
|
+
name: 'search',
|
|
481
|
+
type: 'string',
|
|
482
|
+
default: '',
|
|
483
|
+
description: 'Search term',
|
|
484
|
+
},
|
|
485
|
+
],
|
|
486
|
+
},
|
|
487
|
+
],
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
async execute() {
|
|
491
|
+
const items = this.getInputData();
|
|
492
|
+
const returnData = [];
|
|
493
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
494
|
+
const credentials = await this.getCredentials('posty5Api');
|
|
495
|
+
const { HttpClient } = await Promise.resolve().then(() => __importStar(require('@posty5/core')));
|
|
496
|
+
const http = new HttpClient({
|
|
497
|
+
apiKey: credentials.apiKey,
|
|
498
|
+
});
|
|
499
|
+
const client = new qr_code_1.QRCodeClient(http);
|
|
500
|
+
for (let i = 0; i < items.length; i++) {
|
|
501
|
+
try {
|
|
502
|
+
let responseData = {};
|
|
503
|
+
if (operation === 'create') {
|
|
504
|
+
const qrType = this.getNodeParameter('qrType', i);
|
|
505
|
+
const name = this.getNodeParameter('name', i, '');
|
|
506
|
+
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
507
|
+
const baseParams = {};
|
|
508
|
+
if (name)
|
|
509
|
+
baseParams.name = name;
|
|
510
|
+
if (additionalFields.tag)
|
|
511
|
+
baseParams.tag = additionalFields.tag;
|
|
512
|
+
if (additionalFields.refId)
|
|
513
|
+
baseParams.refId = additionalFields.refId;
|
|
514
|
+
if (additionalFields.templateId)
|
|
515
|
+
baseParams.templateId = additionalFields.templateId;
|
|
516
|
+
if (additionalFields.isEnableMonetization !== undefined) {
|
|
517
|
+
baseParams.isEnableMonetization = additionalFields.isEnableMonetization;
|
|
518
|
+
}
|
|
519
|
+
if (additionalFields.pageTitle || additionalFields.pageDescription) {
|
|
520
|
+
baseParams.pageInfo = {
|
|
521
|
+
title: additionalFields.pageTitle || '',
|
|
522
|
+
description: additionalFields.pageDescription || '',
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
switch (qrType) {
|
|
526
|
+
case 'url': {
|
|
527
|
+
const url = this.getNodeParameter('url', i);
|
|
528
|
+
responseData = await client.createURL({ ...baseParams, url });
|
|
529
|
+
break;
|
|
530
|
+
}
|
|
531
|
+
case 'freeText': {
|
|
532
|
+
const text = this.getNodeParameter('text', i);
|
|
533
|
+
responseData = await client.createFreeText({ ...baseParams, text });
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
case 'email': {
|
|
537
|
+
const email = this.getNodeParameter('email', i);
|
|
538
|
+
const subject = this.getNodeParameter('emailSubject', i, '');
|
|
539
|
+
const body = this.getNodeParameter('emailBody', i, '');
|
|
540
|
+
responseData = await client.createEmail({
|
|
541
|
+
...baseParams,
|
|
542
|
+
emailInfo: { email, subject, body },
|
|
543
|
+
});
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
546
|
+
case 'wifi': {
|
|
547
|
+
const wifiName = this.getNodeParameter('wifiName', i);
|
|
548
|
+
const authenticationType = this.getNodeParameter('wifiAuthType', i);
|
|
549
|
+
const password = this.getNodeParameter('wifiPassword', i, '');
|
|
550
|
+
responseData = await client.createWifi({
|
|
551
|
+
...baseParams,
|
|
552
|
+
wifiInfo: { name: wifiName, authenticationType, password },
|
|
553
|
+
});
|
|
554
|
+
break;
|
|
555
|
+
}
|
|
556
|
+
case 'call': {
|
|
557
|
+
const phoneNumber = this.getNodeParameter('phoneNumber', i);
|
|
558
|
+
responseData = await client.createCall({
|
|
559
|
+
...baseParams,
|
|
560
|
+
callInfo: { phoneNumber },
|
|
561
|
+
});
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
case 'sms': {
|
|
565
|
+
const phoneNumber = this.getNodeParameter('smsPhoneNumber', i);
|
|
566
|
+
const message = this.getNodeParameter('smsMessage', i, '');
|
|
567
|
+
responseData = await client.createSMS({
|
|
568
|
+
...baseParams,
|
|
569
|
+
smsInfo: { phoneNumber, message },
|
|
570
|
+
});
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
573
|
+
case 'geolocation': {
|
|
574
|
+
const latitude = this.getNodeParameter('latitude', i);
|
|
575
|
+
const longitude = this.getNodeParameter('longitude', i);
|
|
576
|
+
responseData = await client.createGeolocation({
|
|
577
|
+
...baseParams,
|
|
578
|
+
geolocationInfo: { latitude, longitude },
|
|
579
|
+
});
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
else if (operation === 'get') {
|
|
585
|
+
const qrCodeId = this.getNodeParameter('qrCodeId', i);
|
|
586
|
+
responseData = await client.get(qrCodeId);
|
|
587
|
+
}
|
|
588
|
+
else if (operation === 'update') {
|
|
589
|
+
const qrCodeId = this.getNodeParameter('qrCodeId', i);
|
|
590
|
+
const qrType = this.getNodeParameter('qrType', i);
|
|
591
|
+
const name = this.getNodeParameter('name', i, '');
|
|
592
|
+
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
593
|
+
const baseParams = { id: qrCodeId };
|
|
594
|
+
if (name)
|
|
595
|
+
baseParams.name = name;
|
|
596
|
+
if (additionalFields.tag)
|
|
597
|
+
baseParams.tag = additionalFields.tag;
|
|
598
|
+
if (additionalFields.refId)
|
|
599
|
+
baseParams.refId = additionalFields.refId;
|
|
600
|
+
if (additionalFields.templateId)
|
|
601
|
+
baseParams.templateId = additionalFields.templateId;
|
|
602
|
+
if (additionalFields.isEnableMonetization !== undefined) {
|
|
603
|
+
baseParams.isEnableMonetization = additionalFields.isEnableMonetization;
|
|
604
|
+
}
|
|
605
|
+
if (additionalFields.pageTitle || additionalFields.pageDescription) {
|
|
606
|
+
baseParams.pageInfo = {
|
|
607
|
+
title: additionalFields.pageTitle || '',
|
|
608
|
+
description: additionalFields.pageDescription || '',
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
switch (qrType) {
|
|
612
|
+
case 'url': {
|
|
613
|
+
const url = this.getNodeParameter('url', i);
|
|
614
|
+
responseData = await client.updateURL(qrCodeId, { ...baseParams, url });
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
case 'freeText': {
|
|
618
|
+
const text = this.getNodeParameter('text', i);
|
|
619
|
+
responseData = await client.updateFreeText(qrCodeId, { ...baseParams, text });
|
|
620
|
+
break;
|
|
621
|
+
}
|
|
622
|
+
case 'email': {
|
|
623
|
+
const email = this.getNodeParameter('email', i);
|
|
624
|
+
const subject = this.getNodeParameter('emailSubject', i, '');
|
|
625
|
+
const body = this.getNodeParameter('emailBody', i, '');
|
|
626
|
+
responseData = await client.updateEmail(qrCodeId, {
|
|
627
|
+
...baseParams,
|
|
628
|
+
emailInfo: { email, subject, body },
|
|
629
|
+
});
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
case 'wifi': {
|
|
633
|
+
const wifiName = this.getNodeParameter('wifiName', i);
|
|
634
|
+
const authenticationType = this.getNodeParameter('wifiAuthType', i);
|
|
635
|
+
const password = this.getNodeParameter('wifiPassword', i, '');
|
|
636
|
+
responseData = await client.updateWifi(qrCodeId, {
|
|
637
|
+
...baseParams,
|
|
638
|
+
wifiInfo: { name: wifiName, authenticationType, password },
|
|
639
|
+
});
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
case 'call': {
|
|
643
|
+
const phoneNumber = this.getNodeParameter('phoneNumber', i);
|
|
644
|
+
responseData = await client.updateCall(qrCodeId, {
|
|
645
|
+
...baseParams,
|
|
646
|
+
callInfo: { phoneNumber },
|
|
647
|
+
});
|
|
648
|
+
break;
|
|
649
|
+
}
|
|
650
|
+
case 'sms': {
|
|
651
|
+
const phoneNumber = this.getNodeParameter('smsPhoneNumber', i);
|
|
652
|
+
const message = this.getNodeParameter('smsMessage', i, '');
|
|
653
|
+
responseData = await client.updateSMS(qrCodeId, {
|
|
654
|
+
...baseParams,
|
|
655
|
+
smsInfo: { phoneNumber, message },
|
|
656
|
+
});
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
case 'geolocation': {
|
|
660
|
+
const latitude = this.getNodeParameter('latitude', i);
|
|
661
|
+
const longitude = this.getNodeParameter('longitude', i);
|
|
662
|
+
responseData = await client.updateGeolocation(qrCodeId, {
|
|
663
|
+
...baseParams,
|
|
664
|
+
geolocationInfo: { latitude, longitude },
|
|
665
|
+
});
|
|
666
|
+
break;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
else if (operation === 'delete') {
|
|
671
|
+
const qrCodeId = this.getNodeParameter('qrCodeId', i);
|
|
672
|
+
responseData = await client.delete(qrCodeId);
|
|
673
|
+
}
|
|
674
|
+
else if (operation === 'list') {
|
|
675
|
+
const returnAll = this.getNodeParameter('returnAll', i, false);
|
|
676
|
+
const filters = this.getNodeParameter('filters', i, {});
|
|
677
|
+
const params = {
|
|
678
|
+
page: 1,
|
|
679
|
+
pageSize: returnAll ? 100 : this.getNodeParameter('limit', i, 50),
|
|
680
|
+
...filters,
|
|
681
|
+
};
|
|
682
|
+
if (returnAll) {
|
|
683
|
+
let allResults = [];
|
|
684
|
+
let page = 1;
|
|
685
|
+
let hasMore = true;
|
|
686
|
+
while (hasMore) {
|
|
687
|
+
const result = await client.list({ ...filters }, { page, pageSize: params.pageSize });
|
|
688
|
+
allResults = allResults.concat(result.items);
|
|
689
|
+
hasMore = result.items.length === params.pageSize;
|
|
690
|
+
page++;
|
|
691
|
+
}
|
|
692
|
+
responseData = allResults;
|
|
693
|
+
}
|
|
694
|
+
else {
|
|
695
|
+
const result = await client.list({ ...filters }, { page: 1, pageSize: params.pageSize });
|
|
696
|
+
responseData = result.items;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
|
|
700
|
+
returnData.push(...executionData);
|
|
701
|
+
}
|
|
702
|
+
catch (error) {
|
|
703
|
+
if (this.continueOnFail()) {
|
|
704
|
+
returnData.push({
|
|
705
|
+
json: { error: error.message },
|
|
706
|
+
pairedItem: { item: i },
|
|
707
|
+
});
|
|
708
|
+
continue;
|
|
709
|
+
}
|
|
710
|
+
throw error;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return [returnData];
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
exports.Posty5QrCode = Posty5QrCode;
|
|
717
|
+
//# sourceMappingURL=Posty5QrCode.node.js.map
|