n8n-nodes-tareno 1.4.0 → 1.5.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/dist/nodes/Tareno/Tareno.node.js +72 -58
- package/package.json +1 -1
|
@@ -46,7 +46,7 @@ class Tareno {
|
|
|
46
46
|
],
|
|
47
47
|
default: 'publish',
|
|
48
48
|
},
|
|
49
|
-
// Account Filter
|
|
49
|
+
// Account Filter
|
|
50
50
|
{
|
|
51
51
|
displayName: 'Filter Accounts by Platform',
|
|
52
52
|
name: 'platformFilter',
|
|
@@ -89,16 +89,38 @@ class Tareno {
|
|
|
89
89
|
default: '',
|
|
90
90
|
description: 'The text content of your post',
|
|
91
91
|
},
|
|
92
|
-
// Media
|
|
92
|
+
// Media Source Selection
|
|
93
|
+
{
|
|
94
|
+
displayName: 'Media Source',
|
|
95
|
+
name: 'mediaSource',
|
|
96
|
+
type: 'options',
|
|
97
|
+
displayOptions: { show: { resource: ['post'] } },
|
|
98
|
+
options: [
|
|
99
|
+
{ name: 'No Media', value: 'none', description: 'Text-only post' },
|
|
100
|
+
{ name: 'Binary File', value: 'binary', description: 'From previous node (e.g., Google Drive)' },
|
|
101
|
+
{ name: 'URL(s)', value: 'url', description: 'Already hosted media URLs' },
|
|
102
|
+
],
|
|
103
|
+
default: 'none',
|
|
104
|
+
},
|
|
105
|
+
// Binary Property (when source is binary)
|
|
106
|
+
{
|
|
107
|
+
displayName: 'Binary Property',
|
|
108
|
+
name: 'binaryPropertyName',
|
|
109
|
+
type: 'string',
|
|
110
|
+
default: 'data',
|
|
111
|
+
displayOptions: { show: { resource: ['post'], mediaSource: ['binary'] } },
|
|
112
|
+
description: 'Name of the binary property containing the media file',
|
|
113
|
+
},
|
|
114
|
+
// Media URLs (when source is url)
|
|
93
115
|
{
|
|
94
116
|
displayName: 'Media URLs',
|
|
95
117
|
name: 'mediaUrls',
|
|
96
118
|
type: 'string',
|
|
97
119
|
typeOptions: { rows: 2 },
|
|
98
|
-
displayOptions: { show: { resource: ['post'] } },
|
|
120
|
+
displayOptions: { show: { resource: ['post'], mediaSource: ['url'] } },
|
|
99
121
|
default: '',
|
|
100
122
|
placeholder: 'https://example.com/image.jpg, https://example.com/video.mp4',
|
|
101
|
-
description: 'Comma-separated URLs of media files
|
|
123
|
+
description: 'Comma-separated URLs of media files',
|
|
102
124
|
},
|
|
103
125
|
// Schedule Time
|
|
104
126
|
{
|
|
@@ -127,7 +149,7 @@ class Tareno {
|
|
|
127
149
|
],
|
|
128
150
|
default: 'post',
|
|
129
151
|
},
|
|
130
|
-
// Additional Options
|
|
152
|
+
// Additional Options
|
|
131
153
|
{
|
|
132
154
|
displayName: 'Additional Options',
|
|
133
155
|
name: 'additionalOptions',
|
|
@@ -136,55 +158,18 @@ class Tareno {
|
|
|
136
158
|
displayOptions: { show: { resource: ['post'] } },
|
|
137
159
|
default: {},
|
|
138
160
|
options: [
|
|
139
|
-
|
|
140
|
-
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
type: 'string',
|
|
144
|
-
default: '',
|
|
145
|
-
description: 'Title for YouTube videos'
|
|
146
|
-
},
|
|
161
|
+
{ displayName: 'YouTube Title', name: 'youtubeTitle', type: 'string', default: '' },
|
|
162
|
+
{ displayName: 'YouTube Description', name: 'youtubeDescription', type: 'string', typeOptions: { rows: 3 }, default: '' },
|
|
163
|
+
{ displayName: 'Pinterest Board ID', name: 'pinterestBoard', type: 'string', default: '' },
|
|
164
|
+
{ displayName: 'Pinterest Link', name: 'pinterestLink', type: 'string', default: '' },
|
|
147
165
|
{
|
|
148
|
-
displayName: '
|
|
149
|
-
name: 'youtubeDescription',
|
|
150
|
-
type: 'string',
|
|
151
|
-
typeOptions: { rows: 3 },
|
|
152
|
-
default: '',
|
|
153
|
-
},
|
|
154
|
-
// Pinterest
|
|
155
|
-
{
|
|
156
|
-
displayName: 'Pinterest Board ID',
|
|
157
|
-
name: 'pinterestBoard',
|
|
158
|
-
type: 'string',
|
|
159
|
-
default: '',
|
|
160
|
-
description: 'The Pinterest board ID to pin to (optional - uses default board if empty)'
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
displayName: 'Pinterest Link',
|
|
164
|
-
name: 'pinterestLink',
|
|
165
|
-
type: 'string',
|
|
166
|
-
default: '',
|
|
167
|
-
description: 'URL to link the pin to'
|
|
168
|
-
},
|
|
169
|
-
// TikTok
|
|
170
|
-
{
|
|
171
|
-
displayName: 'TikTok Privacy',
|
|
172
|
-
name: 'tiktokPrivacy',
|
|
173
|
-
type: 'options',
|
|
174
|
-
options: [
|
|
166
|
+
displayName: 'TikTok Privacy', name: 'tiktokPrivacy', type: 'options', options: [
|
|
175
167
|
{ name: 'Public', value: 'PUBLIC_TO_EVERYONE' },
|
|
176
168
|
{ name: 'Friends', value: 'MUTUAL_FOLLOW_FRIENDS' },
|
|
177
169
|
{ name: 'Private', value: 'SELF_ONLY' },
|
|
178
|
-
],
|
|
179
|
-
default: 'PUBLIC_TO_EVERYONE',
|
|
180
|
-
},
|
|
181
|
-
// General
|
|
182
|
-
{
|
|
183
|
-
displayName: 'Disable Comments',
|
|
184
|
-
name: 'disableComments',
|
|
185
|
-
type: 'boolean',
|
|
186
|
-
default: false,
|
|
170
|
+
], default: 'PUBLIC_TO_EVERYONE'
|
|
187
171
|
},
|
|
172
|
+
{ displayName: 'Disable Comments', name: 'disableComments', type: 'boolean', default: false },
|
|
188
173
|
],
|
|
189
174
|
},
|
|
190
175
|
// ========================
|
|
@@ -208,19 +193,18 @@ class Tareno {
|
|
|
208
193
|
type: 'options',
|
|
209
194
|
displayOptions: { show: { resource: ['media'], operation: ['upload'] } },
|
|
210
195
|
options: [
|
|
211
|
-
{ name: 'Binary File', value: 'file', description: '
|
|
212
|
-
{ name: 'URL', value: 'url', description: 'Download from URL
|
|
196
|
+
{ name: 'Binary File', value: 'file', description: 'From previous node' },
|
|
197
|
+
{ name: 'URL', value: 'url', description: 'Download from URL' },
|
|
213
198
|
],
|
|
214
199
|
default: 'file',
|
|
215
200
|
},
|
|
216
201
|
{
|
|
217
202
|
displayName: 'Binary Property',
|
|
218
|
-
name: '
|
|
203
|
+
name: 'mediaBinaryPropertyName',
|
|
219
204
|
type: 'string',
|
|
220
205
|
default: 'data',
|
|
221
206
|
required: true,
|
|
222
207
|
displayOptions: { show: { resource: ['media'], operation: ['upload'], uploadMode: ['file'] } },
|
|
223
|
-
description: 'Name of the binary property containing the file',
|
|
224
208
|
},
|
|
225
209
|
{
|
|
226
210
|
displayName: 'Media URL',
|
|
@@ -236,7 +220,6 @@ class Tareno {
|
|
|
236
220
|
type: 'string',
|
|
237
221
|
displayOptions: { show: { resource: ['media'], operation: ['upload'] } },
|
|
238
222
|
default: '',
|
|
239
|
-
description: 'Optional custom filename',
|
|
240
223
|
},
|
|
241
224
|
],
|
|
242
225
|
};
|
|
@@ -288,15 +271,46 @@ class Tareno {
|
|
|
288
271
|
if (resource === 'post') {
|
|
289
272
|
const accountId = this.getNodeParameter('accountId', i);
|
|
290
273
|
const text = this.getNodeParameter('text', i);
|
|
291
|
-
const
|
|
274
|
+
const mediaSource = this.getNodeParameter('mediaSource', i);
|
|
292
275
|
const additionalOptions = this.getNodeParameter('additionalOptions', i, {});
|
|
293
|
-
// Get format only if it exists (Instagram/Facebook)
|
|
294
276
|
let format = 'post';
|
|
295
277
|
try {
|
|
296
278
|
format = this.getNodeParameter('format', i);
|
|
297
279
|
}
|
|
298
280
|
catch (e) { }
|
|
299
|
-
|
|
281
|
+
let mediaUrls = [];
|
|
282
|
+
// Handle binary upload - first upload to media library, then get URL
|
|
283
|
+
if (mediaSource === 'binary') {
|
|
284
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
285
|
+
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
|
286
|
+
const binaryBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
287
|
+
// Upload to media library first
|
|
288
|
+
const uploadResponse = await this.helpers.httpRequest({
|
|
289
|
+
method: 'POST',
|
|
290
|
+
url: `${baseUrl}/api/external/media`,
|
|
291
|
+
headers: {
|
|
292
|
+
'X-Tareno-API-Key': credentials.apiKey,
|
|
293
|
+
'Content-Type': 'application/octet-stream',
|
|
294
|
+
'X-File-Name': binaryData.fileName || 'upload',
|
|
295
|
+
'X-Content-Type': binaryData.mimeType,
|
|
296
|
+
},
|
|
297
|
+
body: binaryBuffer,
|
|
298
|
+
});
|
|
299
|
+
let parsed = uploadResponse;
|
|
300
|
+
if (typeof uploadResponse === 'string') {
|
|
301
|
+
try {
|
|
302
|
+
parsed = JSON.parse(uploadResponse);
|
|
303
|
+
}
|
|
304
|
+
catch (e) { }
|
|
305
|
+
}
|
|
306
|
+
if (parsed.url) {
|
|
307
|
+
mediaUrls = [parsed.url];
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
else if (mediaSource === 'url') {
|
|
311
|
+
const mediaUrlsRaw = this.getNodeParameter('mediaUrls', i, '');
|
|
312
|
+
mediaUrls = mediaUrlsRaw ? mediaUrlsRaw.split(',').map(url => url.trim()).filter(Boolean) : [];
|
|
313
|
+
}
|
|
300
314
|
const body = {
|
|
301
315
|
accountId,
|
|
302
316
|
text,
|
|
@@ -332,7 +346,7 @@ class Tareno {
|
|
|
332
346
|
});
|
|
333
347
|
}
|
|
334
348
|
else {
|
|
335
|
-
const binaryPropertyName = this.getNodeParameter('
|
|
349
|
+
const binaryPropertyName = this.getNodeParameter('mediaBinaryPropertyName', i);
|
|
336
350
|
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
|
337
351
|
const binaryBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
338
352
|
responseData = await this.helpers.httpRequest({
|