n8n-nodes-waha-split 2025.1222.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.
- package/LICENSE.md +19 -0
- package/README.md +44 -0
- package/dist/credentials/WAHAApi.credentials.d.ts +8 -0
- package/dist/credentials/WAHAApi.credentials.js +41 -0
- package/dist/credentials/WAHAApi.credentials.js.map +1 -0
- package/dist/nodes/WAHA/WAHA.node.d.ts +4 -0
- package/dist/nodes/WAHA/WAHA.node.js +22 -0
- package/dist/nodes/WAHA/WAHA.node.js.map +1 -0
- package/dist/nodes/WAHA/WAHA.node.json +18 -0
- package/dist/nodes/WAHA/WAHATrigger.node.d.ts +4 -0
- package/dist/nodes/WAHA/WAHATrigger.node.js +22 -0
- package/dist/nodes/WAHA/WAHATrigger.node.js.map +1 -0
- package/dist/nodes/WAHA/WAHATrigger.node.json +18 -0
- package/dist/nodes/WAHA/base/node.d.ts +21 -0
- package/dist/nodes/WAHA/base/node.js +33 -0
- package/dist/nodes/WAHA/base/node.js.map +1 -0
- package/dist/nodes/WAHA/base/trigger.d.ts +18 -0
- package/dist/nodes/WAHA/base/trigger.js +75 -0
- package/dist/nodes/WAHA/base/trigger.js.map +1 -0
- package/dist/nodes/WAHA/openapi/WAHAOperationParser.d.ts +8 -0
- package/dist/nodes/WAHA/openapi/WAHAOperationParser.js +58 -0
- package/dist/nodes/WAHA/openapi/WAHAOperationParser.js.map +1 -0
- package/dist/nodes/WAHA/openapi/WAHAOperationsCollector.d.ts +6 -0
- package/dist/nodes/WAHA/openapi/WAHAOperationsCollector.js +22 -0
- package/dist/nodes/WAHA/openapi/WAHAOperationsCollector.js.map +1 -0
- package/dist/nodes/WAHA/openapi/WAHAResourceParser.d.ts +5 -0
- package/dist/nodes/WAHA/openapi/WAHAResourceParser.js +45 -0
- package/dist/nodes/WAHA/openapi/WAHAResourceParser.js.map +1 -0
- package/dist/nodes/WAHA/v202409/WAHATriggerV202409.d.ts +5 -0
- package/dist/nodes/WAHA/v202409/WAHATriggerV202409.js +63 -0
- package/dist/nodes/WAHA/v202409/WAHATriggerV202409.js.map +1 -0
- package/dist/nodes/WAHA/v202409/WAHATriggerV202409.test.d.ts +1 -0
- package/dist/nodes/WAHA/v202409/WAHATriggerV202409.test.js +51 -0
- package/dist/nodes/WAHA/v202409/WAHATriggerV202409.test.js.map +1 -0
- package/dist/nodes/WAHA/v202409/WAHAv202409.d.ts +4 -0
- package/dist/nodes/WAHA/v202409/WAHAv202409.js +101 -0
- package/dist/nodes/WAHA/v202409/WAHAv202409.js.map +1 -0
- package/dist/nodes/WAHA/v202409/WAHAv202409.test.d.ts +1 -0
- package/dist/nodes/WAHA/v202409/WAHAv202409.test.js +7918 -0
- package/dist/nodes/WAHA/v202409/WAHAv202409.test.js.map +1 -0
- package/dist/nodes/WAHA/v202409/openapi.json +8129 -0
- package/dist/nodes/WAHA/v202502/WAHATriggerV202502.d.ts +5 -0
- package/dist/nodes/WAHA/v202502/WAHATriggerV202502.js +63 -0
- package/dist/nodes/WAHA/v202502/WAHATriggerV202502.js.map +1 -0
- package/dist/nodes/WAHA/v202502/WAHATriggerV202502.test.d.ts +1 -0
- package/dist/nodes/WAHA/v202502/WAHATriggerV202502.test.js +63 -0
- package/dist/nodes/WAHA/v202502/WAHATriggerV202502.test.js.map +1 -0
- package/dist/nodes/WAHA/v202502/WAHAv202502.d.ts +4 -0
- package/dist/nodes/WAHA/v202502/WAHAv202502.js +101 -0
- package/dist/nodes/WAHA/v202502/WAHAv202502.js.map +1 -0
- package/dist/nodes/WAHA/v202502/WAHAv202502.test.d.ts +1 -0
- package/dist/nodes/WAHA/v202502/WAHAv202502.test.js +10678 -0
- package/dist/nodes/WAHA/v202502/WAHAv202502.test.js.map +1 -0
- package/dist/nodes/WAHA/v202502/openapi.json +11084 -0
- package/dist/nodes/WAHA/waha.svg +50 -0
- package/dist/package.json +68 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.js +0 -0
- package/package.json +68 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2022 n8n
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @devlikeapro/n8n-nodes-waha
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="https://github.com/devlikeapro/n8n-nodes-waha/blob/master/WAHA+n8n.png?raw=true" width='300'/>
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
This is a n8n community node.
|
|
7
|
+
It lets you use [WAHA - WhatsApp HTTP API](https://waha.devlike.pro) in your n8n workflows.
|
|
8
|
+
|
|
9
|
+
- [**WAHA**](https://waha.devlike.pro) - **WhatsApp API** that you can run in a click!
|
|
10
|
+
- [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
11
|
+
|
|
12
|
+
👉 Generated from
|
|
13
|
+
[**WAHA OpenAPI**](https://waha.devlike.pro/swagger/)
|
|
14
|
+
using [**devlikeapro/n8n-openapi-node**](https://github.com/devlikeapro/n8n-openapi-node)
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
<!-- toc -->
|
|
19
|
+
|
|
20
|
+
- [Install WAHA n8n node](#install-waha-n8n-node)
|
|
21
|
+
- [Links](#links)
|
|
22
|
+
- [Workflow Examples](#workflow-examples)
|
|
23
|
+
|
|
24
|
+
<!-- tocstop -->
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+
|
|
28
|
+
## Install WAHA n8n node
|
|
29
|
+
Go to your **n8n** => **Settings** => **Community nodes** and install:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
@devlikeapro/n8n-nodes-waha
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If you need help with that, check the
|
|
36
|
+
[**Install community nodes**](https://docs.n8n.io/integrations/community-nodes/installation/gui-install/)
|
|
37
|
+
|
|
38
|
+
## Links
|
|
39
|
+
- [**WAHA + n8n: No Code Low Code WhatsApp Automation Step-By-Step Guide**](https://waha.devlike.pro/blog/waha-n8n/)
|
|
40
|
+
- [**🧩 WAHA + n8n Integration**](https://waha.devlike.pro/docs/integrations/n8n/)
|
|
41
|
+
- [**WAHA n8n Workflow Templates**](http://waha-n8n-templates.devlike.pro/)
|
|
42
|
+
|
|
43
|
+
## Workflow Examples
|
|
44
|
+
👉 Check out [**n8n-workflows**](http://waha-n8n-templates.devlike.pro/) folder for examples.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class WAHAApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
properties: INodeProperties[];
|
|
6
|
+
authenticate: IAuthenticateGeneric;
|
|
7
|
+
test: ICredentialTestRequest;
|
|
8
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAHAApi = void 0;
|
|
4
|
+
class WAHAApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'wahaApi';
|
|
7
|
+
this.displayName = 'WAHA API';
|
|
8
|
+
this.properties = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Host URL',
|
|
11
|
+
name: 'url',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: 'http://localhost:3000',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
displayName: 'API Key',
|
|
17
|
+
name: 'apiKey',
|
|
18
|
+
type: 'string',
|
|
19
|
+
typeOptions: { password: true },
|
|
20
|
+
default: '',
|
|
21
|
+
required: false,
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
this.authenticate = {
|
|
25
|
+
type: 'generic',
|
|
26
|
+
properties: {
|
|
27
|
+
headers: {
|
|
28
|
+
'X-Api-Key': '={{$credentials.apiKey}}',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
this.test = {
|
|
33
|
+
request: {
|
|
34
|
+
baseURL: '={{$credentials.url}}',
|
|
35
|
+
url: '/api/sessions',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.WAHAApi = WAHAApi;
|
|
41
|
+
//# sourceMappingURL=WAHAApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WAHAApi.credentials.js","sourceRoot":"","sources":["../../credentials/WAHAApi.credentials.ts"],"names":[],"mappings":";;;AAMA,MAAa,OAAO;IAApB;QACI,SAAI,GAAG,SAAS,CAAC;QACjB,gBAAW,GAAG,UAAU,CAAC;QACzB,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uBAAuB;aACnC;YACD;gBACI,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACjB,QAAQ,EAAE,KAAK;aACZ;SACJ,CAAC;QAEF,iBAAY,GAAyB;YACjC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACR,OAAO,EAAE;oBACL,WAAW,EAAE,0BAA0B;iBAC1C;aACJ;SACJ,CAAC;QACF,SAAI,GAA2B;YAC3B,OAAO,EAAE;gBACX,OAAO,EAAE,uBAAuB;gBAC1B,GAAG,EAAE,eAAe;aACvB;SACJ,CAAC;IACN,CAAC;CAAA;AAlCD,0BAkCC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAHA = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const WAHAv202409_1 = require("./v202409/WAHAv202409");
|
|
6
|
+
const node_1 = require("./base/node");
|
|
7
|
+
const WAHAv202502_1 = require("./v202502/WAHAv202502");
|
|
8
|
+
class WAHA extends n8n_workflow_1.VersionedNodeType {
|
|
9
|
+
constructor() {
|
|
10
|
+
const baseDescription = {
|
|
11
|
+
...node_1.BASE_DESCRIPTION,
|
|
12
|
+
defaultVersion: 202502,
|
|
13
|
+
};
|
|
14
|
+
const nodeVersions = {
|
|
15
|
+
202502: new WAHAv202502_1.WAHAv202502(),
|
|
16
|
+
202409: new WAHAv202409_1.WAHAv202409(),
|
|
17
|
+
};
|
|
18
|
+
super(nodeVersions, baseDescription);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.WAHA = WAHA;
|
|
22
|
+
//# sourceMappingURL=WAHA.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WAHA.node.js","sourceRoot":"","sources":["../../../nodes/WAHA/WAHA.node.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AACjD,uDAAoD;AACpD,sCAA6C;AAC7C,uDAAkD;AAElD,MAAa,IAAK,SAAQ,gCAAiB;IAC1C;QACC,MAAM,eAAe,GAA6B;YACjD,GAAG,uBAAgB;YACnB,cAAc,EAAE,MAAM;SACtB,CAAC;QAEF,MAAM,YAAY,GAAuC;YACxD,MAAM,EAAE,IAAI,yBAAW,EAAE;YACzB,MAAM,EAAE,IAAI,yBAAW,EAAE;SACzB,CAAC;QAEF,KAAK,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC;CACD;AAdD,oBAcC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-waha.WAHA",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Whatsapp"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://waha.devlike.pro/docs/how-to/security/"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://waha.devlike.pro/docs/how-to"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAHATrigger = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const trigger_1 = require("./base/trigger");
|
|
6
|
+
const WAHATriggerV202409_1 = require("./v202409/WAHATriggerV202409");
|
|
7
|
+
const WAHATriggerV202502_1 = require("./v202502/WAHATriggerV202502");
|
|
8
|
+
class WAHATrigger extends n8n_workflow_1.VersionedNodeType {
|
|
9
|
+
constructor() {
|
|
10
|
+
const baseDescription = {
|
|
11
|
+
...trigger_1.BASE_TRIGGER_DESCRIPTION,
|
|
12
|
+
defaultVersion: 202502,
|
|
13
|
+
};
|
|
14
|
+
const nodeVersions = {
|
|
15
|
+
202502: new WAHATriggerV202502_1.WAHATriggerV202502(),
|
|
16
|
+
202409: new WAHATriggerV202409_1.WAHATriggerV202409(),
|
|
17
|
+
};
|
|
18
|
+
super(nodeVersions, baseDescription);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.WAHATrigger = WAHATrigger;
|
|
22
|
+
//# sourceMappingURL=WAHATrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WAHATrigger.node.js","sourceRoot":"","sources":["../../../nodes/WAHA/WAHATrigger.node.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AACjD,4CAAwD;AACxD,qEAAgE;AAChE,qEAAgE;AAEhE,MAAa,WAAY,SAAQ,gCAAiB;IACjD;QACC,MAAM,eAAe,GAA6B;YACjD,GAAG,kCAAwB;YAC3B,cAAc,EAAE,MAAM;SACtB,CAAC;QAEF,MAAM,YAAY,GAAuC;YACxD,MAAM,EAAE,IAAI,uCAAkB,EAAE;YAChC,MAAM,EAAE,IAAI,uCAAkB,EAAE;SAChC,CAAC;QAEF,KAAK,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC;CACD;AAdD,kCAcC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-waha.wahaTrigger",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Whatsapp"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://waha.devlike.pro/docs/how-to/security/"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://waha.devlike.pro/docs/how-to/webhooks/"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { INodeTypeBaseDescription } from "n8n-workflow";
|
|
2
|
+
export declare const BASE_DESCRIPTION: INodeTypeBaseDescription;
|
|
3
|
+
export declare const NODE_DESCRIPTION: {
|
|
4
|
+
subtitle: string;
|
|
5
|
+
inputs: "main"[];
|
|
6
|
+
outputs: "main"[];
|
|
7
|
+
defaults: {
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
credentials: {
|
|
11
|
+
name: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
}[];
|
|
14
|
+
requestDefaults: {
|
|
15
|
+
headers: {
|
|
16
|
+
Accept: string;
|
|
17
|
+
'Content-Type': string;
|
|
18
|
+
};
|
|
19
|
+
baseURL: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NODE_DESCRIPTION = exports.BASE_DESCRIPTION = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
exports.BASE_DESCRIPTION = {
|
|
6
|
+
name: 'WAHA',
|
|
7
|
+
displayName: 'WAHA',
|
|
8
|
+
icon: 'file:waha.svg',
|
|
9
|
+
description: 'Connect with Whatsapp HTTP API',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
};
|
|
12
|
+
exports.NODE_DESCRIPTION = {
|
|
13
|
+
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
|
|
14
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
15
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
16
|
+
defaults: {
|
|
17
|
+
name: 'WAHA',
|
|
18
|
+
},
|
|
19
|
+
credentials: [
|
|
20
|
+
{
|
|
21
|
+
name: 'wahaApi',
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
requestDefaults: {
|
|
26
|
+
headers: {
|
|
27
|
+
Accept: 'application/json',
|
|
28
|
+
'Content-Type': 'application/json',
|
|
29
|
+
},
|
|
30
|
+
baseURL: '={{$credentials.url}}',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../../nodes/WAHA/base/node.ts"],"names":[],"mappings":";;;AAAA,+CAA2E;AAE9D,QAAA,gBAAgB,GAA6B;IACzD,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE,CAAC,WAAW,CAAC;CACpB,CAAC;AAGW,QAAA,gBAAgB,GAAG;IAC/B,QAAQ,EAAE,8DAA8D;IACxE,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;IACnC,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ;YACC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;SACd;KACD;IACD,eAAe,EAAE;QAChB,OAAO,EAAE;YACR,MAAM,EAAE,kBAAkB;YAC1B,cAAc,EAAE,kBAAkB;SAClC;QACD,OAAO,EAAE,uBAAuB;KAChC;CACD,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { INodeProperties, INodeTypeBaseDescription, WebhookType, type IWebhookFunctions, type IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare const BASE_TRIGGER_DESCRIPTION: INodeTypeBaseDescription;
|
|
3
|
+
export declare const TRIGGER_DESCRIPTION: {
|
|
4
|
+
defaults: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
inputs: never[];
|
|
8
|
+
credentials: never[];
|
|
9
|
+
webhooks: {
|
|
10
|
+
name: WebhookType;
|
|
11
|
+
httpMethod: string;
|
|
12
|
+
responseMode: string;
|
|
13
|
+
path: string;
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
export declare const CONFIGURE_WEBHOOK_NOTE: INodeProperties;
|
|
17
|
+
export declare function makeEventNote(events: string[]): INodeProperties;
|
|
18
|
+
export declare function makeWebhookForEvents(events: string[]): (this: IWebhookFunctions) => Promise<IWebhookResponseData>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONFIGURE_WEBHOOK_NOTE = exports.TRIGGER_DESCRIPTION = exports.BASE_TRIGGER_DESCRIPTION = void 0;
|
|
4
|
+
exports.makeEventNote = makeEventNote;
|
|
5
|
+
exports.makeWebhookForEvents = makeWebhookForEvents;
|
|
6
|
+
exports.BASE_TRIGGER_DESCRIPTION = {
|
|
7
|
+
displayName: 'WAHA Trigger',
|
|
8
|
+
name: 'wahaTrigger',
|
|
9
|
+
icon: 'file:waha.svg',
|
|
10
|
+
group: ['trigger'],
|
|
11
|
+
description: 'Handle WAHA events via webhooks',
|
|
12
|
+
};
|
|
13
|
+
exports.TRIGGER_DESCRIPTION = {
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'WAHA Trigger',
|
|
16
|
+
},
|
|
17
|
+
inputs: [],
|
|
18
|
+
credentials: [],
|
|
19
|
+
webhooks: [
|
|
20
|
+
{
|
|
21
|
+
name: 'default',
|
|
22
|
+
httpMethod: 'POST',
|
|
23
|
+
responseMode: 'onReceived',
|
|
24
|
+
path: 'waha',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
exports.CONFIGURE_WEBHOOK_NOTE = {
|
|
29
|
+
displayName: 'Remember to configure WAHA instance (session or server) to send events to <b>Webhook URL</b>. ' +
|
|
30
|
+
'<br/>Check <b>Docs</b> link above☝️',
|
|
31
|
+
name: 'operation',
|
|
32
|
+
type: 'notice',
|
|
33
|
+
typeOptions: {
|
|
34
|
+
theme: 'info',
|
|
35
|
+
},
|
|
36
|
+
default: '',
|
|
37
|
+
};
|
|
38
|
+
function noteText(events) {
|
|
39
|
+
const parts = ['<b>Events</b>:'];
|
|
40
|
+
for (const event of events) {
|
|
41
|
+
parts.push(`- ${event}`);
|
|
42
|
+
}
|
|
43
|
+
return parts.join('<br>');
|
|
44
|
+
}
|
|
45
|
+
function makeEventNote(events) {
|
|
46
|
+
return {
|
|
47
|
+
displayName: noteText(events),
|
|
48
|
+
name: 'operation',
|
|
49
|
+
type: 'notice',
|
|
50
|
+
typeOptions: {
|
|
51
|
+
theme: 'info',
|
|
52
|
+
},
|
|
53
|
+
default: '',
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function makeWebhookForEvents(events) {
|
|
57
|
+
async function webhook() {
|
|
58
|
+
const bodyData = this.getBodyData();
|
|
59
|
+
const eventType = bodyData.event;
|
|
60
|
+
if (eventType === undefined || !events.includes(eventType)) {
|
|
61
|
+
return {};
|
|
62
|
+
}
|
|
63
|
+
const eventIndex = events.indexOf(eventType);
|
|
64
|
+
const req = this.getRequestObject();
|
|
65
|
+
const data = this.helpers.returnJsonArray(req.body);
|
|
66
|
+
const empty = [];
|
|
67
|
+
const workflowData = events.map((_) => empty);
|
|
68
|
+
workflowData[eventIndex] = data;
|
|
69
|
+
return {
|
|
70
|
+
workflowData: workflowData,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return webhook;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../nodes/WAHA/base/trigger.ts"],"names":[],"mappings":";;;AAqDA,sCAUC;AAED,oDAyBC;AAhFY,QAAA,wBAAwB,GAA6B;IACjE,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,CAAC,SAAS,CAAC;IAClB,WAAW,EAAE,iCAAiC;CAC9C,CAAC;AACW,QAAA,mBAAmB,GAAG;IAClC,QAAQ,EAAE;QACT,IAAI,EAAE,cAAc;KACpB;IACD,MAAM,EAAE,EAAE;IACV,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE;QACT;YACC,IAAI,EAAE,SAAwB;YAC9B,UAAU,EAAE,MAAM;YAClB,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,MAAM;SACZ;KACD;CACD,CAAC;AAEW,QAAA,sBAAsB,GAAoB;IACtD,WAAW,EACV,gGAAgG;QAChG,qCAAqC;IACtC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE;QACZ,KAAK,EAAE,MAAM;KACb;IACD,OAAO,EAAE,EAAE;CACX,CAAC;AAEF,SAAS,QAAQ,CAAC,MAAgB;IACjC,MAAM,KAAK,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,SAAgB,aAAa,CAAC,MAAgB;IAC7C,OAAO;QACN,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC;QAC7B,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;YACZ,KAAK,EAAE,MAAM;SACb;QACD,OAAO,EAAE,EAAE;KACX,CAAC;AACH,CAAC;AAED,SAAgB,oBAAoB,CAAC,MAAgB;IACpD,KAAK,UAAU,OAAO;QACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAEpC,MAAM,SAAS,GAAG,QAAQ,CAAC,KAA2B,CAAC;QAEvD,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAG5D,OAAO,EAAE,CAAC;QACX,CAAC;QACD,MAAM,UAAU,GAAW,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrD,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAEpC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,IAAmB,CAAC,CAAC;QACnE,MAAM,KAAK,GAAyB,EAAE,CAAC;QACvC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;QAC9C,YAAY,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;QAEhC,OAAO;YACN,YAAY,EAAE,YAAY;SAC1B,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { DefaultOperationParser, OperationContext } from '@devlikeapro/n8n-openapi-node';
|
|
3
|
+
export declare class WAHAOperationParser extends DefaultOperationParser {
|
|
4
|
+
name(operation: OpenAPIV3.OperationObject, context: OperationContext): string;
|
|
5
|
+
value(operation: OpenAPIV3.OperationObject, context: OperationContext): string;
|
|
6
|
+
action(operation: OpenAPIV3.OperationObject, context: OperationContext): string;
|
|
7
|
+
description(operation: OpenAPIV3.OperationObject, context: OperationContext): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.WAHAOperationParser = void 0;
|
|
37
|
+
const lodash = __importStar(require("lodash"));
|
|
38
|
+
const n8n_openapi_node_1 = require("@devlikeapro/n8n-openapi-node");
|
|
39
|
+
class WAHAOperationParser extends n8n_openapi_node_1.DefaultOperationParser {
|
|
40
|
+
name(operation, context) {
|
|
41
|
+
let operationId = operation.operationId.split('_').slice(1).join('_');
|
|
42
|
+
if (!operationId) {
|
|
43
|
+
operationId = operation.operationId;
|
|
44
|
+
}
|
|
45
|
+
return lodash.startCase(operationId);
|
|
46
|
+
}
|
|
47
|
+
value(operation, context) {
|
|
48
|
+
return this.name(operation, context);
|
|
49
|
+
}
|
|
50
|
+
action(operation, context) {
|
|
51
|
+
return operation.summary || this.name(operation, context);
|
|
52
|
+
}
|
|
53
|
+
description(operation, context) {
|
|
54
|
+
return operation.description || operation.summary || '';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.WAHAOperationParser = WAHAOperationParser;
|
|
58
|
+
//# sourceMappingURL=WAHAOperationParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WAHAOperationParser.js","sourceRoot":"","sources":["../../../../nodes/WAHA/openapi/WAHAOperationParser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAiC;AACjC,oEAAyF;AAEzF,MAAa,mBAAoB,SAAQ,yCAAsB;IAC9D,IAAI,CAAC,SAAoC,EAAE,OAAyB;QACnE,IAAI,WAAW,GAAW,SAAS,CAAC,WAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChF,IAAI,CAAC,WAAW,EAAE,CAAC;YAClB,WAAW,GAAG,SAAS,CAAC,WAAqB,CAAC;QAC/C,CAAC;QACD,OAAO,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,SAAoC,EAAE,OAAyB;QACpE,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,SAAoC,EAAE,OAAyB;QACrE,OAAO,SAAS,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,WAAW,CAAC,SAAoC,EAAE,OAAyB;QAC1E,OAAO,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC;IACzD,CAAC;CACD;AApBD,kDAoBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { INodeProperties } from 'n8n-workflow';
|
|
3
|
+
import { OperationsCollector, OperationContext } from '@devlikeapro/n8n-openapi-node';
|
|
4
|
+
export declare class WAHAOperationsCollector extends OperationsCollector {
|
|
5
|
+
parseFields(operation: OpenAPIV3.OperationObject, context: OperationContext): INodeProperties[];
|
|
6
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAHAOperationsCollector = void 0;
|
|
4
|
+
const n8n_openapi_node_1 = require("@devlikeapro/n8n-openapi-node");
|
|
5
|
+
function sessionFirst(a, b) {
|
|
6
|
+
if (a.name === 'session') {
|
|
7
|
+
return -1;
|
|
8
|
+
}
|
|
9
|
+
if (b.name === 'session') {
|
|
10
|
+
return 1;
|
|
11
|
+
}
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
class WAHAOperationsCollector extends n8n_openapi_node_1.OperationsCollector {
|
|
15
|
+
parseFields(operation, context) {
|
|
16
|
+
const fields = super.parseFields(operation, context);
|
|
17
|
+
fields.sort(sessionFirst);
|
|
18
|
+
return fields;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.WAHAOperationsCollector = WAHAOperationsCollector;
|
|
22
|
+
//# sourceMappingURL=WAHAOperationsCollector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WAHAOperationsCollector.js","sourceRoot":"","sources":["../../../../nodes/WAHA/openapi/WAHAOperationsCollector.ts"],"names":[],"mappings":";;;AAEA,oEAAsF;AAEtF,SAAS,YAAY,CAAC,CAAM,EAAE,CAAM;IACnC,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,CAAC,CAAC,CAAC;IACX,CAAC;IACD,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,CAAC,CAAC;IACV,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC;AAED,MAAa,uBAAwB,SAAQ,sCAAmB;IAE/D,WAAW,CAAC,SAAoC,EAAE,OAAyB;QAC1E,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE1B,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AARD,0DAQC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.WAHAResourceParser = void 0;
|
|
37
|
+
const lodash = __importStar(require("lodash"));
|
|
38
|
+
const n8n_openapi_node_1 = require("@devlikeapro/n8n-openapi-node");
|
|
39
|
+
class WAHAResourceParser extends n8n_openapi_node_1.DefaultResourceParser {
|
|
40
|
+
value(tag) {
|
|
41
|
+
return lodash.startCase(tag.name.replace(/[^a-zA-Z0-9_-]/g, ''));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.WAHAResourceParser = WAHAResourceParser;
|
|
45
|
+
//# sourceMappingURL=WAHAResourceParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WAHAResourceParser.js","sourceRoot":"","sources":["../../../../nodes/WAHA/openapi/WAHAResourceParser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAiC;AACjC,oEAAsE;AAEtE,MAAa,kBAAmB,SAAQ,wCAAqB;IAC5D,KAAK,CAAC,GAAwB;QAC7B,OAAO,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;CACD;AAJD,gDAIC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class WAHATriggerV202409 implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
webhook: (this: import("n8n-workflow").IWebhookFunctions) => Promise<import("n8n-workflow").IWebhookResponseData>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.WAHATriggerV202409 = void 0;
|
|
37
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
|
+
const doc = __importStar(require("./openapi.json"));
|
|
39
|
+
const trigger_1 = require("../base/trigger");
|
|
40
|
+
function getEvents() {
|
|
41
|
+
const schemas = doc.components.schemas;
|
|
42
|
+
const schema = schemas.WAHAWebhookSessionStatus;
|
|
43
|
+
const event = schema.properties.event;
|
|
44
|
+
return event.enum;
|
|
45
|
+
}
|
|
46
|
+
const events = getEvents();
|
|
47
|
+
const outputs = events.map((_) => n8n_workflow_1.NodeConnectionTypes.Main);
|
|
48
|
+
const outputNames = events;
|
|
49
|
+
class WAHATriggerV202409 {
|
|
50
|
+
constructor() {
|
|
51
|
+
this.description = {
|
|
52
|
+
...trigger_1.BASE_TRIGGER_DESCRIPTION,
|
|
53
|
+
...trigger_1.TRIGGER_DESCRIPTION,
|
|
54
|
+
version: 202409,
|
|
55
|
+
outputs: outputs,
|
|
56
|
+
outputNames: outputNames,
|
|
57
|
+
properties: [trigger_1.CONFIGURE_WEBHOOK_NOTE, (0, trigger_1.makeEventNote)(events)],
|
|
58
|
+
};
|
|
59
|
+
this.webhook = (0, trigger_1.makeWebhookForEvents)(events);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.WAHATriggerV202409 = WAHATriggerV202409;
|
|
63
|
+
//# sourceMappingURL=WAHATriggerV202409.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WAHATriggerV202409.js","sourceRoot":"","sources":["../../../../nodes/WAHA/v202409/WAHATriggerV202409.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAGsB;AAEtB,oDAAsC;AACtC,6CAKyB;AAEzB,SAAS,SAAS;IACjB,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;IACvC,MAAM,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAChD,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;IACtC,OAAO,KAAK,CAAC,IAAI,CAAC;AACnB,CAAC;AAED,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;AAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC,CAAC;AAC5D,MAAM,WAAW,GAAG,MAAM,CAAC;AAG3B,MAAa,kBAAkB;IAA/B;QACC,gBAAW,GAAyB;YACnC,GAAG,kCAAwB;YAC3B,GAAG,6BAAmB;YACtB,OAAO,EAAE,MAAM;YACf,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,WAAW;YACxB,UAAU,EAAE,CAAC,gCAAsB,EAAE,IAAA,uBAAa,EAAC,MAAM,CAAC,CAAC;SAC3D,CAAC;QACF,YAAO,GAAG,IAAA,8BAAoB,EAAC,MAAM,CAAC,CAAA;IACvC,CAAC;CAAA;AAVD,gDAUC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|