@posty5/n8n-nodes-posty5 4.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/README.md +397 -19
  2. package/dist/credentials/Posty5Api.credentials.d.ts +4 -0
  3. package/dist/credentials/Posty5Api.credentials.d.ts.map +1 -1
  4. package/dist/credentials/Posty5Api.credentials.js +30 -4
  5. package/dist/credentials/Posty5Api.credentials.js.map +1 -1
  6. package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.d.ts.map +1 -1
  7. package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.js +6 -2
  8. package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.js.map +1 -1
  9. package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.d.ts.map +1 -1
  10. package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.js +14 -3
  11. package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.js.map +1 -1
  12. package/dist/nodes/Posty5QrCode/Posty5QrCode.node.d.ts +6 -0
  13. package/dist/nodes/Posty5QrCode/Posty5QrCode.node.d.ts.map +1 -1
  14. package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js +850 -189
  15. package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js.map +1 -1
  16. package/dist/nodes/Posty5QrCode/helpers.d.ts +12 -0
  17. package/dist/nodes/Posty5QrCode/helpers.d.ts.map +1 -0
  18. package/dist/nodes/Posty5QrCode/helpers.js +56 -0
  19. package/dist/nodes/Posty5QrCode/helpers.js.map +1 -0
  20. package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.d.ts +8 -0
  21. package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.d.ts.map +1 -1
  22. package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.js +389 -78
  23. package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.js.map +1 -1
  24. package/dist/nodes/Posty5ShortLink/helpers.d.ts +12 -0
  25. package/dist/nodes/Posty5ShortLink/helpers.d.ts.map +1 -0
  26. package/dist/nodes/Posty5ShortLink/helpers.js +46 -0
  27. package/dist/nodes/Posty5ShortLink/helpers.js.map +1 -0
  28. package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.d.ts.map +1 -1
  29. package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.js +458 -75
  30. package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.js.map +1 -1
  31. package/dist/nodes/Posty5Store/Posty5Store.node.d.ts +17 -0
  32. package/dist/nodes/Posty5Store/Posty5Store.node.d.ts.map +1 -0
  33. package/dist/nodes/Posty5Store/Posty5Store.node.js +230 -0
  34. package/dist/nodes/Posty5Store/Posty5Store.node.js.map +1 -0
  35. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.d.ts +4 -0
  36. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.d.ts.map +1 -0
  37. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.js +55 -0
  38. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.js.map +1 -0
  39. package/dist/nodes/Posty5Store/descriptions/order.description.d.ts +4 -0
  40. package/dist/nodes/Posty5Store/descriptions/order.description.d.ts.map +1 -0
  41. package/dist/nodes/Posty5Store/descriptions/order.description.js +91 -0
  42. package/dist/nodes/Posty5Store/descriptions/order.description.js.map +1 -0
  43. package/dist/nodes/Posty5Store/descriptions/product-link.description.d.ts +4 -0
  44. package/dist/nodes/Posty5Store/descriptions/product-link.description.d.ts.map +1 -0
  45. package/dist/nodes/Posty5Store/descriptions/product-link.description.js +48 -0
  46. package/dist/nodes/Posty5Store/descriptions/product-link.description.js.map +1 -0
  47. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.d.ts +4 -0
  48. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.d.ts.map +1 -0
  49. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.js +118 -0
  50. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.js.map +1 -0
  51. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.d.ts +4 -0
  52. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.d.ts.map +1 -0
  53. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.js +167 -0
  54. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.js.map +1 -0
  55. package/dist/nodes/Posty5Store/descriptions/supplier.description.d.ts +4 -0
  56. package/dist/nodes/Posty5Store/descriptions/supplier.description.d.ts.map +1 -0
  57. package/dist/nodes/Posty5Store/descriptions/supplier.description.js +50 -0
  58. package/dist/nodes/Posty5Store/descriptions/supplier.description.js.map +1 -0
  59. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.d.ts +13 -0
  60. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.d.ts.map +1 -0
  61. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.js +171 -0
  62. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.js.map +1 -0
  63. package/dist/nodes/Posty5Trigger/config.d.ts +51 -0
  64. package/dist/nodes/Posty5Trigger/config.d.ts.map +1 -0
  65. package/dist/nodes/Posty5Trigger/config.js +76 -0
  66. package/dist/nodes/Posty5Trigger/config.js.map +1 -0
  67. package/dist/nodes/Posty5Trigger/descriptions.d.ts +4 -0
  68. package/dist/nodes/Posty5Trigger/descriptions.d.ts.map +1 -0
  69. package/dist/nodes/Posty5Trigger/descriptions.js +99 -0
  70. package/dist/nodes/Posty5Trigger/descriptions.js.map +1 -0
  71. package/dist/nodes/Posty5Trigger/helpers.d.ts +34 -0
  72. package/dist/nodes/Posty5Trigger/helpers.d.ts.map +1 -0
  73. package/dist/nodes/Posty5Trigger/helpers.js +139 -0
  74. package/dist/nodes/Posty5Trigger/helpers.js.map +1 -0
  75. package/dist/package.json +78 -0
  76. package/dist/types/common.d.ts +62 -0
  77. package/dist/types/common.d.ts.map +1 -1
  78. package/dist/types/link-analytics.types.d.ts +147 -0
  79. package/dist/types/link-analytics.types.d.ts.map +1 -0
  80. package/dist/types/link-analytics.types.js +10 -0
  81. package/dist/types/link-analytics.types.js.map +1 -0
  82. package/dist/types/link-bulk.types.d.ts +68 -0
  83. package/dist/types/link-bulk.types.d.ts.map +1 -0
  84. package/dist/types/link-bulk.types.js +8 -0
  85. package/dist/types/link-bulk.types.js.map +1 -0
  86. package/dist/types/qr-code.types.d.ts +189 -56
  87. package/dist/types/qr-code.types.d.ts.map +1 -1
  88. package/dist/types/short-link-controls.types.d.ts +82 -0
  89. package/dist/types/short-link-controls.types.d.ts.map +1 -0
  90. package/dist/types/short-link-controls.types.js +7 -0
  91. package/dist/types/short-link-controls.types.js.map +1 -0
  92. package/dist/types/short-link.types.d.ts +63 -15
  93. package/dist/types/short-link.types.d.ts.map +1 -1
  94. package/dist/types/store.types.d.ts +71 -0
  95. package/dist/types/store.types.d.ts.map +1 -0
  96. package/dist/types/store.types.js +7 -0
  97. package/dist/types/store.types.js.map +1 -0
  98. package/dist/types/webhook.types.d.ts +66 -0
  99. package/dist/types/webhook.types.d.ts.map +1 -0
  100. package/dist/types/webhook.types.js +7 -0
  101. package/dist/types/webhook.types.js.map +1 -0
  102. package/dist/utils/analytics.helpers.d.ts +68 -0
  103. package/dist/utils/analytics.helpers.d.ts.map +1 -0
  104. package/dist/utils/analytics.helpers.js +202 -0
  105. package/dist/utils/analytics.helpers.js.map +1 -0
  106. package/dist/utils/analytics.properties.d.ts +10 -0
  107. package/dist/utils/analytics.properties.d.ts.map +1 -0
  108. package/dist/utils/analytics.properties.js +172 -0
  109. package/dist/utils/analytics.properties.js.map +1 -0
  110. package/dist/utils/api.helpers.d.ts +36 -3
  111. package/dist/utils/api.helpers.d.ts.map +1 -1
  112. package/dist/utils/api.helpers.js +77 -7
  113. package/dist/utils/api.helpers.js.map +1 -1
  114. package/dist/utils/constants.d.ts +198 -0
  115. package/dist/utils/constants.d.ts.map +1 -1
  116. package/dist/utils/constants.js +215 -1
  117. package/dist/utils/constants.js.map +1 -1
  118. package/dist/utils/date.helpers.d.ts +25 -0
  119. package/dist/utils/date.helpers.d.ts.map +1 -0
  120. package/dist/utils/date.helpers.js +65 -0
  121. package/dist/utils/date.helpers.js.map +1 -0
  122. package/dist/utils/link-bulk.helpers.d.ts +26 -0
  123. package/dist/utils/link-bulk.helpers.d.ts.map +1 -0
  124. package/dist/utils/link-bulk.helpers.js +135 -0
  125. package/dist/utils/link-bulk.helpers.js.map +1 -0
  126. package/dist/utils/link-bulk.properties.d.ts +9 -0
  127. package/dist/utils/link-bulk.properties.d.ts.map +1 -0
  128. package/dist/utils/link-bulk.properties.js +113 -0
  129. package/dist/utils/link-bulk.properties.js.map +1 -0
  130. package/dist/utils/link-tool.helpers.d.ts +43 -0
  131. package/dist/utils/link-tool.helpers.d.ts.map +1 -0
  132. package/dist/utils/link-tool.helpers.js +121 -0
  133. package/dist/utils/link-tool.helpers.js.map +1 -0
  134. package/dist/utils/post-comments.d.ts +43 -0
  135. package/dist/utils/post-comments.d.ts.map +1 -0
  136. package/dist/utils/post-comments.js +53 -0
  137. package/dist/utils/post-comments.js.map +1 -0
  138. package/dist/utils/qr-content.config.d.ts +66 -0
  139. package/dist/utils/qr-content.config.d.ts.map +1 -0
  140. package/dist/utils/qr-content.config.js +139 -0
  141. package/dist/utils/qr-content.config.js.map +1 -0
  142. package/dist/utils/qr-file.helpers.d.ts +22 -0
  143. package/dist/utils/qr-file.helpers.d.ts.map +1 -0
  144. package/dist/utils/qr-file.helpers.js +63 -0
  145. package/dist/utils/qr-file.helpers.js.map +1 -0
  146. package/dist/utils/qr-target.helpers.d.ts +35 -0
  147. package/dist/utils/qr-target.helpers.d.ts.map +1 -0
  148. package/dist/utils/qr-target.helpers.js +260 -0
  149. package/dist/utils/qr-target.helpers.js.map +1 -0
  150. package/dist/utils/qr-templates.helpers.d.ts +26 -0
  151. package/dist/utils/qr-templates.helpers.d.ts.map +1 -0
  152. package/dist/utils/qr-templates.helpers.js +70 -0
  153. package/dist/utils/qr-templates.helpers.js.map +1 -0
  154. package/dist/utils/resumable-upload.d.ts +39 -0
  155. package/dist/utils/resumable-upload.d.ts.map +1 -0
  156. package/dist/utils/resumable-upload.js +164 -0
  157. package/dist/utils/resumable-upload.js.map +1 -0
  158. package/dist/utils/short-link-controls.helpers.d.ts +31 -0
  159. package/dist/utils/short-link-controls.helpers.d.ts.map +1 -0
  160. package/dist/utils/short-link-controls.helpers.js +185 -0
  161. package/dist/utils/short-link-controls.helpers.js.map +1 -0
  162. package/dist/utils/short-link-controls.properties.d.ts +17 -0
  163. package/dist/utils/short-link-controls.properties.d.ts.map +1 -0
  164. package/dist/utils/short-link-controls.properties.js +315 -0
  165. package/dist/utils/short-link-controls.properties.js.map +1 -0
  166. package/dist/utils/store.helpers.d.ts +43 -0
  167. package/dist/utils/store.helpers.d.ts.map +1 -0
  168. package/dist/utils/store.helpers.js +87 -0
  169. package/dist/utils/store.helpers.js.map +1 -0
  170. package/dist/utils/versioned-write.helpers.d.ts +31 -0
  171. package/dist/utils/versioned-write.helpers.d.ts.map +1 -0
  172. package/dist/utils/versioned-write.helpers.js +120 -0
  173. package/dist/utils/versioned-write.helpers.js.map +1 -0
  174. package/package.json +7 -3
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ /**
3
+ * The Template field of the Short Link and QR Code nodes: the dropdown's
4
+ * options, and which template a run sends.
5
+ *
6
+ * The Posty5 API requires `templateId` on every create and update made with an
7
+ * API key (which is every n8n call), so the node never sends a write without one.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getQrTemplates = getQrTemplates;
11
+ exports.mergeQrTemplateOptions = mergeQrTemplateOptions;
12
+ exports.requireTemplateId = requireTemplateId;
13
+ const api_helpers_1 = require("./api.helpers");
14
+ const constants_1 = require("./constants");
15
+ const link_tool_helpers_1 = require("./link-tool.helpers");
16
+ /**
17
+ * `loadOptions` for the Template field: the caller's own templates first, then
18
+ * the public ones. A template in both lists appears once, as the caller's.
19
+ * A bad credential rejects the call, so n8n shows the error in the dropdown.
20
+ */
21
+ async function getQrTemplates() {
22
+ const credentials = await this.getCredentials('posty5Api');
23
+ const apiKey = credentials.apiKey;
24
+ const qs = { pageSize: constants_1.QR_TEMPLATE_LOOKUP.PAGE_SIZE };
25
+ const [userPage, publicPage] = (await Promise.all([
26
+ api_helpers_1.makeApiRequest.call(this, apiKey, {
27
+ method: 'GET',
28
+ endpoint: `${constants_1.API_ENDPOINTS.QR_CODE_TEMPLATE}${constants_1.QR_TEMPLATE_LOOKUP.USER_PATH}`,
29
+ qs,
30
+ }),
31
+ api_helpers_1.makeApiRequest.call(this, apiKey, {
32
+ method: 'GET',
33
+ endpoint: `${constants_1.API_ENDPOINTS.QR_CODE_TEMPLATE}${constants_1.QR_TEMPLATE_LOOKUP.PUBLIC_PATH}`,
34
+ qs,
35
+ }),
36
+ ]));
37
+ return mergeQrTemplateOptions(userPage?.items || [], publicPage?.items || []);
38
+ }
39
+ /** The dropdown options for two lookup pages: the caller's templates, then the public ones not already listed. */
40
+ function mergeQrTemplateOptions(userTemplates, publicTemplates) {
41
+ const seen = new Set();
42
+ const options = [];
43
+ const lists = [
44
+ [userTemplates, constants_1.QR_TEMPLATE_LOOKUP.USER_LABEL],
45
+ [publicTemplates, constants_1.QR_TEMPLATE_LOOKUP.PUBLIC_LABEL],
46
+ ];
47
+ for (const [templates, description] of lists) {
48
+ for (const template of templates) {
49
+ const id = (0, link_tool_helpers_1.firstText)(template?._id);
50
+ if (!id || seen.has(id))
51
+ continue;
52
+ seen.add(id);
53
+ options.push({ name: (0, link_tool_helpers_1.firstText)(template.name) || id, value: id, description });
54
+ }
55
+ }
56
+ return options;
57
+ }
58
+ /**
59
+ * The template a write sends: the Template field; else the deprecated
60
+ * Additional Fields value that workflows saved before 4.6.0 carry; else, on
61
+ * Update, the record's stored template. Throws when there is none, before any
62
+ * request is made.
63
+ */
64
+ function requireTemplateId(selected, fields, stored) {
65
+ const templateId = (0, link_tool_helpers_1.firstText)(selected, fields.templateId, stored?.templateId);
66
+ if (!templateId)
67
+ throw new Error(constants_1.LINK_TOOL_MESSAGES.TEMPLATE_REQUIRED);
68
+ return templateId;
69
+ }
70
+ //# sourceMappingURL=qr-templates.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qr-templates.helpers.js","sourceRoot":"","sources":["../../utils/qr-templates.helpers.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAcH,wCAmBC;AAGD,wDAoBC;AAQD,8CAQC;AArED,+CAA+C;AAC/C,2CAAoF;AACpF,2DAAgD;AAIhD;;;;GAIG;AACI,KAAK,UAAU,cAAc;IACnC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,WAAW,CAAC,MAAgB,CAAC;IAC5C,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,8BAAkB,CAAC,SAAS,EAAE,CAAC;IAEtD,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC;QACjD,4BAAc,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE;YACjC,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,GAAG,yBAAa,CAAC,gBAAgB,GAAG,8BAAkB,CAAC,SAAS,EAAE;YAC5E,EAAE;SACF,CAAC;QACF,4BAAc,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE;YACjC,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,GAAG,yBAAa,CAAC,gBAAgB,GAAG,8BAAkB,CAAC,WAAW,EAAE;YAC9E,EAAE;SACF,CAAC;KACF,CAAC,CAAiD,CAAC;IAEpD,OAAO,sBAAsB,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;AAC/E,CAAC;AAED,kHAAkH;AAClH,SAA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 * part with no server-side re-buffering.
5
+ */
6
+ export declare const DEFAULT_CHUNK_SIZE: number;
7
+ /** One upload destination the API authorized. */
8
+ export interface IUploadTarget {
9
+ fileURL?: string;
10
+ uploadFileURL?: string;
11
+ bucketFilePath?: string;
12
+ /** Absolute tus endpoint, present only when the resumable service is configured. */
13
+ tusEndpoint?: string;
14
+ /** Signed capability naming this destination, sent as tus metadata. */
15
+ ticket?: string;
16
+ ticketExpiresAt?: string;
17
+ maxSize?: number;
18
+ }
19
+ export interface IResumableUploadOptions {
20
+ /** Bytes per PATCH. Defaults to the server's part size. */
21
+ chunkSize?: number;
22
+ /** Content type stamped on the finished object. */
23
+ contentType?: string;
24
+ /** Carried for diagnostics only — the key lives inside the ticket. */
25
+ fileName?: string;
26
+ }
27
+ /**
28
+ * Whether this target can be uploaded resumably. A server without the resumable
29
+ * service omits these fields, and callers fall back to the signed PUT.
30
+ */
31
+ export declare function supportsResumableUpload(target: IUploadTarget): boolean;
32
+ /**
33
+ * Upload a buffer resumably and return the public URL it lands at.
34
+ *
35
+ * `target.fileURL` came back with the ticket, so the final URL is known up
36
+ * front and there is no completion body to parse.
37
+ */
38
+ export declare function uploadResumable(this: IExecuteFunctions, target: IUploadTarget, data: Buffer, options?: IResumableUploadOptions): Promise<string>;
39
+ //# sourceMappingURL=resumable-upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resumable-upload.d.ts","sourceRoot":"","sources":["../../utils/resumable-upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAqBjD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAkB,CAAC;AAQlD,iDAAiD;AACjD,MAAM,WAAW,aAAa;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACvC,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAEtE;AAmBD;;;;;GAKG;AACH,wBAAsB,eAAe,CACpC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,uBAA4B,GACnC,OAAO,CAAC,MAAM,CAAC,CAgEjB"}
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_CHUNK_SIZE = void 0;
4
+ exports.supportsResumableUpload = supportsResumableUpload;
5
+ exports.uploadResumable = uploadResumable;
6
+ /**
7
+ * Resumable uploads (tus 1.0.0) for large media.
8
+ *
9
+ * A signed PUT is all-or-nothing: a dropped connection at 90% of an hour-long
10
+ * video starts the transfer again from zero. The API offers the same
11
+ * destination as a resumable transfer, and this is the client for it.
12
+ *
13
+ * The protocol subset needed is small — create, patch, head — so it goes
14
+ * through n8n's own `httpRequest` helper rather than adding a tus dependency to
15
+ * the node package. That also means the transfer inherits whatever proxy and
16
+ * certificate configuration the n8n instance already has.
17
+ *
18
+ * NOTE: n8n hands binary data to a node as a Buffer, so the whole file is in
19
+ * memory before this is called. Chunking here bounds what a dropped connection
20
+ * costs, not what the workflow allocates.
21
+ */
22
+ const TUS_VERSION = '1.0.0';
23
+ /**
24
+ * 8MiB matches the server's multipart part size, so one PATCH becomes one R2
25
+ * part with no server-side re-buffering.
26
+ */
27
+ exports.DEFAULT_CHUNK_SIZE = 8 * 1024 * 1024;
28
+ /** Backoff between chunk retries. The chunk is retried, never the whole file. */
29
+ const RETRY_DELAYS = [0, 1000, 3000, 5000, 10000];
30
+ /** Consecutive rounds ending at the same offset before the transfer is abandoned. */
31
+ const MAX_CONSECUTIVE_STALLS = 3;
32
+ /**
33
+ * Whether this target can be uploaded resumably. A server without the resumable
34
+ * service omits these fields, and callers fall back to the signed PUT.
35
+ */
36
+ function supportsResumableUpload(target) {
37
+ return !!target.tusEndpoint && !!target.ticket;
38
+ }
39
+ /** tus metadata is `key base64value` pairs, comma separated. */
40
+ function encodeMetadata(pairs) {
41
+ return Object.entries(pairs)
42
+ .filter(([, value]) => !!value)
43
+ .map(([key, value]) => `${key} ${Buffer.from(value, 'utf8').toString('base64')}`)
44
+ .join(',');
45
+ }
46
+ const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
47
+ function readOffset(headers, fallback) {
48
+ // Header casing varies by transport, so check both.
49
+ const raw = headers?.['upload-offset'] ?? headers?.['Upload-Offset'];
50
+ const parsed = Number(raw);
51
+ return Number.isFinite(parsed) ? parsed : fallback;
52
+ }
53
+ /**
54
+ * Upload a buffer resumably and return the public URL it lands at.
55
+ *
56
+ * `target.fileURL` came back with the ticket, so the final URL is known up
57
+ * front and there is no completion body to parse.
58
+ */
59
+ async function uploadResumable(target, data, options = {}) {
60
+ const { chunkSize = exports.DEFAULT_CHUNK_SIZE, contentType = 'application/octet-stream', fileName = 'upload', } = options;
61
+ if (!supportsResumableUpload(target)) {
62
+ throw new Error('This upload target does not support resumable uploads.');
63
+ }
64
+ if (target.maxSize && data.length > target.maxSize) {
65
+ const limitMb = Math.round(target.maxSize / (1024 * 1024));
66
+ throw new Error(`This file is larger than the ${limitMb}MB limit.`);
67
+ }
68
+ // ── Create ────────────────────────────────────────────────────────────
69
+ const createResponse = await this.helpers.httpRequest({
70
+ method: 'POST',
71
+ url: target.tusEndpoint,
72
+ headers: {
73
+ 'Tus-Resumable': TUS_VERSION,
74
+ 'Upload-Length': String(data.length),
75
+ 'Upload-Metadata': encodeMetadata({
76
+ ticket: target.ticket,
77
+ filename: fileName,
78
+ filetype: contentType,
79
+ }),
80
+ },
81
+ returnFullResponse: true,
82
+ });
83
+ const location = createResponse?.headers?.location ?? createResponse?.headers?.Location;
84
+ if (!location) {
85
+ throw new Error('Upload was created but the server returned no Location header.');
86
+ }
87
+ // A tus server may answer with a relative Location; resolve it against the
88
+ // endpoint so a gateway-relative path still points somewhere usable.
89
+ const uploadUrl = new URL(String(location), target.tusEndpoint).toString();
90
+ // ── Transfer ──────────────────────────────────────────────────────────
91
+ let offset = 0;
92
+ let stalls = 0;
93
+ while (offset < data.length) {
94
+ const end = Math.min(offset + chunkSize, data.length);
95
+ const next = await patchChunk.call(this, uploadUrl, data.subarray(offset, end), offset);
96
+ if (next <= offset) {
97
+ // A round ending where it started is not automatically fatal: a
98
+ // spurious 409 re-syncs to the offset we already had, and retrying
99
+ // that chunk is the right recovery. Only repeated stalls give up.
100
+ if (++stalls >= MAX_CONSECUTIVE_STALLS) {
101
+ throw new Error('The upload stopped making progress and was abandoned.');
102
+ }
103
+ continue;
104
+ }
105
+ stalls = 0;
106
+ offset = next;
107
+ }
108
+ return target.fileURL;
109
+ }
110
+ /**
111
+ * Send one chunk, retrying the chunk itself on a transient failure.
112
+ *
113
+ * Returns the server's new offset, which is authoritative — a chunk can be
114
+ * partially accepted, and trusting our own arithmetic would corrupt everything
115
+ * after it.
116
+ */
117
+ async function patchChunk(uploadUrl, chunk, offset) {
118
+ let lastError;
119
+ for (const delay of RETRY_DELAYS) {
120
+ if (delay)
121
+ await wait(delay);
122
+ try {
123
+ const response = await this.helpers.httpRequest({
124
+ method: 'PATCH',
125
+ url: uploadUrl,
126
+ headers: {
127
+ 'Tus-Resumable': TUS_VERSION,
128
+ 'Upload-Offset': String(offset),
129
+ 'Content-Type': 'application/offset+octet-stream',
130
+ },
131
+ body: chunk,
132
+ returnFullResponse: true,
133
+ });
134
+ return readOffset(response?.headers, offset + chunk.length);
135
+ }
136
+ catch (error) {
137
+ const status = error?.response?.status ?? error?.httpCode ?? error?.statusCode;
138
+ // 409 means our offset disagrees with the server's. Re-syncing is the
139
+ // correct recovery, not a retry at the same wrong offset.
140
+ if (Number(status) === 409) {
141
+ return await headOffset.call(this, uploadUrl);
142
+ }
143
+ // Any other 4xx is a decision, not a blip — retrying an expired
144
+ // ticket or an oversized file only wastes the workflow's time.
145
+ if (Number(status) >= 400 && Number(status) < 500) {
146
+ const detail = error?.response?.body?.message || error?.message || '';
147
+ throw new Error(`Upload rejected (${status}): ${detail}`);
148
+ }
149
+ lastError = error;
150
+ }
151
+ }
152
+ throw lastError ?? new Error('Upload failed');
153
+ }
154
+ /** Ask the server how much of this upload it already holds. */
155
+ async function headOffset(uploadUrl) {
156
+ const response = await this.helpers.httpRequest({
157
+ method: 'HEAD',
158
+ url: uploadUrl,
159
+ headers: { 'Tus-Resumable': TUS_VERSION },
160
+ returnFullResponse: true,
161
+ });
162
+ return readOffset(response?.headers, 0);
163
+ }
164
+ //# sourceMappingURL=resumable-upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resumable-upload.js","sourceRoot":"","sources":["../../utils/resumable-upload.ts"],"names":[],"mappings":";;;AA2DA,0DAEC;AAyBD,0CAqEC;AAzJD;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B;;;GAGG;AACU,QAAA,kBAAkB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,iFAAiF;AACjF,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAElD,qFAAqF;AACrF,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAwBjC;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,MAAqB;IAC5D,OAAO,CAAC,CAAC,MAAM,CAAC,WAAW,IAAI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C,OAAO,KAAU,EAAE,CAAC;YACrB,MAAM,MAAM,GAAG,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,EAAE,QAAQ,IAAI,KAAK,EAAE,UAAU,CAAC;YAE/E,sEAAsE;YACtE,0DAA0D;YAC1D,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;gBAC5B,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YAC/C,CAAC;YAED,gEAAgE;YAChE,+DAA+D;YAC/D,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,EAAE,CAAC;gBACnD,MAAM,MAAM,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,KAAK,EAAE,OAAO,IAAI,EAAE,CAAC;gBACtE,MAAM,IAAI,KAAK,CAAC,oBAAoB,MAAM,MAAM,MAAM,EAAE,CAAC,CAAC;YAC3D,CAAC;YAED,SAAS,GAAG,KAAK,CAAC;QACnB,CAAC;IACF,CAAC;IAED,MAAM,SAAS,IAAI,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;AAC/C,CAAC;AAED,+DAA+D;AAC/D,KAAK,UAAU,UAAU,CAA0B,SAAiB;IACnE,MAAM,QAAQ,GAAQ,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;QACpD,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,SAAS;QACd,OAAO,EAAE,EAAE,eAAe,EAAE,WAAW,EAAE;QACzC,kBAAkB,EAAE,IAAI;KACxB,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Short link controls: the body keys built from the node's control fields, the
3
+ * campaign bodies and the Campaign dropdown.
4
+ *
5
+ * Create sends only what the user filled in. Update and Set Rules send every
6
+ * field the user added: an empty value clears it (the API merges `access` key
7
+ * by key, and an absent section keeps the stored one).
8
+ */
9
+ import { ILoadOptionsFunctions, INode, INodePropertyOptions } from 'n8n-workflow';
10
+ import type { ILinkCampaignBody, ILinkCampaignFields, IShortLinkAccess, IShortLinkControlBody, IShortLinkControlFields, IShortLinkPixel, IShortLinkUtm } from '../types/short-link-controls.types';
11
+ export type ControlsMode = 'create' | 'update';
12
+ /** A comma-separated list as trimmed, non-empty, unique items. */
13
+ export declare function splitList(value: unknown): string[];
14
+ /** A `json` parameter as an array; anything else throws naming the field. */
15
+ export declare function parseJsonArray(node: INode, value: unknown, field: string, itemIndex: number): unknown[];
16
+ /** The UTM values of a single-value fixedCollection; empty values are left out, or sent as null on update. */
17
+ export declare function buildUtm(values: IShortLinkUtm | undefined, mode: ControlsMode): IShortLinkUtm | null | undefined;
18
+ /** The `access` object; `removePassword` wins over a password. */
19
+ export declare function buildAccess(fields: IShortLinkControlFields, mode: ControlsMode): IShortLinkAccess | undefined;
20
+ /** The pixels of a multiple-value fixedCollection, the ones with an ID. */
21
+ export declare function buildPixels(fields: IShortLinkControlFields): IShortLinkPixel[];
22
+ /**
23
+ * The control keys of a create / update / set-rules body.
24
+ * @throws NodeOperationError when Routing Rules or Variants is not a JSON array.
25
+ */
26
+ export declare function buildControlFields(node: INode, fields: IShortLinkControlFields, mode: ControlsMode, itemIndex: number): IShortLinkControlBody;
27
+ /** A campaign create / update body; on update only the fields the user added. */
28
+ export declare function buildCampaignBody(name: string, fields: ILinkCampaignFields, mode: ControlsMode): ILinkCampaignBody;
29
+ /** The Campaign dropdown: the caller's campaigns that are not archived. */
30
+ export declare function getCampaigns(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
31
+ //# sourceMappingURL=short-link-controls.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"short-link-controls.helpers.d.ts","sourceRoot":"","sources":["../../utils/short-link-controls.helpers.ts"],"names":[],"mappings":"AAAA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OAAO,CAAC,oBAAoB,EAAE,CAAC,CAQ/F"}
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+ /**
3
+ * Short link controls: the body keys built from the node's control fields, the
4
+ * campaign bodies and the Campaign dropdown.
5
+ *
6
+ * Create sends only what the user filled in. Update and Set Rules send every
7
+ * field the user added: an empty value clears it (the API merges `access` key
8
+ * by key, and an absent section keeps the stored one).
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.splitList = splitList;
12
+ exports.parseJsonArray = parseJsonArray;
13
+ exports.buildUtm = buildUtm;
14
+ exports.buildAccess = buildAccess;
15
+ exports.buildPixels = buildPixels;
16
+ exports.buildControlFields = buildControlFields;
17
+ exports.buildCampaignBody = buildCampaignBody;
18
+ exports.getCampaigns = getCampaigns;
19
+ const n8n_workflow_1 = require("n8n-workflow");
20
+ const api_helpers_1 = require("./api.helpers");
21
+ const constants_1 = require("./constants");
22
+ const link_tool_helpers_1 = require("./link-tool.helpers");
23
+ /** A comma-separated list as trimmed, non-empty, unique items. */
24
+ function splitList(value) {
25
+ const items = (0, link_tool_helpers_1.toText)(value)
26
+ .split(constants_1.SHORT_LINK_CONTROLS.TAGS_SEPARATOR)
27
+ .map((item) => item.trim())
28
+ .filter(Boolean);
29
+ return Array.from(new Set(items));
30
+ }
31
+ /** A `json` parameter as an array; anything else throws naming the field. */
32
+ function parseJsonArray(node, value, field, itemIndex) {
33
+ let parsed = value;
34
+ if (typeof value === 'string') {
35
+ const text = value.trim();
36
+ if (!text)
37
+ return [];
38
+ try {
39
+ parsed = JSON.parse(text);
40
+ }
41
+ catch {
42
+ parsed = undefined;
43
+ }
44
+ }
45
+ if (!Array.isArray(parsed)) {
46
+ throw new n8n_workflow_1.NodeOperationError(node, constants_1.SHORT_LINK_CONTROLS_MESSAGES.INVALID_JSON(field), { itemIndex });
47
+ }
48
+ return parsed;
49
+ }
50
+ /** The UTM values of a single-value fixedCollection; empty values are left out, or sent as null on update. */
51
+ function buildUtm(values, mode) {
52
+ if (!values)
53
+ return undefined;
54
+ const utm = {};
55
+ for (const key of constants_1.LINK_UTM_KEYS) {
56
+ const text = (0, link_tool_helpers_1.toText)(values[key]).trim();
57
+ if (text)
58
+ utm[key] = text;
59
+ else if (mode === 'update' && (0, link_tool_helpers_1.hasField)(values, key))
60
+ utm[key] = null;
61
+ }
62
+ if (!Object.keys(utm).length)
63
+ return mode === 'update' ? null : undefined;
64
+ return utm;
65
+ }
66
+ /** The `access` object; `removePassword` wins over a password. */
67
+ function buildAccess(fields, mode) {
68
+ const access = {};
69
+ for (const key of constants_1.LINK_ACCESS_KEYS) {
70
+ if (!(0, link_tool_helpers_1.hasField)(fields, key))
71
+ continue;
72
+ const raw = fields[key];
73
+ if (key === 'maxVisits') {
74
+ const visits = Number(raw);
75
+ if (visits > 0)
76
+ access.maxVisits = visits;
77
+ else if (mode === 'update')
78
+ access.maxVisits = null;
79
+ continue;
80
+ }
81
+ const text = (0, link_tool_helpers_1.toText)(raw).trim();
82
+ if (text)
83
+ access[key] = text;
84
+ else if (mode === 'update')
85
+ access[key] = null;
86
+ }
87
+ const password = (0, link_tool_helpers_1.toText)(fields.password);
88
+ if (fields.removePassword === true)
89
+ access.password = null;
90
+ else if (password)
91
+ access.password = password;
92
+ return Object.keys(access).length ? access : undefined;
93
+ }
94
+ /** The pixels of a multiple-value fixedCollection, the ones with an ID. */
95
+ function buildPixels(fields) {
96
+ return (fields.pixels?.pixel || [])
97
+ .map((pixel) => ({ provider: pixel.provider, id: (0, link_tool_helpers_1.toText)(pixel.id).trim() }))
98
+ .filter((pixel) => pixel.provider && pixel.id);
99
+ }
100
+ /**
101
+ * The control keys of a create / update / set-rules body.
102
+ * @throws NodeOperationError when Routing Rules or Variants is not a JSON array.
103
+ */
104
+ function buildControlFields(node, fields, mode, itemIndex) {
105
+ const body = {};
106
+ if ((0, link_tool_helpers_1.hasField)(fields, 'tags')) {
107
+ const tags = splitList(fields.tags);
108
+ if (tags.length || mode === 'update')
109
+ body.tags = tags;
110
+ }
111
+ if ((0, link_tool_helpers_1.hasField)(fields, 'campaignId')) {
112
+ const campaignId = (0, link_tool_helpers_1.toText)(fields.campaignId).trim();
113
+ if (campaignId)
114
+ body.campaignId = campaignId;
115
+ else if (mode === 'update')
116
+ body.campaignId = null;
117
+ }
118
+ const access = buildAccess(fields, mode);
119
+ if (access)
120
+ body.access = access;
121
+ if ((0, link_tool_helpers_1.hasField)(fields, 'utm')) {
122
+ const utm = buildUtm(fields.utm?.values, mode);
123
+ if (utm !== undefined)
124
+ body.utm = utm;
125
+ }
126
+ for (const [field, key, label] of [
127
+ ['routingRules', 'routing', 'Routing Rules'],
128
+ ['variants', 'variants', 'Variants'],
129
+ ]) {
130
+ if (!(0, link_tool_helpers_1.hasField)(fields, field))
131
+ continue;
132
+ const list = parseJsonArray(node, fields[field], label, itemIndex);
133
+ if (list.length || mode === 'update')
134
+ body[key] = list;
135
+ }
136
+ if ((0, link_tool_helpers_1.hasField)(fields, 'pixels')) {
137
+ const pixels = buildPixels(fields);
138
+ if (pixels.length || mode === 'update')
139
+ body.pixels = pixels;
140
+ }
141
+ if (typeof fields.pixelsConsentAcknowledged === 'boolean' && fields.pixelsConsentAcknowledged) {
142
+ body.pixelsConsentAcknowledged = true;
143
+ }
144
+ if (typeof fields.healthMonitor === 'boolean')
145
+ body.health = { enabled: fields.healthMonitor };
146
+ return body;
147
+ }
148
+ /** A campaign create / update body; on update only the fields the user added. */
149
+ function buildCampaignBody(name, fields, mode) {
150
+ const body = {};
151
+ if (name)
152
+ body.name = name;
153
+ if ((0, link_tool_helpers_1.hasField)(fields, 'description')) {
154
+ const description = (0, link_tool_helpers_1.toText)(fields.description).trim();
155
+ if (description)
156
+ body.description = description;
157
+ else if (mode === 'update')
158
+ body.description = null;
159
+ }
160
+ if ((0, link_tool_helpers_1.hasField)(fields, 'color')) {
161
+ if (fields.color)
162
+ body.color = fields.color;
163
+ else if (mode === 'update')
164
+ body.color = null;
165
+ }
166
+ if ((0, link_tool_helpers_1.hasField)(fields, 'utm')) {
167
+ const utm = buildUtm(fields.utm?.values, mode);
168
+ if (utm !== undefined)
169
+ body.utm = utm;
170
+ }
171
+ if (typeof fields.archived === 'boolean')
172
+ body.archived = fields.archived;
173
+ return body;
174
+ }
175
+ /** The Campaign dropdown: the caller's campaigns that are not archived. */
176
+ async function getCampaigns() {
177
+ const credentials = await this.getCredentials('posty5Api');
178
+ const page = (await api_helpers_1.makeApiRequest.call(this, credentials.apiKey, {
179
+ method: 'GET',
180
+ endpoint: constants_1.API_ENDPOINTS.LINK_CAMPAIGN,
181
+ qs: { archived: false, page: 1, pageSize: constants_1.SHORT_LINK_CONTROLS.CAMPAIGN_LOOKUP_PAGE_SIZE },
182
+ }));
183
+ return (page?.items || []).map((campaign) => ({ name: campaign.name, value: campaign._id }));
184
+ }
185
+ //# sourceMappingURL=short-link-controls.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"short-link-controls.helpers.js","sourceRoot":"","sources":["../../utils/short-link-controls.helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AA0BH,8BAMC;AAGD,wCAeC;AAGD,4BAUC;AAGD,kCAmBC;AAGD,kCAIC;AAMD,gDA6CC;AAGD,8CAkBC;AAGD,oCAQC;AA7KD,+CAAsG;AACtG,+CAA+C;AAC/C,2CAMqB;AACrB,2DAAuD;AAcvD,kEAAkE;AAClE,SAAgB,SAAS,CAAC,KAAc;IACvC,MAAM,KAAK,GAAG,IAAA,0BAAM,EAAC,KAAK,CAAC;SACzB,KAAK,CAAC,+BAAmB,CAAC,cAAc,CAAC;SACzC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,OAAO,CAAC,CAAC;IAClB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACnC,CAAC;AAED,6EAA6E;AAC7E,SAAgB,cAAc,CAAC,IAAW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,MAAM,IAAI,GAAG,CAAC,MAAM,4BAAc,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,MAAgB,EAAE;QAC3E,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,yBAAa,CAAC,aAAa;QACrC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,+BAAmB,CAAC,yBAAyB,EAAE;KACzF,CAAC,CAAsD,CAAC;IACzD,OAAO,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAC9F,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Short Link node parameters of the short link controls: the control fields of
3
+ * Create / Update / Set Rules, and the campaign operations' fields.
4
+ */
5
+ import type { INodeProperties } from 'n8n-workflow';
6
+ /** UTM as a single-value fixedCollection (`utm.values`). */
7
+ export declare function buildUtmProperty(description: string): INodeProperties;
8
+ /** The control fields appended to the Create / Update Additional Fields. */
9
+ export declare const SHORT_LINK_CONTROL_ADDITIONAL_FIELDS: INodeProperties[];
10
+ /** Set Rules: the rule sections, each sent only when added. */
11
+ export declare const SHORT_LINK_SET_RULES_PROPERTIES: INodeProperties[];
12
+ /** List Tags and the List filters. */
13
+ export declare const SHORT_LINK_LIST_TAGS_PROPERTIES: INodeProperties[];
14
+ export declare const SHORT_LINK_CONTROL_LIST_FILTERS: INodeProperties[];
15
+ /** Campaign operations' fields. */
16
+ export declare const LINK_CAMPAIGN_PROPERTIES: INodeProperties[];
17
+ //# sourceMappingURL=short-link-controls.properties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"short-link-controls.properties.d.ts","sourceRoot":"","sources":["../../utils/short-link-controls.properties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAcpD,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAsBrE;AA4GD,4EAA4E;AAC5E,eAAO,MAAM,oCAAoC,EAAE,eAAe,EA0BjE,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,+BAA+B,EAAE,eAAe,EAW5D,CAAC;AAEF,sCAAsC;AACtC,eAAO,MAAM,+BAA+B,EAAE,eAAe,EAS5D,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,eAAe,EAkB5D,CAAC;AAqBF,mCAAmC;AACnC,eAAO,MAAM,wBAAwB,EAAE,eAAe,EAkFrD,CAAC"}