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