n8n-nodes-zapperhub 2.0.3 → 2.1.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/README.md +9 -3
- package/dist/nodes/ZapperHub/ZapperHub.node.js +6 -2
- package/dist/nodes/ZapperHub/ZapperHub.node.js.map +1 -1
- package/dist/nodes/ZapperHub/resources/channel.d.ts +2 -0
- package/dist/nodes/ZapperHub/resources/channel.js +411 -0
- package/dist/nodes/ZapperHub/resources/channel.js.map +1 -0
- package/dist/nodes/ZapperHub/resources/community.d.ts +2 -0
- package/dist/nodes/ZapperHub/resources/community.js +120 -0
- package/dist/nodes/ZapperHub/resources/community.js.map +1 -0
- package/dist/nodes/ZapperHub/resources/group.js +134 -1
- package/dist/nodes/ZapperHub/resources/group.js.map +1 -1
- package/dist/nodes/ZapperHub/resources/message.js +20 -2
- package/dist/nodes/ZapperHub/resources/message.js.map +1 -1
- package/dist/nodes/ZapperHub/resources/other.d.ts +0 -1
- package/dist/nodes/ZapperHub/resources/other.js +1 -15
- package/dist/nodes/ZapperHub/resources/other.js.map +1 -1
- package/dist/nodes/ZapperHub/shared.d.ts +1 -0
- package/dist/nodes/ZapperHub/shared.js +8 -1
- package/dist/nodes/ZapperHub/shared.js.map +1 -1
- package/dist/nodes/ZapperHubTrigger/ZapperHubTrigger.node.js +25 -0
- package/dist/nodes/ZapperHubTrigger/ZapperHubTrigger.node.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,8 @@ It removes the webhook when the workflow stops.
|
|
|
38
38
|
- ZapperHub only accepts HTTPS webhook URLs, so n8n must be reachable from the internet.
|
|
39
39
|
|
|
40
40
|
Events: message received or sent, message status, message error, message edited or deleted, connection
|
|
41
|
-
update, call update, group participants update,
|
|
41
|
+
update, call update, group participants update, channel followed or created, channel mute change,
|
|
42
|
+
channel unfollowed or deleted, marketing preference change, contact identity change,
|
|
42
43
|
template sync finished, storage failed or recovered, Instagram comment, Instagram token expired or
|
|
43
44
|
refresh failed.
|
|
44
45
|
|
|
@@ -50,16 +51,21 @@ refresh failed.
|
|
|
50
51
|
| Call | Make, play audio, hang up, reject, get, get many, get and request call permission |
|
|
51
52
|
| Chat | Archive, unarchive, mute, pin, delete |
|
|
52
53
|
| Contact | Check numbers, get, get profile picture, get phone number from LID, block, unblock, get blocked, get marketing opt-outs, set marketing preference, delete data |
|
|
53
|
-
| Group | Create, get, get many, update name and description, update and remove picture, get and reset invite link, update participants. QR Code instances only. |
|
|
54
|
+
| Group | Create, get, get many, update name and description, update and remove picture, update settings, get and reset invite link, get invite info, join with invite, leave, update participants, get and approve or reject join requests. QR Code instances only. |
|
|
55
|
+
| Community | Create, get many, get groups, create group, link and unlink group, get participants. QR Code instances only. |
|
|
54
56
|
| Template | Get, get many, sync with Meta, get sync status |
|
|
55
57
|
| Instagram | Reply privately to a comment, comment on a post, get post, get many posts |
|
|
56
|
-
| Channel |
|
|
58
|
+
| Channel | Create, get, get many, get invite info, follow, unfollow, mute and unmute, update name and description, update and remove picture, delete, get followers, get admins, invite admin, revoke and accept admin invite, remove admin, transfer ownership, pin and unpin message, get insights, send poll, send question. QR Code instances only. |
|
|
57
59
|
| Profile | Update picture, remove picture, update about |
|
|
58
60
|
| Connection | Get (status, QR Code or pairing code) |
|
|
59
61
|
|
|
60
62
|
Media, audio and sticker accept a URL, a base64 file or a binary file from a previous node. Messages
|
|
61
63
|
sent by the node carry `trackSource: "n8n"` in the message log and in the webhook events.
|
|
62
64
|
|
|
65
|
+
Send Text, Send Media (image, video and audio) and Send Audio have the Group Status option. It posts
|
|
66
|
+
the message as a status of the group, which only the participants of the group see. QR Code instances
|
|
67
|
+
only.
|
|
68
|
+
|
|
63
69
|
The node can be used as a tool by the n8n AI Agent.
|
|
64
70
|
|
|
65
71
|
## Compatibility
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ZapperHub = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
5
|
const call_1 = require("./resources/call");
|
|
6
|
+
const channel_1 = require("./resources/channel");
|
|
6
7
|
const chat_1 = require("./resources/chat");
|
|
8
|
+
const community_1 = require("./resources/community");
|
|
7
9
|
const contact_1 = require("./resources/contact");
|
|
8
10
|
const group_1 = require("./resources/group");
|
|
9
11
|
const instagram_1 = require("./resources/instagram");
|
|
@@ -19,7 +21,7 @@ class ZapperHub {
|
|
|
19
21
|
group: ['output'],
|
|
20
22
|
version: 1,
|
|
21
23
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
22
|
-
description: 'Send and manage WhatsApp messages, calls, contacts and
|
|
24
|
+
description: 'Send and manage WhatsApp messages, calls, contacts, groups, communities and channels with the ZapperHub API',
|
|
23
25
|
defaults: {
|
|
24
26
|
name: 'ZapperHub',
|
|
25
27
|
},
|
|
@@ -44,6 +46,7 @@ class ZapperHub {
|
|
|
44
46
|
{ name: 'Call', value: 'call' },
|
|
45
47
|
{ name: 'Channel', value: 'channel' },
|
|
46
48
|
{ name: 'Chat', value: 'chat' },
|
|
49
|
+
{ name: 'Community', value: 'community' },
|
|
47
50
|
{ name: 'Connection', value: 'connection' },
|
|
48
51
|
{ name: 'Contact', value: 'contact' },
|
|
49
52
|
{ name: 'Group', value: 'group' },
|
|
@@ -56,8 +59,9 @@ class ZapperHub {
|
|
|
56
59
|
},
|
|
57
60
|
...message_1.messageDescription,
|
|
58
61
|
...call_1.callDescription,
|
|
59
|
-
...
|
|
62
|
+
...channel_1.channelDescription,
|
|
60
63
|
...chat_1.chatDescription,
|
|
64
|
+
...community_1.communityDescription,
|
|
61
65
|
...other_1.connectionDescription,
|
|
62
66
|
...contact_1.contactDescription,
|
|
63
67
|
...group_1.groupDescription,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZapperHub.node.js","sourceRoot":"","sources":["../../../nodes/ZapperHub/ZapperHub.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;AAE9F,2CAAmD;AACnD,2CAAmD;AACnD,iDAAyD;AACzD,6CAAqD;AACrD,qDAA6D;AAC7D,iDAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"ZapperHub.node.js","sourceRoot":"","sources":["../../../nodes/ZapperHub/ZapperHub.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;AAE9F,2CAAmD;AACnD,iDAAyD;AACzD,2CAAmD;AACnD,qDAA6D;AAC7D,iDAAyD;AACzD,6CAAqD;AACrD,qDAA6D;AAC7D,iDAAyD;AACzD,6CAA8E;AAC9E,mDAA2D;AAE3D,MAAa,SAAS;IAAtB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,IAAI,EAAE,yBAAyB,EAAE;YACtE,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EACV,6GAA6G;YAC9G,QAAQ,EAAE;gBACT,IAAI,EAAE,WAAW;aACjB;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACvD,eAAe,EAAE;gBAChB,OAAO,EAAE,sDAAsD;gBAC/D,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBAClC;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;wBAC/B,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;wBACrC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;wBAC/B,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;wBACzC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;wBAC3C,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;wBACrC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;wBACjC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;wBACzC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;wBACrC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;wBACrC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;qBACvC;oBACD,OAAO,EAAE,SAAS;iBAClB;gBACD,GAAG,4BAAkB;gBACrB,GAAG,sBAAe;gBAClB,GAAG,4BAAkB;gBACrB,GAAG,sBAAe;gBAClB,GAAG,gCAAoB;gBACvB,GAAG,6BAAqB;gBACxB,GAAG,4BAAkB;gBACrB,GAAG,wBAAgB;gBACnB,GAAG,gCAAoB;gBACvB,GAAG,0BAAkB;gBACrB,GAAG,8BAAmB;aACtB;SACD,CAAC;IACH,CAAC;CAAA;AA1DD,8BA0DC"}
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.channelDescription = void 0;
|
|
4
|
+
const shared_1 = require("../shared");
|
|
5
|
+
const R = 'channel';
|
|
6
|
+
const show = (...operations) => (0, shared_1.showFor)(R, operations);
|
|
7
|
+
const channelUrl = (suffix = '') => `=/newsletters/${(0, shared_1.pathParam)('newsletterId')}${suffix}`;
|
|
8
|
+
const userDescription = 'Phone number with country code (for example 5511912345678) or LID ending in @lid, such as the ID that Get Followers returns';
|
|
9
|
+
exports.channelDescription = [
|
|
10
|
+
(0, shared_1.operationSelector)(R, [
|
|
11
|
+
{
|
|
12
|
+
name: 'Accept Admin Invite',
|
|
13
|
+
value: 'acceptAdminInvite',
|
|
14
|
+
action: 'Accept an admin invite of a channel',
|
|
15
|
+
description: 'Accept the admin invite that the connected account received for a channel. QR Code connection only.',
|
|
16
|
+
routing: {
|
|
17
|
+
request: { method: 'POST', url: channelUrl('/admins/accept') },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Create',
|
|
22
|
+
value: 'create',
|
|
23
|
+
action: 'Create a channel',
|
|
24
|
+
routing: {
|
|
25
|
+
request: { method: 'POST', url: '/newsletters' },
|
|
26
|
+
output: (0, shared_1.splitInto)('newsletter'),
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Delete',
|
|
31
|
+
value: 'delete',
|
|
32
|
+
action: 'Delete a channel',
|
|
33
|
+
description: 'Delete a channel permanently. Only the owner of the channel can delete it.',
|
|
34
|
+
routing: {
|
|
35
|
+
request: { method: 'DELETE', url: `=/newsletters/${(0, shared_1.pathParam)('newsletterId')}` },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Follow',
|
|
40
|
+
value: 'follow',
|
|
41
|
+
action: 'Follow a channel',
|
|
42
|
+
routing: {
|
|
43
|
+
request: { method: 'POST', url: `=/newsletters/${(0, shared_1.pathParam)('newsletterId')}/follow` },
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Get',
|
|
48
|
+
value: 'get',
|
|
49
|
+
action: 'Get a channel',
|
|
50
|
+
description: 'Get a channel that the account follows or manages',
|
|
51
|
+
routing: {
|
|
52
|
+
request: { method: 'GET', url: `=/newsletters/${(0, shared_1.pathParam)('newsletterId')}` },
|
|
53
|
+
output: (0, shared_1.splitInto)('newsletter'),
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Get Admins',
|
|
58
|
+
value: 'getAdmins',
|
|
59
|
+
action: 'Get the admins of a channel',
|
|
60
|
+
description: 'Get the number of admins of a channel and the admin invites that are pending. QR Code connection only.',
|
|
61
|
+
routing: {
|
|
62
|
+
request: { method: 'GET', url: channelUrl('/admins') },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'Get Followers',
|
|
67
|
+
value: 'getFollowers',
|
|
68
|
+
action: 'Get the followers of a channel',
|
|
69
|
+
description: 'List the followers of a channel. Returns 100 followers when no limit is set. QR Code connection only.',
|
|
70
|
+
routing: {
|
|
71
|
+
request: { method: 'GET', url: channelUrl('/followers') },
|
|
72
|
+
output: (0, shared_1.splitInto)('followers'),
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'Get Insights',
|
|
77
|
+
value: 'getInsights',
|
|
78
|
+
action: 'Get the insights of a channel',
|
|
79
|
+
description: 'Get the follower and visitor statistics of a channel. QR Code connection only.',
|
|
80
|
+
routing: {
|
|
81
|
+
request: { method: 'GET', url: channelUrl('/insights') },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'Get Invite Info',
|
|
86
|
+
value: 'getInviteInfo',
|
|
87
|
+
action: 'Get the channel of an invite',
|
|
88
|
+
description: 'Get the data of the channel of an invite link, without following the channel. Works for all channels.',
|
|
89
|
+
routing: {
|
|
90
|
+
request: { method: 'GET', url: '/newsletters/invite-info' },
|
|
91
|
+
output: (0, shared_1.splitInto)('newsletter'),
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'Get Many',
|
|
96
|
+
value: 'getMany',
|
|
97
|
+
action: 'Get many channels',
|
|
98
|
+
description: 'List the WhatsApp channels (newsletters) the account follows or owns',
|
|
99
|
+
routing: {
|
|
100
|
+
request: { method: 'GET', url: '/newsletters' },
|
|
101
|
+
output: (0, shared_1.splitInto)('newsletters'),
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'Invite Admin',
|
|
106
|
+
value: 'inviteAdmin',
|
|
107
|
+
action: 'Invite a user to be an admin of a channel',
|
|
108
|
+
description: 'Invite a user to be an admin of a channel. QR Code connection only.',
|
|
109
|
+
routing: {
|
|
110
|
+
request: { method: 'POST', url: channelUrl('/admins/invites') },
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'Mute',
|
|
115
|
+
value: 'mute',
|
|
116
|
+
action: 'Mute or unmute a channel',
|
|
117
|
+
routing: {
|
|
118
|
+
request: { method: 'PUT', url: `=/newsletters/${(0, shared_1.pathParam)('newsletterId')}/mute` },
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'Pin Message',
|
|
123
|
+
value: 'pinMessage',
|
|
124
|
+
action: 'Pin a message of a channel',
|
|
125
|
+
description: 'Pin a message of a channel. Returns the pinned messages of the channel. QR Code connection only.',
|
|
126
|
+
routing: {
|
|
127
|
+
request: {
|
|
128
|
+
method: 'PUT',
|
|
129
|
+
url: channelUrl(`/messages/${(0, shared_1.pathParam)('serverId')}/pin`),
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'Remove Admin',
|
|
135
|
+
value: 'removeAdmin',
|
|
136
|
+
action: 'Remove an admin of a channel',
|
|
137
|
+
description: 'Remove an admin of a channel. QR Code connection only.',
|
|
138
|
+
routing: {
|
|
139
|
+
request: { method: 'DELETE', url: channelUrl(`/admins/${(0, shared_1.pathParam)('user')}`) },
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'Remove Picture',
|
|
144
|
+
value: 'removePicture',
|
|
145
|
+
action: 'Remove the picture of a channel',
|
|
146
|
+
routing: {
|
|
147
|
+
request: {
|
|
148
|
+
method: 'DELETE',
|
|
149
|
+
url: `=/newsletters/${(0, shared_1.pathParam)('newsletterId')}/picture`,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'Revoke Admin Invite',
|
|
155
|
+
value: 'revokeAdminInvite',
|
|
156
|
+
action: 'Revoke an admin invite of a channel',
|
|
157
|
+
description: 'Revoke a pending admin invite of a channel. QR Code connection only.',
|
|
158
|
+
routing: {
|
|
159
|
+
request: {
|
|
160
|
+
method: 'DELETE',
|
|
161
|
+
url: channelUrl(`/admins/invites/${(0, shared_1.pathParam)('user')}`),
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'Send Poll',
|
|
167
|
+
value: 'sendPoll',
|
|
168
|
+
action: 'Send a poll to a channel',
|
|
169
|
+
description: 'Send a poll or a quiz to a channel. QR Code connection only.',
|
|
170
|
+
routing: {
|
|
171
|
+
request: { method: 'POST', url: channelUrl('/polls') },
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'Send Question',
|
|
176
|
+
value: 'sendQuestion',
|
|
177
|
+
action: 'Send a question to a channel',
|
|
178
|
+
description: 'Send a question that the followers answer with text to a channel. QR Code connection only.',
|
|
179
|
+
routing: {
|
|
180
|
+
request: { method: 'POST', url: channelUrl('/questions') },
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'Transfer Ownership',
|
|
185
|
+
value: 'transferOwnership',
|
|
186
|
+
action: 'Transfer the ownership of a channel',
|
|
187
|
+
description: 'Transfer the ownership of a channel to another user. This cannot be undone by the account that transfers. QR Code connection only.',
|
|
188
|
+
routing: {
|
|
189
|
+
request: { method: 'PUT', url: channelUrl('/owner') },
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: 'Unfollow',
|
|
194
|
+
value: 'unfollow',
|
|
195
|
+
action: 'Unfollow a channel',
|
|
196
|
+
routing: {
|
|
197
|
+
request: {
|
|
198
|
+
method: 'POST',
|
|
199
|
+
url: `=/newsletters/${(0, shared_1.pathParam)('newsletterId')}/unfollow`,
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'Unpin Message',
|
|
205
|
+
value: 'unpinMessage',
|
|
206
|
+
action: 'Unpin a message of a channel',
|
|
207
|
+
description: 'Unpin a message of a channel. Returns the pinned messages of the channel. QR Code connection only.',
|
|
208
|
+
routing: {
|
|
209
|
+
request: {
|
|
210
|
+
method: 'DELETE',
|
|
211
|
+
url: channelUrl(`/messages/${(0, shared_1.pathParam)('serverId')}/pin`),
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: 'Update',
|
|
217
|
+
value: 'update',
|
|
218
|
+
action: 'Update the name or description of a channel',
|
|
219
|
+
routing: {
|
|
220
|
+
request: { method: 'PATCH', url: `=/newsletters/${(0, shared_1.pathParam)('newsletterId')}` },
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'Update Picture',
|
|
225
|
+
value: 'updatePicture',
|
|
226
|
+
action: 'Update the picture of a channel',
|
|
227
|
+
routing: {
|
|
228
|
+
request: {
|
|
229
|
+
method: 'PATCH',
|
|
230
|
+
url: `=/newsletters/${(0, shared_1.pathParam)('newsletterId')}/picture`,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
], 'getMany'),
|
|
235
|
+
(0, shared_1.pathField)(show('acceptAdminInvite', 'delete', 'follow', 'get', 'getAdmins', 'getFollowers', 'getInsights', 'inviteAdmin', 'mute', 'pinMessage', 'removeAdmin', 'removePicture', 'revokeAdminInvite', 'sendPoll', 'sendQuestion', 'transferOwnership', 'unfollow', 'unpinMessage', 'update', 'updatePicture'), {
|
|
236
|
+
displayName: 'Channel ID',
|
|
237
|
+
name: 'newsletterId',
|
|
238
|
+
type: 'string',
|
|
239
|
+
default: '',
|
|
240
|
+
placeholder: '120363012345678901@newsletter',
|
|
241
|
+
description: 'ID of the channel, with or without @newsletter',
|
|
242
|
+
}),
|
|
243
|
+
(0, shared_1.bodyField)(show('create'), {
|
|
244
|
+
displayName: 'Name',
|
|
245
|
+
name: 'name',
|
|
246
|
+
type: 'string',
|
|
247
|
+
required: true,
|
|
248
|
+
default: '',
|
|
249
|
+
}),
|
|
250
|
+
(0, shared_1.optionsCollection)(show('create'), [
|
|
251
|
+
(0, shared_1.bodyOption)({
|
|
252
|
+
displayName: 'Description',
|
|
253
|
+
name: 'description',
|
|
254
|
+
type: 'string',
|
|
255
|
+
typeOptions: { rows: 3 },
|
|
256
|
+
default: '',
|
|
257
|
+
}),
|
|
258
|
+
]),
|
|
259
|
+
(0, shared_1.optionsCollection)(show('getFollowers'), [
|
|
260
|
+
(0, shared_1.queryOption)({
|
|
261
|
+
displayName: 'Limit',
|
|
262
|
+
name: 'limit',
|
|
263
|
+
type: 'number',
|
|
264
|
+
typeOptions: { minValue: 1, maxValue: 1000 },
|
|
265
|
+
default: 50,
|
|
266
|
+
description: 'Max number of results to return',
|
|
267
|
+
}),
|
|
268
|
+
]),
|
|
269
|
+
(0, shared_1.pathField)(show('removeAdmin', 'revokeAdminInvite'), {
|
|
270
|
+
displayName: 'User',
|
|
271
|
+
name: 'user',
|
|
272
|
+
type: 'string',
|
|
273
|
+
default: '',
|
|
274
|
+
placeholder: '5511912345678',
|
|
275
|
+
description: userDescription,
|
|
276
|
+
}),
|
|
277
|
+
(0, shared_1.bodyField)(show('inviteAdmin', 'transferOwnership'), {
|
|
278
|
+
displayName: 'User',
|
|
279
|
+
name: 'user',
|
|
280
|
+
type: 'string',
|
|
281
|
+
required: true,
|
|
282
|
+
default: '',
|
|
283
|
+
placeholder: '5511912345678',
|
|
284
|
+
description: userDescription,
|
|
285
|
+
}),
|
|
286
|
+
(0, shared_1.optionsCollection)(show('inviteAdmin'), [
|
|
287
|
+
(0, shared_1.bodyOption)({
|
|
288
|
+
displayName: 'Message',
|
|
289
|
+
name: 'message',
|
|
290
|
+
type: 'string',
|
|
291
|
+
typeOptions: { rows: 3 },
|
|
292
|
+
default: '',
|
|
293
|
+
description: 'Text sent to the user together with the invite',
|
|
294
|
+
}),
|
|
295
|
+
]),
|
|
296
|
+
(0, shared_1.pathField)(show('pinMessage', 'unpinMessage'), {
|
|
297
|
+
displayName: 'Message Server ID',
|
|
298
|
+
name: 'serverId',
|
|
299
|
+
type: 'number',
|
|
300
|
+
typeOptions: { minValue: 1, numberPrecision: 0 },
|
|
301
|
+
default: 1,
|
|
302
|
+
description: 'Server ID of the message in the channel, a positive integer',
|
|
303
|
+
}),
|
|
304
|
+
(0, shared_1.bodyField)(show('sendPoll'), {
|
|
305
|
+
displayName: 'Question',
|
|
306
|
+
name: 'name',
|
|
307
|
+
type: 'string',
|
|
308
|
+
required: true,
|
|
309
|
+
default: '',
|
|
310
|
+
description: 'Question of the poll',
|
|
311
|
+
}),
|
|
312
|
+
(0, shared_1.bodyField)(show('sendPoll'), {
|
|
313
|
+
displayName: 'Poll Options',
|
|
314
|
+
name: 'pollOptions',
|
|
315
|
+
type: 'fixedCollection',
|
|
316
|
+
placeholder: 'Add Option',
|
|
317
|
+
typeOptions: { multipleValues: true, maxAllowedFields: 12 },
|
|
318
|
+
required: true,
|
|
319
|
+
default: {},
|
|
320
|
+
description: 'From 2 to 12 options, without duplicates',
|
|
321
|
+
options: [
|
|
322
|
+
{
|
|
323
|
+
name: 'option',
|
|
324
|
+
displayName: 'Option',
|
|
325
|
+
values: [
|
|
326
|
+
{
|
|
327
|
+
displayName: 'Text',
|
|
328
|
+
name: 'text',
|
|
329
|
+
type: 'string',
|
|
330
|
+
default: '',
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
],
|
|
335
|
+
}, 'options', '={{ ($value.option ?? []).map(item => item.text) }}'),
|
|
336
|
+
(0, shared_1.optionsCollection)(show('sendPoll'), [
|
|
337
|
+
(0, shared_1.bodyOption)({
|
|
338
|
+
displayName: 'Correct Option',
|
|
339
|
+
name: 'correctOption',
|
|
340
|
+
type: 'number',
|
|
341
|
+
typeOptions: { minValue: 0, numberPrecision: 0 },
|
|
342
|
+
default: 0,
|
|
343
|
+
description: 'Position of the correct option, starting at 0. When set, the poll becomes a quiz.',
|
|
344
|
+
}),
|
|
345
|
+
(0, shared_1.bodyOption)({
|
|
346
|
+
displayName: 'Single Choice',
|
|
347
|
+
name: 'singleChoice',
|
|
348
|
+
type: 'boolean',
|
|
349
|
+
default: false,
|
|
350
|
+
description: 'Whether each follower can select only one option',
|
|
351
|
+
}),
|
|
352
|
+
]),
|
|
353
|
+
(0, shared_1.bodyField)(show('sendQuestion'), {
|
|
354
|
+
displayName: 'Text',
|
|
355
|
+
name: 'text',
|
|
356
|
+
type: 'string',
|
|
357
|
+
typeOptions: { rows: 3 },
|
|
358
|
+
required: true,
|
|
359
|
+
default: '',
|
|
360
|
+
description: 'Text of the question',
|
|
361
|
+
}),
|
|
362
|
+
(0, shared_1.queryField)(show('getInviteInfo'), {
|
|
363
|
+
displayName: 'Invite',
|
|
364
|
+
name: 'invite',
|
|
365
|
+
type: 'string',
|
|
366
|
+
required: true,
|
|
367
|
+
default: '',
|
|
368
|
+
placeholder: 'https://whatsapp.com/channel/0029VaAbCdEfGhIjKlMnOp',
|
|
369
|
+
description: 'Invite link or only the code',
|
|
370
|
+
}),
|
|
371
|
+
(0, shared_1.bodyField)(show('mute'), {
|
|
372
|
+
displayName: 'Mute',
|
|
373
|
+
name: 'mute',
|
|
374
|
+
type: 'boolean',
|
|
375
|
+
default: true,
|
|
376
|
+
description: 'Whether to mute the channel. Turn off to unmute.',
|
|
377
|
+
}),
|
|
378
|
+
{
|
|
379
|
+
displayName: 'Update Fields',
|
|
380
|
+
name: 'updateFields',
|
|
381
|
+
type: 'collection',
|
|
382
|
+
placeholder: 'Add Field',
|
|
383
|
+
default: {},
|
|
384
|
+
displayOptions: show('update'),
|
|
385
|
+
description: 'Give the name, the description or both. An empty description removes the description.',
|
|
386
|
+
options: [
|
|
387
|
+
(0, shared_1.bodyOption)({
|
|
388
|
+
displayName: 'Description',
|
|
389
|
+
name: 'description',
|
|
390
|
+
type: 'string',
|
|
391
|
+
typeOptions: { rows: 3 },
|
|
392
|
+
default: '',
|
|
393
|
+
}),
|
|
394
|
+
(0, shared_1.bodyOption)({
|
|
395
|
+
displayName: 'Name',
|
|
396
|
+
name: 'name',
|
|
397
|
+
type: 'string',
|
|
398
|
+
default: '',
|
|
399
|
+
}),
|
|
400
|
+
],
|
|
401
|
+
},
|
|
402
|
+
(0, shared_1.bodyField)(show('updatePicture'), {
|
|
403
|
+
displayName: 'Picture',
|
|
404
|
+
name: 'picture',
|
|
405
|
+
type: 'string',
|
|
406
|
+
required: true,
|
|
407
|
+
default: '',
|
|
408
|
+
description: 'URL or Base64 of a square JPEG image of 640x640 px',
|
|
409
|
+
}),
|
|
410
|
+
];
|
|
411
|
+
//# sourceMappingURL=channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../../nodes/ZapperHub/resources/channel.ts"],"names":[],"mappings":";;;AAEA,sCAWmB;AAEnB,MAAM,CAAC,GAAG,SAAS,CAAC;AACpB,MAAM,IAAI,GAAG,CAAC,GAAG,UAAoB,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AACjE,MAAM,UAAU,GAAG,CAAC,MAAM,GAAG,EAAE,EAAE,EAAE,CAAC,iBAAiB,IAAA,kBAAS,EAAC,cAAc,CAAC,GAAG,MAAM,EAAE,CAAC;AAE1F,MAAM,eAAe,GACpB,6HAA6H,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EAAE,EAAE;QACX,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC;QAC9B,WAAW,EACV,uFAAuF;QACxF,OAAO,EAAE;YACR,IAAA,mBAAU,EAAC;gBACV,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;gBACxB,OAAO,EAAE,EAAE;aACX,CAAC;YACF,IAAA,mBAAU,EAAC;gBACV,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX,CAAC;SACF;KACD;IACD,IAAA,kBAAS,EAAC,IAAI,CAAC,eAAe,CAAC,EAAE;QAChC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,oDAAoD;KACjE,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.communityDescription = void 0;
|
|
4
|
+
const shared_1 = require("../shared");
|
|
5
|
+
const R = 'community';
|
|
6
|
+
const show = (...operations) => (0, shared_1.showFor)(R, operations);
|
|
7
|
+
exports.communityDescription = [
|
|
8
|
+
(0, shared_1.operationSelector)(R, [
|
|
9
|
+
{
|
|
10
|
+
name: 'Create',
|
|
11
|
+
value: 'create',
|
|
12
|
+
action: 'Create a community',
|
|
13
|
+
description: 'Create a community. WhatsApp also creates its announcement group. To change the name, description, picture or settings, use the Group operations with the community ID.',
|
|
14
|
+
routing: { request: { method: 'POST', url: '/communities' } },
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'Create Group',
|
|
18
|
+
value: 'createGroup',
|
|
19
|
+
action: 'Create a group in a community',
|
|
20
|
+
routing: {
|
|
21
|
+
request: { method: 'POST', url: `=/communities/${(0, shared_1.pathParam)('communityId')}/groups` },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'Get Groups',
|
|
26
|
+
value: 'getGroups',
|
|
27
|
+
action: 'Get the groups of a community',
|
|
28
|
+
description: 'List the groups of a community, the announcement group included',
|
|
29
|
+
routing: {
|
|
30
|
+
request: { method: 'GET', url: `=/communities/${(0, shared_1.pathParam)('communityId')}/groups` },
|
|
31
|
+
output: (0, shared_1.splitInto)('groups'),
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Get Many',
|
|
36
|
+
value: 'getMany',
|
|
37
|
+
action: 'Get many communities',
|
|
38
|
+
description: 'List the communities of the connected account',
|
|
39
|
+
routing: {
|
|
40
|
+
request: { method: 'GET', url: '/communities' },
|
|
41
|
+
output: (0, shared_1.splitInto)('communities'),
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Get Participants',
|
|
46
|
+
value: 'getParticipants',
|
|
47
|
+
action: 'Get the participants of a community',
|
|
48
|
+
description: 'List the participants of all the groups of a community',
|
|
49
|
+
routing: {
|
|
50
|
+
request: {
|
|
51
|
+
method: 'GET',
|
|
52
|
+
url: `=/communities/${(0, shared_1.pathParam)('communityId')}/participants`,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Link Group',
|
|
58
|
+
value: 'linkGroup',
|
|
59
|
+
action: 'Link a group to a community',
|
|
60
|
+
description: 'Link an existing group. The account must be an admin of the community and of the group.',
|
|
61
|
+
routing: {
|
|
62
|
+
request: {
|
|
63
|
+
method: 'PUT',
|
|
64
|
+
url: `=/communities/${(0, shared_1.pathParam)('communityId')}/groups/${(0, shared_1.pathParam)('groupId')}`,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Unlink Group',
|
|
70
|
+
value: 'unlinkGroup',
|
|
71
|
+
action: 'Unlink a group from a community',
|
|
72
|
+
description: 'The group continues to exist with the same participants',
|
|
73
|
+
routing: {
|
|
74
|
+
request: {
|
|
75
|
+
method: 'DELETE',
|
|
76
|
+
url: `=/communities/${(0, shared_1.pathParam)('communityId')}/groups/${(0, shared_1.pathParam)('groupId')}`,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
], 'getMany'),
|
|
81
|
+
(0, shared_1.pathField)(show('createGroup', 'getGroups', 'getParticipants', 'linkGroup', 'unlinkGroup'), {
|
|
82
|
+
displayName: 'Community ID',
|
|
83
|
+
name: 'communityId',
|
|
84
|
+
type: 'string',
|
|
85
|
+
default: '',
|
|
86
|
+
placeholder: '120363012345678901@g.us',
|
|
87
|
+
}),
|
|
88
|
+
(0, shared_1.pathField)(show('linkGroup', 'unlinkGroup'), {
|
|
89
|
+
displayName: 'Group ID',
|
|
90
|
+
name: 'groupId',
|
|
91
|
+
type: 'string',
|
|
92
|
+
default: '',
|
|
93
|
+
placeholder: '120363012345678902@g.us',
|
|
94
|
+
}),
|
|
95
|
+
(0, shared_1.bodyField)(show('create', 'createGroup'), {
|
|
96
|
+
displayName: 'Name',
|
|
97
|
+
name: 'name',
|
|
98
|
+
type: 'string',
|
|
99
|
+
required: true,
|
|
100
|
+
default: '',
|
|
101
|
+
}),
|
|
102
|
+
(0, shared_1.bodyField)(show('createGroup'), {
|
|
103
|
+
displayName: 'Participants',
|
|
104
|
+
name: 'participants',
|
|
105
|
+
type: 'string',
|
|
106
|
+
default: '',
|
|
107
|
+
placeholder: '5511912345678, 5521987654321',
|
|
108
|
+
description: 'Comma-separated phone numbers with country code, in addition to the connected account. Optional.',
|
|
109
|
+
}, 'participants', shared_1.commaList),
|
|
110
|
+
(0, shared_1.optionsCollection)(show('getMany'), [
|
|
111
|
+
(0, shared_1.queryOption)({
|
|
112
|
+
displayName: 'Include Participants',
|
|
113
|
+
name: 'showParticipants',
|
|
114
|
+
type: 'boolean',
|
|
115
|
+
default: false,
|
|
116
|
+
description: 'Whether to include the participants of each community',
|
|
117
|
+
}),
|
|
118
|
+
]),
|
|
119
|
+
];
|
|
120
|
+
//# sourceMappingURL=community.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"community.js","sourceRoot":"","sources":["../../../../nodes/ZapperHub/resources/community.ts"],"names":[],"mappings":";;;AAEA,sCAUmB;AAEnB,MAAM,CAAC,GAAG,WAAW,CAAC;AACtB,MAAM,IAAI,GAAG,CAAC,GAAG,UAAoB,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AAEpD,QAAA,oBAAoB,GAAsB;IACtD,IAAA,0BAAiB,EAChB,CAAC,EACD;QACC;YACC,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,oBAAoB;YAC5B,WAAW,EACV,yKAAyK;YAC1K,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE;SAC7D;QACD;YACC,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,+BAA+B;YACvC,OAAO,EAAE;gBACR,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,IAAA,kBAAS,EAAC,aAAa,CAAC,SAAS,EAAE;aACpF;SACD;QACD;YACC,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,+BAA+B;YACvC,WAAW,EAAE,iEAAiE;YAC9E,OAAO,EAAE;gBACR,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,IAAA,kBAAS,EAAC,aAAa,CAAC,SAAS,EAAE;gBACnF,MAAM,EAAE,IAAA,kBAAS,EAAC,QAAQ,C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