@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,91 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Posty5QrCode = void 0;
4
4
  const api_helpers_1 = require("../../utils/api.helpers");
5
+ const versioned_write_helpers_1 = require("../../utils/versioned-write.helpers");
6
+ const analytics_helpers_1 = require("../../utils/analytics.helpers");
7
+ const analytics_properties_1 = require("../../utils/analytics.properties");
5
8
  const constants_1 = require("../../utils/constants");
9
+ const link_bulk_helpers_1 = require("../../utils/link-bulk.helpers");
10
+ const link_bulk_properties_1 = require("../../utils/link-bulk.properties");
11
+ const helpers_1 = require("./helpers");
12
+ const link_tool_helpers_1 = require("../../utils/link-tool.helpers");
13
+ const qr_target_helpers_1 = require("../../utils/qr-target.helpers");
14
+ const qr_file_helpers_1 = require("../../utils/qr-file.helpers");
15
+ const qr_templates_helpers_1 = require("../../utils/qr-templates.helpers");
16
+ const qr_content_config_1 = require("../../utils/qr-content.config");
17
+ /** QR Type options. *Create Many* offers all but the bulk-excluded ones (`file`). */
18
+ const QR_TYPE_OPTIONS = [
19
+ {
20
+ name: 'URL',
21
+ value: 'url',
22
+ description: 'Link to a website',
23
+ },
24
+ {
25
+ name: 'Free Text',
26
+ value: 'freeText',
27
+ description: 'Plain text content',
28
+ },
29
+ {
30
+ name: 'Email',
31
+ value: 'email',
32
+ description: 'Email address with optional subject and body',
33
+ },
34
+ {
35
+ name: 'WiFi',
36
+ value: 'wifi',
37
+ description: 'WiFi network credentials',
38
+ },
39
+ {
40
+ name: 'Phone Call',
41
+ value: 'call',
42
+ description: 'Phone number to call',
43
+ },
44
+ {
45
+ name: 'SMS',
46
+ value: 'sms',
47
+ description: 'SMS message',
48
+ },
49
+ {
50
+ name: 'Geolocation',
51
+ value: 'geolocation',
52
+ description: 'Geographic coordinates',
53
+ },
54
+ {
55
+ name: 'Business Card (vCard)',
56
+ value: 'vcard',
57
+ description: 'Contact card a phone saves to its contacts',
58
+ },
59
+ {
60
+ name: 'Calendar Event',
61
+ value: 'event',
62
+ description: 'Event a phone adds to its calendar',
63
+ },
64
+ {
65
+ name: 'WhatsApp',
66
+ value: 'whatsapp',
67
+ description: 'Opens a WhatsApp chat with an optional pre-filled message',
68
+ },
69
+ {
70
+ name: 'Review Link',
71
+ value: 'review',
72
+ description: 'Opens the page to leave a review (Google, Tripadvisor, …)',
73
+ },
74
+ {
75
+ name: 'Social Profile',
76
+ value: 'social',
77
+ description: 'Opens a social media profile, or a page listing up to 12 (dynamic)',
78
+ },
79
+ {
80
+ name: 'App Store Links',
81
+ value: 'appStore',
82
+ description: 'Sends Android to Google Play, iOS to the App Store, others to a fallback (dynamic only)',
83
+ },
84
+ {
85
+ name: 'File (PDF or Image)',
86
+ value: 'file',
87
+ description: 'A hosted PDF, JPEG, PNG or WebP from a binary property (dynamic only)',
88
+ },
89
+ ];
6
90
  class Posty5QrCode {
7
91
  constructor() {
8
92
  this.description = {
@@ -10,9 +94,10 @@ class Posty5QrCode {
10
94
  name: 'posty5QrCode',
11
95
  icon: 'file:posty5.svg',
12
96
  group: ['transform'],
13
- version: 1,
97
+ version: [1, 2],
98
+ defaultVersion: 2,
14
99
  subtitle: '={{$parameter["operation"] + ": " + $parameter["qrType"]}}',
15
- description: 'Create and manage QR codes with Posty5',
100
+ description: 'Create and manage QR codes with Posty5. v1 is legacy: update and delete overwrite (last write wins)',
16
101
  defaults: {
17
102
  name: 'Posty5 QR Code',
18
103
  },
@@ -37,6 +122,12 @@ class Posty5QrCode {
37
122
  description: 'Create a new QR code',
38
123
  action: 'Create a QR code',
39
124
  },
125
+ {
126
+ name: 'Create Many',
127
+ value: 'createMany',
128
+ description: 'Create one QR code per input item in batched API calls',
129
+ action: 'Create many QR codes',
130
+ },
40
131
  {
41
132
  name: 'Delete',
42
133
  value: 'delete',
@@ -49,6 +140,18 @@ class Posty5QrCode {
49
140
  description: 'Get a QR code by ID',
50
141
  action: 'Get a QR code',
51
142
  },
143
+ {
144
+ name: 'Get Analytics',
145
+ value: 'getAnalytics',
146
+ description: 'Get scans, unique visitors, a series and breakdowns of a QR code',
147
+ action: 'Get analytics for a QR code',
148
+ },
149
+ {
150
+ name: 'Get Statistics',
151
+ value: 'getStatistics',
152
+ description: 'Get counts over all your QR codes: totals, visits per day and the top 10 by visits',
153
+ action: 'Get statistics for QR codes',
154
+ },
52
155
  {
53
156
  name: 'List',
54
157
  value: 'list',
@@ -64,7 +167,7 @@ class Posty5QrCode {
64
167
  ],
65
168
  default: 'create',
66
169
  },
67
- // QR Type selection for Create/Update
170
+ // QR Type selection for Create/Update (Create Many: no file, the bulk route refuses it)
68
171
  {
69
172
  displayName: 'QR Type',
70
173
  name: 'qrType',
@@ -74,57 +177,125 @@ class Posty5QrCode {
74
177
  operation: ['create', 'update'],
75
178
  },
76
179
  },
77
- options: [
78
- {
79
- name: 'URL',
80
- value: 'url',
81
- description: 'Link to a website',
180
+ options: QR_TYPE_OPTIONS,
181
+ default: 'url',
182
+ },
183
+ {
184
+ displayName: 'QR Type',
185
+ name: 'qrType',
186
+ type: 'options',
187
+ displayOptions: {
188
+ show: {
189
+ operation: ['createMany'],
82
190
  },
83
- {
84
- name: 'Free Text',
85
- value: 'freeText',
86
- description: 'Plain text content',
191
+ },
192
+ options: QR_TYPE_OPTIONS.filter((option) => !qr_content_config_1.QR_CONTENT_CONFIG.bulkExcludedTypes.includes(option.value)),
193
+ default: 'url',
194
+ },
195
+ // Common fields
196
+ {
197
+ displayName: 'Template Name or ID',
198
+ name: 'templateId',
199
+ type: 'options',
200
+ required: true,
201
+ typeOptions: {
202
+ loadOptionsMethod: 'getQrTemplates',
203
+ },
204
+ displayOptions: {
205
+ show: {
206
+ operation: ['create'],
87
207
  },
88
- {
89
- name: 'Email',
90
- value: 'email',
91
- description: 'Email address with optional subject and body',
208
+ },
209
+ default: '',
210
+ description: 'The design of the QR code. Required by the Posty5 API for API-key calls. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
211
+ },
212
+ {
213
+ displayName: 'Template Name or ID',
214
+ name: 'templateId',
215
+ type: 'options',
216
+ typeOptions: {
217
+ loadOptionsMethod: 'getQrTemplates',
218
+ },
219
+ displayOptions: {
220
+ show: {
221
+ operation: ['update'],
92
222
  },
93
- {
94
- name: 'WiFi',
95
- value: 'wifi',
96
- description: 'WiFi network credentials',
223
+ },
224
+ default: '',
225
+ description: 'The design of the QR code. Leave empty to keep the current one. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
226
+ },
227
+ {
228
+ displayName: 'Name',
229
+ name: 'name',
230
+ type: 'string',
231
+ displayOptions: {
232
+ show: {
233
+ operation: ['create', 'createMany', 'update'],
97
234
  },
98
- {
99
- name: 'Phone Call',
100
- value: 'call',
101
- description: 'Phone number to call',
235
+ },
236
+ default: '',
237
+ description: 'A friendly name for the QR code. On Update, leave it empty to keep the current name.',
238
+ },
239
+ // Mode (static / dynamic). Hidden for Wi-Fi: a phone joins the network from
240
+ // the image itself, so there is no link to redirect (the API answers 400).
241
+ {
242
+ displayName: 'Mode',
243
+ name: 'mode',
244
+ type: 'options',
245
+ displayOptions: {
246
+ show: {
247
+ operation: ['create', 'createMany'],
102
248
  },
249
+ hide: {
250
+ qrType: ['wifi', 'appStore', 'file'],
251
+ },
252
+ },
253
+ options: [
103
254
  {
104
- name: 'SMS',
105
- value: 'sms',
106
- description: 'SMS message',
255
+ name: 'Static',
256
+ value: 'static',
257
+ description: 'The image encodes the content itself',
107
258
  },
108
259
  {
109
- name: 'Geolocation',
110
- value: 'geolocation',
111
- description: 'Geographic coordinates',
260
+ name: 'Dynamic',
261
+ value: 'dynamic',
262
+ description: 'The image encodes a Posty5 link that redirects to the content',
112
263
  },
113
264
  ],
114
- default: 'url',
265
+ default: 'static',
266
+ description: 'Dynamic: the image points to a Posty5 link, so you can change where it goes later without reprinting. Social Profile with 2 or more profiles is always dynamic.',
115
267
  },
116
- // Common fields
117
268
  {
118
- displayName: 'Name',
119
- name: 'name',
120
- type: 'string',
269
+ displayName: 'Mode',
270
+ name: 'mode',
271
+ type: 'options',
121
272
  displayOptions: {
122
273
  show: {
123
- operation: ['create', 'update'],
274
+ operation: ['update'],
275
+ },
276
+ hide: {
277
+ qrType: ['wifi', 'appStore', 'file'],
124
278
  },
125
279
  },
280
+ options: [
281
+ {
282
+ name: 'Keep Current',
283
+ value: '',
284
+ description: 'Do not change the mode',
285
+ },
286
+ {
287
+ name: 'Static',
288
+ value: 'static',
289
+ description: 'The image encodes the content itself',
290
+ },
291
+ {
292
+ name: 'Dynamic',
293
+ value: 'dynamic',
294
+ description: 'The image encodes a Posty5 link that redirects to the content',
295
+ },
296
+ ],
126
297
  default: '',
127
- description: 'A friendly name for the QR code',
298
+ description: 'Dynamic: the image points to a Posty5 link, so you can change where it goes later without reprinting. Social Profile with 2 or more profiles is always dynamic.',
128
299
  },
129
300
  // URL Type fields
130
301
  {
@@ -134,7 +305,7 @@ class Posty5QrCode {
134
305
  required: true,
135
306
  displayOptions: {
136
307
  show: {
137
- operation: ['create', 'update'],
308
+ operation: ['create', 'createMany', 'update'],
138
309
  qrType: ['url'],
139
310
  },
140
311
  },
@@ -149,7 +320,7 @@ class Posty5QrCode {
149
320
  required: true,
150
321
  displayOptions: {
151
322
  show: {
152
- operation: ['create', 'update'],
323
+ operation: ['create', 'createMany', 'update'],
153
324
  qrType: ['freeText'],
154
325
  },
155
326
  },
@@ -164,7 +335,7 @@ class Posty5QrCode {
164
335
  required: true,
165
336
  displayOptions: {
166
337
  show: {
167
- operation: ['create', 'update'],
338
+ operation: ['create', 'createMany', 'update'],
168
339
  qrType: ['email'],
169
340
  },
170
341
  },
@@ -177,7 +348,7 @@ class Posty5QrCode {
177
348
  type: 'string',
178
349
  displayOptions: {
179
350
  show: {
180
- operation: ['create', 'update'],
351
+ operation: ['create', 'createMany', 'update'],
181
352
  qrType: ['email'],
182
353
  },
183
354
  },
@@ -190,7 +361,7 @@ class Posty5QrCode {
190
361
  type: 'string',
191
362
  displayOptions: {
192
363
  show: {
193
- operation: ['create', 'update'],
364
+ operation: ['create', 'createMany', 'update'],
194
365
  qrType: ['email'],
195
366
  },
196
367
  },
@@ -205,7 +376,7 @@ class Posty5QrCode {
205
376
  required: true,
206
377
  displayOptions: {
207
378
  show: {
208
- operation: ['create', 'update'],
379
+ operation: ['create', 'createMany', 'update'],
209
380
  qrType: ['wifi'],
210
381
  },
211
382
  },
@@ -218,7 +389,7 @@ class Posty5QrCode {
218
389
  type: 'options',
219
390
  displayOptions: {
220
391
  show: {
221
- operation: ['create', 'update'],
392
+ operation: ['create', 'createMany', 'update'],
222
393
  qrType: ['wifi'],
223
394
  },
224
395
  },
@@ -236,7 +407,7 @@ class Posty5QrCode {
236
407
  type: 'string',
237
408
  displayOptions: {
238
409
  show: {
239
- operation: ['create', 'update'],
410
+ operation: ['create', 'createMany', 'update'],
240
411
  qrType: ['wifi'],
241
412
  wifiAuthType: ['WPA', 'WEP'],
242
413
  },
@@ -252,7 +423,7 @@ class Posty5QrCode {
252
423
  required: true,
253
424
  displayOptions: {
254
425
  show: {
255
- operation: ['create', 'update'],
426
+ operation: ['create', 'createMany', 'update'],
256
427
  qrType: ['call'],
257
428
  },
258
429
  },
@@ -267,7 +438,7 @@ class Posty5QrCode {
267
438
  required: true,
268
439
  displayOptions: {
269
440
  show: {
270
- operation: ['create', 'update'],
441
+ operation: ['create', 'createMany', 'update'],
271
442
  qrType: ['sms'],
272
443
  },
273
444
  },
@@ -280,7 +451,7 @@ class Posty5QrCode {
280
451
  type: 'string',
281
452
  displayOptions: {
282
453
  show: {
283
- operation: ['create', 'update'],
454
+ operation: ['create', 'createMany', 'update'],
284
455
  qrType: ['sms'],
285
456
  },
286
457
  },
@@ -295,7 +466,7 @@ class Posty5QrCode {
295
466
  required: true,
296
467
  displayOptions: {
297
468
  show: {
298
- operation: ['create', 'update'],
469
+ operation: ['create', 'createMany', 'update'],
299
470
  qrType: ['geolocation'],
300
471
  },
301
472
  },
@@ -309,68 +480,573 @@ class Posty5QrCode {
309
480
  required: true,
310
481
  displayOptions: {
311
482
  show: {
312
- operation: ['create', 'update'],
483
+ operation: ['create', 'createMany', 'update'],
313
484
  qrType: ['geolocation'],
314
485
  },
315
486
  },
316
487
  default: 0,
317
488
  description: 'Longitude coordinate',
318
489
  },
319
- // Additional fields for Create/Update
490
+ // vCard fields (first name or organization is required by the API)
320
491
  {
321
- displayName: 'Additional Fields',
322
- name: 'additionalFields',
492
+ displayName: 'First Name',
493
+ name: 'vcardFirstName',
494
+ type: 'string',
495
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['vcard'] } },
496
+ default: '',
497
+ description: 'First name. First Name or Organization is required.',
498
+ },
499
+ {
500
+ displayName: 'Last Name',
501
+ name: 'vcardLastName',
502
+ type: 'string',
503
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['vcard'] } },
504
+ default: '',
505
+ },
506
+ {
507
+ displayName: 'Organization',
508
+ name: 'vcardOrganization',
509
+ type: 'string',
510
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['vcard'] } },
511
+ default: '',
512
+ description: 'Company or organization. First Name or Organization is required.',
513
+ },
514
+ {
515
+ displayName: 'Job Title',
516
+ name: 'vcardJobTitle',
517
+ type: 'string',
518
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['vcard'] } },
519
+ default: '',
520
+ },
521
+ {
522
+ displayName: 'Phones',
523
+ name: 'vcardPhones',
524
+ type: 'fixedCollection',
525
+ placeholder: 'Add Phone',
526
+ typeOptions: { multipleValues: true, maxAllowedFields: qr_content_config_1.QR_CONTENT_CONFIG.vcard.phonesMax },
527
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['vcard'] } },
528
+ default: {},
529
+ description: `Up to ${qr_content_config_1.QR_CONTENT_CONFIG.vcard.phonesMax} phone numbers`,
530
+ options: [
531
+ {
532
+ displayName: 'Phone',
533
+ name: 'phone',
534
+ values: [
535
+ {
536
+ displayName: 'Kind',
537
+ name: 'kind',
538
+ type: 'options',
539
+ options: (0, qr_content_config_1.toNodeOptions)(qr_content_config_1.QR_CONTENT_CONFIG.vcard.phoneKinds),
540
+ default: 'mobile',
541
+ description: 'Kind of phone number',
542
+ },
543
+ {
544
+ displayName: 'Number',
545
+ name: 'number',
546
+ type: 'string',
547
+ default: '',
548
+ description: 'Phone number, international format recommended',
549
+ },
550
+ ],
551
+ },
552
+ ],
553
+ },
554
+ {
555
+ displayName: 'Emails',
556
+ name: 'vcardEmails',
557
+ type: 'string',
558
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['vcard'] } },
559
+ default: '',
560
+ placeholder: 'name@example.com, other@example.com',
561
+ description: `Comma-separated email addresses, at most ${qr_content_config_1.QR_CONTENT_CONFIG.vcard.emailsMax}`,
562
+ },
563
+ {
564
+ displayName: 'Website',
565
+ name: 'vcardWebsite',
566
+ type: 'string',
567
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['vcard'] } },
568
+ default: '',
569
+ description: 'Website (http or https URL)',
570
+ },
571
+ {
572
+ displayName: 'Address',
573
+ name: 'vcardAddress',
323
574
  type: 'collection',
324
- placeholder: 'Add Field',
575
+ placeholder: 'Add Address Field',
576
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['vcard'] } },
577
+ default: {},
578
+ description: 'Work address',
579
+ options: [
580
+ { displayName: 'City', name: 'city', type: 'string', default: '' },
581
+ { displayName: 'Country', name: 'country', type: 'string', default: '' },
582
+ { displayName: 'Postal Code', name: 'postalCode', type: 'string', default: '' },
583
+ { displayName: 'Region', name: 'region', type: 'string', default: '', description: 'State or region' },
584
+ { displayName: 'Street', name: 'street', type: 'string', default: '' },
585
+ ],
586
+ },
587
+ {
588
+ displayName: 'Note',
589
+ name: 'vcardNote',
590
+ type: 'string',
591
+ typeOptions: { rows: 2 },
592
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['vcard'] } },
593
+ default: '',
594
+ description: 'Free note on the contact card',
595
+ },
596
+ // Calendar event fields
597
+ {
598
+ displayName: 'Event Title',
599
+ name: 'eventTitle',
600
+ type: 'string',
601
+ required: true,
602
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['event'] } },
603
+ default: '',
604
+ description: 'Title of the event',
605
+ },
606
+ {
607
+ displayName: 'Starts At',
608
+ name: 'eventStartsAt',
609
+ type: 'dateTime',
610
+ required: true,
611
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['event'] } },
612
+ default: '',
613
+ description: 'Start of the event. A value without an offset is read in the event timezone.',
614
+ },
615
+ {
616
+ displayName: 'Ends At',
617
+ name: 'eventEndsAt',
618
+ type: 'dateTime',
619
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['event'] } },
620
+ default: '',
621
+ description: 'End of the event; must be after the start',
622
+ },
623
+ {
624
+ displayName: 'All Day',
625
+ name: 'eventAllDay',
626
+ type: 'boolean',
627
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['event'] } },
628
+ default: false,
629
+ description: 'Whether the event lasts the whole day (times are ignored)',
630
+ },
631
+ {
632
+ displayName: 'Timezone',
633
+ name: 'eventTimezone',
634
+ type: 'options',
635
+ options: qr_content_config_1.QR_EVENT_TIMEZONES.map((zone) => ({ name: zone, value: zone })),
636
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['event'] } },
637
+ default: 'UTC',
638
+ description: 'IANA time zone the start and end are read in. Use an expression for a zone not listed.',
639
+ },
640
+ {
641
+ displayName: 'Location',
642
+ name: 'eventLocation',
643
+ type: 'string',
644
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['event'] } },
645
+ default: '',
646
+ description: 'Where the event takes place',
647
+ },
648
+ {
649
+ displayName: 'Description',
650
+ name: 'eventDescription',
651
+ type: 'string',
652
+ typeOptions: { rows: 2 },
653
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['event'] } },
654
+ default: '',
655
+ description: 'Event description',
656
+ },
657
+ {
658
+ displayName: 'Event URL',
659
+ name: 'eventUrl',
660
+ type: 'string',
661
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['event'] } },
662
+ default: '',
663
+ description: 'Link for the event (http or https URL)',
664
+ },
665
+ // WhatsApp fields
666
+ {
667
+ displayName: 'Phone Number',
668
+ name: 'whatsappPhoneNumber',
669
+ type: 'string',
670
+ required: true,
671
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['whatsapp'] } },
672
+ default: '',
673
+ placeholder: '+201001234567',
674
+ description: 'WhatsApp number in international format',
675
+ },
676
+ {
677
+ displayName: 'Message',
678
+ name: 'whatsappMessage',
679
+ type: 'string',
680
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['whatsapp'] } },
681
+ default: '',
682
+ description: 'Pre-filled chat message',
683
+ },
684
+ // Review fields
685
+ {
686
+ displayName: 'Platform',
687
+ name: 'reviewPlatform',
688
+ type: 'options',
689
+ options: (0, qr_content_config_1.toNodeOptions)(qr_content_config_1.QR_CONTENT_CONFIG.review.platforms),
690
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['review'] } },
691
+ default: 'google',
692
+ description: 'Where the review is left',
693
+ },
694
+ {
695
+ displayName: 'Place ID',
696
+ name: 'reviewPlaceId',
697
+ type: 'string',
698
+ displayOptions: {
699
+ show: { operation: ['create', 'createMany', 'update'], qrType: ['review'], reviewPlatform: ['google'] },
700
+ },
701
+ default: '',
702
+ description: 'Google place ID. Google takes a Place ID or a Review URL.',
703
+ },
704
+ {
705
+ displayName: 'Review URL',
706
+ name: 'reviewUrl',
707
+ type: 'string',
708
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['review'] } },
709
+ default: '',
710
+ description: "Review page URL on the platform's own site",
711
+ },
712
+ // Social profile fields: 1 profile (static or dynamic) or 2-12 (dynamic only)
713
+ {
714
+ displayName: 'Profiles',
715
+ name: 'socialProfiles',
716
+ type: 'fixedCollection',
717
+ placeholder: 'Add Profile',
718
+ required: true,
719
+ typeOptions: { multipleValues: true, maxAllowedFields: qr_content_config_1.QR_CONTENT_CONFIG.social.maxProfilesDynamic },
720
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['social'] } },
721
+ default: {},
722
+ description: `Up to ${qr_content_config_1.QR_CONTENT_CONFIG.social.maxProfilesDynamic} profiles. With 2 or more the code is always dynamic (its scan page lists them).`,
723
+ options: [
724
+ {
725
+ displayName: 'Profile',
726
+ name: 'profile',
727
+ values: [
728
+ {
729
+ displayName: 'Platform',
730
+ name: 'platform',
731
+ type: 'options',
732
+ options: (0, qr_content_config_1.toNodeOptions)(qr_content_config_1.QR_CONTENT_CONFIG.social.platforms),
733
+ default: 'instagram',
734
+ description: 'Social network of the profile',
735
+ },
736
+ {
737
+ displayName: 'Handle',
738
+ name: 'handle',
739
+ type: 'string',
740
+ default: '',
741
+ placeholder: 'posty5',
742
+ description: 'Profile handle. Set a Handle or a Profile URL (Other needs a URL).',
743
+ },
744
+ {
745
+ displayName: 'Profile URL',
746
+ name: 'url',
747
+ type: 'string',
748
+ default: '',
749
+ description: 'Profile URL. Set a Handle or a Profile URL.',
750
+ },
751
+ ],
752
+ },
753
+ ],
754
+ },
755
+ {
756
+ displayName: 'Page Title',
757
+ name: 'socialTitle',
758
+ type: 'string',
759
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['social'] } },
760
+ default: '',
761
+ description: 'Title of the profile list page (2 or more profiles)',
762
+ },
763
+ // App store fields (dynamic only)
764
+ {
765
+ displayName: 'Android URL',
766
+ name: 'appStoreAndroidUrl',
767
+ type: 'string',
768
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['appStore'] } },
769
+ default: '',
770
+ placeholder: 'https://play.google.com/store/apps/…',
771
+ description: 'Google Play link. Set an Android URL, an iOS URL, or both.',
772
+ },
773
+ {
774
+ displayName: 'iOS URL',
775
+ name: 'appStoreIosUrl',
776
+ type: 'string',
777
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['appStore'] } },
778
+ default: '',
779
+ placeholder: 'https://apps.apple.com/app/id123456789',
780
+ description: 'App Store link. Set an Android URL, an iOS URL, or both.',
781
+ },
782
+ {
783
+ displayName: 'Fallback URL',
784
+ name: 'appStoreFallbackUrl',
785
+ type: 'string',
786
+ required: true,
787
+ displayOptions: { show: { operation: ['create', 'createMany', 'update'], qrType: ['appStore'] } },
788
+ default: '',
789
+ placeholder: 'https://example.com/app',
790
+ description: 'Where desktops and other devices (or a missing store link) go',
791
+ },
792
+ // File fields (dynamic only; not offered on Create Many)
793
+ {
794
+ displayName: 'Binary Property',
795
+ name: 'binaryPropertyName',
796
+ type: 'string',
797
+ required: true,
798
+ displayOptions: { show: { operation: ['create'], qrType: ['file'] } },
799
+ default: 'data',
800
+ description: `Input binary property holding the file: a PDF, JPEG, PNG or WebP of up to ${qr_content_config_1.QR_CONTENT_CONFIG.file.maxUploadBytes / (1024 * 1024)} MB`,
801
+ },
802
+ {
803
+ displayName: 'Binary Property',
804
+ name: 'binaryPropertyName',
805
+ type: 'string',
806
+ displayOptions: { show: { operation: ['update'], qrType: ['file'] } },
807
+ default: '',
808
+ placeholder: qr_content_config_1.QR_CONTENT_CONFIG.file.defaultBinaryProperty,
809
+ description: 'Input binary property holding a new file. Leave empty to keep the stored file.',
810
+ },
811
+ {
812
+ displayName: 'File Name',
813
+ name: 'fileName',
814
+ type: 'string',
815
+ displayOptions: { show: { operation: ['create', 'update'], qrType: ['file'] } },
816
+ default: '',
817
+ description: "Name shown for the file. Empty: the binary's own file name (on Update without a new file, the stored name is kept).",
818
+ },
819
+ // Scan rules (dynamic codes only, Starter plan and above). Create: shown
820
+ // only for Dynamic. Update: always (the API answers 400 on a static code).
821
+ {
822
+ displayName: 'Scan Rules',
823
+ name: 'scanRules',
824
+ type: 'collection',
825
+ placeholder: 'Add Rule',
325
826
  default: {},
326
827
  displayOptions: {
327
828
  show: {
328
- operation: ['create', 'update'],
829
+ operation: ['create'],
830
+ mode: ['dynamic'],
831
+ },
832
+ hide: {
833
+ qrType: ['wifi', 'appStore', 'file'],
329
834
  },
330
835
  },
836
+ description: 'Limit when and how often a dynamic QR code works. Leave empty for no rules.',
331
837
  options: [
332
838
  {
333
- displayName: 'Tag',
334
- name: 'tag',
335
- type: 'string',
839
+ displayName: 'Active From',
840
+ name: 'activeFrom',
841
+ type: 'dateTime',
336
842
  default: '',
337
- description: 'Organization tag for filtering',
843
+ description: 'Scans before this moment go to the Fallback URL',
338
844
  },
339
845
  {
340
- displayName: 'Reference ID',
341
- name: 'refId',
846
+ displayName: 'Expires At',
847
+ name: 'expiresAt',
848
+ type: 'dateTime',
849
+ default: '',
850
+ description: 'Scans from this moment go to the Fallback URL. Must be after Active From.',
851
+ },
852
+ {
853
+ displayName: 'Max Scans',
854
+ name: 'maxVisits',
855
+ type: 'number',
856
+ typeOptions: { minValue: 1, numberPrecision: 0 },
857
+ default: 1,
858
+ description: 'Scans allowed; later scans go to the Fallback URL',
859
+ },
860
+ {
861
+ displayName: 'Fallback URL',
862
+ name: 'fallbackUrl',
342
863
  type: 'string',
343
864
  default: '',
344
- description: 'External reference ID',
865
+ placeholder: 'https://example.com/offer-ended',
866
+ description: 'Where gated scans go (http or https)',
345
867
  },
346
868
  {
347
- displayName: 'Template ID',
348
- name: 'templateId',
869
+ displayName: 'Clear Scan Rules',
870
+ name: 'clearScanRules',
871
+ type: 'boolean',
872
+ default: false,
873
+ description: 'Whether to remove every scan rule from the code (overrides the other fields)',
874
+ },
875
+ ],
876
+ },
877
+ {
878
+ displayName: 'Scan Rules',
879
+ name: 'scanRules',
880
+ type: 'collection',
881
+ placeholder: 'Add Rule',
882
+ default: {},
883
+ displayOptions: {
884
+ show: {
885
+ operation: ['create'],
886
+ qrType: ['appStore', 'file'],
887
+ },
888
+ },
889
+ description: 'Limit when and how often a dynamic QR code works. Leave empty for no rules.',
890
+ options: [
891
+ {
892
+ displayName: 'Active From',
893
+ name: 'activeFrom',
894
+ type: 'dateTime',
895
+ default: '',
896
+ description: 'Scans before this moment go to the Fallback URL',
897
+ },
898
+ {
899
+ displayName: 'Expires At',
900
+ name: 'expiresAt',
901
+ type: 'dateTime',
902
+ default: '',
903
+ description: 'Scans from this moment go to the Fallback URL. Must be after Active From.',
904
+ },
905
+ {
906
+ displayName: 'Max Scans',
907
+ name: 'maxVisits',
908
+ type: 'number',
909
+ typeOptions: { minValue: 1, numberPrecision: 0 },
910
+ default: 1,
911
+ description: 'Scans allowed; later scans go to the Fallback URL',
912
+ },
913
+ {
914
+ displayName: 'Fallback URL',
915
+ name: 'fallbackUrl',
349
916
  type: 'string',
350
917
  default: '',
351
- description: 'QR code template/style ID',
918
+ placeholder: 'https://example.com/offer-ended',
919
+ description: 'Where gated scans go (http or https)',
352
920
  },
353
921
  {
354
- displayName: 'Enable Monetization',
355
- name: 'isEnableMonetization',
922
+ displayName: 'Clear Scan Rules',
923
+ name: 'clearScanRules',
356
924
  type: 'boolean',
357
925
  default: false,
358
- description: 'Whether to enable monetization for this QR code',
926
+ description: 'Whether to remove every scan rule from the code (overrides the other fields)',
359
927
  },
928
+ ],
929
+ },
930
+ {
931
+ displayName: 'Scan Rules',
932
+ name: 'scanRules',
933
+ type: 'collection',
934
+ placeholder: 'Add Rule',
935
+ default: {},
936
+ displayOptions: {
937
+ show: {
938
+ operation: ['update'],
939
+ },
940
+ hide: {
941
+ qrType: ['wifi'],
942
+ },
943
+ },
944
+ description: 'Dynamic codes only. Leave empty to keep the current rules; any rule set here replaces all of them.',
945
+ options: [
360
946
  {
361
- displayName: 'Page Title',
362
- name: 'pageTitle',
947
+ displayName: 'Active From',
948
+ name: 'activeFrom',
949
+ type: 'dateTime',
950
+ default: '',
951
+ description: 'Scans before this moment go to the Fallback URL',
952
+ },
953
+ {
954
+ displayName: 'Expires At',
955
+ name: 'expiresAt',
956
+ type: 'dateTime',
957
+ default: '',
958
+ description: 'Scans from this moment go to the Fallback URL. Must be after Active From.',
959
+ },
960
+ {
961
+ displayName: 'Max Scans',
962
+ name: 'maxVisits',
963
+ type: 'number',
964
+ typeOptions: { minValue: 1, numberPrecision: 0 },
965
+ default: 1,
966
+ description: 'Scans allowed; later scans go to the Fallback URL',
967
+ },
968
+ {
969
+ displayName: 'Fallback URL',
970
+ name: 'fallbackUrl',
363
971
  type: 'string',
364
972
  default: '',
365
- description: 'Landing page title',
973
+ placeholder: 'https://example.com/offer-ended',
974
+ description: 'Where gated scans go (http or https)',
975
+ },
976
+ {
977
+ displayName: 'Clear Scan Rules',
978
+ name: 'clearScanRules',
979
+ type: 'boolean',
980
+ default: false,
981
+ description: 'Whether to remove every scan rule from the code (overrides the other fields)',
982
+ },
983
+ ],
984
+ },
985
+ // Additional fields for Create/Update
986
+ {
987
+ displayName: 'Additional Fields',
988
+ name: 'additionalFields',
989
+ type: 'collection',
990
+ placeholder: 'Add Field',
991
+ default: {},
992
+ displayOptions: {
993
+ show: {
994
+ operation: ['create', 'update'],
995
+ },
996
+ },
997
+ options: [
998
+ {
999
+ displayName: 'Landing Page',
1000
+ name: 'isEnableLandingPage',
1001
+ type: 'boolean',
1002
+ default: false,
1003
+ description: 'Whether the QR code\'s Posty5 page shows the title and description below',
366
1004
  },
367
1005
  {
368
1006
  displayName: 'Page Description',
369
1007
  name: 'pageDescription',
370
1008
  type: 'string',
1009
+ displayOptions: {
1010
+ show: {
1011
+ isEnableLandingPage: [true],
1012
+ },
1013
+ },
371
1014
  default: '',
372
1015
  description: 'Landing page description',
373
1016
  },
1017
+ {
1018
+ displayName: 'Page Title',
1019
+ name: 'pageTitle',
1020
+ type: 'string',
1021
+ displayOptions: {
1022
+ show: {
1023
+ isEnableLandingPage: [true],
1024
+ },
1025
+ },
1026
+ default: '',
1027
+ description: 'Landing page title. Required when Landing Page is on.',
1028
+ },
1029
+ {
1030
+ displayName: 'Reference ID',
1031
+ name: 'refId',
1032
+ type: 'string',
1033
+ default: '',
1034
+ description: 'External reference ID. On Update, an empty value clears it.',
1035
+ },
1036
+ {
1037
+ displayName: 'Tag',
1038
+ name: 'tag',
1039
+ type: 'string',
1040
+ default: '',
1041
+ description: 'Organization tag for filtering. On Update, an empty value clears it.',
1042
+ },
1043
+ {
1044
+ displayName: 'Template ID (Deprecated)',
1045
+ name: 'templateId',
1046
+ type: 'string',
1047
+ default: '',
1048
+ description: 'Use the Template field instead. Read only when Template is empty, so workflows saved before version 4.6.0 keep their template.',
1049
+ },
374
1050
  ],
375
1051
  },
376
1052
  // Get, Update, Delete operation fields
@@ -381,7 +1057,7 @@ class Posty5QrCode {
381
1057
  required: true,
382
1058
  displayOptions: {
383
1059
  show: {
384
- operation: ['get', 'update', 'delete'],
1060
+ operation: ['get', 'getAnalytics', 'update', 'delete'],
385
1061
  },
386
1062
  },
387
1063
  default: '',
@@ -443,6 +1119,17 @@ class Posty5QrCode {
443
1119
  default: '',
444
1120
  description: 'Filter by reference ID',
445
1121
  },
1122
+ {
1123
+ displayName: 'Mode',
1124
+ name: 'mode',
1125
+ type: 'options',
1126
+ options: [
1127
+ { name: 'Static', value: 'static' },
1128
+ { name: 'Dynamic', value: 'dynamic' },
1129
+ ],
1130
+ default: 'static',
1131
+ description: 'Only QR codes of this mode',
1132
+ },
446
1133
  {
447
1134
  displayName: 'Search',
448
1135
  name: 'search',
@@ -452,8 +1139,20 @@ class Posty5QrCode {
452
1139
  },
453
1140
  ],
454
1141
  },
1142
+ // Get Analytics operation fields (shared with the other link-tool node)
1143
+ ...analytics_properties_1.LINK_ANALYTICS_PROPERTIES,
1144
+ // Get Statistics operation fields (shared with the other link-tool node)
1145
+ ...analytics_properties_1.LINK_STATISTICS_PROPERTIES,
1146
+ // Create Many operation fields (shared with the other link-tool node)
1147
+ ...(0, link_bulk_properties_1.buildLinkBulkProperties)(false),
1148
+ ...(0, versioned_write_helpers_1.buildVersionedWriteProperties)(['update', 'delete']),
455
1149
  ],
456
1150
  };
1151
+ this.methods = {
1152
+ loadOptions: {
1153
+ getQrTemplates: qr_templates_helpers_1.getQrTemplates,
1154
+ },
1155
+ };
457
1156
  }
458
1157
  async execute() {
459
1158
  const items = this.getInputData();
@@ -461,74 +1160,48 @@ class Posty5QrCode {
461
1160
  const operation = this.getNodeParameter('operation', 0);
462
1161
  const credentials = await this.getCredentials('posty5Api');
463
1162
  const apiKey = credentials.apiKey;
1163
+ // Create Many reads every item once and answers one item per input item.
1164
+ if (operation === 'createMany') {
1165
+ if (!items.length)
1166
+ return [[]];
1167
+ const defaults = (0, link_bulk_helpers_1.readBulkDefaults)(this.getNodeParameter('bulkDefaults', 0, {}));
1168
+ const options = this.getNodeParameter('bulkOptions', 0, {});
1169
+ const prepared = (0, link_bulk_helpers_1.prepareBulkRows)(items.length, (i) => (0, helpers_1.buildQrCodeBulkRow)(this, i, defaults));
1170
+ return [await (0, link_bulk_helpers_1.executeBulkCreate)(this, apiKey, helpers_1.QR_CODE_BULK_ROUTE, prepared, defaults, options)];
1171
+ }
464
1172
  for (let i = 0; i < items.length; i++) {
465
1173
  try {
466
1174
  let responseData = {};
467
1175
  if (operation === 'create') {
468
1176
  const qrType = this.getNodeParameter('qrType', i);
469
- const name = this.getNodeParameter('name', i, '');
470
1177
  const additionalFields = this.getNodeParameter('additionalFields', i, {});
471
- const body = {};
1178
+ const name = (0, link_tool_helpers_1.firstText)(this.getNodeParameter('name', i, ''));
1179
+ const body = {
1180
+ ...(0, link_tool_helpers_1.buildCommonCreateFields)(additionalFields),
1181
+ templateId: (0, qr_templates_helpers_1.requireTemplateId)(this.getNodeParameter('templateId', i, ''), additionalFields),
1182
+ qrCodeTarget: (0, qr_target_helpers_1.buildQrCodeTarget)(qrType, (parameter, fallback) => this.getNodeParameter(parameter, i, fallback)),
1183
+ // Required by the API; the template supplies the design and the
1184
+ // server builds `options.text` from `qrCodeTarget`.
1185
+ options: {},
1186
+ };
472
1187
  if (name)
473
1188
  body.name = name;
474
- if (additionalFields.tag)
475
- body.tag = additionalFields.tag;
476
- if (additionalFields.refId)
477
- body.refId = additionalFields.refId;
478
- if (additionalFields.templateId)
479
- body.templateId = additionalFields.templateId;
480
- if (additionalFields.isEnableMonetization !== undefined) {
481
- body.isEnableMonetization = additionalFields.isEnableMonetization;
1189
+ // Static is the API default: send `mode` only for dynamic, so saved
1190
+ // workflows (no value) keep sending the same body. A target with no
1191
+ // static form (app store, file, 2+ social profiles) is always dynamic.
1192
+ const mode = (0, qr_target_helpers_1.requiredQrMode)(body.qrCodeTarget) ?? (0, qr_target_helpers_1.readQrMode)(this.getNodeParameter('mode', i, 'static'));
1193
+ if (mode === 'dynamic')
1194
+ body.mode = mode;
1195
+ if (qrType === 'file') {
1196
+ // Upload last, after every local check: the signed URL is short-lived.
1197
+ const upload = await (0, qr_file_helpers_1.uploadQrFile)(this, apiKey, i, (0, link_tool_helpers_1.toText)(this.getNodeParameter('binaryPropertyName', i, qr_content_config_1.QR_CONTENT_CONFIG.file.defaultBinaryProperty)).trim() ||
1198
+ qr_content_config_1.QR_CONTENT_CONFIG.file.defaultBinaryProperty, body.qrCodeTarget.file?.fileName);
1199
+ body.qrCodeTarget.file = { ...body.qrCodeTarget.file, ...upload };
482
1200
  }
483
- if (additionalFields.pageTitle || additionalFields.pageDescription) {
484
- body.pageInfo = {
485
- title: additionalFields.pageTitle || '',
486
- description: additionalFields.pageDescription || '',
487
- };
488
- }
489
- // Add type-specific fields
490
- switch (qrType) {
491
- case 'url': {
492
- const url = this.getNodeParameter('url', i);
493
- body.url = { url };
494
- break;
495
- }
496
- case 'freeText': {
497
- const text = this.getNodeParameter('text', i);
498
- body.text = text;
499
- break;
500
- }
501
- case 'email': {
502
- const email = this.getNodeParameter('email', i);
503
- const subject = this.getNodeParameter('emailSubject', i, '');
504
- const emailBody = this.getNodeParameter('emailBody', i, '');
505
- body.email = { email, subject, body: emailBody };
506
- break;
507
- }
508
- case 'wifi': {
509
- const wifiName = this.getNodeParameter('wifiName', i);
510
- const authenticationType = this.getNodeParameter('wifiAuthType', i);
511
- const password = this.getNodeParameter('wifiPassword', i, '');
512
- body.wifi = { name: wifiName, authenticationType, password };
513
- break;
514
- }
515
- case 'call': {
516
- const phoneNumber = this.getNodeParameter('phoneNumber', i);
517
- body.call = { phoneNumber };
518
- break;
519
- }
520
- case 'sms': {
521
- const phoneNumber = this.getNodeParameter('smsPhoneNumber', i);
522
- const message = this.getNodeParameter('smsMessage', i, '');
523
- body.sms = { phoneNumber, message };
524
- break;
525
- }
526
- case 'geolocation': {
527
- const latitude = this.getNodeParameter('latitude', i);
528
- const longitude = this.getNodeParameter('longitude', i);
529
- body.geolocation = { latitude, longitude };
530
- break;
531
- }
1201
+ if (mode === 'dynamic') {
1202
+ const access = (0, qr_target_helpers_1.buildQrAccess)(this.getNodeParameter('scanRules', i, {}));
1203
+ if (access !== undefined)
1204
+ body.access = access;
532
1205
  }
533
1206
  responseData = await api_helpers_1.makeApiRequest.call(this, apiKey, {
534
1207
  method: 'POST',
@@ -543,77 +1216,61 @@ class Posty5QrCode {
543
1216
  endpoint: `${constants_1.API_ENDPOINTS.QR_CODE}/${qrCodeId}`,
544
1217
  });
545
1218
  }
1219
+ else if (operation === 'getAnalytics') {
1220
+ responseData = await (0, analytics_helpers_1.executeGetAnalytics)(this, apiKey, constants_1.API_ENDPOINTS.QR_CODE, this.getNodeParameter('qrCodeId', i), i);
1221
+ }
1222
+ else if (operation === 'getStatistics') {
1223
+ responseData = await (0, analytics_helpers_1.executeGetStatistics)(this, apiKey, constants_1.API_ENDPOINTS.QR_CODE, i);
1224
+ }
546
1225
  else if (operation === 'update') {
547
1226
  const qrCodeId = this.getNodeParameter('qrCodeId', i);
548
1227
  const qrType = this.getNodeParameter('qrType', i);
549
- const name = this.getNodeParameter('name', i, '');
550
1228
  const additionalFields = this.getNodeParameter('additionalFields', i, {});
551
- const body = {};
1229
+ // Built first, so an unknown type fails before any request.
1230
+ const qrCodeTarget = (0, qr_target_helpers_1.buildQrCodeTarget)(qrType, (parameter, fallback) => this.getNodeParameter(parameter, i, fallback));
1231
+ // Fetch-then-put: the API names an untitled update after its text and
1232
+ // drops an omitted template type, so the stored record is the base.
1233
+ const stored = (await api_helpers_1.makeApiRequest.call(this, apiKey, {
1234
+ method: 'GET',
1235
+ endpoint: `${constants_1.API_ENDPOINTS.QR_CODE}/${qrCodeId}`,
1236
+ }));
1237
+ // Resolved before the file upload: a missing version fails with no side effect.
1238
+ const version = await (0, versioned_write_helpers_1.resolveWriteVersion)(this, apiKey, i, `${constants_1.API_ENDPOINTS.QR_CODE}/${qrCodeId}`, stored);
1239
+ const body = {
1240
+ ...(0, link_tool_helpers_1.buildCommonUpdateFields)(additionalFields, stored),
1241
+ templateId: (0, qr_templates_helpers_1.requireTemplateId)(this.getNodeParameter('templateId', i, ''), additionalFields, stored),
1242
+ qrCodeTarget,
1243
+ options: {},
1244
+ };
1245
+ const name = (0, link_tool_helpers_1.firstText)(this.getNodeParameter('name', i, ''), stored.name);
552
1246
  if (name)
553
1247
  body.name = name;
554
- if (additionalFields.tag)
555
- body.tag = additionalFields.tag;
556
- if (additionalFields.refId)
557
- body.refId = additionalFields.refId;
558
- if (additionalFields.templateId)
559
- body.templateId = additionalFields.templateId;
560
- if (additionalFields.isEnableMonetization !== undefined) {
561
- body.isEnableMonetization = additionalFields.isEnableMonetization;
562
- }
563
- if (additionalFields.pageTitle || additionalFields.pageDescription) {
564
- body.pageInfo = {
565
- title: additionalFields.pageTitle || '',
566
- description: additionalFields.pageDescription || '',
567
- };
568
- }
569
- // Add type-specific fields
570
- switch (qrType) {
571
- case 'url': {
572
- const url = this.getNodeParameter('url', i);
573
- body.url = { url };
574
- break;
575
- }
576
- case 'freeText': {
577
- const text = this.getNodeParameter('text', i);
578
- body.qrCodeTarget = { text };
579
- break;
580
- }
581
- case 'email': {
582
- const email = this.getNodeParameter('email', i);
583
- const subject = this.getNodeParameter('emailSubject', i, '');
584
- const emailBody = this.getNodeParameter('emailBody', i, '');
585
- body.email = { email, subject, body: emailBody };
586
- break;
587
- }
588
- case 'wifi': {
589
- const wifiName = this.getNodeParameter('wifiName', i);
590
- const authenticationType = this.getNodeParameter('wifiAuthType', i);
591
- const password = this.getNodeParameter('wifiPassword', i, '');
592
- body.wifi = { name: wifiName, authenticationType, password };
593
- break;
594
- }
595
- case 'call': {
596
- const phoneNumber = this.getNodeParameter('phoneNumber', i);
597
- body.call = { phoneNumber };
598
- break;
599
- }
600
- case 'sms': {
601
- const phoneNumber = this.getNodeParameter('smsPhoneNumber', i);
602
- const message = this.getNodeParameter('smsMessage', i, '');
603
- body.sms = { phoneNumber, message };
604
- break;
1248
+ // Empty ("Keep Current") sends nothing; the API keeps the stored mode.
1249
+ // A target with no static form always sends dynamic.
1250
+ const mode = (0, qr_target_helpers_1.requiredQrMode)(qrCodeTarget) ?? (0, qr_target_helpers_1.readQrMode)(this.getNodeParameter('mode', i, ''));
1251
+ if (mode)
1252
+ body.mode = mode;
1253
+ if (qrType === 'file') {
1254
+ // No binary property: no upload, no bucketFilePath, the stored file stays.
1255
+ const binaryProperty = (0, link_tool_helpers_1.toText)(this.getNodeParameter('binaryPropertyName', i, '')).trim();
1256
+ const storedFileName = stored.qrCodeTarget?.file?.fileName;
1257
+ if (binaryProperty) {
1258
+ const upload = await (0, qr_file_helpers_1.uploadQrFile)(this, apiKey, i, binaryProperty, qrCodeTarget.file?.fileName);
1259
+ qrCodeTarget.file = { ...qrCodeTarget.file, ...upload };
605
1260
  }
606
- case 'geolocation': {
607
- const latitude = this.getNodeParameter('latitude', i);
608
- const longitude = this.getNodeParameter('longitude', i);
609
- body.geolocation = { latitude, longitude };
610
- break;
1261
+ else if (!qrCodeTarget.file?.fileName && storedFileName) {
1262
+ qrCodeTarget.file = { ...qrCodeTarget.file, fileName: storedFileName };
611
1263
  }
612
1264
  }
1265
+ // Empty Scan Rules keeps the stored rules; Clear sends access: null.
1266
+ const access = (0, qr_target_helpers_1.buildQrAccess)(this.getNodeParameter('scanRules', i, {}));
1267
+ if (access !== undefined)
1268
+ body.access = access;
613
1269
  responseData = await api_helpers_1.makeApiRequest.call(this, apiKey, {
614
1270
  method: 'PUT',
615
1271
  endpoint: `${constants_1.API_ENDPOINTS.QR_CODE}/${qrType}/${qrCodeId}`,
616
1272
  body,
1273
+ version,
617
1274
  });
618
1275
  }
619
1276
  else if (operation === 'delete') {
@@ -621,6 +1278,7 @@ class Posty5QrCode {
621
1278
  responseData = await api_helpers_1.makeApiRequest.call(this, apiKey, {
622
1279
  method: 'DELETE',
623
1280
  endpoint: `${constants_1.API_ENDPOINTS.QR_CODE}/${qrCodeId}`,
1281
+ version: await (0, versioned_write_helpers_1.resolveWriteVersion)(this, apiKey, i, `${constants_1.API_ENDPOINTS.QR_CODE}/${qrCodeId}`),
624
1282
  });
625
1283
  }
626
1284
  else if (operation === 'list') {
@@ -631,6 +1289,9 @@ class Posty5QrCode {
631
1289
  qs.tag = filters.tag;
632
1290
  if (filters.refId)
633
1291
  qs.refId = filters.refId;
1292
+ const modeFilter = (0, qr_target_helpers_1.readQrMode)(filters.mode);
1293
+ if (modeFilter)
1294
+ qs.mode = modeFilter;
634
1295
  if (filters.search) {
635
1296
  qs.name = filters.search;
636
1297
  }