@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
@@ -3,20 +3,218 @@
3
3
  * Central location for all API-related constants
4
4
  */
5
5
  export declare const POSTY5_API_BASE_URL = "https://api.posty5.com";
6
+ /**
7
+ * `X-Posty5-Client`, sent on every request this package makes to the API (the
8
+ * mcp-server headers contract: `posty5-n8n/<version>`; the API logs it and never
9
+ * trusts it). The version is package.json's, compiled in by tsc through
10
+ * `resolveJsonModule`, so a release bump cannot leave a stale copy here.
11
+ */
12
+ export declare const Posty5ClientConst: {
13
+ readonly HEADER: "X-Posty5-Client";
14
+ readonly VALUE: `posty5-n8n/${string}`;
15
+ };
16
+ /**
17
+ * The credential's Test button (`GET /api/api-key/current`). A wrong or revoked
18
+ * key answers 401; a 200 has to name the key at `KEY_ID_PATH`, so a 200 from
19
+ * anything else is not a pass.
20
+ */
21
+ export declare const CredentialTestConst: {
22
+ readonly INVALID_KEY_STATUS: 401;
23
+ readonly INVALID_KEY_MESSAGE: "Invalid or revoked API key";
24
+ readonly KEY_ID_PATH: "result.apiKey._id";
25
+ readonly NO_KEY_ID_MESSAGE: "The Posty5 API did not identify this API key";
26
+ };
6
27
  export declare const API_ENDPOINTS: {
28
+ readonly API_KEY_CURRENT: "/api/api-key/current";
7
29
  readonly SHORT_LINK: "/api/short-link";
30
+ readonly LINK_CAMPAIGN: "/api/link-campaign";
8
31
  readonly QR_CODE: "/api/qr-code";
32
+ readonly QR_CODE_TEMPLATE: "/api/qr-code-template";
9
33
  readonly HTML_HOSTING: "/api/html-hosting";
10
34
  readonly FORM_SUBMISSION: "/api/html-hosting-form-submission";
11
35
  readonly SOCIAL_PUBLISHER_WORKSPACE: "/api/social-publisher-workspace";
12
36
  readonly SOCIAL_PUBLISHER_POST: "/api/social-publisher-post";
37
+ readonly STORE_SUPPLIERS: "/api/store-suppliers";
38
+ readonly STORE_ORDERS: "/api/store-orders";
39
+ readonly WEBHOOK_ENDPOINTS: "/api/webhook-endpoints";
13
40
  };
14
41
  export declare const DEFAULT_PAGINATION: {
15
42
  readonly page: 1;
16
43
  readonly pageSize: 50;
17
44
  };
45
+ /**
46
+ * Page sizes the `/api/store-suppliers` list routes accept. They mirror the api's
47
+ * Joi schemas (`suppliers/schema.ts`): a larger `pageSize` is refused with a 400,
48
+ * not clamped, so the node's Limit fields are capped at the same values.
49
+ */
50
+ export declare const STORE_SUPPLIER_PAGE_SIZES: {
51
+ /** Catalogue browse (`GET /:storeId/:id/products`) — the api's `CATALOGUE_MAX_PAGE_SIZE`. */
52
+ readonly CATALOGUE_MAX: 48;
53
+ /** Supplier order queue (`GET /:storeId/orders`). */
54
+ readonly SUPPLIER_ORDERS_MAX: 100;
55
+ };
56
+ /**
57
+ * The Template dropdown on the Short Link and QR Code nodes. It reads the
58
+ * caller's own templates (`GET /api/qr-code-template/user-lookup`, accepts the
59
+ * API key) and the public ones (`/public-lookup`, no auth). Both lists are
60
+ * cursor-paged; one page of `PAGE_SIZE` each fills the dropdown, and a template
61
+ * beyond it can still be entered by ID as an expression.
62
+ */
63
+ export declare const QR_TEMPLATE_LOOKUP: {
64
+ readonly USER_PATH: "/user-lookup";
65
+ readonly PUBLIC_PATH: "/public-lookup";
66
+ readonly PAGE_SIZE: 100;
67
+ /** Shown under each option so the user can tell the two lists apart. */
68
+ readonly USER_LABEL: "My template";
69
+ readonly PUBLIC_LABEL: "Public template";
70
+ };
71
+ /**
72
+ * The QR types the API validates (`/api/qr-code/:type`). The node's QR Type
73
+ * values are these, and `qrCodeTarget.type` is always one of them.
74
+ */
75
+ export declare const QR_CODE_TYPES: readonly ["url", "freeText", "email", "wifi", "call", "sms", "geolocation", "vcard", "event", "whatsapp", "review", "social", "appStore", "file"];
76
+ /** WiFi authentication values: the node's default, and the one that means "open network" (no password is sent). */
77
+ export declare const QR_WIFI_AUTH: {
78
+ readonly DEFAULT: "WPA";
79
+ readonly OPEN_NETWORK: "nopass";
80
+ };
81
+ /** The Short Link fields that set a device's destination by hand (S13). */
82
+ export declare const SHORT_LINK_DEEP_LINK_FIELDS: readonly ["androidUrl", "iosUrl"];
83
+ /** Errors the Short Link and QR Code nodes raise before calling the API. */
84
+ export declare const LINK_TOOL_MESSAGES: {
85
+ readonly TEMPLATE_REQUIRED: "Template is required: pick one in the Template field. The Posty5 API refuses a create or update made with an API key without it.";
86
+ };
87
+ /**
88
+ * *Get Analytics* on the Short Link and QR Code nodes:
89
+ * `GET <SHORT_LINK|QR_CODE>/:id/analytics` (contract C2). The breakdown names,
90
+ * intervals, the `all` value and the limit bounds mirror the API's query schema.
91
+ */
92
+ export declare const LINK_ANALYTICS: {
93
+ /** Path segment after `/:id`. */
94
+ readonly PATH_SEGMENT: "analytics";
95
+ /** `breakdown` value asking for every breakdown the owner's plan allows. */
96
+ readonly ALL_BREAKDOWNS: "all";
97
+ /** Separator of an explicit `breakdown` list. */
98
+ readonly BREAKDOWN_SEPARATOR: ",";
99
+ /** Days of each preset range, today included. */
100
+ readonly RANGE_DAYS: {
101
+ readonly last7Days: 7;
102
+ readonly last30Days: 30;
103
+ readonly last90Days: 90;
104
+ };
105
+ /** The Range a new node starts with: the API's own default span. */
106
+ readonly DEFAULT_RANGE: "last30Days";
107
+ readonly DEFAULT_INTERVAL: "day";
108
+ /** The Output a new node starts with: the API answer, unchanged. */
109
+ readonly DEFAULT_OUTPUT: "response";
110
+ /** Rows per breakdown: the API's default and maximum. */
111
+ readonly LIMIT_DEFAULT: 10;
112
+ readonly LIMIT_MIN: 1;
113
+ readonly LIMIT_MAX: 50;
114
+ /** The status the API answers for a breakdown or a range the owner's plan does not include. */
115
+ readonly PLAN_GATE_HTTP_CODE: "403";
116
+ /** The zone used when neither the Time Zone option nor the workflow names one. */
117
+ readonly FALLBACK_TIME_ZONE: "UTC";
118
+ };
119
+ /**
120
+ * *Get Statistics* on the Short Link and QR Code nodes: account-wide counts
121
+ * over the caller's records, `GET <SHORT_LINK|QR_CODE>/statistics`. The periods
122
+ * are the API's own `period` values; days are UTC days on the server.
123
+ */
124
+ export declare const LINK_STATISTICS: {
125
+ readonly PATH_SEGMENT: "statistics";
126
+ /** The API's default period. */
127
+ readonly DEFAULT_PERIOD: "30d";
128
+ readonly CUSTOM_PERIOD: "custom";
129
+ };
130
+ /** Errors *Get Analytics* and *Get Statistics* raise before calling the API. */
131
+ export declare const LINK_ANALYTICS_MESSAGES: {
132
+ readonly ID_REQUIRED: "The ID is required to read analytics.";
133
+ readonly CUSTOM_RANGE_REQUIRED: "A Custom range needs both From and To dates.";
134
+ readonly INVALID_DATE: "is not a date. Use a date such as 2026-10-01.";
135
+ readonly UNKNOWN_TIME_ZONE: "is not a known time zone. Use an IANA name such as Africa/Cairo in the Time Zone option or in the workflow settings.";
136
+ };
137
+ /** `YYYY-MM-DD` at the start of a date string (the day an n8n `dateTime` value names). */
138
+ export declare const DAY_KEY_PATTERN: RegExp;
139
+ /** Milliseconds in one calendar day (day keys are shifted on UTC midnights, so no DST applies). */
140
+ export declare const MS_PER_DAY: number;
141
+ /**
142
+ * *Create Many* on the Short Link and QR Code nodes: `POST <SHORT_LINK|QR_CODE>/bulk`
143
+ * (link-qr-bulk-and-webhooks contract). Rows are sent in chunks of at most
144
+ * `MAX_BATCH_SIZE`; each chunk carries `Idempotency-Key:
145
+ * n8n-<executionId>-<nodeName>-<chunk>`, so retrying the same execution is
146
+ * charged once while a new run is not deduped.
147
+ */
148
+ export declare const LINK_BULK: {
149
+ readonly PATH_SEGMENT: "bulk";
150
+ readonly MAX_BATCH_SIZE: 100;
151
+ readonly DEFAULT_BATCH_SIZE: 100;
152
+ readonly IDEMPOTENCY_HEADER: "Idempotency-Key";
153
+ readonly IDEMPOTENCY_PREFIX: "n8n";
154
+ readonly ROW_STATUS_CREATED: "created";
155
+ readonly ROW_STATUS_FAILED: "failed";
156
+ };
157
+ /** Errors *Create Many* raises. */
158
+ export declare const LINK_BULK_MESSAGES: {
159
+ readonly TEMPLATE_REQUIRED: "Template is required: pick one in the Template field or set Defaults > Template ID. The Posty5 API refuses a create made with an API key without it.";
160
+ readonly ROW_FAILED: "Posty5 refused a row of Create Many";
161
+ readonly MISSING_ROW_RESULT: "The Posty5 API returned no result for this row";
162
+ };
18
163
  export declare const API_TIMEOUTS: {
19
164
  readonly DEFAULT: 30000;
20
165
  readonly UPLOAD: 120000;
21
166
  };
167
+ /**
168
+ * Short link controls (short-link-controls): sub-paths under `/api/short-link`,
169
+ * the enums the API's Joi schemas accept, and the node's own messages.
170
+ */
171
+ export declare const SHORT_LINK_CONTROLS: {
172
+ readonly TAGS_PATH: "/tags";
173
+ readonly HEALTH_CHECK_PATH: "/health-check";
174
+ /** `?tags=a,b` and the Tags field are split on this. */
175
+ readonly TAGS_SEPARATOR: ",";
176
+ /** `GET /api/link-campaign` page size for the Campaign dropdown. */
177
+ readonly CAMPAIGN_LOOKUP_PAGE_SIZE: 100;
178
+ /** Answer of Check Health (the API answers 202 with no body). */
179
+ readonly HEALTH_CHECK_QUEUED: {
180
+ readonly queued: true;
181
+ };
182
+ };
183
+ /** Retargeting pixel providers (`pixelsJoi`). */
184
+ export declare const LINK_PIXEL_PROVIDERS: readonly ["meta", "googleAds", "tiktok", "linkedin", "x", "pinterest"];
185
+ /** Campaign colours (`LINK_CAMPAIGN_COLORS`). */
186
+ export declare const LINK_CAMPAIGN_COLORS: readonly ["slate", "red", "orange", "amber", "green", "teal", "blue", "indigo", "purple", "pink"];
187
+ /** Routing rule condition values (documented in the Routing Rules field). */
188
+ export declare const LINK_ROUTING_DEVICES: readonly ["tablet", "mobile", "desktop", "other"];
189
+ export declare const LINK_ROUTING_OS: readonly ["android", "ios", "windows", "macos", "linux"];
190
+ /** The UTM keys a link or a campaign carries. */
191
+ export declare const LINK_UTM_KEYS: readonly ["source", "medium", "campaign", "term", "content"];
192
+ /** The access keys of a link (`password` and `removePassword` handled apart). */
193
+ export declare const LINK_ACCESS_KEYS: readonly ["activeFrom", "expiresAt", "maxVisits", "fallbackUrl"];
194
+ export declare const SHORT_LINK_CONTROLS_MESSAGES: {
195
+ readonly INVALID_JSON: (field: string) => string;
196
+ readonly CAMPAIGN_NAME_REQUIRED: "Campaign Name is required";
197
+ readonly ID_REQUIRED: (field: string) => string;
198
+ };
199
+ /**
200
+ * Optimistic concurrency (optimistic-concurrency feature, D-5/D-6/D-18). v2 of
201
+ * the nodes with update/delete operations sends the Version field as
202
+ * `If-Match`; v1 keeps last-write-wins by reading the item's `__v` first.
203
+ */
204
+ export declare const VERSIONED_WRITES: {
205
+ readonly IF_MATCH_HEADER: "If-Match";
206
+ readonly CONFLICT_CODE: "VERSION_CONFLICT";
207
+ /** The node version that carries the Version field. */
208
+ readonly FIRST_VERSIONED_NODE_VERSION: 2;
209
+ readonly VERSION_PARAMETER: "expectedVersion";
210
+ readonly OPTIONS_PARAMETER: "versionOptions";
211
+ /** The v1-only legacy notice (display only, no value). */
212
+ readonly V1_NOTICE_PARAMETER: "legacyVersionNotice";
213
+ readonly ON_UNKNOWN_FAIL: "fail";
214
+ readonly ON_UNKNOWN_USE_LATEST: "useLatest";
215
+ readonly DEFAULT_VERSION_EXPRESSION: "={{ $json.__v }}";
216
+ readonly CONFLICT_MESSAGE: (currentVersion?: number) => string;
217
+ readonly UNKNOWN_VERSION_MESSAGE: "Version is required: map the __v of a Get step, or set Version Options > On Unknown Version to Use Latest (Overwrite).";
218
+ readonly V1_DEPRECATION_NOTE: "Version 1 of this node is legacy: its update and delete operations read the item first and overwrite it (last write wins). Add the node again to get version 2, which fails on a conflict instead.";
219
+ };
22
220
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../utils/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D,eAAO,MAAM,aAAa;;;;;;;CAOhB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX,eAAO,MAAM,YAAY;;;CAGf,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../utils/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;CAahB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;IACrC,6FAA6F;;IAE7F,qDAAqD;;CAE5C,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;IAI9B,wEAAwE;;;CAG/D,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,aAA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4BAA4B;mCAClB,MAAM;;kCAEP,MAAM;CAClB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;IAG5B,uDAAuD;;;;IAIvD,0DAA0D;;;;;iDAKtB,MAAM;;;CAMjC,CAAC"}
@@ -4,22 +4,236 @@
4
4
  * Central location for all API-related constants
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.API_TIMEOUTS = exports.DEFAULT_PAGINATION = exports.API_ENDPOINTS = exports.POSTY5_API_BASE_URL = void 0;
7
+ exports.VERSIONED_WRITES = exports.SHORT_LINK_CONTROLS_MESSAGES = exports.LINK_ACCESS_KEYS = exports.LINK_UTM_KEYS = exports.LINK_ROUTING_OS = exports.LINK_ROUTING_DEVICES = exports.LINK_CAMPAIGN_COLORS = exports.LINK_PIXEL_PROVIDERS = exports.SHORT_LINK_CONTROLS = exports.API_TIMEOUTS = exports.LINK_BULK_MESSAGES = exports.LINK_BULK = exports.MS_PER_DAY = exports.DAY_KEY_PATTERN = exports.LINK_ANALYTICS_MESSAGES = exports.LINK_STATISTICS = exports.LINK_ANALYTICS = exports.LINK_TOOL_MESSAGES = exports.SHORT_LINK_DEEP_LINK_FIELDS = exports.QR_WIFI_AUTH = exports.QR_CODE_TYPES = exports.QR_TEMPLATE_LOOKUP = exports.STORE_SUPPLIER_PAGE_SIZES = exports.DEFAULT_PAGINATION = exports.API_ENDPOINTS = exports.CredentialTestConst = exports.Posty5ClientConst = exports.POSTY5_API_BASE_URL = void 0;
8
+ const package_json_1 = require("../package.json");
8
9
  exports.POSTY5_API_BASE_URL = 'https://api.posty5.com';
10
+ /**
11
+ * `X-Posty5-Client`, sent on every request this package makes to the API (the
12
+ * mcp-server headers contract: `posty5-n8n/<version>`; the API logs it and never
13
+ * trusts it). The version is package.json's, compiled in by tsc through
14
+ * `resolveJsonModule`, so a release bump cannot leave a stale copy here.
15
+ */
16
+ exports.Posty5ClientConst = {
17
+ HEADER: 'X-Posty5-Client',
18
+ VALUE: `posty5-n8n/${package_json_1.version}`,
19
+ };
20
+ /**
21
+ * The credential's Test button (`GET /api/api-key/current`). A wrong or revoked
22
+ * key answers 401; a 200 has to name the key at `KEY_ID_PATH`, so a 200 from
23
+ * anything else is not a pass.
24
+ */
25
+ exports.CredentialTestConst = {
26
+ INVALID_KEY_STATUS: 401,
27
+ INVALID_KEY_MESSAGE: 'Invalid or revoked API key',
28
+ KEY_ID_PATH: 'result.apiKey._id',
29
+ NO_KEY_ID_MESSAGE: 'The Posty5 API did not identify this API key',
30
+ };
9
31
  exports.API_ENDPOINTS = {
32
+ API_KEY_CURRENT: '/api/api-key/current',
10
33
  SHORT_LINK: '/api/short-link',
34
+ LINK_CAMPAIGN: '/api/link-campaign',
11
35
  QR_CODE: '/api/qr-code',
36
+ QR_CODE_TEMPLATE: '/api/qr-code-template',
12
37
  HTML_HOSTING: '/api/html-hosting',
13
38
  FORM_SUBMISSION: '/api/html-hosting-form-submission',
14
39
  SOCIAL_PUBLISHER_WORKSPACE: '/api/social-publisher-workspace',
15
40
  SOCIAL_PUBLISHER_POST: '/api/social-publisher-post',
41
+ STORE_SUPPLIERS: '/api/store-suppliers',
42
+ STORE_ORDERS: '/api/store-orders',
43
+ WEBHOOK_ENDPOINTS: '/api/webhook-endpoints',
16
44
  };
17
45
  exports.DEFAULT_PAGINATION = {
18
46
  page: 1,
19
47
  pageSize: 50,
20
48
  };
49
+ /**
50
+ * Page sizes the `/api/store-suppliers` list routes accept. They mirror the api's
51
+ * Joi schemas (`suppliers/schema.ts`): a larger `pageSize` is refused with a 400,
52
+ * not clamped, so the node's Limit fields are capped at the same values.
53
+ */
54
+ exports.STORE_SUPPLIER_PAGE_SIZES = {
55
+ /** Catalogue browse (`GET /:storeId/:id/products`) — the api's `CATALOGUE_MAX_PAGE_SIZE`. */
56
+ CATALOGUE_MAX: 48,
57
+ /** Supplier order queue (`GET /:storeId/orders`). */
58
+ SUPPLIER_ORDERS_MAX: 100,
59
+ };
60
+ /**
61
+ * The Template dropdown on the Short Link and QR Code nodes. It reads the
62
+ * caller's own templates (`GET /api/qr-code-template/user-lookup`, accepts the
63
+ * API key) and the public ones (`/public-lookup`, no auth). Both lists are
64
+ * cursor-paged; one page of `PAGE_SIZE` each fills the dropdown, and a template
65
+ * beyond it can still be entered by ID as an expression.
66
+ */
67
+ exports.QR_TEMPLATE_LOOKUP = {
68
+ USER_PATH: '/user-lookup',
69
+ PUBLIC_PATH: '/public-lookup',
70
+ PAGE_SIZE: 100,
71
+ /** Shown under each option so the user can tell the two lists apart. */
72
+ USER_LABEL: 'My template',
73
+ PUBLIC_LABEL: 'Public template',
74
+ };
75
+ /**
76
+ * The QR types the API validates (`/api/qr-code/:type`). The node's QR Type
77
+ * values are these, and `qrCodeTarget.type` is always one of them.
78
+ */
79
+ exports.QR_CODE_TYPES = [
80
+ 'url',
81
+ 'freeText',
82
+ 'email',
83
+ 'wifi',
84
+ 'call',
85
+ 'sms',
86
+ 'geolocation',
87
+ 'vcard',
88
+ 'event',
89
+ 'whatsapp',
90
+ 'review',
91
+ 'social',
92
+ 'appStore',
93
+ 'file',
94
+ ];
95
+ /** WiFi authentication values: the node's default, and the one that means "open network" (no password is sent). */
96
+ exports.QR_WIFI_AUTH = {
97
+ DEFAULT: 'WPA',
98
+ OPEN_NETWORK: 'nopass',
99
+ };
100
+ /** The Short Link fields that set a device's destination by hand (S13). */
101
+ exports.SHORT_LINK_DEEP_LINK_FIELDS = ['androidUrl', 'iosUrl'];
102
+ /** Errors the Short Link and QR Code nodes raise before calling the API. */
103
+ exports.LINK_TOOL_MESSAGES = {
104
+ TEMPLATE_REQUIRED: 'Template is required: pick one in the Template field. The Posty5 API refuses a create or update made with an API key without it.',
105
+ };
106
+ /**
107
+ * *Get Analytics* on the Short Link and QR Code nodes:
108
+ * `GET <SHORT_LINK|QR_CODE>/:id/analytics` (contract C2). The breakdown names,
109
+ * intervals, the `all` value and the limit bounds mirror the API's query schema.
110
+ */
111
+ exports.LINK_ANALYTICS = {
112
+ /** Path segment after `/:id`. */
113
+ PATH_SEGMENT: 'analytics',
114
+ /** `breakdown` value asking for every breakdown the owner's plan allows. */
115
+ ALL_BREAKDOWNS: 'all',
116
+ /** Separator of an explicit `breakdown` list. */
117
+ BREAKDOWN_SEPARATOR: ',',
118
+ /** Days of each preset range, today included. */
119
+ RANGE_DAYS: {
120
+ last7Days: 7,
121
+ last30Days: 30,
122
+ last90Days: 90,
123
+ },
124
+ /** The Range a new node starts with: the API's own default span. */
125
+ DEFAULT_RANGE: 'last30Days',
126
+ DEFAULT_INTERVAL: 'day',
127
+ /** The Output a new node starts with: the API answer, unchanged. */
128
+ DEFAULT_OUTPUT: 'response',
129
+ /** Rows per breakdown: the API's default and maximum. */
130
+ LIMIT_DEFAULT: 10,
131
+ LIMIT_MIN: 1,
132
+ LIMIT_MAX: 50,
133
+ /** The status the API answers for a breakdown or a range the owner's plan does not include. */
134
+ PLAN_GATE_HTTP_CODE: '403',
135
+ /** The zone used when neither the Time Zone option nor the workflow names one. */
136
+ FALLBACK_TIME_ZONE: 'UTC',
137
+ };
138
+ /**
139
+ * *Get Statistics* on the Short Link and QR Code nodes: account-wide counts
140
+ * over the caller's records, `GET <SHORT_LINK|QR_CODE>/statistics`. The periods
141
+ * are the API's own `period` values; days are UTC days on the server.
142
+ */
143
+ exports.LINK_STATISTICS = {
144
+ PATH_SEGMENT: 'statistics',
145
+ /** The API's default period. */
146
+ DEFAULT_PERIOD: '30d',
147
+ CUSTOM_PERIOD: 'custom',
148
+ };
149
+ /** Errors *Get Analytics* and *Get Statistics* raise before calling the API. */
150
+ exports.LINK_ANALYTICS_MESSAGES = {
151
+ ID_REQUIRED: 'The ID is required to read analytics.',
152
+ CUSTOM_RANGE_REQUIRED: 'A Custom range needs both From and To dates.',
153
+ INVALID_DATE: 'is not a date. Use a date such as 2026-10-01.',
154
+ UNKNOWN_TIME_ZONE: 'is not a known time zone. Use an IANA name such as Africa/Cairo in the Time Zone option or in the workflow settings.',
155
+ };
156
+ /** `YYYY-MM-DD` at the start of a date string (the day an n8n `dateTime` value names). */
157
+ exports.DAY_KEY_PATTERN = /^\d{4}-\d{2}-\d{2}/;
158
+ /** Milliseconds in one calendar day (day keys are shifted on UTC midnights, so no DST applies). */
159
+ exports.MS_PER_DAY = 24 * 60 * 60 * 1000;
160
+ /**
161
+ * *Create Many* on the Short Link and QR Code nodes: `POST <SHORT_LINK|QR_CODE>/bulk`
162
+ * (link-qr-bulk-and-webhooks contract). Rows are sent in chunks of at most
163
+ * `MAX_BATCH_SIZE`; each chunk carries `Idempotency-Key:
164
+ * n8n-<executionId>-<nodeName>-<chunk>`, so retrying the same execution is
165
+ * charged once while a new run is not deduped.
166
+ */
167
+ exports.LINK_BULK = {
168
+ PATH_SEGMENT: 'bulk',
169
+ MAX_BATCH_SIZE: 100,
170
+ DEFAULT_BATCH_SIZE: 100,
171
+ IDEMPOTENCY_HEADER: 'Idempotency-Key',
172
+ IDEMPOTENCY_PREFIX: 'n8n',
173
+ ROW_STATUS_CREATED: 'created',
174
+ ROW_STATUS_FAILED: 'failed',
175
+ };
176
+ /** Errors *Create Many* raises. */
177
+ exports.LINK_BULK_MESSAGES = {
178
+ TEMPLATE_REQUIRED: 'Template is required: pick one in the Template field or set Defaults > Template ID. The Posty5 API refuses a create made with an API key without it.',
179
+ ROW_FAILED: 'Posty5 refused a row of Create Many',
180
+ MISSING_ROW_RESULT: 'The Posty5 API returned no result for this row',
181
+ };
21
182
  exports.API_TIMEOUTS = {
22
183
  DEFAULT: 30000, // 30 seconds
23
184
  UPLOAD: 120000, // 2 minutes for uploads
24
185
  };
186
+ /**
187
+ * Short link controls (short-link-controls): sub-paths under `/api/short-link`,
188
+ * the enums the API's Joi schemas accept, and the node's own messages.
189
+ */
190
+ exports.SHORT_LINK_CONTROLS = {
191
+ TAGS_PATH: '/tags',
192
+ HEALTH_CHECK_PATH: '/health-check',
193
+ /** `?tags=a,b` and the Tags field are split on this. */
194
+ TAGS_SEPARATOR: ',',
195
+ /** `GET /api/link-campaign` page size for the Campaign dropdown. */
196
+ CAMPAIGN_LOOKUP_PAGE_SIZE: 100,
197
+ /** Answer of Check Health (the API answers 202 with no body). */
198
+ HEALTH_CHECK_QUEUED: { queued: true },
199
+ };
200
+ /** Retargeting pixel providers (`pixelsJoi`). */
201
+ exports.LINK_PIXEL_PROVIDERS = ['meta', 'googleAds', 'tiktok', 'linkedin', 'x', 'pinterest'];
202
+ /** Campaign colours (`LINK_CAMPAIGN_COLORS`). */
203
+ exports.LINK_CAMPAIGN_COLORS = [
204
+ 'slate', 'red', 'orange', 'amber', 'green', 'teal', 'blue', 'indigo', 'purple', 'pink',
205
+ ];
206
+ /** Routing rule condition values (documented in the Routing Rules field). */
207
+ exports.LINK_ROUTING_DEVICES = ['tablet', 'mobile', 'desktop', 'other'];
208
+ exports.LINK_ROUTING_OS = ['android', 'ios', 'windows', 'macos', 'linux'];
209
+ /** The UTM keys a link or a campaign carries. */
210
+ exports.LINK_UTM_KEYS = ['source', 'medium', 'campaign', 'term', 'content'];
211
+ /** The access keys of a link (`password` and `removePassword` handled apart). */
212
+ exports.LINK_ACCESS_KEYS = ['activeFrom', 'expiresAt', 'maxVisits', 'fallbackUrl'];
213
+ exports.SHORT_LINK_CONTROLS_MESSAGES = {
214
+ INVALID_JSON: (field) => `${field} must be a JSON array, e.g. [] or [{ ... }]`,
215
+ CAMPAIGN_NAME_REQUIRED: 'Campaign Name is required',
216
+ ID_REQUIRED: (field) => `${field} is required`,
217
+ };
218
+ /**
219
+ * Optimistic concurrency (optimistic-concurrency feature, D-5/D-6/D-18). v2 of
220
+ * the nodes with update/delete operations sends the Version field as
221
+ * `If-Match`; v1 keeps last-write-wins by reading the item's `__v` first.
222
+ */
223
+ exports.VERSIONED_WRITES = {
224
+ IF_MATCH_HEADER: 'If-Match',
225
+ CONFLICT_CODE: 'VERSION_CONFLICT',
226
+ /** The node version that carries the Version field. */
227
+ FIRST_VERSIONED_NODE_VERSION: 2,
228
+ VERSION_PARAMETER: 'expectedVersion',
229
+ OPTIONS_PARAMETER: 'versionOptions',
230
+ /** The v1-only legacy notice (display only, no value). */
231
+ V1_NOTICE_PARAMETER: 'legacyVersionNotice',
232
+ ON_UNKNOWN_FAIL: 'fail',
233
+ ON_UNKNOWN_USE_LATEST: 'useLatest',
234
+ DEFAULT_VERSION_EXPRESSION: '={{ $json.__v }}',
235
+ CONFLICT_MESSAGE: (currentVersion) => `The item changed since it was read${typeof currentVersion === 'number' ? ` (current version ${currentVersion})` : ''}. Get it again, then update.`,
236
+ UNKNOWN_VERSION_MESSAGE: 'Version is required: map the __v of a Get step, or set Version Options > On Unknown Version to Use Latest (Overwrite).',
237
+ V1_DEPRECATION_NOTE: 'Version 1 of this node is legacy: its update and delete operations read the item first and overwrite it (last write wins). Add the node again to get version 2, which fails on a conflict instead.',
238
+ };
25
239
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../utils/constants.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,mBAAmB,GAAG,wBAAwB,CAAC;AAE/C,QAAA,aAAa,GAAG;IAC5B,UAAU,EAAE,iBAAiB;IAC7B,OAAO,EAAE,cAAc;IACvB,YAAY,EAAE,mBAAmB;IACjC,eAAe,EAAE,mCAAmC;IACpD,0BAA0B,EAAE,iCAAiC;IAC7D,qBAAqB,EAAE,4BAA4B;CAC1C,CAAC;AAEE,QAAA,kBAAkB,GAAG;IACjC,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,EAAE;CACH,CAAC;AAEE,QAAA,YAAY,GAAG;IAC3B,OAAO,EAAE,KAAK,EAAE,aAAa;IAC7B,MAAM,EAAE,MAAM,EAAE,wBAAwB;CAC/B,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../utils/constants.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAA4D;AAE/C,QAAA,mBAAmB,GAAG,wBAAwB,CAAC;AAE5D;;;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CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAExF,iDAAiD;AACpC,QAAA,aAAa,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAE1F,iFAAiF;AACpE,QAAA,gBAAgB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,CAAU,CAAC;AAEpF,QAAA,4BAA4B,GAAG;IAC3C,YAAY,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,KAAK,6CAA6C;IACtF,sBAAsB,EAAE,2BAA2B;IACnD,WAAW,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,KAAK,cAAc;CAC7C,CAAC;AAEX;;;;GAIG;AACU,QAAA,gBAAgB,GAAG;IAC/B,eAAe,EAAE,UAAU;IAC3B,aAAa,EAAE,kBAAkB;IACjC,uDAAuD;IACvD,4BAA4B,EAAE,CAAC;IAC/B,iBAAiB,EAAE,iBAAiB;IACpC,iBAAiB,EAAE,gBAAgB;IACnC,0DAA0D;IAC1D,mBAAmB,EAAE,qBAAqB;IAC1C,eAAe,EAAE,MAAM;IACvB,qBAAqB,EAAE,WAAW;IAClC,0BAA0B,EAAE,kBAAkB;IAC9C,gBAAgB,EAAE,CAAC,cAAuB,EAAE,EAAE,CAC7C,qCAAqC,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,qBAAqB,cAAc,GAAG,CAAC,CAAC,CAAC,EAAE,8BAA8B;IACpJ,uBAAuB,EACtB,wHAAwH;IACzH,mBAAmB,EAClB,oMAAoM;CAC5L,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Calendar-day helpers. A "day key" is `YYYY-MM-DD`, the date format the
3
+ * Posty5 analytics query takes. Every day-key computation in this package goes
4
+ * through here (AI_RULES §3).
5
+ */
6
+ /**
7
+ * The day key `date` falls on in the IANA zone `timeZone`.
8
+ * @throws RangeError when `timeZone` is not a zone the runtime knows.
9
+ */
10
+ export declare function toDayKey(date: Date, timeZone: string): string;
11
+ /** Whether the runtime knows `timeZone` as an IANA zone. */
12
+ export declare function isKnownTimeZone(timeZone: string): boolean;
13
+ /** `dayKey` moved by `days` (negative goes back). */
14
+ export declare function shiftDayKey(dayKey: string, days: number): string;
15
+ /**
16
+ * The day a date parameter names, as a day key; `undefined` when it names none.
17
+ *
18
+ * - A string that starts with `YYYY-MM-DD` (what an n8n `dateTime` field holds,
19
+ * e.g. `2026-10-01T00:00:00`) → those ten characters, with no zone shift.
20
+ * - A `Date` → its UTC calendar day.
21
+ * - A Luxon `DateTime` (what `$now` / `$today` give in an expression) → its own
22
+ * calendar day (`toISODate()`).
23
+ */
24
+ export declare function parseDayKey(value: unknown): string | undefined;
25
+ //# sourceMappingURL=date.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.helpers.d.ts","sourceRoot":"","sources":["../../utils/date.helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAS7D;AAED,4DAA4D;AAC5D,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOzD;AAED,qDAAqD;AACrD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAa9D"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ /**
3
+ * Calendar-day helpers. A "day key" is `YYYY-MM-DD`, the date format the
4
+ * Posty5 analytics query takes. Every day-key computation in this package goes
5
+ * through here (AI_RULES §3).
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.toDayKey = toDayKey;
9
+ exports.isKnownTimeZone = isKnownTimeZone;
10
+ exports.shiftDayKey = shiftDayKey;
11
+ exports.parseDayKey = parseDayKey;
12
+ const constants_1 = require("./constants");
13
+ /**
14
+ * The day key `date` falls on in the IANA zone `timeZone`.
15
+ * @throws RangeError when `timeZone` is not a zone the runtime knows.
16
+ */
17
+ function toDayKey(date, timeZone) {
18
+ const parts = new Intl.DateTimeFormat('en-US', {
19
+ timeZone,
20
+ year: 'numeric',
21
+ month: '2-digit',
22
+ day: '2-digit',
23
+ }).formatToParts(date);
24
+ const byType = Object.fromEntries(parts.map((item) => [item.type, item.value]));
25
+ return `${byType.year}-${byType.month}-${byType.day}`;
26
+ }
27
+ /** Whether the runtime knows `timeZone` as an IANA zone. */
28
+ function isKnownTimeZone(timeZone) {
29
+ try {
30
+ new Intl.DateTimeFormat('en-US', { timeZone });
31
+ return true;
32
+ }
33
+ catch {
34
+ return false;
35
+ }
36
+ }
37
+ /** `dayKey` moved by `days` (negative goes back). */
38
+ function shiftDayKey(dayKey, days) {
39
+ const midnight = Date.parse(`${dayKey}T00:00:00.000Z`);
40
+ return new Date(midnight + days * constants_1.MS_PER_DAY).toISOString().slice(0, 10);
41
+ }
42
+ /**
43
+ * The day a date parameter names, as a day key; `undefined` when it names none.
44
+ *
45
+ * - A string that starts with `YYYY-MM-DD` (what an n8n `dateTime` field holds,
46
+ * e.g. `2026-10-01T00:00:00`) → those ten characters, with no zone shift.
47
+ * - A `Date` → its UTC calendar day.
48
+ * - A Luxon `DateTime` (what `$now` / `$today` give in an expression) → its own
49
+ * calendar day (`toISODate()`).
50
+ */
51
+ function parseDayKey(value) {
52
+ if (typeof value === 'string') {
53
+ const match = constants_1.DAY_KEY_PATTERN.exec(value.trim());
54
+ return match ? match[0] : undefined;
55
+ }
56
+ if (value instanceof Date) {
57
+ return Number.isNaN(value.getTime()) ? undefined : value.toISOString().slice(0, 10);
58
+ }
59
+ if (value && typeof value.toISODate === 'function') {
60
+ const isoDate = value.toISODate();
61
+ return isoDate ? parseDayKey(isoDate) : undefined;
62
+ }
63
+ return undefined;
64
+ }
65
+ //# sourceMappingURL=date.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.helpers.js","sourceRoot":"","sources":["../../utils/date.helpers.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAQH,4BASC;AAGD,0CAOC;AAGD,kCAGC;AAWD,kCAaC;AAvDD,2CAA0D;AAE1D;;;GAGG;AACH,SAAgB,QAAQ,CAAC,IAAU,EAAE,QAAgB;IACpD,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;QAC9C,QAAQ;QACR,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,SAAS;KACd,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;AACvD,CAAC;AAED,4DAA4D;AAC5D,SAAgB,eAAe,CAAC,QAAgB;IAC/C,IAAI,CAAC;QACJ,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED,qDAAqD;AACrD,SAAgB,WAAW,CAAC,MAAc,EAAE,IAAY;IACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,MAAM,gBAAgB,CAAC,CAAC;IACvD,OAAO,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,sBAAU,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,WAAW,CAAC,KAAc;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,2BAAe,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACjD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrC,CAAC;IACD,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACrF,CAAC;IACD,IAAI,KAAK,IAAI,OAAQ,KAAiC,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;QACjF,MAAM,OAAO,GAAI,KAA4C,CAAC,SAAS,EAAE,CAAC;QAC1E,OAAO,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnD,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * *Create Many* on the Short Link and QR Code nodes.
3
+ *
4
+ * Every input item is mapped to one row with the same field reading as
5
+ * *Create*; the rows are sent in chunks to the sync bulk route and every input
6
+ * item gets exactly one output item (`pairedItem` = its index) carrying the
7
+ * row's result. A refused row is an output item with `status: "failed"`, not a
8
+ * thrown error, unless *Fail on Any Row Error* is on.
9
+ */
10
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
11
+ import type { BulkPreparedRow, IBulkDefaults, IBulkNodeOptions, IBulkRoute } from '../types/link-bulk.types';
12
+ /** The *Defaults* collection as the body's `defaults`, empty values left out. */
13
+ export declare function readBulkDefaults(raw: Record<string, unknown> | undefined): IBulkDefaults;
14
+ /** *Batch Size* clamped to 1..100 (100 when unset or not a number). */
15
+ export declare function readBatchSize(value: unknown): number;
16
+ /** `n8n-<executionId>-<nodeName>-<chunk>`: one execution retried is deduped, a new run is not. */
17
+ export declare function buildBulkIdempotencyKey(executionId: string, nodeName: string, chunk: number): string;
18
+ /** Map every input item to a row; an item whose mapping throws becomes a local failure and is not sent. */
19
+ export declare function prepareBulkRows<TRow>(count: number, mapItem: (itemIndex: number) => TRow): BulkPreparedRow<TRow>[];
20
+ /**
21
+ * Send the prepared rows in chunks and answer one output item per input item,
22
+ * in input order. A whole-request error (403 gate, 400 credits) throws, or,
23
+ * with `continueOnFail()`, becomes `{ error }` on every item of that chunk.
24
+ */
25
+ export declare function executeBulkCreate<TRow>(ctx: IExecuteFunctions, apiKey: string, route: IBulkRoute<TRow>, prepared: BulkPreparedRow<TRow>[], defaults: IBulkDefaults, options: IBulkNodeOptions): Promise<INodeExecutionData[]>;
26
+ //# sourceMappingURL=link-bulk.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-bulk.helpers.d.ts","sourceRoot":"","sources":["../../utils/link-bulk.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAsB,MAAM,cAAc,CAAC;AAIzF,OAAO,KAAK,EACX,eAAe,EAEf,aAAa,EACb,gBAAgB,EAChB,UAAU,EAEV,MAAM,0BAA0B,CAAC;AAElC,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,aAAa,CASxF;AAED,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIpD;AAED,kGAAkG;AAClG,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpG;AAED,2GAA2G;AAC3G,wBAAgB,eAAe,CAAC,IAAI,EACnC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,GAClC,eAAe,CAAC,IAAI,CAAC,EAAE,CAUzB;AAsBD;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAC3C,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,EACvB,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,EACjC,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,gBAAgB,GACvB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA4D/B"}