@funnelchat-hq/sdk 0.3.0 → 0.3.2
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 +27 -21
- package/dist/index.cjs +44 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2359 -1466
- package/dist/index.d.ts +2359 -1466
- package/dist/index.js +44 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -384,7 +384,13 @@ var GROUP_ACTION_ERROR_CODES = {
|
|
|
384
384
|
/** 422: that `type` cannot be sent to this group by this number. */
|
|
385
385
|
unsupported_type: 422,
|
|
386
386
|
/** 429: the number has 50 group actions open. Wait for some to finish; not worth retrying. */
|
|
387
|
-
too_many_pending_actions: 429
|
|
387
|
+
too_many_pending_actions: 429,
|
|
388
|
+
/** 403: following a group (also by writing to one not in the account) needs **Groups and campaigns → Manage groups**. */
|
|
389
|
+
import_permission_required: 403,
|
|
390
|
+
/** 429, with `Retry-After`: the number already followed 5 groups this minute. */
|
|
391
|
+
import_rate_limited: 429,
|
|
392
|
+
/** 409: another call is following the same group right now. */
|
|
393
|
+
import_in_progress: 409
|
|
388
394
|
};
|
|
389
395
|
var IDEMPOTENCY_ERROR_CODES = {
|
|
390
396
|
/** 422: the key was already used with another body. Use a new key for a new resource. */
|
|
@@ -590,14 +596,29 @@ var routes = [
|
|
|
590
596
|
{ "method": "GET", "path": "/api/v1/forms/families/{familyId}/versions", "operationId": "pendingForms.versions", "domain": "conversations", "permission": "conversations:read", "tag": "WhatsappForm", "summary": "The versions of a form", "pending": true },
|
|
591
597
|
{ "method": "GET", "path": "/api/v1/forms/templates", "operationId": "pendingForms.templates", "domain": "conversations", "permission": "conversations:read", "tag": "WhatsappForm", "summary": "Templates to start a form", "pending": true },
|
|
592
598
|
{ "method": "GET", "path": "/api/v1/groups", "operationId": "group.index", "domain": "communities", "permission": "communities:read", "tag": "Grupos", "summary": "Listar grupos", "pending": false },
|
|
599
|
+
{ "method": "POST", "path": "/api/v1/groups", "operationId": "apiGroupAction.create", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Crea un grupo", "pending": false },
|
|
593
600
|
{ "method": "GET", "path": "/api/v1/groups/{group}", "operationId": "group.show", "domain": "communities", "permission": "communities:read", "tag": "Grupos", "summary": "Ver un grupo", "pending": false },
|
|
594
601
|
{ "method": "GET", "path": "/api/v1/groups/{group}/actions", "operationId": "group.actions", "domain": "communities", "permission": "communities:read", "tag": "Grupos", "summary": "Listar las acciones de sesi\xF3n sobre un grupo", "pending": false },
|
|
602
|
+
{ "method": "POST", "path": "/api/v1/groups/{group}/admins", "operationId": "apiGroupAction.promoteAdmins", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Promueve tel\xE9fonos a administrador", "pending": false },
|
|
603
|
+
{ "method": "POST", "path": "/api/v1/groups/{group}/admins/remove", "operationId": "apiGroupAction.demoteAdmins", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Quita el rol de administrador a tel\xE9fonos", "pending": false },
|
|
604
|
+
{ "method": "PUT", "path": "/api/v1/groups/{group}/description", "operationId": "apiGroupAction.updateDescription", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Cambia la descripci\xF3n del grupo", "pending": false },
|
|
605
|
+
{ "method": "POST", "path": "/api/v1/groups/{group}/import", "operationId": "v2.apiGroupImport", "domain": "communities", "permission": "communities:operate", "tag": "Grupos", "summary": "Importar un grupo de un n\xFAmero", "pending": false },
|
|
606
|
+
{ "method": "GET", "path": "/api/v1/groups/{group}/invite-link/live", "operationId": "apiGroupAction.inviteLink", "domain": "communities", "permission": "communities:read", "tag": "Acciones de grupo", "summary": "Link de invitaci\xF3n vigente del grupo", "pending": false },
|
|
607
|
+
{ "method": "POST", "path": "/api/v1/groups/{group}/invite-link/renew", "operationId": "apiGroupAction.renewInviteLink", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Renueva el link de invitaci\xF3n del grupo", "pending": false },
|
|
608
|
+
{ "method": "GET", "path": "/api/v1/groups/{group}/join-requests", "operationId": "apiGroupAction.joinRequests", "domain": "communities", "permission": "communities:read", "tag": "Acciones de grupo", "summary": "Solicitudes pendientes para unirse al grupo", "pending": false },
|
|
609
|
+
{ "method": "POST", "path": "/api/v1/groups/{group}/join-requests/approve", "operationId": "apiGroupAction.approveJoinRequests", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Aprueba solicitudes para unirse al grupo", "pending": false },
|
|
610
|
+
{ "method": "POST", "path": "/api/v1/groups/{group}/join-requests/reject", "operationId": "apiGroupAction.rejectJoinRequests", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Rechaza solicitudes para unirse al grupo", "pending": false },
|
|
595
611
|
{ "method": "GET", "path": "/api/v1/groups/{group}/messages", "operationId": "group.messages", "domain": "communities", "permission": "communities:read", "tag": "Grupos", "summary": "Listar los mensajes enviados a un grupo", "pending": false },
|
|
596
|
-
{ "method": "POST", "path": "/api/v1/groups/{group}/messages", "operationId": "
|
|
612
|
+
{ "method": "POST", "path": "/api/v1/groups/{group}/messages", "operationId": "apiGroupAction.sendMessage", "domain": "communities", "permission": "communities:send", "tag": "Acciones de grupo", "summary": "Mandar un mensaje a un grupo", "pending": false },
|
|
613
|
+
{ "method": "PUT", "path": "/api/v1/groups/{group}/name", "operationId": "apiGroupAction.updateName", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Cambia el nombre del grupo", "pending": false },
|
|
597
614
|
{ "method": "GET", "path": "/api/v1/groups/{group}/participant-events", "operationId": "group.participantEvents", "domain": "communities", "permission": "communities:read", "tag": "Participantes", "summary": "Listar entradas y salidas de un grupo", "pending": false },
|
|
615
|
+
{ "method": "POST", "path": "/api/v1/groups/{group}/participants", "operationId": "apiGroupAction.addParticipants", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Suma participantes al grupo", "pending": false },
|
|
616
|
+
{ "method": "POST", "path": "/api/v1/groups/{group}/participants/remove", "operationId": "apiGroupAction.removeParticipants", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Saca participantes del grupo", "pending": false },
|
|
617
|
+
{ "method": "PUT", "path": "/api/v1/groups/{group}/photo", "operationId": "apiGroupAction.updatePhoto", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Cambia la foto del grupo", "pending": false },
|
|
598
618
|
{ "method": "GET", "path": "/api/v1/groups/{group}/scheduled-messages", "operationId": "group.scheduledMessages", "domain": "communities", "permission": "communities:read", "tag": "Grupos", "summary": "Listar los env\xEDos programados que incluyen un grupo", "pending": false },
|
|
619
|
+
{ "method": "PUT", "path": "/api/v1/groups/{group}/settings", "operationId": "apiGroupAction.updateSettings", "domain": "communities", "permission": "communities:operate", "tag": "Acciones de grupo", "summary": "Cambia si los miembros pueden escribir", "pending": false },
|
|
599
620
|
{ "method": "GET", "path": "/api/v1/groups/{groupUid}/metadata", "operationId": "groupMetadata.show", "domain": "communities", "permission": "communities:read", "tag": "Grupos", "summary": "Ver los datos actuales de un grupo en WhatsApp", "pending": false },
|
|
600
|
-
{ "method": "GET", "path": "/api/v1/groups/actions/{action}", "operationId": "
|
|
621
|
+
{ "method": "GET", "path": "/api/v1/groups/actions/{action}", "operationId": "apiGroupAction.show", "domain": "communities", "permission": "communities:read", "tag": "Acciones de grupo", "summary": "Ver c\xF3mo sali\xF3 una acci\xF3n de grupo", "pending": true },
|
|
601
622
|
{ "method": "GET", "path": "/api/v1/groups/participants", "operationId": "group.participants", "domain": "communities", "permission": "communities:read", "tag": "Participantes", "summary": "Listar los participantes de un grupo", "pending": false },
|
|
602
623
|
{ "method": "GET", "path": "/api/v1/kanban-settings", "operationId": "kanbanSetting.index", "domain": "conversations", "permission": "conversations:read", "tag": "KanbanSetting", "summary": "Listar tableros", "pending": false },
|
|
603
624
|
{ "method": "POST", "path": "/api/v1/kanban-settings", "operationId": "kanbanSetting.store", "domain": "conversations", "permission": "conversations:write", "tag": "KanbanSetting", "summary": "Crear un tablero", "pending": false },
|
|
@@ -1114,7 +1135,11 @@ var Groups = class extends Resource {
|
|
|
1114
1135
|
retrieve(group, options) {
|
|
1115
1136
|
return this.client.request("GET", "/api/v1/groups/{group}", { ...options, path: { group } });
|
|
1116
1137
|
}
|
|
1117
|
-
/**
|
|
1138
|
+
/**
|
|
1139
|
+
* `GET /api/v1/devices/{device}/groups`, paginated (`page`, `pageSize`): the groups of one number,
|
|
1140
|
+
* read live from WhatsApp (for a key, reused for a minute per number). A group that is already in
|
|
1141
|
+
* the account brings `device_id`; any other can be followed with {@link Groups.follow}.
|
|
1142
|
+
*/
|
|
1118
1143
|
listByDevice(device, query, options) {
|
|
1119
1144
|
return this.client.paginate("/api/v1/devices/{device}/groups", { ...options, path: { device }, query });
|
|
1120
1145
|
}
|
|
@@ -1157,6 +1182,20 @@ var Groups = class extends Resource {
|
|
|
1157
1182
|
sendMessage(group, body, options) {
|
|
1158
1183
|
return this.client.request("POST", "/api/v1/groups/{group}/messages", { ...options, path: { group }, body });
|
|
1159
1184
|
}
|
|
1185
|
+
/**
|
|
1186
|
+
* `POST /api/v1/groups/{group}/import`: follows a WhatsApp group of a QR number (`device_id`), as
|
|
1187
|
+
* importing it in the panel does: from then on its joins and leaves arrive by
|
|
1188
|
+
* `group_participant.joined` and `group_participant.left`. Resolves to `{ data: { uid, name,
|
|
1189
|
+
* imported, is_admin } }`: `imported` is `false` when the group was already in the account, and
|
|
1190
|
+
* `is_admin` says whether the number administers it (without that it cannot write to it). Needs
|
|
1191
|
+
* **Groups and campaigns → Manage groups** (`403 import_permission_required`); up to 5 groups
|
|
1192
|
+
* per number per minute (`429 import_rate_limited`, with `retryAfter`); an official number is
|
|
1193
|
+
* `422 provider_unsupported`. {@link Groups.sendMessage} follows the group itself when it is not in
|
|
1194
|
+
* the account yet.
|
|
1195
|
+
*/
|
|
1196
|
+
follow(group, body, options) {
|
|
1197
|
+
return this.client.request("POST", "/api/v1/groups/{group}/import", { ...options, path: { group }, body });
|
|
1198
|
+
}
|
|
1160
1199
|
/**
|
|
1161
1200
|
* `GET /api/v1/groups/actions/{action}`: where a group action, such as a message sent with
|
|
1162
1201
|
* {@link Groups.sendMessage}, is (`queued`, `running`, `completed` or `failed`) and its `result`.
|
|
@@ -1444,7 +1483,7 @@ var Webhooks = class extends Resource {
|
|
|
1444
1483
|
};
|
|
1445
1484
|
|
|
1446
1485
|
// src/version.ts
|
|
1447
|
-
var VERSION = "0.3.
|
|
1486
|
+
var VERSION = "0.3.2";
|
|
1448
1487
|
|
|
1449
1488
|
// src/client.ts
|
|
1450
1489
|
var BASE_URLS = {
|