@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.
- package/README.md +364 -16
- package/dist/credentials/Posty5Api.credentials.d.ts +4 -0
- package/dist/credentials/Posty5Api.credentials.d.ts.map +1 -1
- package/dist/credentials/Posty5Api.credentials.js +30 -4
- package/dist/credentials/Posty5Api.credentials.js.map +1 -1
- package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.d.ts.map +1 -1
- package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.js +6 -2
- package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.js.map +1 -1
- package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.d.ts.map +1 -1
- package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.js +14 -3
- package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.js.map +1 -1
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.d.ts +8 -0
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.d.ts.map +1 -1
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js +885 -190
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js.map +1 -1
- package/dist/nodes/Posty5QrCode/helpers.d.ts +12 -0
- package/dist/nodes/Posty5QrCode/helpers.d.ts.map +1 -0
- package/dist/nodes/Posty5QrCode/helpers.js +56 -0
- package/dist/nodes/Posty5QrCode/helpers.js.map +1 -0
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.d.ts +8 -0
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.d.ts.map +1 -1
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.js +389 -78
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.js.map +1 -1
- package/dist/nodes/Posty5ShortLink/helpers.d.ts +12 -0
- package/dist/nodes/Posty5ShortLink/helpers.d.ts.map +1 -0
- package/dist/nodes/Posty5ShortLink/helpers.js +46 -0
- package/dist/nodes/Posty5ShortLink/helpers.js.map +1 -0
- package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.d.ts.map +1 -1
- package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.js +143 -52
- package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.js.map +1 -1
- package/dist/nodes/Posty5Store/Posty5Store.node.d.ts +17 -0
- package/dist/nodes/Posty5Store/Posty5Store.node.d.ts.map +1 -0
- package/dist/nodes/Posty5Store/Posty5Store.node.js +230 -0
- package/dist/nodes/Posty5Store/Posty5Store.node.js.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.d.ts +4 -0
- package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.d.ts.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.js +55 -0
- package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.js.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/order.description.d.ts +4 -0
- package/dist/nodes/Posty5Store/descriptions/order.description.d.ts.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/order.description.js +91 -0
- package/dist/nodes/Posty5Store/descriptions/order.description.js.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/product-link.description.d.ts +4 -0
- package/dist/nodes/Posty5Store/descriptions/product-link.description.d.ts.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/product-link.description.js +48 -0
- package/dist/nodes/Posty5Store/descriptions/product-link.description.js.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/supplier-order.description.d.ts +4 -0
- package/dist/nodes/Posty5Store/descriptions/supplier-order.description.d.ts.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/supplier-order.description.js +118 -0
- package/dist/nodes/Posty5Store/descriptions/supplier-order.description.js.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/supplier-product.description.d.ts +4 -0
- package/dist/nodes/Posty5Store/descriptions/supplier-product.description.d.ts.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/supplier-product.description.js +167 -0
- package/dist/nodes/Posty5Store/descriptions/supplier-product.description.js.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/supplier.description.d.ts +4 -0
- package/dist/nodes/Posty5Store/descriptions/supplier.description.d.ts.map +1 -0
- package/dist/nodes/Posty5Store/descriptions/supplier.description.js +50 -0
- package/dist/nodes/Posty5Store/descriptions/supplier.description.js.map +1 -0
- package/dist/nodes/Posty5Trigger/Posty5Trigger.node.d.ts +13 -0
- package/dist/nodes/Posty5Trigger/Posty5Trigger.node.d.ts.map +1 -0
- package/dist/nodes/Posty5Trigger/Posty5Trigger.node.js +171 -0
- package/dist/nodes/Posty5Trigger/Posty5Trigger.node.js.map +1 -0
- package/dist/nodes/Posty5Trigger/config.d.ts +51 -0
- package/dist/nodes/Posty5Trigger/config.d.ts.map +1 -0
- package/dist/nodes/Posty5Trigger/config.js +76 -0
- package/dist/nodes/Posty5Trigger/config.js.map +1 -0
- package/dist/nodes/Posty5Trigger/descriptions.d.ts +4 -0
- package/dist/nodes/Posty5Trigger/descriptions.d.ts.map +1 -0
- package/dist/nodes/Posty5Trigger/descriptions.js +99 -0
- package/dist/nodes/Posty5Trigger/descriptions.js.map +1 -0
- package/dist/nodes/Posty5Trigger/helpers.d.ts +34 -0
- package/dist/nodes/Posty5Trigger/helpers.d.ts.map +1 -0
- package/dist/nodes/Posty5Trigger/helpers.js +139 -0
- package/dist/nodes/Posty5Trigger/helpers.js.map +1 -0
- package/dist/package.json +78 -0
- package/dist/types/common.d.ts +70 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/link-analytics.types.d.ts +147 -0
- package/dist/types/link-analytics.types.d.ts.map +1 -0
- package/dist/types/link-analytics.types.js +10 -0
- package/dist/types/link-analytics.types.js.map +1 -0
- package/dist/types/link-bulk.types.d.ts +68 -0
- package/dist/types/link-bulk.types.d.ts.map +1 -0
- package/dist/types/link-bulk.types.js +8 -0
- package/dist/types/link-bulk.types.js.map +1 -0
- package/dist/types/qr-code.types.d.ts +252 -56
- package/dist/types/qr-code.types.d.ts.map +1 -1
- package/dist/types/short-link-controls.types.d.ts +82 -0
- package/dist/types/short-link-controls.types.d.ts.map +1 -0
- package/dist/types/short-link-controls.types.js +7 -0
- package/dist/types/short-link-controls.types.js.map +1 -0
- package/dist/types/short-link.types.d.ts +63 -15
- package/dist/types/short-link.types.d.ts.map +1 -1
- package/dist/types/store.types.d.ts +71 -0
- package/dist/types/store.types.d.ts.map +1 -0
- package/dist/types/store.types.js +7 -0
- package/dist/types/store.types.js.map +1 -0
- package/dist/types/webhook.types.d.ts +66 -0
- package/dist/types/webhook.types.d.ts.map +1 -0
- package/dist/types/webhook.types.js +7 -0
- package/dist/types/webhook.types.js.map +1 -0
- package/dist/utils/analytics.helpers.d.ts +68 -0
- package/dist/utils/analytics.helpers.d.ts.map +1 -0
- package/dist/utils/analytics.helpers.js +202 -0
- package/dist/utils/analytics.helpers.js.map +1 -0
- package/dist/utils/analytics.properties.d.ts +10 -0
- package/dist/utils/analytics.properties.d.ts.map +1 -0
- package/dist/utils/analytics.properties.js +172 -0
- package/dist/utils/analytics.properties.js.map +1 -0
- package/dist/utils/api.helpers.d.ts +50 -3
- package/dist/utils/api.helpers.d.ts.map +1 -1
- package/dist/utils/api.helpers.js +170 -7
- package/dist/utils/api.helpers.js.map +1 -1
- package/dist/utils/constants.d.ts +239 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +260 -1
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/date.helpers.d.ts +25 -0
- package/dist/utils/date.helpers.d.ts.map +1 -0
- package/dist/utils/date.helpers.js +65 -0
- package/dist/utils/date.helpers.js.map +1 -0
- package/dist/utils/link-bulk.helpers.d.ts +26 -0
- package/dist/utils/link-bulk.helpers.d.ts.map +1 -0
- package/dist/utils/link-bulk.helpers.js +135 -0
- package/dist/utils/link-bulk.helpers.js.map +1 -0
- package/dist/utils/link-bulk.properties.d.ts +9 -0
- package/dist/utils/link-bulk.properties.d.ts.map +1 -0
- package/dist/utils/link-bulk.properties.js +113 -0
- package/dist/utils/link-bulk.properties.js.map +1 -0
- package/dist/utils/link-tool.helpers.d.ts +43 -0
- package/dist/utils/link-tool.helpers.d.ts.map +1 -0
- package/dist/utils/link-tool.helpers.js +121 -0
- package/dist/utils/link-tool.helpers.js.map +1 -0
- package/dist/utils/post-comments.d.ts +43 -0
- package/dist/utils/post-comments.d.ts.map +1 -0
- package/dist/utils/post-comments.js +53 -0
- package/dist/utils/post-comments.js.map +1 -0
- package/dist/utils/qr-content.config.d.ts +66 -0
- package/dist/utils/qr-content.config.d.ts.map +1 -0
- package/dist/utils/qr-content.config.js +139 -0
- package/dist/utils/qr-content.config.js.map +1 -0
- package/dist/utils/qr-file.helpers.d.ts +22 -0
- package/dist/utils/qr-file.helpers.d.ts.map +1 -0
- package/dist/utils/qr-file.helpers.js +63 -0
- package/dist/utils/qr-file.helpers.js.map +1 -0
- package/dist/utils/qr-render.helpers.d.ts +48 -0
- package/dist/utils/qr-render.helpers.d.ts.map +1 -0
- package/dist/utils/qr-render.helpers.js +172 -0
- package/dist/utils/qr-render.helpers.js.map +1 -0
- package/dist/utils/qr-render.properties.d.ts +8 -0
- package/dist/utils/qr-render.properties.d.ts.map +1 -0
- package/dist/utils/qr-render.properties.js +143 -0
- package/dist/utils/qr-render.properties.js.map +1 -0
- package/dist/utils/qr-target.helpers.d.ts +35 -0
- package/dist/utils/qr-target.helpers.d.ts.map +1 -0
- package/dist/utils/qr-target.helpers.js +260 -0
- package/dist/utils/qr-target.helpers.js.map +1 -0
- package/dist/utils/qr-templates.helpers.d.ts +26 -0
- package/dist/utils/qr-templates.helpers.d.ts.map +1 -0
- package/dist/utils/qr-templates.helpers.js +70 -0
- package/dist/utils/qr-templates.helpers.js.map +1 -0
- package/dist/utils/short-link-controls.helpers.d.ts +31 -0
- package/dist/utils/short-link-controls.helpers.d.ts.map +1 -0
- package/dist/utils/short-link-controls.helpers.js +185 -0
- package/dist/utils/short-link-controls.helpers.js.map +1 -0
- package/dist/utils/short-link-controls.properties.d.ts +17 -0
- package/dist/utils/short-link-controls.properties.d.ts.map +1 -0
- package/dist/utils/short-link-controls.properties.js +315 -0
- package/dist/utils/short-link-controls.properties.js.map +1 -0
- package/dist/utils/store.helpers.d.ts +43 -0
- package/dist/utils/store.helpers.d.ts.map +1 -0
- package/dist/utils/store.helpers.js +87 -0
- package/dist/utils/store.helpers.js.map +1 -0
- package/dist/utils/versioned-write.helpers.d.ts +31 -0
- package/dist/utils/versioned-write.helpers.d.ts.map +1 -0
- package/dist/utils/versioned-write.helpers.js +120 -0
- package/dist/utils/versioned-write.helpers.js.map +1 -0
- package/package.json +7 -3
package/dist/utils/constants.js
CHANGED
|
@@ -4,22 +4,281 @@
|
|
|
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_RENDER_MESSAGES = exports.QR_RENDER = 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
|
+
* QR Code *Render*, *Check Scannability* and *List Templates* (QR design and
|
|
77
|
+
* export, K6): `GET /api/qr-code/:id/render`, `POST /api/qr-code/scannability-check`,
|
|
78
|
+
* the two template lookups, and the print presets of
|
|
79
|
+
* `GET /api/qr-code-template/design-catalogue`. Values mirror the API's schemas.
|
|
80
|
+
* SVG, PDF, a preset, a DPI or a PNG over 2048 px need a paid plan; the API's
|
|
81
|
+
* 403 text is shown unchanged.
|
|
82
|
+
*/
|
|
83
|
+
exports.QR_RENDER = {
|
|
84
|
+
RENDER_PATH_SEGMENT: 'render',
|
|
85
|
+
SCANNABILITY_PATH: '/scannability-check',
|
|
86
|
+
CATALOGUE_PATH: '/design-catalogue',
|
|
87
|
+
FORMATS: ['png', 'svg', 'pdf'],
|
|
88
|
+
DEFAULT_FORMAT: 'png',
|
|
89
|
+
/** The API's MIME type per format, used when the answer carries none. */
|
|
90
|
+
MIME_TYPES: {
|
|
91
|
+
png: 'image/png',
|
|
92
|
+
svg: 'image/svg+xml',
|
|
93
|
+
pdf: 'application/pdf',
|
|
94
|
+
},
|
|
95
|
+
DPI_VALUES: [150, 300, 600],
|
|
96
|
+
DEFAULT_DPI: 300,
|
|
97
|
+
/** `presetId` value that takes a width in mm (`customMm`). */
|
|
98
|
+
CUSTOM_PRESET_ID: 'custom',
|
|
99
|
+
CUSTOM_MM_MIN: 20,
|
|
100
|
+
CUSTOM_MM_MAX: 500,
|
|
101
|
+
DEFAULT_CUSTOM_MM: 50,
|
|
102
|
+
SIZE_PX_MIN: 64,
|
|
103
|
+
SIZE_PX_MAX: 6000,
|
|
104
|
+
DEFAULT_SIZE_PX: 1024,
|
|
105
|
+
DEFAULT_BINARY_PROPERTY: 'data',
|
|
106
|
+
/** Any value: the API answers an attachment named `<name>-<preset|size>.<ext>`. */
|
|
107
|
+
DOWNLOAD_FLAG: '1',
|
|
108
|
+
/** File name when the answer has no `Content-Disposition`: `qr-code-<id>.<ext>`. */
|
|
109
|
+
FALLBACK_FILE_NAME_PREFIX: 'qr-code-',
|
|
110
|
+
/** The "no preset" option of the Print Preset dropdown. */
|
|
111
|
+
NO_PRESET_LABEL: 'None (Size in Pixels)',
|
|
112
|
+
LIST_TEMPLATES_DEFAULT_LIMIT: 50,
|
|
113
|
+
LIST_TEMPLATES_MAX_LIMIT: 100,
|
|
114
|
+
};
|
|
115
|
+
/** Errors the QR render operations raise before any request. */
|
|
116
|
+
exports.QR_RENDER_MESSAGES = {
|
|
117
|
+
unknownFormat: (format) => `Unknown format "${format}". Use png, svg or pdf.`,
|
|
118
|
+
idRequired: (what) => `${what} is required`,
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* The QR types the API validates (`/api/qr-code/:type`). The node's QR Type
|
|
122
|
+
* values are these, and `qrCodeTarget.type` is always one of them.
|
|
123
|
+
*/
|
|
124
|
+
exports.QR_CODE_TYPES = [
|
|
125
|
+
'url',
|
|
126
|
+
'freeText',
|
|
127
|
+
'email',
|
|
128
|
+
'wifi',
|
|
129
|
+
'call',
|
|
130
|
+
'sms',
|
|
131
|
+
'geolocation',
|
|
132
|
+
'vcard',
|
|
133
|
+
'event',
|
|
134
|
+
'whatsapp',
|
|
135
|
+
'review',
|
|
136
|
+
'social',
|
|
137
|
+
'appStore',
|
|
138
|
+
'file',
|
|
139
|
+
];
|
|
140
|
+
/** WiFi authentication values: the node's default, and the one that means "open network" (no password is sent). */
|
|
141
|
+
exports.QR_WIFI_AUTH = {
|
|
142
|
+
DEFAULT: 'WPA',
|
|
143
|
+
OPEN_NETWORK: 'nopass',
|
|
144
|
+
};
|
|
145
|
+
/** The Short Link fields that set a device's destination by hand (S13). */
|
|
146
|
+
exports.SHORT_LINK_DEEP_LINK_FIELDS = ['androidUrl', 'iosUrl'];
|
|
147
|
+
/** Errors the Short Link and QR Code nodes raise before calling the API. */
|
|
148
|
+
exports.LINK_TOOL_MESSAGES = {
|
|
149
|
+
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.',
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* *Get Analytics* on the Short Link and QR Code nodes:
|
|
153
|
+
* `GET <SHORT_LINK|QR_CODE>/:id/analytics` (contract C2). The breakdown names,
|
|
154
|
+
* intervals, the `all` value and the limit bounds mirror the API's query schema.
|
|
155
|
+
*/
|
|
156
|
+
exports.LINK_ANALYTICS = {
|
|
157
|
+
/** Path segment after `/:id`. */
|
|
158
|
+
PATH_SEGMENT: 'analytics',
|
|
159
|
+
/** `breakdown` value asking for every breakdown the owner's plan allows. */
|
|
160
|
+
ALL_BREAKDOWNS: 'all',
|
|
161
|
+
/** Separator of an explicit `breakdown` list. */
|
|
162
|
+
BREAKDOWN_SEPARATOR: ',',
|
|
163
|
+
/** Days of each preset range, today included. */
|
|
164
|
+
RANGE_DAYS: {
|
|
165
|
+
last7Days: 7,
|
|
166
|
+
last30Days: 30,
|
|
167
|
+
last90Days: 90,
|
|
168
|
+
},
|
|
169
|
+
/** The Range a new node starts with: the API's own default span. */
|
|
170
|
+
DEFAULT_RANGE: 'last30Days',
|
|
171
|
+
DEFAULT_INTERVAL: 'day',
|
|
172
|
+
/** The Output a new node starts with: the API answer, unchanged. */
|
|
173
|
+
DEFAULT_OUTPUT: 'response',
|
|
174
|
+
/** Rows per breakdown: the API's default and maximum. */
|
|
175
|
+
LIMIT_DEFAULT: 10,
|
|
176
|
+
LIMIT_MIN: 1,
|
|
177
|
+
LIMIT_MAX: 50,
|
|
178
|
+
/** The status the API answers for a breakdown or a range the owner's plan does not include. */
|
|
179
|
+
PLAN_GATE_HTTP_CODE: '403',
|
|
180
|
+
/** The zone used when neither the Time Zone option nor the workflow names one. */
|
|
181
|
+
FALLBACK_TIME_ZONE: 'UTC',
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* *Get Statistics* on the Short Link and QR Code nodes: account-wide counts
|
|
185
|
+
* over the caller's records, `GET <SHORT_LINK|QR_CODE>/statistics`. The periods
|
|
186
|
+
* are the API's own `period` values; days are UTC days on the server.
|
|
187
|
+
*/
|
|
188
|
+
exports.LINK_STATISTICS = {
|
|
189
|
+
PATH_SEGMENT: 'statistics',
|
|
190
|
+
/** The API's default period. */
|
|
191
|
+
DEFAULT_PERIOD: '30d',
|
|
192
|
+
CUSTOM_PERIOD: 'custom',
|
|
193
|
+
};
|
|
194
|
+
/** Errors *Get Analytics* and *Get Statistics* raise before calling the API. */
|
|
195
|
+
exports.LINK_ANALYTICS_MESSAGES = {
|
|
196
|
+
ID_REQUIRED: 'The ID is required to read analytics.',
|
|
197
|
+
CUSTOM_RANGE_REQUIRED: 'A Custom range needs both From and To dates.',
|
|
198
|
+
INVALID_DATE: 'is not a date. Use a date such as 2026-10-01.',
|
|
199
|
+
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.',
|
|
200
|
+
};
|
|
201
|
+
/** `YYYY-MM-DD` at the start of a date string (the day an n8n `dateTime` value names). */
|
|
202
|
+
exports.DAY_KEY_PATTERN = /^\d{4}-\d{2}-\d{2}/;
|
|
203
|
+
/** Milliseconds in one calendar day (day keys are shifted on UTC midnights, so no DST applies). */
|
|
204
|
+
exports.MS_PER_DAY = 24 * 60 * 60 * 1000;
|
|
205
|
+
/**
|
|
206
|
+
* *Create Many* on the Short Link and QR Code nodes: `POST <SHORT_LINK|QR_CODE>/bulk`
|
|
207
|
+
* (link-qr-bulk-and-webhooks contract). Rows are sent in chunks of at most
|
|
208
|
+
* `MAX_BATCH_SIZE`; each chunk carries `Idempotency-Key:
|
|
209
|
+
* n8n-<executionId>-<nodeName>-<chunk>`, so retrying the same execution is
|
|
210
|
+
* charged once while a new run is not deduped.
|
|
211
|
+
*/
|
|
212
|
+
exports.LINK_BULK = {
|
|
213
|
+
PATH_SEGMENT: 'bulk',
|
|
214
|
+
MAX_BATCH_SIZE: 100,
|
|
215
|
+
DEFAULT_BATCH_SIZE: 100,
|
|
216
|
+
IDEMPOTENCY_HEADER: 'Idempotency-Key',
|
|
217
|
+
IDEMPOTENCY_PREFIX: 'n8n',
|
|
218
|
+
ROW_STATUS_CREATED: 'created',
|
|
219
|
+
ROW_STATUS_FAILED: 'failed',
|
|
220
|
+
};
|
|
221
|
+
/** Errors *Create Many* raises. */
|
|
222
|
+
exports.LINK_BULK_MESSAGES = {
|
|
223
|
+
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.',
|
|
224
|
+
ROW_FAILED: 'Posty5 refused a row of Create Many',
|
|
225
|
+
MISSING_ROW_RESULT: 'The Posty5 API returned no result for this row',
|
|
226
|
+
};
|
|
21
227
|
exports.API_TIMEOUTS = {
|
|
22
228
|
DEFAULT: 30000, // 30 seconds
|
|
23
229
|
UPLOAD: 120000, // 2 minutes for uploads
|
|
24
230
|
};
|
|
231
|
+
/**
|
|
232
|
+
* Short link controls (short-link-controls): sub-paths under `/api/short-link`,
|
|
233
|
+
* the enums the API's Joi schemas accept, and the node's own messages.
|
|
234
|
+
*/
|
|
235
|
+
exports.SHORT_LINK_CONTROLS = {
|
|
236
|
+
TAGS_PATH: '/tags',
|
|
237
|
+
HEALTH_CHECK_PATH: '/health-check',
|
|
238
|
+
/** `?tags=a,b` and the Tags field are split on this. */
|
|
239
|
+
TAGS_SEPARATOR: ',',
|
|
240
|
+
/** `GET /api/link-campaign` page size for the Campaign dropdown. */
|
|
241
|
+
CAMPAIGN_LOOKUP_PAGE_SIZE: 100,
|
|
242
|
+
/** Answer of Check Health (the API answers 202 with no body). */
|
|
243
|
+
HEALTH_CHECK_QUEUED: { queued: true },
|
|
244
|
+
};
|
|
245
|
+
/** Retargeting pixel providers (`pixelsJoi`). */
|
|
246
|
+
exports.LINK_PIXEL_PROVIDERS = ['meta', 'googleAds', 'tiktok', 'linkedin', 'x', 'pinterest'];
|
|
247
|
+
/** Campaign colours (`LINK_CAMPAIGN_COLORS`). */
|
|
248
|
+
exports.LINK_CAMPAIGN_COLORS = [
|
|
249
|
+
'slate', 'red', 'orange', 'amber', 'green', 'teal', 'blue', 'indigo', 'purple', 'pink',
|
|
250
|
+
];
|
|
251
|
+
/** Routing rule condition values (documented in the Routing Rules field). */
|
|
252
|
+
exports.LINK_ROUTING_DEVICES = ['tablet', 'mobile', 'desktop', 'other'];
|
|
253
|
+
exports.LINK_ROUTING_OS = ['android', 'ios', 'windows', 'macos', 'linux'];
|
|
254
|
+
/** The UTM keys a link or a campaign carries. */
|
|
255
|
+
exports.LINK_UTM_KEYS = ['source', 'medium', 'campaign', 'term', 'content'];
|
|
256
|
+
/** The access keys of a link (`password` and `removePassword` handled apart). */
|
|
257
|
+
exports.LINK_ACCESS_KEYS = ['activeFrom', 'expiresAt', 'maxVisits', 'fallbackUrl'];
|
|
258
|
+
exports.SHORT_LINK_CONTROLS_MESSAGES = {
|
|
259
|
+
INVALID_JSON: (field) => `${field} must be a JSON array, e.g. [] or [{ ... }]`,
|
|
260
|
+
CAMPAIGN_NAME_REQUIRED: 'Campaign Name is required',
|
|
261
|
+
ID_REQUIRED: (field) => `${field} is required`,
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Optimistic concurrency (optimistic-concurrency feature, D-5/D-6/D-18). v2 of
|
|
265
|
+
* the nodes with update/delete operations sends the Version field as
|
|
266
|
+
* `If-Match`; v1 keeps last-write-wins by reading the item's `__v` first.
|
|
267
|
+
*/
|
|
268
|
+
exports.VERSIONED_WRITES = {
|
|
269
|
+
IF_MATCH_HEADER: 'If-Match',
|
|
270
|
+
CONFLICT_CODE: 'VERSION_CONFLICT',
|
|
271
|
+
/** The node version that carries the Version field. */
|
|
272
|
+
FIRST_VERSIONED_NODE_VERSION: 2,
|
|
273
|
+
VERSION_PARAMETER: 'expectedVersion',
|
|
274
|
+
OPTIONS_PARAMETER: 'versionOptions',
|
|
275
|
+
/** The v1-only legacy notice (display only, no value). */
|
|
276
|
+
V1_NOTICE_PARAMETER: 'legacyVersionNotice',
|
|
277
|
+
ON_UNKNOWN_FAIL: 'fail',
|
|
278
|
+
ON_UNKNOWN_USE_LATEST: 'useLatest',
|
|
279
|
+
DEFAULT_VERSION_EXPRESSION: '={{ $json.__v }}',
|
|
280
|
+
CONFLICT_MESSAGE: (currentVersion) => `The item changed since it was read${typeof currentVersion === 'number' ? ` (current version ${currentVersion})` : ''}. Get it again, then update.`,
|
|
281
|
+
UNKNOWN_VERSION_MESSAGE: 'Version is required: map the __v of a Get step, or set Version Options > On Unknown Version to Use Latest (Overwrite).',
|
|
282
|
+
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.',
|
|
283
|
+
};
|
|
25
284
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../utils/constants.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
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;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG;IAChC,MAAM,EAAE,iBAAiB;IACzB,KAAK,EAAE,cAAc,sBAAc,EAAE;CAC5B,CAAC;AAEX;;;;GAIG;AACU,QAAA,mBAAmB,GAAG;IAClC,kBAAkB,EAAE,GAAG;IACvB,mBAAmB,EAAE,4BAA4B;IACjD,WAAW,EAAE,mBAAmB;IAChC,iBAAiB,EAAE,8CAA8C;CACxD,CAAC;AAEE,QAAA,aAAa,GAAG;IAC5B,eAAe,EAAE,sBAAsB;IACvC,UAAU,EAAE,iBAAiB;IAC7B,aAAa,EAAE,oBAAoB;IACnC,OAAO,EAAE,cAAc;IACvB,gBAAgB,EA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BAAiB;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"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* *Create Many* on the Short Link and QR Code nodes.
|
|
4
|
+
*
|
|
5
|
+
* Every input item is mapped to one row with the same field reading as
|
|
6
|
+
* *Create*; the rows are sent in chunks to the sync bulk route and every input
|
|
7
|
+
* item gets exactly one output item (`pairedItem` = its index) carrying the
|
|
8
|
+
* row's result. A refused row is an output item with `status: "failed"`, not a
|
|
9
|
+
* thrown error, unless *Fail on Any Row Error* is on.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.readBulkDefaults = readBulkDefaults;
|
|
13
|
+
exports.readBatchSize = readBatchSize;
|
|
14
|
+
exports.buildBulkIdempotencyKey = buildBulkIdempotencyKey;
|
|
15
|
+
exports.prepareBulkRows = prepareBulkRows;
|
|
16
|
+
exports.executeBulkCreate = executeBulkCreate;
|
|
17
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
18
|
+
const api_helpers_1 = require("./api.helpers");
|
|
19
|
+
const link_tool_helpers_1 = require("./link-tool.helpers");
|
|
20
|
+
const constants_1 = require("./constants");
|
|
21
|
+
/** The *Defaults* collection as the body's `defaults`, empty values left out. */
|
|
22
|
+
function readBulkDefaults(raw) {
|
|
23
|
+
const defaults = {};
|
|
24
|
+
const templateId = (0, link_tool_helpers_1.firstText)(raw?.templateId);
|
|
25
|
+
const tag = (0, link_tool_helpers_1.firstText)(raw?.tag);
|
|
26
|
+
const refId = (0, link_tool_helpers_1.firstText)(raw?.refId);
|
|
27
|
+
if (templateId)
|
|
28
|
+
defaults.templateId = templateId;
|
|
29
|
+
if (tag)
|
|
30
|
+
defaults.tag = tag;
|
|
31
|
+
if (refId)
|
|
32
|
+
defaults.refId = refId;
|
|
33
|
+
return defaults;
|
|
34
|
+
}
|
|
35
|
+
/** *Batch Size* clamped to 1..100 (100 when unset or not a number). */
|
|
36
|
+
function readBatchSize(value) {
|
|
37
|
+
const size = Math.floor(Number(value));
|
|
38
|
+
if (!Number.isFinite(size) || size < 1)
|
|
39
|
+
return constants_1.LINK_BULK.DEFAULT_BATCH_SIZE;
|
|
40
|
+
return Math.min(size, constants_1.LINK_BULK.MAX_BATCH_SIZE);
|
|
41
|
+
}
|
|
42
|
+
/** `n8n-<executionId>-<nodeName>-<chunk>`: one execution retried is deduped, a new run is not. */
|
|
43
|
+
function buildBulkIdempotencyKey(executionId, nodeName, chunk) {
|
|
44
|
+
return [constants_1.LINK_BULK.IDEMPOTENCY_PREFIX, executionId, nodeName, String(chunk)].join('-');
|
|
45
|
+
}
|
|
46
|
+
/** Map every input item to a row; an item whose mapping throws becomes a local failure and is not sent. */
|
|
47
|
+
function prepareBulkRows(count, mapItem) {
|
|
48
|
+
const prepared = [];
|
|
49
|
+
for (let i = 0; i < count; i++) {
|
|
50
|
+
try {
|
|
51
|
+
prepared.push({ row: mapItem(i) });
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
prepared.push({ error: error.message });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return prepared;
|
|
58
|
+
}
|
|
59
|
+
/** A failed row's output json. */
|
|
60
|
+
function failedRow(message) {
|
|
61
|
+
return { status: constants_1.LINK_BULK.ROW_STATUS_FAILED, errors: [{ message }] };
|
|
62
|
+
}
|
|
63
|
+
/** A row result as the item's json: the API's result without its request-relative `row`. */
|
|
64
|
+
function toRowJson(result) {
|
|
65
|
+
if (!result)
|
|
66
|
+
return failedRow(constants_1.LINK_BULK_MESSAGES.MISSING_ROW_RESULT);
|
|
67
|
+
const json = { ...result };
|
|
68
|
+
delete json.row;
|
|
69
|
+
return json;
|
|
70
|
+
}
|
|
71
|
+
/** A failed row's errors as one line, for *Fail on Any Row Error*. */
|
|
72
|
+
function rowErrorText(json) {
|
|
73
|
+
return (json.errors || [])
|
|
74
|
+
.map((error) => (error.field ? `${error.field}: ${error.message}` : error.message))
|
|
75
|
+
.join('; ');
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Send the prepared rows in chunks and answer one output item per input item,
|
|
79
|
+
* in input order. A whole-request error (403 gate, 400 credits) throws, or,
|
|
80
|
+
* with `continueOnFail()`, becomes `{ error }` on every item of that chunk.
|
|
81
|
+
*/
|
|
82
|
+
async function executeBulkCreate(ctx, apiKey, route, prepared, defaults, options) {
|
|
83
|
+
const output = new Array(prepared.length);
|
|
84
|
+
const sendable = [];
|
|
85
|
+
prepared.forEach((entry, itemIndex) => {
|
|
86
|
+
if ('row' in entry)
|
|
87
|
+
sendable.push({ itemIndex, row: entry.row });
|
|
88
|
+
else
|
|
89
|
+
output[itemIndex] = { json: failedRow(entry.error), pairedItem: { item: itemIndex } };
|
|
90
|
+
});
|
|
91
|
+
const batchSize = readBatchSize(options.batchSize);
|
|
92
|
+
const executionId = String(ctx.getExecutionId());
|
|
93
|
+
const nodeName = ctx.getNode().name;
|
|
94
|
+
for (let start = 0, chunk = 0; start < sendable.length; start += batchSize, chunk++) {
|
|
95
|
+
const slice = sendable.slice(start, start + batchSize);
|
|
96
|
+
try {
|
|
97
|
+
const result = (await api_helpers_1.makeApiRequest.call(ctx, apiKey, {
|
|
98
|
+
method: 'POST',
|
|
99
|
+
endpoint: route.endpoint,
|
|
100
|
+
body: route.toBody(slice.map((entry) => entry.row), defaults),
|
|
101
|
+
headers: {
|
|
102
|
+
[constants_1.LINK_BULK.IDEMPOTENCY_HEADER]: buildBulkIdempotencyKey(executionId, nodeName, chunk),
|
|
103
|
+
},
|
|
104
|
+
}));
|
|
105
|
+
// `row` is 1-based over this request's rows.
|
|
106
|
+
const byRow = new Map();
|
|
107
|
+
for (const item of result?.items || [])
|
|
108
|
+
byRow.set(item.row, item);
|
|
109
|
+
slice.forEach((entry, position) => {
|
|
110
|
+
output[entry.itemIndex] = {
|
|
111
|
+
json: toRowJson(byRow.get(position + 1)),
|
|
112
|
+
pairedItem: { item: entry.itemIndex },
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
if (!ctx.continueOnFail())
|
|
118
|
+
throw error;
|
|
119
|
+
for (const entry of slice) {
|
|
120
|
+
output[entry.itemIndex] = {
|
|
121
|
+
json: { error: error.message },
|
|
122
|
+
pairedItem: { item: entry.itemIndex },
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (options.failOnRowError) {
|
|
128
|
+
const failedIndex = output.findIndex((item) => item.json.status === constants_1.LINK_BULK.ROW_STATUS_FAILED);
|
|
129
|
+
if (failedIndex >= 0) {
|
|
130
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `${constants_1.LINK_BULK_MESSAGES.ROW_FAILED}: ${rowErrorText(output[failedIndex].json)}`, { itemIndex: failedIndex });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return output;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=link-bulk.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-bulk.helpers.js","sourceRoot":"","sources":["../../utils/link-bulk.helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAgBH,4CASC;AAGD,sCAIC;AAGD,0DAEC;AAGD,0CAaC;AA2BD,8CAmEC;AAjJD,+CAAyF;AACzF,+CAA+C;AAC/C,2DAAgD;AAChD,2CAA4D;AAU5D,iFAAiF;AACjF,SAAgB,gBAAgB,CAAC,GAAwC;IACxE,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,IAAA,6BAAS,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAG,IAAA,6BAAS,EAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,IAAA,6BAAS,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpC,IAAI,UAAU;QAAE,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;IACjD,IAAI,GAAG;QAAE,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC;IAC5B,IAAI,KAAK;QAAE,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IAClC,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,uEAAuE;AACvE,SAAgB,aAAa,CAAC,KAAc;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC;QAA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AE,MAAM,KAAK,CAAC;YACvC,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;gBAC3B,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG;oBACzB,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE;oBACzC,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE;iBACrC,CAAC;YACH,CAAC;QACF,CAAC;IACF,CAAC;IAED,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,qBAAS,CAAC,iBAAiB,CAAC,CAAC;QACjG,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,iCAAkB,CAC3B,GAAG,CAAC,OAAO,EAAE,EACb,GAAG,8BAAkB,CAAC,UAAU,KAAK,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAA+B,CAAC,EAAE,EACxG,EAAE,SAAS,EAAE,WAAW,EAAE,CAC1B,CAAC;QACH,CAAC;IACF,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* *Create Many* fields shared by the Short Link and QR Code nodes: the row's
|
|
3
|
+
* optional Template, Tag and Reference ID, the *Defaults* collection and the
|
|
4
|
+
* *Options* collection. Row content fields are the nodes' own *Create* fields.
|
|
5
|
+
*/
|
|
6
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
7
|
+
/** *Fetch Page Metadata* applies to short links only. */
|
|
8
|
+
export declare function buildLinkBulkProperties(withFetchMetadata: boolean): INodeProperties[];
|
|
9
|
+
//# sourceMappingURL=link-bulk.properties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-bulk.properties.d.ts","sourceRoot":"","sources":["../../utils/link-bulk.properties.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAKpD,yDAAyD;AACzD,wBAAgB,uBAAuB,CAAC,iBAAiB,EAAE,OAAO,GAAG,eAAe,EAAE,CAuGrF"}
|