@botozap/sdk 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +24 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -2
- package/dist/index.d.ts +48 -2
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @botozap/sdk
|
|
2
2
|
|
|
3
|
+
## 0.28.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d33253b: Sincronizar templates com a Meta fora do painel: `templates.sync()` (SDK), a tool `sync_templates` (MCP) e `botozap templates sync` (CLI) chamam `POST /v1/templates/sync`, que traz o status real, importa os criados no WhatsApp Manager e tira os excluídos lá. `customer_id` limita a um Cliente.
|
|
8
|
+
|
|
9
|
+
## 0.27.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 4b22f9b: Mensagens que pararam de chegar com a autorização valendo: `phoneNumbers.resubscribeWebhooks(id)` (SDK), a tool `resubscribe_phone_number_webhooks` (MCP) e `botozap numbers resubscribe-webhooks <id>` (CLI) chamam `POST /v1/phone_numbers/{id}/webhook-subscription` e inscrevem o BotoZap de novo na Meta, sem refazer a conexão. A saúde do número (`phone_number_health`) passa a explicar `checks.webhook_subscription`.
|
|
14
|
+
|
|
3
15
|
## 0.26.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -5519,6 +5519,16 @@ var Templates = class {
|
|
|
5519
5519
|
{ body: params }
|
|
5520
5520
|
);
|
|
5521
5521
|
}
|
|
5522
|
+
/**
|
|
5523
|
+
* O Sincronizar da tela de Templates: traz da Meta status, categoria,
|
|
5524
|
+
* conteúdo e `rejection_reason` dos templates das conexões ativas (ou de um
|
|
5525
|
+
* Cliente), importa os criados no WhatsApp Manager e tira daqui os excluídos
|
|
5526
|
+
* lá. Use quando um status parecer parado. Autorização recusada pela Meta
|
|
5527
|
+
* responde 409 `reconnect_required`. Scope `templates:write`.
|
|
5528
|
+
*/
|
|
5529
|
+
sync(params = {}) {
|
|
5530
|
+
return this.client.requestItem("POST", "/templates/sync", { body: params });
|
|
5531
|
+
}
|
|
5522
5532
|
};
|
|
5523
5533
|
|
|
5524
5534
|
// src/resources/broadcasts.ts
|
|
@@ -6155,13 +6165,26 @@ var PhoneNumbers = class {
|
|
|
6155
6165
|
body: { window_days: params.window_days }
|
|
6156
6166
|
});
|
|
6157
6167
|
}
|
|
6158
|
-
/**
|
|
6168
|
+
/**
|
|
6169
|
+
* Prontidão do número. Com a conexão ativa, confere ao vivo o token
|
|
6170
|
+
* (`checks.token_validity`) e se a Meta manda as mensagens para o BotoZap
|
|
6171
|
+
* (`checks.webhook_subscription`).
|
|
6172
|
+
*/
|
|
6159
6173
|
health(id) {
|
|
6160
6174
|
return this.client.requestItem(
|
|
6161
6175
|
"GET",
|
|
6162
6176
|
`/phone_numbers/${enc6(id)}/health`
|
|
6163
6177
|
);
|
|
6164
6178
|
}
|
|
6179
|
+
/**
|
|
6180
|
+
* Inscreve o BotoZap de novo para receber as mensagens do número, com a
|
|
6181
|
+
* autorização já guardada, sem refazer a conexão. Resolve a prontidão
|
|
6182
|
+
* `webhooks_lost`; autorização recusada pela Meta responde 409
|
|
6183
|
+
* `reconnect_required` (aí só o link de setup resolve). Scope `numbers:write`.
|
|
6184
|
+
*/
|
|
6185
|
+
resubscribeWebhooks(id) {
|
|
6186
|
+
return this.client.requestItem("POST", `/phone_numbers/${enc6(id)}/webhook-subscription`);
|
|
6187
|
+
}
|
|
6165
6188
|
};
|
|
6166
6189
|
function enc6(id) {
|
|
6167
6190
|
return encodeURIComponent(id);
|