@posty5/n8n-nodes-posty5 4.2.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.
- package/README.md +351 -15
- 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 +6 -0
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.d.ts.map +1 -1
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js +850 -189
- 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 +62 -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 +189 -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 +36 -3
- package/dist/utils/api.helpers.d.ts.map +1 -1
- package/dist/utils/api.helpers.js +77 -7
- package/dist/utils/api.helpers.js.map +1 -1
- package/dist/utils/constants.d.ts +198 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +215 -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-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
|
@@ -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,GA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,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"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* *Create Many* fields shared by the Short Link and QR Code nodes: the row's
|
|
4
|
+
* optional Template, Tag and Reference ID, the *Defaults* collection and the
|
|
5
|
+
* *Options* collection. Row content fields are the nodes' own *Create* fields.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.buildLinkBulkProperties = buildLinkBulkProperties;
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const SHOW_CREATE_MANY = { show: { operation: ['createMany'] } };
|
|
11
|
+
/** *Fetch Page Metadata* applies to short links only. */
|
|
12
|
+
function buildLinkBulkProperties(withFetchMetadata) {
|
|
13
|
+
const options = [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Batch Size',
|
|
16
|
+
name: 'batchSize',
|
|
17
|
+
type: 'number',
|
|
18
|
+
typeOptions: { minValue: 1, maxValue: constants_1.LINK_BULK.MAX_BATCH_SIZE },
|
|
19
|
+
default: 100,
|
|
20
|
+
description: 'Rows sent per API request (at most 100)',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
displayName: 'Fail on Any Row Error',
|
|
24
|
+
name: 'failOnRowError',
|
|
25
|
+
type: 'boolean',
|
|
26
|
+
default: false,
|
|
27
|
+
description: 'Whether to stop the workflow when Posty5 refuses a row. Off: a refused row is an output item with status "failed". Rows already created stay created.',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
if (withFetchMetadata) {
|
|
31
|
+
options.push({
|
|
32
|
+
displayName: 'Fetch Page Metadata',
|
|
33
|
+
name: 'fetchMetadata',
|
|
34
|
+
type: 'boolean',
|
|
35
|
+
default: true,
|
|
36
|
+
description: 'Whether Posty5 reads the title and image of each destination page in the background',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Template Name or ID',
|
|
42
|
+
name: 'templateId',
|
|
43
|
+
type: 'options',
|
|
44
|
+
typeOptions: { loadOptionsMethod: 'getQrTemplates' },
|
|
45
|
+
displayOptions: SHOW_CREATE_MANY,
|
|
46
|
+
default: '',
|
|
47
|
+
description: 'The design of this row. Leave empty to use Defaults > Template ID; one of the two is required. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Row Fields',
|
|
51
|
+
name: 'rowFields',
|
|
52
|
+
type: 'collection',
|
|
53
|
+
placeholder: 'Add Field',
|
|
54
|
+
default: {},
|
|
55
|
+
displayOptions: SHOW_CREATE_MANY,
|
|
56
|
+
options: [
|
|
57
|
+
{
|
|
58
|
+
displayName: 'Reference ID',
|
|
59
|
+
name: 'refId',
|
|
60
|
+
type: 'string',
|
|
61
|
+
default: '',
|
|
62
|
+
description: 'External reference ID of this row',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
displayName: 'Tag',
|
|
66
|
+
name: 'tag',
|
|
67
|
+
type: 'string',
|
|
68
|
+
default: '',
|
|
69
|
+
description: 'Organization tag of this row',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Defaults',
|
|
75
|
+
name: 'bulkDefaults',
|
|
76
|
+
type: 'collection',
|
|
77
|
+
placeholder: 'Add Default',
|
|
78
|
+
default: {},
|
|
79
|
+
displayOptions: SHOW_CREATE_MANY,
|
|
80
|
+
description: 'Applied to every row that does not set the field itself',
|
|
81
|
+
options: [
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Reference ID',
|
|
84
|
+
name: 'refId',
|
|
85
|
+
type: 'string',
|
|
86
|
+
default: '',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
displayName: 'Tag',
|
|
90
|
+
name: 'tag',
|
|
91
|
+
type: 'string',
|
|
92
|
+
default: '',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
displayName: 'Template ID',
|
|
96
|
+
name: 'templateId',
|
|
97
|
+
type: 'string',
|
|
98
|
+
default: '',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
displayName: 'Options',
|
|
104
|
+
name: 'bulkOptions',
|
|
105
|
+
type: 'collection',
|
|
106
|
+
placeholder: 'Add Option',
|
|
107
|
+
default: {},
|
|
108
|
+
displayOptions: SHOW_CREATE_MANY,
|
|
109
|
+
options,
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=link-bulk.properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-bulk.properties.js","sourceRoot":"","sources":["../../utils/link-bulk.properties.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAQH,0DAuGC;AA5GD,2CAAwC;AAExC,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;AAEjE,yDAAyD;AACzD,SAAgB,uBAAuB,CAAC,iBAA0B;IACjE,MAAM,OAAO,GAAsB;QAClC;YACC,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,qBAAS,CAAC,cAAc,EAAE;YAChE,OAAO,EAAE,GAAG;YACZ,WAAW,EAAE,yCAAyC;SACtD;QACD;YACC,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,WAAW,EACV,uJAAuJ;SACxJ;KACD,CAAC;IACF,IAAI,iBAAiB,EAAE,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC;YACZ,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,qFAAqF;SAClG,CAAC,CAAC;IACJ,CAAC;IAED,OAAO;QACN;YACC,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,EAAE,iBAAiB,EAAE,gBAAgB,EAAE;YACpD,cAAc,EAAE,gBAAgB;YAChC,OAAO,EAAE,EAAE;YACX,WAAW,EACV,gNAAgN;SACjN;QACD;YACC,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,WAAW;YACxB,OAAO,EAAE,EAAE;YACX,cAAc,EAAE,gBAAgB;YAChC,OAAO,EAAE;gBACR;oBACC,WAAW,EAAE,cAAc;oBAC3B,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,mCAAmC;iBAChD;gBACD;oBACC,WAAW,EAAE,KAAK;oBAClB,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,8BAA8B;iBAC3C;aACD;SACD;QACD;YACC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,aAAa;YAC1B,OAAO,EAAE,EAAE;YACX,cAAc,EAAE,gBAAgB;YAChC,WAAW,EAAE,yDAAyD;YACtE,OAAO,EAAE;gBACR;oBACC,WAAW,EAAE,cAAc;oBAC3B,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;iBACX;gBACD;oBACC,WAAW,EAAE,KAAK;oBAClB,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;iBACX;gBACD;oBACC,WAAW,EAAE,aAAa;oBAC1B,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;iBACX;aACD;SACD;QACD;YACC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,YAAY;YACzB,OAAO,EAAE,EAAE;YACX,cAAc,EAAE,gBAAgB;YAChC,OAAO;SACP;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body pieces the Short Link and QR Code nodes build the same way.
|
|
3
|
+
*
|
|
4
|
+
* Create sends only what the user filled in. Update is fetch-then-put: both
|
|
5
|
+
* `PUT` routes replace the record with the body they get, so the node reads the
|
|
6
|
+
* stored record first and sends it back with the user's fields on top. A field
|
|
7
|
+
* the user did not touch therefore keeps its stored value.
|
|
8
|
+
*/
|
|
9
|
+
import type { ILinkToolAdditionalFields, ILinkToolCommonBody, ILinkToolPageInfo, ILinkToolStoredFields, ILinkToolStoredPageInfo } from '../types/common';
|
|
10
|
+
import type { IShortLinkAdditionalFields, IShortLinkDeepLinks } from '../types/short-link.types';
|
|
11
|
+
/**
|
|
12
|
+
* A parameter value as the string the API expects (`''` for nothing). An n8n
|
|
13
|
+
* expression can hand over a number, e.g. a phone number read from a sheet.
|
|
14
|
+
*/
|
|
15
|
+
export declare function toText(value: unknown): string;
|
|
16
|
+
/** The first value that is a non-empty string once trimmed, trimmed; or undefined. */
|
|
17
|
+
export declare function firstText(...values: unknown[]): string | undefined;
|
|
18
|
+
/** Whether the user added this field to the collection (the key is present, even with an empty value). */
|
|
19
|
+
export declare function hasField(fields: object, key: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The page info to send: the user's title and description over the stored ones.
|
|
22
|
+
* An empty value never overrides a stored one. Only the keys both write schemas
|
|
23
|
+
* accept are sent: the stored `image` is read-only and would be refused.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildPageInfo(fields: ILinkToolAdditionalFields, stored?: ILinkToolStoredPageInfo | null): ILinkToolPageInfo | undefined;
|
|
26
|
+
/** Create: tag, reference ID, landing page and page info, each only when the user set it. */
|
|
27
|
+
export declare function buildCommonCreateFields(fields: ILinkToolAdditionalFields): ILinkToolCommonBody;
|
|
28
|
+
/**
|
|
29
|
+
* Update: the stored record with the user's fields on top. A Tag or Reference ID
|
|
30
|
+
* the user added but left empty clears it. `templateType` and `createdFrom` are
|
|
31
|
+
* always the stored ones: the short-link update resets an omitted `createdFrom`
|
|
32
|
+
* to "api", and both updates drop an omitted `templateType`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildCommonUpdateFields(fields: ILinkToolAdditionalFields, stored: ILinkToolStoredFields): ILinkToolCommonBody;
|
|
35
|
+
/**
|
|
36
|
+
* The Android / iOS destinations to send. Create sends a filled-in value only
|
|
37
|
+
* (empty means "use the target page's own deep link"). Update sends every field
|
|
38
|
+
* the user added, even empty (which clears it), and nothing else, so the API
|
|
39
|
+
* keeps the stored value, or re-reads the new target page's when the
|
|
40
|
+
* destination URL changed.
|
|
41
|
+
*/
|
|
42
|
+
export declare function buildDeepLinkFields(fields: IShortLinkAdditionalFields, operation: 'create' | 'update'): IShortLinkDeepLinks;
|
|
43
|
+
//# sourceMappingURL=link-tool.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-tool.helpers.d.ts","sourceRoot":"","sources":["../../utils/link-tool.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACX,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEjG;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAG7C;AAED,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,SAAS,CAMlE;AAED,0GAA0G;AAC1G,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC5B,MAAM,EAAE,yBAAyB,EACjC,MAAM,CAAC,EAAE,uBAAuB,GAAG,IAAI,GACrC,iBAAiB,GAAG,SAAS,CAY/B;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,yBAAyB,GAAG,mBAAmB,CAY9F;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,yBAAyB,EACjC,MAAM,EAAE,qBAAqB,GAC3B,mBAAmB,CAiBrB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAC5B,mBAAmB,CAOrB"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Body pieces the Short Link and QR Code nodes build the same way.
|
|
4
|
+
*
|
|
5
|
+
* Create sends only what the user filled in. Update is fetch-then-put: both
|
|
6
|
+
* `PUT` routes replace the record with the body they get, so the node reads the
|
|
7
|
+
* stored record first and sends it back with the user's fields on top. A field
|
|
8
|
+
* the user did not touch therefore keeps its stored value.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.toText = toText;
|
|
12
|
+
exports.firstText = firstText;
|
|
13
|
+
exports.hasField = hasField;
|
|
14
|
+
exports.buildPageInfo = buildPageInfo;
|
|
15
|
+
exports.buildCommonCreateFields = buildCommonCreateFields;
|
|
16
|
+
exports.buildCommonUpdateFields = buildCommonUpdateFields;
|
|
17
|
+
exports.buildDeepLinkFields = buildDeepLinkFields;
|
|
18
|
+
const constants_1 = require("./constants");
|
|
19
|
+
/**
|
|
20
|
+
* A parameter value as the string the API expects (`''` for nothing). An n8n
|
|
21
|
+
* expression can hand over a number, e.g. a phone number read from a sheet.
|
|
22
|
+
*/
|
|
23
|
+
function toText(value) {
|
|
24
|
+
if (value === undefined || value === null)
|
|
25
|
+
return '';
|
|
26
|
+
return typeof value === 'string' ? value : String(value);
|
|
27
|
+
}
|
|
28
|
+
/** The first value that is a non-empty string once trimmed, trimmed; or undefined. */
|
|
29
|
+
function firstText(...values) {
|
|
30
|
+
for (const value of values) {
|
|
31
|
+
const text = toText(value).trim();
|
|
32
|
+
if (text)
|
|
33
|
+
return text;
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
/** Whether the user added this field to the collection (the key is present, even with an empty value). */
|
|
38
|
+
function hasField(fields, key) {
|
|
39
|
+
return Object.prototype.hasOwnProperty.call(fields, key);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The page info to send: the user's title and description over the stored ones.
|
|
43
|
+
* An empty value never overrides a stored one. Only the keys both write schemas
|
|
44
|
+
* accept are sent: the stored `image` is read-only and would be refused.
|
|
45
|
+
*/
|
|
46
|
+
function buildPageInfo(fields, stored) {
|
|
47
|
+
const title = firstText(fields.pageTitle, stored?.title);
|
|
48
|
+
const description = firstText(fields.pageDescription, stored?.description);
|
|
49
|
+
if (!title && !description)
|
|
50
|
+
return undefined;
|
|
51
|
+
const pageInfo = {};
|
|
52
|
+
if (title)
|
|
53
|
+
pageInfo.title = title;
|
|
54
|
+
if (description)
|
|
55
|
+
pageInfo.description = description;
|
|
56
|
+
if (typeof stored?.descriptionIsHtmlFile === 'boolean') {
|
|
57
|
+
pageInfo.descriptionIsHtmlFile = stored.descriptionIsHtmlFile;
|
|
58
|
+
}
|
|
59
|
+
return pageInfo;
|
|
60
|
+
}
|
|
61
|
+
/** Create: tag, reference ID, landing page and page info, each only when the user set it. */
|
|
62
|
+
function buildCommonCreateFields(fields) {
|
|
63
|
+
const body = {};
|
|
64
|
+
const tag = firstText(fields.tag);
|
|
65
|
+
const refId = firstText(fields.refId);
|
|
66
|
+
const pageInfo = buildPageInfo(fields);
|
|
67
|
+
if (tag)
|
|
68
|
+
body.tag = tag;
|
|
69
|
+
if (refId)
|
|
70
|
+
body.refId = refId;
|
|
71
|
+
if (typeof fields.isEnableLandingPage === 'boolean')
|
|
72
|
+
body.isEnableLandingPage = fields.isEnableLandingPage;
|
|
73
|
+
if (pageInfo)
|
|
74
|
+
body.pageInfo = pageInfo;
|
|
75
|
+
return body;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Update: the stored record with the user's fields on top. A Tag or Reference ID
|
|
79
|
+
* the user added but left empty clears it. `templateType` and `createdFrom` are
|
|
80
|
+
* always the stored ones: the short-link update resets an omitted `createdFrom`
|
|
81
|
+
* to "api", and both updates drop an omitted `templateType`.
|
|
82
|
+
*/
|
|
83
|
+
function buildCommonUpdateFields(fields, stored) {
|
|
84
|
+
const body = {};
|
|
85
|
+
const tag = hasField(fields, 'tag') ? toText(fields.tag).trim() : stored.tag;
|
|
86
|
+
const refId = hasField(fields, 'refId') ? toText(fields.refId).trim() : stored.refId;
|
|
87
|
+
const isEnableLandingPage = typeof fields.isEnableLandingPage === 'boolean'
|
|
88
|
+
? fields.isEnableLandingPage
|
|
89
|
+
: stored.isEnableLandingPage;
|
|
90
|
+
const pageInfo = buildPageInfo(fields, stored.pageInfo);
|
|
91
|
+
if (typeof tag === 'string')
|
|
92
|
+
body.tag = tag;
|
|
93
|
+
if (typeof refId === 'string')
|
|
94
|
+
body.refId = refId;
|
|
95
|
+
if (stored.templateType)
|
|
96
|
+
body.templateType = stored.templateType;
|
|
97
|
+
if (stored.createdFrom)
|
|
98
|
+
body.createdFrom = stored.createdFrom;
|
|
99
|
+
if (typeof isEnableLandingPage === 'boolean')
|
|
100
|
+
body.isEnableLandingPage = isEnableLandingPage;
|
|
101
|
+
if (pageInfo)
|
|
102
|
+
body.pageInfo = pageInfo;
|
|
103
|
+
return body;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The Android / iOS destinations to send. Create sends a filled-in value only
|
|
107
|
+
* (empty means "use the target page's own deep link"). Update sends every field
|
|
108
|
+
* the user added, even empty (which clears it), and nothing else, so the API
|
|
109
|
+
* keeps the stored value, or re-reads the new target page's when the
|
|
110
|
+
* destination URL changed.
|
|
111
|
+
*/
|
|
112
|
+
function buildDeepLinkFields(fields, operation) {
|
|
113
|
+
const links = {};
|
|
114
|
+
for (const key of constants_1.SHORT_LINK_DEEP_LINK_FIELDS) {
|
|
115
|
+
const value = toText(fields[key]).trim();
|
|
116
|
+
if (operation === 'update' ? hasField(fields, key) : value)
|
|
117
|
+
links[key] = value;
|
|
118
|
+
}
|
|
119
|
+
return links;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=link-tool.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-tool.helpers.js","sourceRoot":"","sources":["../../utils/link-tool.helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAgBH,wBAGC;AAGD,8BAMC;AAGD,4BAEC;AAOD,sCAeC;AAGD,0DAYC;AAQD,0DAoBC;AASD,kDAUC;AAnHD,2CAA0D;AAU1D;;;GAGG;AACH,SAAgB,MAAM,CAAC,KAAc;IACpC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IACrD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,sFAAsF;AACtF,SAAgB,SAAS,CAAC,GAAG,MAAiB;IAC7C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;IACvB,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,0GAA0G;AAC1G,SAAgB,QAAQ,CAAC,MAAc,EAAE,GAAW;IACnD,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAC5B,MAAiC,EACjC,MAAuC;IAEvC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,SAAS,CAAC,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GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACzC,IAAI,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;YAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAChF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning what the node's UI collected into the `comments[]` the API takes.
|
|
3
|
+
*
|
|
4
|
+
* Extracted because the video flow and the image flow both do it, and two copies
|
|
5
|
+
* of "map the UI onto the payload" is where one of them keeps sending the
|
|
6
|
+
* deprecated singular after the other stops.
|
|
7
|
+
*/
|
|
8
|
+
/** One comment, as the API declares it. Nothing else may be sent. */
|
|
9
|
+
export interface IPostCommentPayload {
|
|
10
|
+
text: string;
|
|
11
|
+
delayMinutes?: number;
|
|
12
|
+
imageUrl?: string;
|
|
13
|
+
postToFacebook: boolean;
|
|
14
|
+
postToInstagram: boolean;
|
|
15
|
+
postToYoutube: boolean;
|
|
16
|
+
/** Always false: TikTok exposes no public comment-posting endpoint. */
|
|
17
|
+
postToTiktok: false;
|
|
18
|
+
}
|
|
19
|
+
/** At most this many. Enforced server-side; mirrored here so the node can stop first. */
|
|
20
|
+
export declare const MAX_POST_COMMENTS = 5;
|
|
21
|
+
/** One entry of the `comments` fixedCollection, as n8n hands it back. */
|
|
22
|
+
interface IRawComment {
|
|
23
|
+
text?: unknown;
|
|
24
|
+
delayMinutes?: unknown;
|
|
25
|
+
imageUrl?: unknown;
|
|
26
|
+
postToFacebook?: unknown;
|
|
27
|
+
postToInstagram?: unknown;
|
|
28
|
+
postToYoutube?: unknown;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The comments to send, from the two collections the node offers.
|
|
32
|
+
*
|
|
33
|
+
* `comments` wins. The deprecated singular is mapped into the list ONLY when the
|
|
34
|
+
* list is empty — the API refuses a request carrying both, so a workflow that
|
|
35
|
+
* has been upgraded halfway must not send two shapes. A blank row is dropped
|
|
36
|
+
* rather than sent: a row somebody added and never typed into is an abandoned
|
|
37
|
+
* intention, not a comment, and the API would charge for it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildCommentsPayload(comments: {
|
|
40
|
+
comment?: IRawComment[];
|
|
41
|
+
} | undefined, legacyComment: IRawComment | undefined): IPostCommentPayload[];
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=post-comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-comments.d.ts","sourceRoot":"","sources":["../../utils/post-comments.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qEAAqE;AACrE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,YAAY,EAAE,KAAK,CAAC;CACrB;AAED,yFAAyF;AACzF,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,yEAAyE;AACzE,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAyBD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE;IAAE,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;CAAE,GAAG,SAAS,EACjD,aAAa,EAAE,WAAW,GAAG,SAAS,GACrC,mBAAmB,EAAE,CAOvB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Turning what the node's UI collected into the `comments[]` the API takes.
|
|
4
|
+
*
|
|
5
|
+
* Extracted because the video flow and the image flow both do it, and two copies
|
|
6
|
+
* of "map the UI onto the payload" is where one of them keeps sending the
|
|
7
|
+
* deprecated singular after the other stops.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.MAX_POST_COMMENTS = void 0;
|
|
11
|
+
exports.buildCommentsPayload = buildCommentsPayload;
|
|
12
|
+
/** At most this many. Enforced server-side; mirrored here so the node can stop first. */
|
|
13
|
+
exports.MAX_POST_COMMENTS = 5;
|
|
14
|
+
function hasText(row) {
|
|
15
|
+
return typeof row?.text === 'string' && row.text.trim().length > 0;
|
|
16
|
+
}
|
|
17
|
+
function toPayload(row) {
|
|
18
|
+
const payload = {
|
|
19
|
+
text: row.text,
|
|
20
|
+
postToFacebook: row.postToFacebook !== false,
|
|
21
|
+
postToInstagram: row.postToInstagram !== false,
|
|
22
|
+
postToYoutube: row.postToYoutube !== false,
|
|
23
|
+
postToTiktok: false,
|
|
24
|
+
};
|
|
25
|
+
// Only sent when they carry something. Joi refuses an undeclared key and
|
|
26
|
+
// validates the ones it declares, so an empty string in `imageUrl` is a 400
|
|
27
|
+
// about a URL the user never typed.
|
|
28
|
+
const delay = Number(row.delayMinutes);
|
|
29
|
+
if (Number.isFinite(delay) && delay > 0)
|
|
30
|
+
payload.delayMinutes = delay;
|
|
31
|
+
if (typeof row.imageUrl === 'string' && row.imageUrl.trim())
|
|
32
|
+
payload.imageUrl = row.imageUrl.trim();
|
|
33
|
+
return payload;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The comments to send, from the two collections the node offers.
|
|
37
|
+
*
|
|
38
|
+
* `comments` wins. The deprecated singular is mapped into the list ONLY when the
|
|
39
|
+
* list is empty — the API refuses a request carrying both, so a workflow that
|
|
40
|
+
* has been upgraded halfway must not send two shapes. A blank row is dropped
|
|
41
|
+
* rather than sent: a row somebody added and never typed into is an abandoned
|
|
42
|
+
* intention, not a comment, and the API would charge for it.
|
|
43
|
+
*/
|
|
44
|
+
function buildCommentsPayload(comments, legacyComment) {
|
|
45
|
+
const rows = Array.isArray(comments?.comment) ? comments.comment : [];
|
|
46
|
+
const filled = rows.filter(hasText).map(toPayload);
|
|
47
|
+
if (filled.length)
|
|
48
|
+
return filled.slice(0, exports.MAX_POST_COMMENTS);
|
|
49
|
+
if (hasText(legacyComment))
|
|
50
|
+
return [toPayload(legacyComment)];
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=post-comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-comments.js","sourceRoot":"","sources":["../../utils/post-comments.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA2DH,oDAUC;AAvDD,yFAAyF;AAC5E,QAAA,iBAAiB,GAAG,CAAC,CAAC;AAYnC,SAAS,OAAO,CAAC,GAA4B;IAC3C,OAAO,OAAO,GAAG,EAAE,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,SAAS,CAAC,GAAmC;IACpD,MAAM,OAAO,GAAwB;QACnC,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,cAAc,EAAE,GAAG,CAAC,cAAc,KAAK,KAAK;QAC5C,eAAe,EAAE,GAAG,CAAC,eAAe,KAAK,KAAK;QAC9C,aAAa,EAAE,GAAG,CAAC,aAAa,KAAK,KAAK;QAC1C,YAAY,EAAE,KAAK;KACpB,CAAC;IAEF,yEAAyE;IACzE,4EAA4E;IAC5E,oCAAoC;IACpC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACvC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC;IACtE,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE;QAAE,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEpG,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAClC,QAAiD,EACjD,aAAsC;IAEtC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,QAAS,CAAC,OAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAEnD,IAAI,MAAM,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,yBAAiB,CAAC,CAAC;IAC7D,IAAI,OAAO,CAAC,aAAa,CAAC;QAAE,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9D,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Option lists and limits of the QR content types (vCard, event, WhatsApp,
|
|
3
|
+
* review, social). They mirror the API's `QrContentConfig`
|
|
4
|
+
* (`link-tools-service/.../qr-code/qr-text.config.ts`) and the npm SDK's
|
|
5
|
+
* `QrCodeVCardPhoneKind` / `QrCodeReviewPlatform` / `QrCodeSocialPlatform`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const QR_CONTENT_CONFIG: {
|
|
8
|
+
readonly vcard: {
|
|
9
|
+
readonly phoneKinds: readonly ["mobile", "work", "home"];
|
|
10
|
+
readonly defaultPhoneKind: "mobile";
|
|
11
|
+
readonly phonesMax: 3;
|
|
12
|
+
readonly emailsMax: 2;
|
|
13
|
+
/** Separator of the Emails field (comma-separated → array). */
|
|
14
|
+
readonly emailSeparator: ",";
|
|
15
|
+
};
|
|
16
|
+
readonly event: {
|
|
17
|
+
readonly defaultTimezone: "UTC";
|
|
18
|
+
};
|
|
19
|
+
readonly review: {
|
|
20
|
+
readonly platforms: readonly ["google", "tripadvisor", "trustpilot", "yelp", "facebook", "other"];
|
|
21
|
+
/** The platform that takes a Place ID instead of a URL. */
|
|
22
|
+
readonly placeIdPlatform: "google";
|
|
23
|
+
};
|
|
24
|
+
readonly social: {
|
|
25
|
+
readonly platforms: readonly ["instagram", "facebook", "tiktok", "x", "youtube", "linkedin", "snapchat", "telegram", "threads", "pinterest", "other"];
|
|
26
|
+
/** Profiles a static code may carry; more makes the code dynamic-only. */
|
|
27
|
+
readonly maxProfilesStatic: 1;
|
|
28
|
+
/** Profiles a dynamic code may carry (API `maxProfilesDynamic`). */
|
|
29
|
+
readonly maxProfilesDynamic: 12;
|
|
30
|
+
readonly defaultPlatform: "instagram";
|
|
31
|
+
};
|
|
32
|
+
/** Types with no static form: the node hides Mode and always sends `mode: dynamic`. */
|
|
33
|
+
readonly dynamicOnlyTypes: readonly ["appStore", "file"];
|
|
34
|
+
/** Types *Create Many* cannot send (the bulk route refuses a `file` row: it needs an upload first). */
|
|
35
|
+
readonly bulkExcludedTypes: readonly ["file"];
|
|
36
|
+
readonly file: {
|
|
37
|
+
/** Default binary property the file is read from. */
|
|
38
|
+
readonly defaultBinaryProperty: "data";
|
|
39
|
+
/** The API's default upload cap (`QR_FILE_MAX_UPLOAD_MB`, 10 MB); checked before any request. */
|
|
40
|
+
readonly maxUploadBytes: number;
|
|
41
|
+
readonly fileNameMax: 120;
|
|
42
|
+
/** MIME types a `file` code accepts (API `QrFileConfig.mimeTypes`). */
|
|
43
|
+
readonly mimeTypes: readonly ["application/pdf", "image/jpeg", "image/png", "image/webp"];
|
|
44
|
+
/** File name sent when neither the field nor the binary has one. */
|
|
45
|
+
readonly fallbackFileName: "file";
|
|
46
|
+
readonly uploadUrlPath: "/file/upload-url";
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/** Errors the QR Code node raises before calling the API for a `file` code. */
|
|
50
|
+
export declare const QR_FILE_MESSAGES: {
|
|
51
|
+
readonly binaryMissing: (property: string) => string;
|
|
52
|
+
readonly tooLarge: (maxMb: number) => string;
|
|
53
|
+
readonly empty: "The file is empty.";
|
|
54
|
+
readonly mimeNotAllowed: (mimeType: string) => string;
|
|
55
|
+
readonly notInBulk: "File QR codes cannot be created with Create Many: use Create (the file is uploaded first).";
|
|
56
|
+
};
|
|
57
|
+
/** Display names of the option values above. */
|
|
58
|
+
export declare const QR_CONTENT_LABELS: Record<string, string>;
|
|
59
|
+
/** A static IANA time-zone list for the Event Timezone field (any other zone can be typed via an expression). */
|
|
60
|
+
export declare const QR_EVENT_TIMEZONES: readonly ["UTC", "Africa/Cairo", "Africa/Casablanca", "Africa/Johannesburg", "Africa/Lagos", "Africa/Nairobi", "America/Anchorage", "America/Bogota", "America/Chicago", "America/Denver", "America/Los_Angeles", "America/Mexico_City", "America/New_York", "America/Sao_Paulo", "America/Toronto", "Asia/Baghdad", "Asia/Bangkok", "Asia/Dubai", "Asia/Hong_Kong", "Asia/Jakarta", "Asia/Karachi", "Asia/Kolkata", "Asia/Riyadh", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Tokyo", "Australia/Melbourne", "Australia/Sydney", "Europe/Amsterdam", "Europe/Berlin", "Europe/Istanbul", "Europe/London", "Europe/Madrid", "Europe/Moscow", "Europe/Paris", "Europe/Rome", "Pacific/Auckland"];
|
|
61
|
+
/** n8n option rows for a list of values. */
|
|
62
|
+
export declare function toNodeOptions(values: readonly string[]): Array<{
|
|
63
|
+
name: string;
|
|
64
|
+
value: string;
|
|
65
|
+
}>;
|
|
66
|
+
//# sourceMappingURL=qr-content.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qr-content.config.d.ts","sourceRoot":"","sources":["../../utils/qr-content.config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,iBAAiB;;;;;;QAM5B,+DAA+D;;;;;;;;QAQ/D,2DAA2D;;;;;QAiB3D,0EAA0E;;QAE1E,oEAAoE;;;;IAIrE,uFAAuF;;IAEvF,uGAAuG;;;QAGtG,qDAAqD;;QAErD,iGAAiG;;;QAGjG,uEAAuE;;QAEvE,oEAAoE;;;;CAI5D,CAAC;AAEX,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB;uCACF,MAAM;+BAEd,MAAM;;wCAEG,MAAM;;CAGxB,CAAC;AAEX,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAmBpD,CAAC;AAEF,iHAAiH;AACjH,eAAO,MAAM,kBAAkB,6qBAuCrB,CAAC;AAEX,4CAA4C;AAC5C,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAE/F"}
|