@posty5/n8n-nodes-posty5 4.0.0 → 5.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.
Files changed (174) hide show
  1. package/README.md +397 -19
  2. package/dist/credentials/Posty5Api.credentials.d.ts +4 -0
  3. package/dist/credentials/Posty5Api.credentials.d.ts.map +1 -1
  4. package/dist/credentials/Posty5Api.credentials.js +30 -4
  5. package/dist/credentials/Posty5Api.credentials.js.map +1 -1
  6. package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.d.ts.map +1 -1
  7. package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.js +6 -2
  8. package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.js.map +1 -1
  9. package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.d.ts.map +1 -1
  10. package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.js +14 -3
  11. package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.js.map +1 -1
  12. package/dist/nodes/Posty5QrCode/Posty5QrCode.node.d.ts +6 -0
  13. package/dist/nodes/Posty5QrCode/Posty5QrCode.node.d.ts.map +1 -1
  14. package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js +850 -189
  15. package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js.map +1 -1
  16. package/dist/nodes/Posty5QrCode/helpers.d.ts +12 -0
  17. package/dist/nodes/Posty5QrCode/helpers.d.ts.map +1 -0
  18. package/dist/nodes/Posty5QrCode/helpers.js +56 -0
  19. package/dist/nodes/Posty5QrCode/helpers.js.map +1 -0
  20. package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.d.ts +8 -0
  21. package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.d.ts.map +1 -1
  22. package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.js +389 -78
  23. package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.js.map +1 -1
  24. package/dist/nodes/Posty5ShortLink/helpers.d.ts +12 -0
  25. package/dist/nodes/Posty5ShortLink/helpers.d.ts.map +1 -0
  26. package/dist/nodes/Posty5ShortLink/helpers.js +46 -0
  27. package/dist/nodes/Posty5ShortLink/helpers.js.map +1 -0
  28. package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.d.ts.map +1 -1
  29. package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.js +458 -75
  30. package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.js.map +1 -1
  31. package/dist/nodes/Posty5Store/Posty5Store.node.d.ts +17 -0
  32. package/dist/nodes/Posty5Store/Posty5Store.node.d.ts.map +1 -0
  33. package/dist/nodes/Posty5Store/Posty5Store.node.js +230 -0
  34. package/dist/nodes/Posty5Store/Posty5Store.node.js.map +1 -0
  35. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.d.ts +4 -0
  36. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.d.ts.map +1 -0
  37. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.js +55 -0
  38. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.js.map +1 -0
  39. package/dist/nodes/Posty5Store/descriptions/order.description.d.ts +4 -0
  40. package/dist/nodes/Posty5Store/descriptions/order.description.d.ts.map +1 -0
  41. package/dist/nodes/Posty5Store/descriptions/order.description.js +91 -0
  42. package/dist/nodes/Posty5Store/descriptions/order.description.js.map +1 -0
  43. package/dist/nodes/Posty5Store/descriptions/product-link.description.d.ts +4 -0
  44. package/dist/nodes/Posty5Store/descriptions/product-link.description.d.ts.map +1 -0
  45. package/dist/nodes/Posty5Store/descriptions/product-link.description.js +48 -0
  46. package/dist/nodes/Posty5Store/descriptions/product-link.description.js.map +1 -0
  47. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.d.ts +4 -0
  48. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.d.ts.map +1 -0
  49. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.js +118 -0
  50. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.js.map +1 -0
  51. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.d.ts +4 -0
  52. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.d.ts.map +1 -0
  53. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.js +167 -0
  54. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.js.map +1 -0
  55. package/dist/nodes/Posty5Store/descriptions/supplier.description.d.ts +4 -0
  56. package/dist/nodes/Posty5Store/descriptions/supplier.description.d.ts.map +1 -0
  57. package/dist/nodes/Posty5Store/descriptions/supplier.description.js +50 -0
  58. package/dist/nodes/Posty5Store/descriptions/supplier.description.js.map +1 -0
  59. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.d.ts +13 -0
  60. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.d.ts.map +1 -0
  61. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.js +171 -0
  62. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.js.map +1 -0
  63. package/dist/nodes/Posty5Trigger/config.d.ts +51 -0
  64. package/dist/nodes/Posty5Trigger/config.d.ts.map +1 -0
  65. package/dist/nodes/Posty5Trigger/config.js +76 -0
  66. package/dist/nodes/Posty5Trigger/config.js.map +1 -0
  67. package/dist/nodes/Posty5Trigger/descriptions.d.ts +4 -0
  68. package/dist/nodes/Posty5Trigger/descriptions.d.ts.map +1 -0
  69. package/dist/nodes/Posty5Trigger/descriptions.js +99 -0
  70. package/dist/nodes/Posty5Trigger/descriptions.js.map +1 -0
  71. package/dist/nodes/Posty5Trigger/helpers.d.ts +34 -0
  72. package/dist/nodes/Posty5Trigger/helpers.d.ts.map +1 -0
  73. package/dist/nodes/Posty5Trigger/helpers.js +139 -0
  74. package/dist/nodes/Posty5Trigger/helpers.js.map +1 -0
  75. package/dist/package.json +78 -0
  76. package/dist/types/common.d.ts +62 -0
  77. package/dist/types/common.d.ts.map +1 -1
  78. package/dist/types/link-analytics.types.d.ts +147 -0
  79. package/dist/types/link-analytics.types.d.ts.map +1 -0
  80. package/dist/types/link-analytics.types.js +10 -0
  81. package/dist/types/link-analytics.types.js.map +1 -0
  82. package/dist/types/link-bulk.types.d.ts +68 -0
  83. package/dist/types/link-bulk.types.d.ts.map +1 -0
  84. package/dist/types/link-bulk.types.js +8 -0
  85. package/dist/types/link-bulk.types.js.map +1 -0
  86. package/dist/types/qr-code.types.d.ts +189 -56
  87. package/dist/types/qr-code.types.d.ts.map +1 -1
  88. package/dist/types/short-link-controls.types.d.ts +82 -0
  89. package/dist/types/short-link-controls.types.d.ts.map +1 -0
  90. package/dist/types/short-link-controls.types.js +7 -0
  91. package/dist/types/short-link-controls.types.js.map +1 -0
  92. package/dist/types/short-link.types.d.ts +63 -15
  93. package/dist/types/short-link.types.d.ts.map +1 -1
  94. package/dist/types/store.types.d.ts +71 -0
  95. package/dist/types/store.types.d.ts.map +1 -0
  96. package/dist/types/store.types.js +7 -0
  97. package/dist/types/store.types.js.map +1 -0
  98. package/dist/types/webhook.types.d.ts +66 -0
  99. package/dist/types/webhook.types.d.ts.map +1 -0
  100. package/dist/types/webhook.types.js +7 -0
  101. package/dist/types/webhook.types.js.map +1 -0
  102. package/dist/utils/analytics.helpers.d.ts +68 -0
  103. package/dist/utils/analytics.helpers.d.ts.map +1 -0
  104. package/dist/utils/analytics.helpers.js +202 -0
  105. package/dist/utils/analytics.helpers.js.map +1 -0
  106. package/dist/utils/analytics.properties.d.ts +10 -0
  107. package/dist/utils/analytics.properties.d.ts.map +1 -0
  108. package/dist/utils/analytics.properties.js +172 -0
  109. package/dist/utils/analytics.properties.js.map +1 -0
  110. package/dist/utils/api.helpers.d.ts +36 -3
  111. package/dist/utils/api.helpers.d.ts.map +1 -1
  112. package/dist/utils/api.helpers.js +77 -7
  113. package/dist/utils/api.helpers.js.map +1 -1
  114. package/dist/utils/constants.d.ts +198 -0
  115. package/dist/utils/constants.d.ts.map +1 -1
  116. package/dist/utils/constants.js +215 -1
  117. package/dist/utils/constants.js.map +1 -1
  118. package/dist/utils/date.helpers.d.ts +25 -0
  119. package/dist/utils/date.helpers.d.ts.map +1 -0
  120. package/dist/utils/date.helpers.js +65 -0
  121. package/dist/utils/date.helpers.js.map +1 -0
  122. package/dist/utils/link-bulk.helpers.d.ts +26 -0
  123. package/dist/utils/link-bulk.helpers.d.ts.map +1 -0
  124. package/dist/utils/link-bulk.helpers.js +135 -0
  125. package/dist/utils/link-bulk.helpers.js.map +1 -0
  126. package/dist/utils/link-bulk.properties.d.ts +9 -0
  127. package/dist/utils/link-bulk.properties.d.ts.map +1 -0
  128. package/dist/utils/link-bulk.properties.js +113 -0
  129. package/dist/utils/link-bulk.properties.js.map +1 -0
  130. package/dist/utils/link-tool.helpers.d.ts +43 -0
  131. package/dist/utils/link-tool.helpers.d.ts.map +1 -0
  132. package/dist/utils/link-tool.helpers.js +121 -0
  133. package/dist/utils/link-tool.helpers.js.map +1 -0
  134. package/dist/utils/post-comments.d.ts +43 -0
  135. package/dist/utils/post-comments.d.ts.map +1 -0
  136. package/dist/utils/post-comments.js +53 -0
  137. package/dist/utils/post-comments.js.map +1 -0
  138. package/dist/utils/qr-content.config.d.ts +66 -0
  139. package/dist/utils/qr-content.config.d.ts.map +1 -0
  140. package/dist/utils/qr-content.config.js +139 -0
  141. package/dist/utils/qr-content.config.js.map +1 -0
  142. package/dist/utils/qr-file.helpers.d.ts +22 -0
  143. package/dist/utils/qr-file.helpers.d.ts.map +1 -0
  144. package/dist/utils/qr-file.helpers.js +63 -0
  145. package/dist/utils/qr-file.helpers.js.map +1 -0
  146. package/dist/utils/qr-target.helpers.d.ts +35 -0
  147. package/dist/utils/qr-target.helpers.d.ts.map +1 -0
  148. package/dist/utils/qr-target.helpers.js +260 -0
  149. package/dist/utils/qr-target.helpers.js.map +1 -0
  150. package/dist/utils/qr-templates.helpers.d.ts +26 -0
  151. package/dist/utils/qr-templates.helpers.d.ts.map +1 -0
  152. package/dist/utils/qr-templates.helpers.js +70 -0
  153. package/dist/utils/qr-templates.helpers.js.map +1 -0
  154. package/dist/utils/resumable-upload.d.ts +39 -0
  155. package/dist/utils/resumable-upload.d.ts.map +1 -0
  156. package/dist/utils/resumable-upload.js +164 -0
  157. package/dist/utils/resumable-upload.js.map +1 -0
  158. package/dist/utils/short-link-controls.helpers.d.ts +31 -0
  159. package/dist/utils/short-link-controls.helpers.d.ts.map +1 -0
  160. package/dist/utils/short-link-controls.helpers.js +185 -0
  161. package/dist/utils/short-link-controls.helpers.js.map +1 -0
  162. package/dist/utils/short-link-controls.properties.d.ts +17 -0
  163. package/dist/utils/short-link-controls.properties.d.ts.map +1 -0
  164. package/dist/utils/short-link-controls.properties.js +315 -0
  165. package/dist/utils/short-link-controls.properties.js.map +1 -0
  166. package/dist/utils/store.helpers.d.ts +43 -0
  167. package/dist/utils/store.helpers.d.ts.map +1 -0
  168. package/dist/utils/store.helpers.js +87 -0
  169. package/dist/utils/store.helpers.js.map +1 -0
  170. package/dist/utils/versioned-write.helpers.d.ts +31 -0
  171. package/dist/utils/versioned-write.helpers.d.ts.map +1 -0
  172. package/dist/utils/versioned-write.helpers.js +120 -0
  173. package/dist/utils/versioned-write.helpers.js.map +1 -0
  174. package/package.json +7 -3
@@ -2,7 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Posty5SocialPublisherPost = void 0;
4
4
  const api_helpers_1 = require("../../utils/api.helpers");
5
+ const versioned_write_helpers_1 = require("../../utils/versioned-write.helpers");
5
6
  const constants_1 = require("../../utils/constants");
7
+ const resumable_upload_1 = require("../../utils/resumable-upload");
8
+ const post_comments_1 = require("../../utils/post-comments");
6
9
  class Posty5SocialPublisherPost {
7
10
  constructor() {
8
11
  this.description = {
@@ -10,9 +13,10 @@ class Posty5SocialPublisherPost {
10
13
  name: 'posty5SocialPublisherPost',
11
14
  icon: 'file:posty5.svg',
12
15
  group: ['transform'],
13
- version: 1,
16
+ version: [1, 2],
17
+ defaultVersion: 2,
14
18
  subtitle: '={{$parameter["operation"]}}',
15
- description: 'Publish videos to social media platforms. Supports an optional post-publish auto-comment (Pro plan, +1 credit) for YouTube, Facebook and Instagram — TikTok is not supported.',
19
+ description: 'Publish videos to social media platforms. Supports up to five post-publish comments (25 credits each) for YouTube, Facebook and Instagram — TikTok is not supported. v1 is legacy: reschedule and delete overwrite (last write wins).',
16
20
  defaults: {
17
21
  name: 'Posty5 Social Publisher Post',
18
22
  },
@@ -46,15 +50,45 @@ class Posty5SocialPublisherPost {
46
50
  {
47
51
  name: 'Publish Image to Workspace',
48
52
  value: 'publishImage',
49
- description: 'Publish an image to social media platforms via workspace (5 credits, +1 if comment is set)',
53
+ description: 'Publish an image to social media platforms via workspace (50 credits, plus 25 per comment)',
50
54
  action: 'Publish an image to workspace',
51
55
  },
52
56
  {
53
57
  name: 'Publish Image to Account',
54
58
  value: 'publishImageToAccount',
55
- description: 'Publish an image to a single connected account (5 credits, +1 if comment is set)',
59
+ description: 'Publish an image to a single connected account (50 credits, plus 25 per comment)',
56
60
  action: 'Publish an image to account',
57
61
  },
62
+ {
63
+ name: 'Publish Long Video to Workspace',
64
+ value: 'publishLongVideo',
65
+ description: 'Publish a video of up to 60 minutes via workspace. Charged by duration: 50 credits per started 5 minutes.',
66
+ action: 'Publish a long video to workspace',
67
+ },
68
+ {
69
+ name: 'Publish Long Video to Account',
70
+ value: 'publishLongVideoToAccount',
71
+ description: 'Publish a video of up to 60 minutes to a single connected account. Charged by duration: 50 credits per started 5 minutes.',
72
+ action: 'Publish a long video to account',
73
+ },
74
+ {
75
+ name: 'Quote Long Video',
76
+ value: 'getLongVideoQuote',
77
+ description: 'Measure a video and return its exact credit cost plus which platforms accept it. Creates nothing and charges nothing.',
78
+ action: 'Quote a long video',
79
+ },
80
+ {
81
+ name: 'Reschedule Post',
82
+ value: 'reschedulePost',
83
+ description: 'Move a not-yet-published post to another time, or publish it now. Costs no credits.',
84
+ action: 'Reschedule a post',
85
+ },
86
+ {
87
+ name: 'Delete Post',
88
+ value: 'deletePost',
89
+ description: 'Delete a post that has not published yet and release its uploaded media. Free — nothing was charged for a post that never went out.',
90
+ action: 'Delete a post',
91
+ },
58
92
  {
59
93
  name: 'Get Post Status',
60
94
  value: 'getPostStatus',
@@ -84,7 +118,7 @@ class Posty5SocialPublisherPost {
84
118
  required: true,
85
119
  displayOptions: {
86
120
  show: {
87
- operation: ['publishVideo'],
121
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
88
122
  },
89
123
  },
90
124
  default: '',
@@ -97,7 +131,7 @@ class Posty5SocialPublisherPost {
97
131
  required: true,
98
132
  displayOptions: {
99
133
  show: {
100
- operation: ['publishVideoToAccount'],
134
+ operation: ['publishVideoToAccount', 'publishLongVideoToAccount'],
101
135
  },
102
136
  },
103
137
  default: '',
@@ -109,7 +143,7 @@ class Posty5SocialPublisherPost {
109
143
  type: 'options',
110
144
  displayOptions: {
111
145
  show: {
112
- operation: ['publishVideo'],
146
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
113
147
  },
114
148
  },
115
149
  options: [
@@ -126,7 +160,7 @@ class Posty5SocialPublisherPost {
126
160
  required: true,
127
161
  displayOptions: {
128
162
  show: {
129
- operation: ['publishVideo'],
163
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
130
164
  videoSource: ['binary'],
131
165
  },
132
166
  },
@@ -140,7 +174,7 @@ class Posty5SocialPublisherPost {
140
174
  required: true,
141
175
  displayOptions: {
142
176
  show: {
143
- operation: ['publishVideo'],
177
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
144
178
  videoSource: ['url'],
145
179
  },
146
180
  },
@@ -153,7 +187,7 @@ class Posty5SocialPublisherPost {
153
187
  type: 'options',
154
188
  displayOptions: {
155
189
  show: {
156
- operation: ['publishVideo'],
190
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
157
191
  },
158
192
  },
159
193
  options: [
@@ -170,7 +204,7 @@ class Posty5SocialPublisherPost {
170
204
  type: 'string',
171
205
  displayOptions: {
172
206
  show: {
173
- operation: ['publishVideo'],
207
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
174
208
  thumbnailSource: ['binary'],
175
209
  },
176
210
  },
@@ -183,7 +217,7 @@ class Posty5SocialPublisherPost {
183
217
  type: 'string',
184
218
  displayOptions: {
185
219
  show: {
186
- operation: ['publishVideo'],
220
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
187
221
  thumbnailSource: ['url'],
188
222
  },
189
223
  },
@@ -196,7 +230,7 @@ class Posty5SocialPublisherPost {
196
230
  type: 'options',
197
231
  displayOptions: {
198
232
  show: {
199
- operation: ['publishVideo'],
233
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
200
234
  },
201
235
  },
202
236
  options: [
@@ -212,7 +246,7 @@ class Posty5SocialPublisherPost {
212
246
  type: 'dateTime',
213
247
  displayOptions: {
214
248
  show: {
215
- operation: ['publishVideo'],
249
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
216
250
  scheduledPublishTime: ['later'],
217
251
  },
218
252
  },
@@ -227,7 +261,7 @@ class Posty5SocialPublisherPost {
227
261
  default: '',
228
262
  displayOptions: {
229
263
  show: {
230
- operation: ['publishVideo'],
264
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
231
265
  },
232
266
  },
233
267
  },
@@ -239,7 +273,7 @@ class Posty5SocialPublisherPost {
239
273
  default: {},
240
274
  displayOptions: {
241
275
  show: {
242
- operation: ['publishVideo'],
276
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
243
277
  },
244
278
  },
245
279
  options: [
@@ -281,7 +315,7 @@ class Posty5SocialPublisherPost {
281
315
  default: '',
282
316
  displayOptions: {
283
317
  show: {
284
- operation: ['publishVideo'],
318
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
285
319
  },
286
320
  },
287
321
  },
@@ -293,7 +327,7 @@ class Posty5SocialPublisherPost {
293
327
  default: {},
294
328
  displayOptions: {
295
329
  show: {
296
- operation: ['publishVideo'],
330
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
297
331
  },
298
332
  },
299
333
  options: [
@@ -347,7 +381,7 @@ class Posty5SocialPublisherPost {
347
381
  default: '',
348
382
  displayOptions: {
349
383
  show: {
350
- operation: ['publishVideo'],
384
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
351
385
  },
352
386
  },
353
387
  },
@@ -359,7 +393,7 @@ class Posty5SocialPublisherPost {
359
393
  default: {},
360
394
  displayOptions: {
361
395
  show: {
362
- operation: ['publishVideo'],
396
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
363
397
  },
364
398
  },
365
399
  options: [
@@ -387,7 +421,7 @@ class Posty5SocialPublisherPost {
387
421
  default: '',
388
422
  displayOptions: {
389
423
  show: {
390
- operation: ['publishVideo'],
424
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
391
425
  },
392
426
  },
393
427
  },
@@ -399,7 +433,7 @@ class Posty5SocialPublisherPost {
399
433
  default: {},
400
434
  displayOptions: {
401
435
  show: {
402
- operation: ['publishVideo'],
436
+ operation: ['publishVideo', 'publishLongVideo', 'publishLongVideoToAccount'],
403
437
  },
404
438
  },
405
439
  options: [
@@ -419,7 +453,7 @@ class Posty5SocialPublisherPost {
419
453
  },
420
454
  ],
421
455
  },
422
- // Auto-Comment (post-publish comment, Pro plan, +1 credit)
456
+ // Post-publish comments — 25 credits each
423
457
  {
424
458
  displayName: 'Comment',
425
459
  name: 'comment',
@@ -431,7 +465,7 @@ class Posty5SocialPublisherPost {
431
465
  operation: ['publishVideo', 'publishVideoToAccount', 'publishImage', 'publishImageToAccount'],
432
466
  },
433
467
  },
434
- description: 'Optional post-publish comment (Pro plan, +1 credit). When Text is set, a comment is added under each enabled platform once the video/image is published.',
468
+ description: 'DEPRECATED — use Comments instead. Kept so existing workflows keep running; it is mapped into the first entry of Comments when that is empty, and the two are never sent together.',
435
469
  options: [
436
470
  {
437
471
  displayName: 'Text',
@@ -439,7 +473,7 @@ class Posty5SocialPublisherPost {
439
473
  type: 'string',
440
474
  typeOptions: { rows: 3 },
441
475
  default: '',
442
- description: 'Comment text (1-2200 characters). Leave empty to skip auto-commenting.',
476
+ description: 'Comment text (1-2200 characters). Leave empty to skip commenting.',
443
477
  },
444
478
  {
445
479
  displayName: 'Post to Facebook',
@@ -471,6 +505,76 @@ class Posty5SocialPublisherPost {
471
505
  },
472
506
  ],
473
507
  },
508
+ // Up to five comments, in the order they post. A fixedCollection
509
+ // rather than a plain collection because n8n's `multipleValues` is
510
+ // what gives an "Add Comment" button that produces a LIST.
511
+ {
512
+ displayName: 'Comments',
513
+ name: 'comments',
514
+ type: 'fixedCollection',
515
+ placeholder: 'Add Comment',
516
+ default: {},
517
+ typeOptions: { multipleValues: true, maxValue: 5, sortable: true },
518
+ displayOptions: {
519
+ show: {
520
+ operation: ['publishVideo', 'publishVideoToAccount', 'publishImage', 'publishImageToAccount'],
521
+ },
522
+ },
523
+ description: 'Up to five comments posted under each enabled platform once the post is published. 25 credits each, charged per comment that actually posts. TikTok is never one of them.',
524
+ options: [
525
+ {
526
+ displayName: 'Comment',
527
+ name: 'comment',
528
+ values: [
529
+ {
530
+ displayName: 'Text',
531
+ name: 'text',
532
+ type: 'string',
533
+ typeOptions: { rows: 3 },
534
+ default: '',
535
+ required: true,
536
+ description: 'Comment text (1-2200 characters)',
537
+ },
538
+ {
539
+ displayName: 'Delay (Minutes)',
540
+ name: 'delayMinutes',
541
+ type: 'number',
542
+ default: 0,
543
+ typeOptions: { minValue: 0, maxValue: 1440 },
544
+ description: 'How long to wait after the post is published. 0 posts it straight away; the maximum is 1440 (24 hours).',
545
+ },
546
+ {
547
+ displayName: 'Image URL',
548
+ name: 'imageUrl',
549
+ type: 'string',
550
+ default: '',
551
+ description: 'A publicly reachable image to attach. Facebook only — Instagram and YouTube comments are text-only, so an image bound for either is dropped with a reason rather than failing the comment.',
552
+ },
553
+ {
554
+ displayName: 'Post to Facebook',
555
+ name: 'postToFacebook',
556
+ type: 'boolean',
557
+ default: true,
558
+ description: 'Whether to add this comment under the Facebook post',
559
+ },
560
+ {
561
+ displayName: 'Post to Instagram',
562
+ name: 'postToInstagram',
563
+ type: 'boolean',
564
+ default: true,
565
+ description: 'Whether to add this comment under the Instagram post',
566
+ },
567
+ {
568
+ displayName: 'Post to YouTube',
569
+ name: 'postToYoutube',
570
+ type: 'boolean',
571
+ default: true,
572
+ description: 'Whether to add this comment under the YouTube post',
573
+ },
574
+ ],
575
+ },
576
+ ],
577
+ },
474
578
  // ─── Image post fields (task 6) ───────────────────────────────────
475
579
  // Image post shares the per-platform settings collections + the
476
580
  // Comment block above with the video flow. The only new inputs are
@@ -507,7 +611,7 @@ class Posty5SocialPublisherPost {
507
611
  { name: 'Uploaded Bucket File', value: 'image-file' },
508
612
  ],
509
613
  default: 'image-url',
510
- description: 'Where the image lives. "External URL" sends the URL directly; "Uploaded Bucket File" requires uploading via /generate-upload-urls first.',
614
+ description: 'Where the image lives. "External URL" sends the URL directly; "Uploaded Bucket File" requires uploading via /generate-upload-urls first, and keeping the postId it returns.',
511
615
  },
512
616
  {
513
617
  displayName: 'Image URL',
@@ -537,6 +641,19 @@ class Posty5SocialPublisherPost {
537
641
  default: '',
538
642
  description: 'fileURL returned by /generate-upload-urls after you uploaded the image',
539
643
  },
644
+ {
645
+ displayName: 'Upload Post ID',
646
+ name: 'imageUploadPostId',
647
+ type: 'string',
648
+ displayOptions: {
649
+ show: {
650
+ operation: ['publishImage', 'publishImageToAccount'],
651
+ imageSource: ['image-file'],
652
+ },
653
+ },
654
+ default: '',
655
+ description: 'The postId returned together with the Bucket File URL when you requested the upload. The post is created under it so it owns the uploaded image. Leave it empty and the image is never deleted from storage — not when the post is deleted, and not by the cleanup after publishing.',
656
+ },
540
657
  {
541
658
  displayName: 'Caption',
542
659
  name: 'imageCaption',
@@ -625,6 +742,100 @@ class Posty5SocialPublisherPost {
625
742
  default: 50,
626
743
  description: 'Max number of results to return',
627
744
  },
745
+ {
746
+ displayName: 'Post ID',
747
+ name: 'deletePostId',
748
+ type: 'string',
749
+ required: true,
750
+ displayOptions: {
751
+ show: {
752
+ operation: ['deletePost'],
753
+ },
754
+ },
755
+ default: '',
756
+ description: 'The post to delete. Only posts that have not published yet are eligible; a published post must be taken down with Remove instead.',
757
+ },
758
+ // ─── Long video: quote + reschedule ──────────────────────────────
759
+ {
760
+ displayName: 'Video URL',
761
+ name: 'quoteVideoUrl',
762
+ type: 'string',
763
+ required: true,
764
+ displayOptions: {
765
+ show: {
766
+ operation: ['getLongVideoQuote'],
767
+ },
768
+ },
769
+ default: '',
770
+ description: 'URL of an uploaded or externally hosted video to measure and price. The duration is read server-side; nothing is created or charged.',
771
+ },
772
+ {
773
+ displayName: 'Post ID',
774
+ name: 'reschedulePostId',
775
+ type: 'string',
776
+ required: true,
777
+ displayOptions: {
778
+ show: {
779
+ operation: ['reschedulePost'],
780
+ },
781
+ },
782
+ default: '',
783
+ description: 'The post to move. Only posts still pending with a future publish time are eligible.',
784
+ },
785
+ {
786
+ displayName: 'New Publish Time',
787
+ name: 'rescheduleWhen',
788
+ type: 'options',
789
+ displayOptions: {
790
+ show: {
791
+ operation: ['reschedulePost'],
792
+ },
793
+ },
794
+ options: [
795
+ { name: 'Now', value: 'now' },
796
+ { name: 'Schedule for Later', value: 'later' },
797
+ ],
798
+ default: 'later',
799
+ description: 'Publish the post immediately, or move it to a new date',
800
+ },
801
+ {
802
+ displayName: 'New Schedule Date',
803
+ name: 'rescheduleDate',
804
+ type: 'dateTime',
805
+ required: true,
806
+ displayOptions: {
807
+ show: {
808
+ operation: ['reschedulePost'],
809
+ rescheduleWhen: ['later'],
810
+ },
811
+ },
812
+ default: '',
813
+ description: 'The new date and time to publish the post',
814
+ },
815
+ {
816
+ displayName: 'New Caption',
817
+ name: 'rescheduleCaption',
818
+ type: 'string',
819
+ displayOptions: {
820
+ show: {
821
+ operation: ['reschedulePost'],
822
+ },
823
+ },
824
+ default: '',
825
+ description: 'Optionally replace the caption at the same time. Leave empty to keep it.',
826
+ },
827
+ {
828
+ displayName: 'Long video is capped at 60 minutes and charged by duration — 50 credits for every started 5 minutes. Platform limits differ: YouTube and Facebook take an hour, Instagram Reels stop at 15 minutes, and TikTok depends on the connected creator. Targets that cannot take the video are reported in "refusedTargets" and the post still publishes to the rest.',
829
+ name: 'longVideoNotice',
830
+ type: 'notice',
831
+ displayOptions: {
832
+ show: {
833
+ operation: ['publishLongVideo', 'publishLongVideoToAccount'],
834
+ },
835
+ },
836
+ default: '',
837
+ },
838
+ ...(0, versioned_write_helpers_1.buildVersionedWriteProperties)(['reschedulePost', 'deletePost']),
628
839
  ],
629
840
  };
630
841
  }
@@ -650,6 +861,7 @@ class Posty5SocialPublisherPost {
650
861
  let videoURL;
651
862
  let thumbURL;
652
863
  let source;
864
+ let uploadedPostId;
653
865
  // Handle video
654
866
  if (videoSource === 'binary') {
655
867
  const videoBinaryProperty = this.getNodeParameter('videoBinaryProperty', i);
@@ -663,17 +875,21 @@ class Posty5SocialPublisherPost {
663
875
  thumbFileType: 'jpg',
664
876
  },
665
877
  });
666
- // Upload video
878
+ // Upload video. The post stores the public `fileURL`, not the
879
+ // signed URL minus its query: that one is the storage API
880
+ // host, which the publisher cannot fetch and the cleanup does
881
+ // not recognise as ours.
667
882
  await api_helpers_1.uploadFile.call(this, uploadUrlsResponse.video.uploadFileURL, videoBuffer);
668
- videoURL = uploadUrlsResponse.video.uploadFileURL.split('?')[0];
883
+ videoURL = uploadUrlsResponse.video.fileURL;
669
884
  source = 'video-upload';
885
+ uploadedPostId = uploadUrlsResponse.postId;
670
886
  // Handle thumbnail
671
887
  if (thumbnailSource === 'binary') {
672
888
  const thumbnailBinaryProperty = this.getNodeParameter('thumbnailBinaryProperty', i);
673
889
  if (items[i].binary?.[thumbnailBinaryProperty]) {
674
890
  const thumbnailBuffer = await this.helpers.getBinaryDataBuffer(i, thumbnailBinaryProperty);
675
891
  await api_helpers_1.uploadFile.call(this, uploadUrlsResponse.thumb.uploadFileURL, thumbnailBuffer);
676
- thumbURL = uploadUrlsResponse.thumb.uploadFileURL.split('?')[0];
892
+ thumbURL = uploadUrlsResponse.thumb.fileURL;
677
893
  }
678
894
  }
679
895
  else if (thumbnailSource === 'url') {
@@ -683,19 +899,7 @@ class Posty5SocialPublisherPost {
683
899
  else {
684
900
  // URL-based video
685
901
  videoURL = this.getNodeParameter('videoUrl', i);
686
- // Detect source type from URL pattern
687
- if (videoURL.includes('facebook.com') || videoURL.includes('fb.watch')) {
688
- source = 'facebook-video';
689
- }
690
- else if (videoURL.includes('tiktok.com')) {
691
- source = 'tiktok-video';
692
- }
693
- else if (videoURL.includes('youtube.com') || videoURL.includes('youtu.be')) {
694
- source = 'youtube-video';
695
- }
696
- else {
697
- source = 'video-url';
698
- }
902
+ source = 'video-url';
699
903
  if (thumbnailSource === 'url') {
700
904
  thumbURL = this.getNodeParameter('thumbnailUrl', i);
701
905
  }
@@ -746,27 +950,22 @@ class Posty5SocialPublisherPost {
746
950
  if (Object.keys(instagramSettings).length > 0) {
747
951
  postBody.instagramConfig = instagramSettings;
748
952
  }
749
- // Optional post-publish auto-comment (Pro plan, +1 credit).
750
- // TikTok comments are not supported and will report `notSupported` in the status response.
751
- const commentSettings = this.getNodeParameter('comment', i, {});
752
- if (commentSettings && typeof commentSettings.text === 'string' && commentSettings.text.trim().length > 0) {
753
- postBody.comment = {
754
- text: commentSettings.text,
755
- postToFacebook: commentSettings.postToFacebook ?? true,
756
- postToInstagram: commentSettings.postToInstagram ?? true,
757
- postToYoutube: commentSettings.postToYoutube ?? true,
758
- postToTiktok: false,
759
- };
760
- }
761
- // Create post
762
- let endpoint = '';
763
- const isFileUpload = source === 'video-upload';
764
- if (operation === 'publishVideo') {
765
- endpoint = `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}${isFileUpload ? '/short-video/workspace/by-file' : '/short-video/workspace/by-url'}`;
766
- }
767
- else {
768
- endpoint = `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}${isFileUpload ? '/short-video/account/by-file' : '/short-video/account/by-url'}`;
953
+ // Post-publish comments — 25 credits each, and never both shapes:
954
+ // `comments` wins, the deprecated singular is used only when
955
+ // the list is empty. TikTok always reports `notSupported`.
956
+ const postComments = (0, post_comments_1.buildCommentsPayload)(this.getNodeParameter('comments', i, {}), this.getNodeParameter('comment', i, {}));
957
+ if (postComments.length) {
958
+ postBody.comments = postComments;
769
959
  }
960
+ // Create post. An uploaded video is created under the id
961
+ // `generate-upload-urls` reserved: its files live in that id's
962
+ // folder, and the server only ever deletes a folder whose id
963
+ // matches the post's own — a post given a fresh id leaks its
964
+ // upload for good.
965
+ const target = operation === 'publishVideo' ? 'workspace' : 'account';
966
+ const bySegment = source === 'video-upload' ? 'by-file' : 'by-url';
967
+ const endpoint = `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/short-video/${target}/${bySegment}` +
968
+ (uploadedPostId ? `/${uploadedPostId}` : '');
770
969
  responseData = await api_helpers_1.makeApiRequest.call(this, apiKey, {
771
970
  method: 'POST',
772
971
  endpoint,
@@ -789,12 +988,18 @@ class Posty5SocialPublisherPost {
789
988
  const imageSource = this.getNodeParameter('imageSource', i);
790
989
  const caption = this.getNodeParameter('imageCaption', i);
791
990
  const aiEnhanced = this.getNodeParameter('imageAiEnhanced', i, false);
991
+ // The image was uploaded outside this node, so the node cannot
992
+ // reserve its id — the caller did, with `generate-upload-urls`,
993
+ // and passes it back. The server deletes an uploaded image's
994
+ // folder only when the folder's id is the post's own.
792
995
  const image = { source: imageSource };
996
+ let uploadedPostId = '';
793
997
  if (imageSource === 'image-url') {
794
998
  image.externalUrl = this.getNodeParameter('imageExternalUrl', i);
795
999
  }
796
1000
  else {
797
1001
  image.bucketKey = this.getNodeParameter('imageBucketKey', i);
1002
+ uploadedPostId = this.getNodeParameter('imageUploadPostId', i, '').trim();
798
1003
  }
799
1004
  const imagePostBody = {
800
1005
  workspaceId,
@@ -803,26 +1008,204 @@ class Posty5SocialPublisherPost {
803
1008
  caption,
804
1009
  aiEnhanced,
805
1010
  };
806
- // Optional auto-comment — reuse the existing Comment collection.
807
- const commentSettings = this.getNodeParameter('comment', i, {});
808
- if (commentSettings && typeof commentSettings.text === 'string' && commentSettings.text.trim().length > 0) {
809
- imagePostBody.comment = {
810
- text: commentSettings.text,
811
- postToFacebook: commentSettings.postToFacebook ?? true,
812
- postToInstagram: commentSettings.postToInstagram ?? true,
813
- postToYoutube: commentSettings.postToYoutube ?? true,
814
- postToTiktok: false,
815
- };
1011
+ // The same two collections as the video flow, through the same
1012
+ // helper — two copies of this mapping is where one of them
1013
+ // keeps sending the deprecated singular after the other stops.
1014
+ const imageComments = (0, post_comments_1.buildCommentsPayload)(this.getNodeParameter('comments', i, {}), this.getNodeParameter('comment', i, {}));
1015
+ if (imageComments.length) {
1016
+ imagePostBody.comments = imageComments;
816
1017
  }
817
- const endpoint = isWorkspace
818
- ? `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/image/workspace`
819
- : `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/image/account`;
1018
+ const endpoint = `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/image/${isWorkspace ? 'workspace' : 'account'}` +
1019
+ (uploadedPostId ? `/${uploadedPostId}` : '');
820
1020
  responseData = await api_helpers_1.makeApiRequest.call(this, apiKey, {
821
1021
  method: 'POST',
822
1022
  endpoint,
823
1023
  body: imagePostBody,
824
1024
  });
825
1025
  }
1026
+ else if (operation === 'publishLongVideo' ||
1027
+ operation === 'publishLongVideoToAccount') {
1028
+ // ─── Long video (up to 60 minutes) ───────────────────────
1029
+ // The payload is the short-video payload. What differs is
1030
+ // duration, which the server measures from the file — there
1031
+ // is no duration field here, and one would be ignored,
1032
+ // because the price is derived from it.
1033
+ const isWorkspace = operation === 'publishLongVideo';
1034
+ const workspaceId = isWorkspace
1035
+ ? this.getNodeParameter('workspaceId', i)
1036
+ : undefined;
1037
+ const accountId = !isWorkspace
1038
+ ? this.getNodeParameter('accountId', i)
1039
+ : undefined;
1040
+ const videoSource = this.getNodeParameter('videoSource', i);
1041
+ const thumbnailSource = this.getNodeParameter('thumbnailSource', i, 'none');
1042
+ const scheduledPublishTime = this.getNodeParameter('scheduledPublishTime', i);
1043
+ let videoURL;
1044
+ let thumbURL;
1045
+ let source;
1046
+ let uploadedPostId;
1047
+ if (videoSource === 'binary') {
1048
+ const videoBinaryProperty = this.getNodeParameter('videoBinaryProperty', i);
1049
+ const videoBuffer = await this.helpers.getBinaryDataBuffer(i, videoBinaryProperty);
1050
+ // Declaring the post type here is what buys the early
1051
+ // refusal: the server checks plan gating and whether the
1052
+ // balance covers even the shortest long video BEFORE an
1053
+ // hour of footage is transferred.
1054
+ const uploadUrlsResponse = await api_helpers_1.makeApiRequest.call(this, apiKey, {
1055
+ method: 'POST',
1056
+ endpoint: `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/generate-upload-urls`,
1057
+ body: {
1058
+ videoFileType: 'video/mp4',
1059
+ thumbFileType: thumbnailSource === 'binary' ? 'image/jpeg' : undefined,
1060
+ postType: 'longVideo',
1061
+ },
1062
+ });
1063
+ // Prefer the resumable transfer for a long video — this is
1064
+ // the case a single PUT handles worst, since a dropped
1065
+ // connection at 90% of an hour of footage otherwise starts
1066
+ // again from zero. Servers without the resumable service
1067
+ // omit the tus fields and the signed PUT still works.
1068
+ if ((0, resumable_upload_1.supportsResumableUpload)(uploadUrlsResponse.video)) {
1069
+ await resumable_upload_1.uploadResumable.call(this, uploadUrlsResponse.video, videoBuffer, {
1070
+ contentType: 'video/mp4',
1071
+ fileName: items[i].binary?.[videoBinaryProperty]?.fileName || 'video.mp4',
1072
+ });
1073
+ }
1074
+ else {
1075
+ await api_helpers_1.uploadFile.call(this, uploadUrlsResponse.video.uploadFileURL, videoBuffer);
1076
+ }
1077
+ videoURL = uploadUrlsResponse.video.fileURL;
1078
+ source = 'video-file';
1079
+ uploadedPostId = uploadUrlsResponse.postId;
1080
+ if (thumbnailSource === 'binary') {
1081
+ const thumbnailBinaryProperty = this.getNodeParameter('thumbnailBinaryProperty', i);
1082
+ if (items[i].binary?.[thumbnailBinaryProperty]) {
1083
+ const thumbnailBuffer = await this.helpers.getBinaryDataBuffer(i, thumbnailBinaryProperty);
1084
+ await api_helpers_1.uploadFile.call(this, uploadUrlsResponse.thumb.uploadFileURL, thumbnailBuffer);
1085
+ thumbURL = uploadUrlsResponse.thumb.fileURL;
1086
+ }
1087
+ }
1088
+ else if (thumbnailSource === 'url') {
1089
+ thumbURL = this.getNodeParameter('thumbnailUrl', i);
1090
+ }
1091
+ }
1092
+ else {
1093
+ videoURL = this.getNodeParameter('videoUrl', i);
1094
+ source = 'video-url';
1095
+ if (thumbnailSource === 'url') {
1096
+ thumbURL = this.getNodeParameter('thumbnailUrl', i);
1097
+ }
1098
+ }
1099
+ const longVideoBody = {
1100
+ workspaceId,
1101
+ accountId,
1102
+ videoURL,
1103
+ source,
1104
+ };
1105
+ if (thumbURL) {
1106
+ longVideoBody.thumbURL = thumbURL;
1107
+ }
1108
+ if (scheduledPublishTime === 'later') {
1109
+ const scheduleDate = this.getNodeParameter('scheduleDate', i);
1110
+ longVideoBody.schedule = {
1111
+ type: 'schedule',
1112
+ scheduledAt: new Date(scheduleDate).toISOString(),
1113
+ };
1114
+ }
1115
+ else {
1116
+ longVideoBody.schedule = { type: 'now' };
1117
+ }
1118
+ const lvYoutube = this.getNodeParameter('youtubeSettings', i, {});
1119
+ if (Object.keys(lvYoutube).length > 0) {
1120
+ longVideoBody.youtube = { ...lvYoutube };
1121
+ if (lvYoutube.tags && typeof lvYoutube.tags === 'string') {
1122
+ longVideoBody.youtube.tags = lvYoutube.tags
1123
+ .split(',')
1124
+ .map((t) => t.trim());
1125
+ }
1126
+ }
1127
+ const lvTiktok = this.getNodeParameter('tiktokSettings', i, {});
1128
+ if (Object.keys(lvTiktok).length > 0) {
1129
+ longVideoBody.tiktok = lvTiktok;
1130
+ }
1131
+ const lvFacebook = this.getNodeParameter('facebookSettings', i, {});
1132
+ if (Object.keys(lvFacebook).length > 0) {
1133
+ longVideoBody.facebook = lvFacebook;
1134
+ }
1135
+ const lvInstagram = this.getNodeParameter('instagramSettings', i, {});
1136
+ if (Object.keys(lvInstagram).length > 0) {
1137
+ longVideoBody.instagram = lvInstagram;
1138
+ }
1139
+ const lvComment = this.getNodeParameter('comment', i, {});
1140
+ if (lvComment &&
1141
+ typeof lvComment.text === 'string' &&
1142
+ lvComment.text.trim().length > 0) {
1143
+ longVideoBody.comment = {
1144
+ text: lvComment.text,
1145
+ postToFacebook: lvComment.postToFacebook ?? true,
1146
+ postToInstagram: lvComment.postToInstagram ?? true,
1147
+ postToYoutube: lvComment.postToYoutube ?? true,
1148
+ postToTiktok: false,
1149
+ };
1150
+ }
1151
+ const target = isWorkspace ? 'workspace' : 'account';
1152
+ const bySegment = source === 'video-file' ? 'by-file' : 'by-url';
1153
+ const longVideoEndpoint = `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/long-video/${target}/${bySegment}` +
1154
+ (uploadedPostId ? `/${uploadedPostId}` : '');
1155
+ // The response carries the measured duration, the credits
1156
+ // charged and any target dropped for exceeding its own
1157
+ // limit — all of it lands in the item so a later node can
1158
+ // branch on cost or on a partial publish.
1159
+ responseData = await api_helpers_1.makeApiRequest.call(this, apiKey, {
1160
+ method: 'POST',
1161
+ endpoint: longVideoEndpoint,
1162
+ body: longVideoBody,
1163
+ });
1164
+ }
1165
+ else if (operation === 'getLongVideoQuote') {
1166
+ // Measures and prices a video without creating or charging
1167
+ // anything, so a workflow can branch on cost before it
1168
+ // commits to publishing.
1169
+ const quoteVideoUrl = this.getNodeParameter('quoteVideoUrl', i);
1170
+ responseData = await api_helpers_1.makeApiRequest.call(this, apiKey, {
1171
+ method: 'POST',
1172
+ endpoint: `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/long-video/quote`,
1173
+ body: { videoURL: quoteVideoUrl },
1174
+ });
1175
+ }
1176
+ else if (operation === 'reschedulePost') {
1177
+ const reschedulePostId = this.getNodeParameter('reschedulePostId', i);
1178
+ const rescheduleWhen = this.getNodeParameter('rescheduleWhen', i, 'later');
1179
+ const rescheduleCaption = this.getNodeParameter('rescheduleCaption', i, '');
1180
+ // The edit route takes the schedule flat (scheduleType + scheduledAt), not the
1181
+ // create routes' `schedule` object, and refuses scheduledAt with "now".
1182
+ const rescheduleBody = rescheduleWhen === 'later'
1183
+ ? {
1184
+ scheduleType: 'schedule',
1185
+ scheduledAt: new Date(this.getNodeParameter('rescheduleDate', i)).toISOString(),
1186
+ }
1187
+ : { scheduleType: 'now' };
1188
+ if (rescheduleCaption.trim().length > 0) {
1189
+ rescheduleBody.caption = rescheduleCaption;
1190
+ }
1191
+ responseData = await api_helpers_1.makeApiRequest.call(this, apiKey, {
1192
+ method: 'PUT',
1193
+ endpoint: `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/${reschedulePostId}`,
1194
+ body: rescheduleBody,
1195
+ // The post has no plain `GET /:id`: its `/status` read carries `__v`.
1196
+ version: await (0, versioned_write_helpers_1.resolveWriteVersion)(this, apiKey, i, `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/${reschedulePostId}/status`),
1197
+ });
1198
+ }
1199
+ else if (operation === 'deletePost') {
1200
+ // Free, and irreversible for the caller: the post is gone and its
1201
+ // uploaded media is released in the same request.
1202
+ const deletePostId = this.getNodeParameter('deletePostId', i);
1203
+ responseData = await api_helpers_1.makeApiRequest.call(this, apiKey, {
1204
+ method: 'DELETE',
1205
+ endpoint: `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/${deletePostId}`,
1206
+ version: await (0, versioned_write_helpers_1.resolveWriteVersion)(this, apiKey, i, `${constants_1.API_ENDPOINTS.SOCIAL_PUBLISHER_POST}/${deletePostId}/status`),
1207
+ });
1208
+ }
826
1209
  else if (operation === 'getPostStatus') {
827
1210
  const postId = this.getNodeParameter('postId', i);
828
1211
  responseData = await api_helpers_1.makeApiRequest.call(this, apiKey, {