@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.
Files changed (170) hide show
  1. package/README.md +351 -15
  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 +143 -52
  30. package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.js.map +1 -1
  31. package/dist/nodes/Posty5Store/Posty5Store.node.d.ts +17 -0
  32. package/dist/nodes/Posty5Store/Posty5Store.node.d.ts.map +1 -0
  33. package/dist/nodes/Posty5Store/Posty5Store.node.js +230 -0
  34. package/dist/nodes/Posty5Store/Posty5Store.node.js.map +1 -0
  35. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.d.ts +4 -0
  36. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.d.ts.map +1 -0
  37. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.js +55 -0
  38. package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.js.map +1 -0
  39. package/dist/nodes/Posty5Store/descriptions/order.description.d.ts +4 -0
  40. package/dist/nodes/Posty5Store/descriptions/order.description.d.ts.map +1 -0
  41. package/dist/nodes/Posty5Store/descriptions/order.description.js +91 -0
  42. package/dist/nodes/Posty5Store/descriptions/order.description.js.map +1 -0
  43. package/dist/nodes/Posty5Store/descriptions/product-link.description.d.ts +4 -0
  44. package/dist/nodes/Posty5Store/descriptions/product-link.description.d.ts.map +1 -0
  45. package/dist/nodes/Posty5Store/descriptions/product-link.description.js +48 -0
  46. package/dist/nodes/Posty5Store/descriptions/product-link.description.js.map +1 -0
  47. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.d.ts +4 -0
  48. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.d.ts.map +1 -0
  49. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.js +118 -0
  50. package/dist/nodes/Posty5Store/descriptions/supplier-order.description.js.map +1 -0
  51. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.d.ts +4 -0
  52. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.d.ts.map +1 -0
  53. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.js +167 -0
  54. package/dist/nodes/Posty5Store/descriptions/supplier-product.description.js.map +1 -0
  55. package/dist/nodes/Posty5Store/descriptions/supplier.description.d.ts +4 -0
  56. package/dist/nodes/Posty5Store/descriptions/supplier.description.d.ts.map +1 -0
  57. package/dist/nodes/Posty5Store/descriptions/supplier.description.js +50 -0
  58. package/dist/nodes/Posty5Store/descriptions/supplier.description.js.map +1 -0
  59. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.d.ts +13 -0
  60. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.d.ts.map +1 -0
  61. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.js +171 -0
  62. package/dist/nodes/Posty5Trigger/Posty5Trigger.node.js.map +1 -0
  63. package/dist/nodes/Posty5Trigger/config.d.ts +51 -0
  64. package/dist/nodes/Posty5Trigger/config.d.ts.map +1 -0
  65. package/dist/nodes/Posty5Trigger/config.js +76 -0
  66. package/dist/nodes/Posty5Trigger/config.js.map +1 -0
  67. package/dist/nodes/Posty5Trigger/descriptions.d.ts +4 -0
  68. package/dist/nodes/Posty5Trigger/descriptions.d.ts.map +1 -0
  69. package/dist/nodes/Posty5Trigger/descriptions.js +99 -0
  70. package/dist/nodes/Posty5Trigger/descriptions.js.map +1 -0
  71. package/dist/nodes/Posty5Trigger/helpers.d.ts +34 -0
  72. package/dist/nodes/Posty5Trigger/helpers.d.ts.map +1 -0
  73. package/dist/nodes/Posty5Trigger/helpers.js +139 -0
  74. package/dist/nodes/Posty5Trigger/helpers.js.map +1 -0
  75. package/dist/package.json +78 -0
  76. package/dist/types/common.d.ts +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/short-link-controls.helpers.d.ts +31 -0
  155. package/dist/utils/short-link-controls.helpers.d.ts.map +1 -0
  156. package/dist/utils/short-link-controls.helpers.js +185 -0
  157. package/dist/utils/short-link-controls.helpers.js.map +1 -0
  158. package/dist/utils/short-link-controls.properties.d.ts +17 -0
  159. package/dist/utils/short-link-controls.properties.d.ts.map +1 -0
  160. package/dist/utils/short-link-controls.properties.js +315 -0
  161. package/dist/utils/short-link-controls.properties.js.map +1 -0
  162. package/dist/utils/store.helpers.d.ts +43 -0
  163. package/dist/utils/store.helpers.d.ts.map +1 -0
  164. package/dist/utils/store.helpers.js +87 -0
  165. package/dist/utils/store.helpers.js.map +1 -0
  166. package/dist/utils/versioned-write.helpers.d.ts +31 -0
  167. package/dist/utils/versioned-write.helpers.d.ts.map +1 -0
  168. package/dist/utils/versioned-write.helpers.js +120 -0
  169. package/dist/utils/versioned-write.helpers.js.map +1 -0
  170. 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,SAAgB,sBAAsB,CACrC,aAA0C,EAC1C,eAA4C;IAE5C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAiD;QAC3D,CAAC,aAAa,EAAE,8BAAkB,CAAC,UAAU,CAAC;QAC9C,CAAC,eAAe,EAAE,8BAAkB,CAAC,YAAY,CAAC;KAClD,CAAC;IAEF,KAAK,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,KAAK,EAAE,CAAC;QAC9C,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,MAAM,EAAE,GAAG,IAAA,6BAAS,EAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;YACpC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBAAE,SAAS;YAClC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAA,6BAAS,EAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QAChF,CAAC;IACF,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAChC,QAAiB,EACjB,MAAiC,EACjC,MAA8B;IAE9B,MAAM,UAAU,GAAG,IAAA,6BAAS,EAAC,QAAQ,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC9E,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,8BAAkB,CAAC,iBAAiB,CAAC,CAAC;IACvE,OAAO,UAAU,CAAC;AACnB,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;;;;;;;GAOG;AAEH,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,oBAAoB,EAAsB,MAAM,cAAc,CAAC;AAUtG,OAAO,KAAK,EACX,iB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* 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,EAAE,KAAc,EAAE,KAAa,EAAE,SAAiB;IAC3F,IAAI,MAAM,GAAY,KAAK,CAAC;IAC5B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE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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"}
@@ -0,0 +1,315 @@
1
+ "use strict";
2
+ /**
3
+ * Short Link node parameters of the short link controls: the control fields of
4
+ * Create / Update / Set Rules, and the campaign operations' fields.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.LINK_CAMPAIGN_PROPERTIES = exports.SHORT_LINK_CONTROL_LIST_FILTERS = exports.SHORT_LINK_LIST_TAGS_PROPERTIES = exports.SHORT_LINK_SET_RULES_PROPERTIES = exports.SHORT_LINK_CONTROL_ADDITIONAL_FIELDS = void 0;
8
+ exports.buildUtmProperty = buildUtmProperty;
9
+ const constants_1 = require("./constants");
10
+ const PIXEL_PROVIDER_LABELS = {
11
+ meta: 'Meta',
12
+ googleAds: 'Google Ads',
13
+ tiktok: 'TikTok',
14
+ linkedin: 'LinkedIn',
15
+ x: 'X',
16
+ pinterest: 'Pinterest',
17
+ };
18
+ const capitalize = (value) => value.charAt(0).toUpperCase() + value.slice(1);
19
+ /** UTM as a single-value fixedCollection (`utm.values`). */
20
+ function buildUtmProperty(description) {
21
+ return {
22
+ displayName: 'UTM',
23
+ name: 'utm',
24
+ type: 'fixedCollection',
25
+ default: {},
26
+ placeholder: 'Add UTM',
27
+ description,
28
+ options: [
29
+ {
30
+ displayName: 'Values',
31
+ name: 'values',
32
+ values: constants_1.LINK_UTM_KEYS.map((key) => ({
33
+ displayName: capitalize(key),
34
+ name: key,
35
+ type: 'string',
36
+ default: '',
37
+ description: `The utm_${key} value. Up to 100 characters, no spaces, quotes or angle brackets.`,
38
+ })),
39
+ },
40
+ ],
41
+ };
42
+ }
43
+ /** The access / routing / variants / UTM / pixels fields (Set Rules and the Additional Fields). */
44
+ const RULE_FIELDS = [
45
+ {
46
+ displayName: 'Active From',
47
+ name: 'activeFrom',
48
+ type: 'dateTime',
49
+ default: '',
50
+ description: 'Before this moment the link answers "not yet active". On Update, an empty value clears it.',
51
+ },
52
+ {
53
+ displayName: 'Expires At',
54
+ name: 'expiresAt',
55
+ type: 'dateTime',
56
+ default: '',
57
+ description: 'After this moment the link answers "expired". On Update, an empty value clears it.',
58
+ },
59
+ {
60
+ displayName: 'Fallback URL',
61
+ name: 'fallbackUrl',
62
+ type: 'string',
63
+ default: '',
64
+ placeholder: 'https://example.com/ended',
65
+ description: 'Where a stopped visit (not active, expired, limit reached) goes instead of the unavailable page',
66
+ },
67
+ {
68
+ displayName: 'Max Visits',
69
+ name: 'maxVisits',
70
+ type: 'number',
71
+ typeOptions: { minValue: 0, maxValue: 10000000 },
72
+ default: 0,
73
+ description: 'Stop the link after this many visits (people, never bots). 0 on Update clears the limit.',
74
+ },
75
+ {
76
+ displayName: 'Password',
77
+ name: 'password',
78
+ type: 'string',
79
+ typeOptions: { password: true },
80
+ default: '',
81
+ description: '4 – 128 characters. Visitors must enter it before they continue. Never returned by the API. Plan-gated. n8n stores node parameters in the workflow: prefer an expression reading a secret.',
82
+ },
83
+ {
84
+ displayName: 'Remove Password',
85
+ name: 'removePassword',
86
+ type: 'boolean',
87
+ default: false,
88
+ description: 'Whether to remove the link password (wins over Password)',
89
+ },
90
+ {
91
+ displayName: 'Routing Rules (JSON)',
92
+ name: 'routingRules',
93
+ type: 'json',
94
+ default: '[]',
95
+ description: 'Ordered rules, the first match wins (max 20). Conditions: countries, devices (tablet, mobile, desktop, other), os (android, ios, windows, macos, linux), languages, timeWindow {days,from,to,tz}. Keep each rule\'s ID when updating. [] on Update clears them.',
96
+ hint: 'Example: [{"name":"DE mobile","conditions":{"countries":["DE"],"devices":["mobile"]},"targetUrl":"https://example.de"}]',
97
+ },
98
+ {
99
+ displayName: 'Variants (JSON)',
100
+ name: 'variants',
101
+ type: 'json',
102
+ default: '[]',
103
+ description: 'A/B split: 0 or 2 – 5 variants, each with a name, a destination and a relative weight (1 – 100). [] on Update clears them.',
104
+ hint: 'Example: [{"name":"A","url":"https://a.example","weight":50},{"name":"B","url":"https://b.example","weight":50}]',
105
+ },
106
+ buildUtmProperty('UTM parameters appended to the destination'),
107
+ {
108
+ displayName: 'Pixels',
109
+ name: 'pixels',
110
+ type: 'fixedCollection',
111
+ typeOptions: { multipleValues: true },
112
+ default: {},
113
+ placeholder: 'Add Pixel',
114
+ description: 'Retargeting pixels fired before the redirect (one per provider, max 5)',
115
+ options: [
116
+ {
117
+ displayName: 'Pixel',
118
+ name: 'pixel',
119
+ values: [
120
+ {
121
+ displayName: 'Provider',
122
+ name: 'provider',
123
+ type: 'options',
124
+ options: constants_1.LINK_PIXEL_PROVIDERS.map((value) => ({ name: PIXEL_PROVIDER_LABELS[value], value })),
125
+ default: 'meta',
126
+ },
127
+ {
128
+ displayName: 'Pixel ID',
129
+ name: 'id',
130
+ type: 'string',
131
+ default: '',
132
+ },
133
+ ],
134
+ },
135
+ ],
136
+ },
137
+ {
138
+ displayName: 'Pixels Consent Acknowledged',
139
+ name: 'pixelsConsentAcknowledged',
140
+ type: 'boolean',
141
+ default: false,
142
+ description: 'Whether you confirm a lawful basis for tracking visitors. Required the first time pixels are set.',
143
+ },
144
+ ];
145
+ /** The control fields appended to the Create / Update Additional Fields. */
146
+ exports.SHORT_LINK_CONTROL_ADDITIONAL_FIELDS = [
147
+ {
148
+ displayName: 'Tags',
149
+ name: 'tags',
150
+ type: 'string',
151
+ default: '',
152
+ placeholder: 'summer, newsletter',
153
+ description: 'Comma-separated tags. On Update, they replace the list; an empty value clears it.',
154
+ },
155
+ {
156
+ displayName: 'Campaign Name or ID',
157
+ name: 'campaignId',
158
+ type: 'options',
159
+ typeOptions: { loadOptionsMethod: 'getCampaigns' },
160
+ default: '',
161
+ description: 'The campaign the link belongs to; its UTM fills the link\'s empty UTM fields. On Update, an empty value detaches it. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
162
+ },
163
+ {
164
+ displayName: 'Health Monitor',
165
+ name: 'healthMonitor',
166
+ type: 'boolean',
167
+ default: false,
168
+ description: 'Whether Posty5 checks the destination regularly and records when it fails',
169
+ },
170
+ ...RULE_FIELDS,
171
+ ];
172
+ /** Set Rules: the rule sections, each sent only when added. */
173
+ exports.SHORT_LINK_SET_RULES_PROPERTIES = [
174
+ {
175
+ displayName: 'Rules',
176
+ name: 'rules',
177
+ type: 'collection',
178
+ placeholder: 'Add Rule',
179
+ default: {},
180
+ displayOptions: { show: { operation: ['setRules'] } },
181
+ description: 'Only the sections you add change; an added but empty one clears it',
182
+ options: RULE_FIELDS,
183
+ },
184
+ ];
185
+ /** List Tags and the List filters. */
186
+ exports.SHORT_LINK_LIST_TAGS_PROPERTIES = [
187
+ {
188
+ displayName: 'Starts With',
189
+ name: 'term',
190
+ type: 'string',
191
+ default: '',
192
+ displayOptions: { show: { operation: ['listTags'] } },
193
+ description: 'Only tags starting with this text (case-insensitive)',
194
+ },
195
+ ];
196
+ exports.SHORT_LINK_CONTROL_LIST_FILTERS = [
197
+ {
198
+ displayName: 'Campaign Name or ID',
199
+ name: 'campaignId',
200
+ type: 'options',
201
+ typeOptions: { loadOptionsMethod: 'getCampaigns' },
202
+ default: '',
203
+ description: 'Only links of this campaign. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
204
+ },
205
+ {
206
+ displayName: 'Tags',
207
+ name: 'tags',
208
+ type: 'string',
209
+ default: '',
210
+ placeholder: 'summer, newsletter',
211
+ description: 'Comma-separated: links carrying any of these tags',
212
+ },
213
+ ];
214
+ const CAMPAIGN_OPERATIONS_WITH_ID = ['getCampaign', 'updateCampaign', 'deleteCampaign'];
215
+ const CAMPAIGN_FIELDS = [
216
+ {
217
+ displayName: 'Color',
218
+ name: 'color',
219
+ type: 'options',
220
+ options: [{ name: 'None', value: '' }, ...constants_1.LINK_CAMPAIGN_COLORS.map((value) => ({ name: capitalize(value), value }))],
221
+ default: '',
222
+ },
223
+ {
224
+ displayName: 'Description',
225
+ name: 'description',
226
+ type: 'string',
227
+ default: '',
228
+ },
229
+ buildUtmProperty('Copied into a link\'s empty UTM fields when the link is saved with this campaign'),
230
+ ];
231
+ /** Campaign operations' fields. */
232
+ exports.LINK_CAMPAIGN_PROPERTIES = [
233
+ {
234
+ displayName: 'Campaign ID',
235
+ name: 'campaignId',
236
+ type: 'string',
237
+ required: true,
238
+ default: '',
239
+ displayOptions: { show: { operation: CAMPAIGN_OPERATIONS_WITH_ID } },
240
+ },
241
+ {
242
+ displayName: 'Campaign Name',
243
+ name: 'campaignName',
244
+ type: 'string',
245
+ required: true,
246
+ default: '',
247
+ displayOptions: { show: { operation: ['createCampaign'] } },
248
+ },
249
+ {
250
+ displayName: 'Additional Fields',
251
+ name: 'campaignFields',
252
+ type: 'collection',
253
+ placeholder: 'Add Field',
254
+ default: {},
255
+ displayOptions: { show: { operation: ['createCampaign'] } },
256
+ options: CAMPAIGN_FIELDS,
257
+ },
258
+ {
259
+ displayName: 'Update Fields',
260
+ name: 'campaignFields',
261
+ type: 'collection',
262
+ placeholder: 'Add Field',
263
+ default: {},
264
+ displayOptions: { show: { operation: ['updateCampaign'] } },
265
+ options: [
266
+ {
267
+ displayName: 'Archived',
268
+ name: 'archived',
269
+ type: 'boolean',
270
+ default: false,
271
+ description: 'Whether the campaign is archived (hidden from pickers; its links keep working)',
272
+ },
273
+ {
274
+ displayName: 'Name',
275
+ name: 'name',
276
+ type: 'string',
277
+ default: '',
278
+ },
279
+ ...CAMPAIGN_FIELDS,
280
+ ],
281
+ },
282
+ {
283
+ displayName: 'Detach Links',
284
+ name: 'detach',
285
+ type: 'boolean',
286
+ default: false,
287
+ displayOptions: { show: { operation: ['deleteCampaign'] } },
288
+ description: 'Whether to detach the campaign\'s links first. Off, the API refuses to delete a campaign links still use.',
289
+ },
290
+ {
291
+ displayName: 'Filters',
292
+ name: 'campaignFilters',
293
+ type: 'collection',
294
+ placeholder: 'Add Filter',
295
+ default: {},
296
+ displayOptions: { show: { operation: ['listCampaigns'] } },
297
+ options: [
298
+ {
299
+ displayName: 'Archived',
300
+ name: 'archived',
301
+ type: 'boolean',
302
+ default: false,
303
+ description: 'Whether to list only archived (true) or only active (false) campaigns',
304
+ },
305
+ {
306
+ displayName: 'Search',
307
+ name: 'term',
308
+ type: 'string',
309
+ default: '',
310
+ description: 'Only campaigns whose name contains this text',
311
+ },
312
+ ],
313
+ },
314
+ ];
315
+ //# sourceMappingURL=short-link-controls.properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"short-link-controls.properties.js","sourceRoot":"","sources":["../../utils/short-link-controls.properties.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiBH,4CAsBC;AApCD,2CAAwF;AAExF,MAAM,qBAAqB,GAA0D;IACpF,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,YAAY;IACvB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,CAAC,EAAE,GAAG;IACN,SAAS,EAAE,WAAW;CACtB,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE7F,4DAA4D;AAC5D,SAAgB,gBAAgB,CAAC,WAAmB;IACnD,OAAO;QACN,WAAW,EAAE,KAAK;QAClB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,SAAS;QACtB,WAAW;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,QAAQ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