@affeldt28/n8n-nodes-weclapp 1.2.5 → 1.3.1

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 (23) hide show
  1. package/README.md +15 -0
  2. package/dist/nodes/Weclapp/descriptions/shared/QueryParameter/includeReferencedEntities.js +4 -1
  3. package/dist/nodes/Weclapp/descriptions/shared/QueryParameter/includeReferencedEntities.js.map +1 -1
  4. package/dist/nodes/Weclapp/descriptions/shared/QueryParameter/properties.js +4 -1
  5. package/dist/nodes/Weclapp/descriptions/shared/QueryParameter/properties.js.map +1 -1
  6. package/dist/nodes/Weclapp/descriptions/shared/QueryParameter/sort.js +3 -0
  7. package/dist/nodes/Weclapp/descriptions/shared/QueryParameter/sort.js.map +1 -1
  8. package/dist/nodes/WeclappTrigger/GenericFunctions.d.ts +8 -0
  9. package/dist/nodes/WeclappTrigger/GenericFunctions.js +33 -0
  10. package/dist/nodes/WeclappTrigger/GenericFunctions.js.map +1 -0
  11. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.d.ts +12 -0
  12. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.js +92 -0
  13. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.js.map +1 -0
  14. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.json +16 -0
  15. package/dist/nodes/WeclappTrigger/descriptions/index.d.ts +4 -0
  16. package/dist/nodes/WeclappTrigger/descriptions/index.js +29 -0
  17. package/dist/nodes/WeclappTrigger/descriptions/index.js.map +1 -0
  18. package/dist/nodes/WeclappTrigger/descriptions/ticket.d.ts +9 -0
  19. package/dist/nodes/WeclappTrigger/descriptions/ticket.js +18 -0
  20. package/dist/nodes/WeclappTrigger/descriptions/ticket.js.map +1 -0
  21. package/dist/package.json +3 -2
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +3 -2
package/README.md CHANGED
@@ -135,6 +135,21 @@ No specific minimum n8n version is pinned in this package yet.
135
135
 
136
136
  ## Usage
137
137
 
138
+ ### Ticket creation trigger
139
+
140
+ Add **Weclapp Trigger** to your workflow, select your **Weclapp API** credential,
141
+ and choose **Ticket Created**. Activate the workflow to receive new ticket events.
142
+ The node automatically registers a weclapp webhook for ticket creation and removes
143
+ its subscription when the workflow is deactivated. Ticket updates and deletions
144
+ do not trigger the workflow, and existing tickets are not imported.
145
+
146
+ Your n8n webhook URL must be reachable from weclapp. The API token needs permission
147
+ to create, read, and delete webhooks. For a manual test, listen for a test event
148
+ and then create a ticket in weclapp.
149
+
150
+ The trigger outputs the webhook request body. Use **Weclapp > Ticket > Get** with
151
+ the ticket ID from the event if you need the full ticket details.
152
+
138
153
  For query operations, use the available query parameters to shape the weclapp request:
139
154
 
140
155
  * **Page**, **Page Size**, and **Offset** control pagination.
@@ -7,6 +7,9 @@ exports.includeReferencedEntitiesQueryParameter = {
7
7
  type: 'fixedCollection',
8
8
  typeOptions: {
9
9
  multipleValues: true,
10
+ fixedCollection: {
11
+ itemTitle: '={{ $collection.item.value.name || "Referenced Entity" }}',
12
+ },
10
13
  },
11
14
  default: {},
12
15
  placeholder: 'Add Referenced Entity',
@@ -29,7 +32,7 @@ exports.includeReferencedEntitiesQueryParameter = {
29
32
  routing: {
30
33
  request: {
31
34
  qs: {
32
- includeReferencedEntities: '={{$parameter.includeReferencedEntities.entity.map((e) => e.name).join(",")}}',
35
+ includeReferencedEntities: '={{($parameter.options.includeReferencedEntities?.entity ?? []).map(e => e.name.trim()).filter(Boolean).join(",") || undefined}}',
33
36
  },
34
37
  },
35
38
  },
@@ -1 +1 @@
1
- {"version":3,"file":"includeReferencedEntities.js","sourceRoot":"","sources":["../../../../../../nodes/Weclapp/descriptions/shared/QueryParameter/includeReferencedEntities.ts"],"names":[],"mappings":";;;AAEa,QAAA,uCAAuC,GAAoB;IACvE,WAAW,EAAE,6BAA6B;IAC1C,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;QACZ,cAAc,EAAE,IAAI;KACpB;IACD,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,uBAAuB;IACpC,OAAO,EAAE;QACR;YACC,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,aAAa;oBAC1B,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,eAAe;oBAC5B,QAAQ,EAAE,IAAI;iBACd;aACD;SACD;KACD;IACD,OAAO,EAAE;QACR,OAAO,EAAE;YACR,EAAE,EAAE;gBACH,yBAAyB,EACxB,+EAA+E;aAChF;SACD;KACD;CACD,CAAC"}
1
+ {"version":3,"file":"includeReferencedEntities.js","sourceRoot":"","sources":["../../../../../../nodes/Weclapp/descriptions/shared/QueryParameter/includeReferencedEntities.ts"],"names":[],"mappings":";;;AAEa,QAAA,uCAAuC,GAAoB;IACvE,WAAW,EAAE,6BAA6B;IAC1C,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;QACZ,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE;YAChB,SAAS,EAAE,2DAA2D;SACtE;KACD;IACD,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,uBAAuB;IACpC,OAAO,EAAE;QACR;YACC,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,aAAa;oBAC1B,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,eAAe;oBAC5B,QAAQ,EAAE,IAAI;iBACd;aACD;SACD;KACD;IACD,OAAO,EAAE;QACR,OAAO,EAAE;YACR,EAAE,EAAE;gBACH,yBAAyB,EACxB,kIAAkI;aACnI;SACD;KACD;CACD,CAAC"}
@@ -7,6 +7,9 @@ exports.propertiesQueryParameter = {
7
7
  type: 'fixedCollection',
8
8
  typeOptions: {
9
9
  multipleValues: true,
10
+ fixedCollection: {
11
+ itemTitle: '={{ $collection.item.value.property || "Property" }}',
12
+ },
10
13
  },
11
14
  default: {},
12
15
  placeholder: 'Add Property',
@@ -30,7 +33,7 @@ exports.propertiesQueryParameter = {
30
33
  routing: {
31
34
  request: {
32
35
  qs: {
33
- properties: '={{$parameter.properties.items.map(item => item.property).join(",")}}',
36
+ properties: '={{($parameter.options.properties?.items ?? []).map(item => item.property.trim()).filter(Boolean).join(",") || undefined}}',
34
37
  },
35
38
  },
36
39
  },
@@ -1 +1 @@
1
- {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../../../../nodes/Weclapp/descriptions/shared/QueryParameter/properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,wBAAwB,GAAoB;IACxD,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;QACZ,cAAc,EAAE,IAAI;KACpB;IACD,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE;QACR;YACC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,OAAO;YACb,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,eAAe;oBAC5B,IAAI,EAAE,UAAU;oBAChB,WAAW,EAAE,6DAA6D;oBAC1E,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,wBAAwB;oBACrC,QAAQ,EAAE,IAAI;iBACd;aACD;SACD;KACD;IACD,OAAO,EAAE;QACR,OAAO,EAAE;YACR,EAAE,EAAE;gBACH,UAAU,EAAE,uEAAuE;aACnF;SACD;KACD;CACD,CAAC"}
1
+ {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../../../../nodes/Weclapp/descriptions/shared/QueryParameter/properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,wBAAwB,GAAoB;IACxD,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;QACZ,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE;YAChB,SAAS,EAAE,sDAAsD;SACjE;KACD;IACD,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE;QACR;YACC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,OAAO;YACb,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,eAAe;oBAC5B,IAAI,EAAE,UAAU;oBAChB,WAAW,EAAE,6DAA6D;oBAC1E,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,wBAAwB;oBACrC,QAAQ,EAAE,IAAI;iBACd;aACD;SACD;KACD;IACD,OAAO,EAAE;QACR,OAAO,EAAE;YACR,EAAE,EAAE;gBACH,UAAU,EACT,4HAA4H;aAC7H;SACD;KACD;CACD,CAAC"}
@@ -7,6 +7,9 @@ exports.sortQueryParameter = {
7
7
  type: 'fixedCollection',
8
8
  typeOptions: {
9
9
  multipleValues: true,
10
+ fixedCollection: {
11
+ itemTitle: '={{ $collection.item.value.property || "Sort" }}',
12
+ },
10
13
  },
11
14
  default: {},
12
15
  placeholder: 'Add Sort',
@@ -1 +1 @@
1
- {"version":3,"file":"sort.js","sourceRoot":"","sources":["../../../../../../nodes/Weclapp/descriptions/shared/QueryParameter/sort.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAAoB;IAClD,WAAW,EAAE,SAAS;IACtB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;QACZ,cAAc,EAAE,IAAI;KACpB;IACD,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,UAAU;IACvB,OAAO,EAAE;QACR;YACC,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,uBAAuB;oBACpC,QAAQ,EAAE,IAAI;iBACd;gBACD;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,WAAW;4BACjB,KAAK,EAAE,KAAK;yBACZ;wBACD;4BACC,IAAI,EAAE,YAAY;4BAClB,KAAK,EAAE,MAAM;yBACb;qBACD;iBACD;aACD;SACD;KACD;IACD,OAAO,EAAE;QACR,OAAO,EAAE;YACR,EAAE,EAAE;gBACH,IAAI,EAAE,gHAAgH;aACtH;SACD;KACD;CACD,CAAC"}
1
+ {"version":3,"file":"sort.js","sourceRoot":"","sources":["../../../../../../nodes/Weclapp/descriptions/shared/QueryParameter/sort.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAAoB;IAClD,WAAW,EAAE,SAAS;IACtB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;QACZ,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE;YAChB,SAAS,EAAE,kDAAkD;SAC7D;KACD;IACD,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,UAAU;IACvB,OAAO,EAAE;QACR;YACC,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,uBAAuB;oBACpC,QAAQ,EAAE,IAAI;iBACd;gBACD;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,WAAW;4BACjB,KAAK,EAAE,KAAK;yBACZ;wBACD;4BACC,IAAI,EAAE,YAAY;4BAClB,KAAK,EAAE,MAAM;yBACb;qBACD;iBACD;aACD;SACD;KACD;IACD,OAAO,EAAE;QACR,OAAO,EAAE;YACR,EAAE,EAAE;gBACH,IAAI,EAAE,gHAAgH;aACtH;SACD;KACD;CACD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { IDataObject, IHookFunctions } from 'n8n-workflow';
2
+ import type { WebhookEvent } from './descriptions/ticket';
3
+ export declare function isNotFound(error: unknown): boolean;
4
+ export declare const WeclappWebhookApi: {
5
+ getWebhook(context: IHookFunctions, id: string): Promise<IDataObject>;
6
+ createWebhook(context: IHookFunctions, event: WebhookEvent, url: string): Promise<IDataObject>;
7
+ deleteWebhook(context: IHookFunctions, id: string): Promise<IDataObject>;
8
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WeclappWebhookApi = void 0;
4
+ exports.isNotFound = isNotFound;
5
+ async function apiRequest(context, method, path, body) {
6
+ const credentials = await context.getCredentials('weclappApi');
7
+ return await context.helpers.httpRequestWithAuthentication.call(context, 'weclappApi', {
8
+ method,
9
+ url: `https://${credentials.tenant}.weclapp.com/webapp/api/v2${path}`,
10
+ headers: { Accept: 'application/json' },
11
+ body,
12
+ json: true,
13
+ });
14
+ }
15
+ function isNotFound(error) {
16
+ var _a;
17
+ const details = error;
18
+ return ((details === null || details === void 0 ? void 0 : details.httpCode) === '404' ||
19
+ (details === null || details === void 0 ? void 0 : details.statusCode) === 404 ||
20
+ ((_a = details === null || details === void 0 ? void 0 : details.response) === null || _a === void 0 ? void 0 : _a.status) === 404);
21
+ }
22
+ exports.WeclappWebhookApi = {
23
+ getWebhook(context, id) {
24
+ return apiRequest(context, 'GET', `/webhook/id/${encodeURIComponent(id)}`);
25
+ },
26
+ createWebhook(context, event, url) {
27
+ return apiRequest(context, 'POST', '/webhook', { ...event, requestMethod: 'POST', url });
28
+ },
29
+ deleteWebhook(context, id) {
30
+ return apiRequest(context, 'DELETE', `/webhook/id/${encodeURIComponent(id)}`);
31
+ },
32
+ };
33
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/WeclappTrigger/GenericFunctions.ts"],"names":[],"mappings":";;;AAmBA,gCAWC;AA3BD,KAAK,UAAU,UAAU,CACxB,OAAuB,EACvB,MAA2B,EAC3B,IAAY,EACZ,IAAkB;IAElB,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAC/D,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE;QACtF,MAAM;QACN,GAAG,EAAE,WAAW,WAAW,CAAC,MAAM,6BAA6B,IAAI,EAAE;QACrE,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;QACvC,IAAI;QACJ,IAAI,EAAE,IAAI;KACV,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,UAAU,CAAC,KAAc;;IACxC,MAAM,OAAO,GAAG,KAIf,CAAC;IACF,OAAO,CACN,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,MAAK,KAAK;QAC3B,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,MAAK,GAAG;QAC3B,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,0CAAE,MAAM,MAAK,GAAG,CACjC,CAAC;AACH,CAAC;AAEY,QAAA,iBAAiB,GAAG;IAChC,UAAU,CAAC,OAAuB,EAAE,EAAU;QAC7C,OAAO,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,eAAe,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;IACD,aAAa,CAAC,OAAuB,EAAE,KAAmB,EAAE,GAAW;QACtE,OAAO,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1F,CAAC;IACD,aAAa,CAAC,OAAuB,EAAE,EAAU;QAChD,OAAO,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC/E,CAAC;CACD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type IHookFunctions, type INodeType, type INodeTypeDescription, type IWebhookFunctions, type IWebhookResponseData } from 'n8n-workflow';
2
+ export declare class WeclappTrigger implements INodeType {
3
+ description: INodeTypeDescription;
4
+ webhookMethods: {
5
+ default: {
6
+ checkExists(this: IHookFunctions): Promise<boolean>;
7
+ create(this: IHookFunctions): Promise<boolean>;
8
+ delete(this: IHookFunctions): Promise<boolean>;
9
+ };
10
+ };
11
+ webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
12
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WeclappTrigger = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const descriptions_1 = require("./descriptions");
6
+ const GenericFunctions_1 = require("./GenericFunctions");
7
+ class WeclappTrigger {
8
+ constructor() {
9
+ this.description = {
10
+ displayName: 'Weclapp Trigger',
11
+ name: 'weclappTrigger',
12
+ icon: { light: 'file:../../icons/weclapp.svg', dark: 'file:../../icons/weclapp.dark.svg' },
13
+ group: ['trigger'],
14
+ version: 1,
15
+ subtitle: 'Ticket Created',
16
+ description: 'Start a workflow when a ticket is created in weclapp',
17
+ defaults: { name: 'Weclapp Trigger' },
18
+ inputs: [],
19
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
20
+ credentials: [{ name: 'weclappApi', required: true }],
21
+ webhooks: [
22
+ { name: 'default', httpMethod: 'POST', responseMode: 'onReceived', path: 'webhook' },
23
+ ],
24
+ properties: descriptions_1.triggerProperties,
25
+ };
26
+ this.webhookMethods = {
27
+ default: {
28
+ async checkExists() {
29
+ const data = this.getWorkflowStaticData('node');
30
+ if (!data.webhookId)
31
+ return false;
32
+ try {
33
+ const event = (0, descriptions_1.getWebhookEvent)(this);
34
+ const webhook = await GenericFunctions_1.WeclappWebhookApi.getWebhook(this, String(data.webhookId));
35
+ return (webhook.url === this.getNodeWebhookUrl('default') &&
36
+ webhook.entityName === event.entityName &&
37
+ webhook.atCreate === event.atCreate &&
38
+ webhook.atUpdate === event.atUpdate &&
39
+ webhook.atDelete === event.atDelete &&
40
+ webhook.requestMethod === 'POST' &&
41
+ !webhook.deactivatedDate);
42
+ }
43
+ catch (error) {
44
+ if ((0, GenericFunctions_1.isNotFound)(error)) {
45
+ delete data.webhookId;
46
+ return false;
47
+ }
48
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
49
+ }
50
+ },
51
+ async create() {
52
+ const data = this.getWorkflowStaticData('node');
53
+ if (data.webhookId) {
54
+ try {
55
+ await GenericFunctions_1.WeclappWebhookApi.deleteWebhook(this, String(data.webhookId));
56
+ }
57
+ catch (error) {
58
+ if (!(0, GenericFunctions_1.isNotFound)(error))
59
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
60
+ }
61
+ delete data.webhookId;
62
+ }
63
+ const webhook = await GenericFunctions_1.WeclappWebhookApi.createWebhook(this, (0, descriptions_1.getWebhookEvent)(this), this.getNodeWebhookUrl('default'));
64
+ if (!webhook.id)
65
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'weclapp did not return a webhook ID');
66
+ data.webhookId = webhook.id;
67
+ return true;
68
+ },
69
+ async delete() {
70
+ const data = this.getWorkflowStaticData('node');
71
+ if (data.webhookId) {
72
+ try {
73
+ await GenericFunctions_1.WeclappWebhookApi.deleteWebhook(this, String(data.webhookId));
74
+ }
75
+ catch (error) {
76
+ if (!(0, GenericFunctions_1.isNotFound)(error))
77
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
78
+ }
79
+ delete data.webhookId;
80
+ }
81
+ return true;
82
+ },
83
+ },
84
+ };
85
+ }
86
+ async webhook() {
87
+ const body = this.getBodyData();
88
+ return { workflowData: [this.helpers.returnJsonArray(body)] };
89
+ }
90
+ }
91
+ exports.WeclappTrigger = WeclappTrigger;
92
+ //# sourceMappingURL=WeclappTrigger.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WeclappTrigger.node.js","sourceRoot":"","sources":["../../../nodes/WeclappTrigger/WeclappTrigger.node.ts"],"names":[],"mappings":";;;AAAA,+CAUsB;AACtB,iDAAoE;AACpE,yDAAmE;AAEnE,MAAa,cAAc;IAA3B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,EAAE,KAAK,EAAE,8BAA8B,EAAE,IAAI,EAAE,mCAAmC,EAAE;YAC1F,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;YACrC,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACrD,QAAQ,EAAE;gBACT,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;aACpF;YACD,UAAU,EAAE,gCAAiB;SAC7B,CAAC;QAEF,mBAAc,GAAG;YAChB,OAAO,EAAE;gBACR,KAAK,CAAC,WAAW;oBAChB,MAAM,IAAI,GAAG,IAAI,CAAC,qBAA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EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IAC/D,CAAC;CACD;AA5FD,wCA4FC"}
@@ -0,0 +1,16 @@
1
+ {
2
+ "node": "@affeldt28/n8n-nodes-weclapp.weclappTrigger",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": [
6
+ "Productivity",
7
+ "Sales"
8
+ ],
9
+ "resources": {
10
+ "primaryDocumentation": [
11
+ {
12
+ "url": "https://www.weclapp.com/api/"
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,4 @@
1
+ import { type IHookFunctions, type INodeProperties } from 'n8n-workflow';
2
+ import { type WebhookEvent } from './ticket';
3
+ export declare const triggerProperties: INodeProperties[];
4
+ export declare function getWebhookEvent(context: IHookFunctions): WebhookEvent;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.triggerProperties = void 0;
4
+ exports.getWebhookEvent = getWebhookEvent;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const ticket_1 = require("./ticket");
7
+ const resourceEvents = { ticket: ticket_1.ticketEvents };
8
+ exports.triggerProperties = [
9
+ {
10
+ displayName: 'Resource',
11
+ name: 'resource',
12
+ type: 'options',
13
+ noDataExpression: true,
14
+ options: [{ name: 'Ticket', value: 'ticket' }],
15
+ default: 'ticket',
16
+ },
17
+ ...ticket_1.ticketProperties,
18
+ ];
19
+ function getWebhookEvent(context) {
20
+ var _a;
21
+ const resource = context.getNodeParameter('resource', 'ticket');
22
+ const event = context.getNodeParameter('event', 'ticketCreated');
23
+ const configuration = (_a = resourceEvents[resource]) === null || _a === void 0 ? void 0 : _a[event];
24
+ if (!configuration) {
25
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Unsupported weclapp event: ${resource}/${event}`);
26
+ }
27
+ return configuration;
28
+ }
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/WeclappTrigger/descriptions/index.ts"],"names":[],"mappings":";;;AAiBA,0CAWC;AA5BD,+CAA6F;AAC7F,qCAA6E;AAE7E,MAAM,cAAc,GAAiD,EAAE,MAAM,EAAE,qBAAY,EAAE,CAAC;AAEjF,QAAA,iBAAiB,GAAsB;IACnD;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QAC9C,OAAO,EAAE,QAAQ;KACjB;IACD,GAAG,yBAAgB;CACnB,CAAC;AAEF,SAAgB,eAAe,CAAC,OAAuB;;IACtD,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,QAAQ,CAAW,CAAC;IAC1E,MAAM,KAAK,GAAG,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,eAAe,CAAW,CAAC;IAC3E,MAAM,aAAa,GAAG,MAAA,cAAc,CAAC,QAAQ,CAAC,0CAAG,KAAK,CAAC,CAAC;IACxD,IAAI,CAAC,aAAa,EAAE,CAAC;QACpB,MAAM,IAAI,iCAAkB,CAC3B,OAAO,CAAC,OAAO,EAAE,EACjB,8BAA8B,QAAQ,IAAI,KAAK,EAAE,CACjD,CAAC;IACH,CAAC;IACD,OAAO,aAAa,CAAC;AACtB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export interface WebhookEvent {
3
+ entityName: string;
4
+ atCreate: boolean;
5
+ atUpdate: boolean;
6
+ atDelete: boolean;
7
+ }
8
+ export declare const ticketEvents: Record<string, WebhookEvent>;
9
+ export declare const ticketProperties: INodeProperties[];
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ticketProperties = exports.ticketEvents = void 0;
4
+ exports.ticketEvents = {
5
+ ticketCreated: { entityName: 'ticket', atCreate: true, atUpdate: false, atDelete: false },
6
+ };
7
+ exports.ticketProperties = [
8
+ {
9
+ displayName: 'Trigger On',
10
+ name: 'event',
11
+ type: 'options',
12
+ noDataExpression: true,
13
+ displayOptions: { show: { resource: ['ticket'] } },
14
+ options: [{ name: 'Ticket Created', value: 'ticketCreated' }],
15
+ default: 'ticketCreated',
16
+ },
17
+ ];
18
+ //# sourceMappingURL=ticket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticket.js","sourceRoot":"","sources":["../../../../nodes/WeclappTrigger/descriptions/ticket.ts"],"names":[],"mappings":";;;AASa,QAAA,YAAY,GAAiC;IACzD,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;CACzF,CAAC;AAEW,QAAA,gBAAgB,GAAsB;IAClD;QACC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;QAClD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;QAC7D,OAAO,EAAE,eAAe;KACxB;CACD,CAAC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@affeldt28/n8n-nodes-weclapp",
3
- "version": "1.2.5",
3
+ "version": "1.3.1",
4
4
  "description": "n8n node for Weclapp",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/affeldt28/n8n-nodes-weclapp",
@@ -39,7 +39,8 @@
39
39
  "dist/credentials/WeclappApi.credentials.js"
40
40
  ],
41
41
  "nodes": [
42
- "dist/nodes/Weclapp/Weclapp.node.js"
42
+ "dist/nodes/Weclapp/Weclapp.node.js",
43
+ "dist/nodes/WeclappTrigger/WeclappTrigger.node.js"
43
44
  ]
44
45
  },
45
46
  "publishConfig": {