bzapper 0.8.1 → 0.9.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.
@@ -124,6 +124,27 @@ module Bzapper
124
124
  request("GET", "/webhooks/#{segment(id, "id")}/deliveries", query: query, timeout: timeout)
125
125
  end
126
126
 
127
+ # Redeliver a failed delivery. `POST /webhooks/{id}/deliveries/{delivery_id}/redeliver`
128
+ #
129
+ # Sends a FAILED delivery again: same body and same event_id (your idempotency keeps working),
130
+ # signed with the webhook's CURRENT secret. One attempt; the outcome updates the delivery. Only
131
+ # deliveries that failed in the last 7 days can be redelivered — the body carries conversation
132
+ # content and is kept only for that long.
133
+ #
134
+ # @param id [String] Webhook ID (UUID).
135
+ # @param delivery_id [String] Delivery id (from listWebhookDeliveries).
136
+ # @param idempotency_key [String, nil] chave de idempotência (senão a SDK gera uma).
137
+ # @param timeout [Numeric, nil] segundos por tentativa (padrão: o do cliente).
138
+ # @return [Hash, Array, nil] o JSON da resposta, inteiro (nil em 204).
139
+ # @raise [Bzapper::Error] resposta fora de 2xx ou falha de rede.
140
+ # @raise [ArgumentError] parâmetro de caminho vazio, "." ou "..".
141
+ def redeliver_webhook_delivery(id, delivery_id, idempotency_key: nil, timeout: nil)
142
+ request("POST",
143
+ "/webhooks/#{segment(id, "id")}/deliveries/#{segment(delivery_id, "delivery_id")}/redeliver",
144
+ idempotency_key: idempotency_key,
145
+ timeout: timeout)
146
+ end
147
+
127
148
  # Emit a sample event to the project's stream and webhooks (like `stripe trigger`). `POST
128
149
  # /webhooks/trigger`
129
150
  #
@@ -19,6 +19,8 @@ require_relative "resources/advisories"
19
19
  require_relative "resources/webhooks"
20
20
  require_relative "resources/pools"
21
21
  require_relative "resources/connect"
22
+ require_relative "resources/official"
23
+ require_relative "resources/templates"
22
24
  require_relative "resources/partner"
23
25
 
24
26
  module Bzapper
@@ -73,8 +75,14 @@ module Bzapper
73
75
  # @return [Resources::Connect] bZapper Connect do lado do CLIENTE: apps parceiros conectados à conta.
74
76
  attr_reader :connect
75
77
 
78
+ # @return [Resources::Official] Trilho oficial (WhatsApp Cloud API): conta WABA, Embedded Signup, números e perfil comercial.
79
+ attr_reader :official
80
+
81
+ # @return [Resources::Templates] Templates de mensagem aprovados pela Meta (trilho oficial): criar, sincronizar, mídia e fallback.
82
+ attr_reader :templates
83
+
76
84
  # Nomes dos recursos, na ordem da spec.
77
- RESOURCES = %i[accounts contacts usage billing advanced conversations instances groups system messages scheduling campaigns advisories webhooks pools connect].freeze
85
+ RESOURCES = %i[accounts contacts usage billing advanced conversations instances groups system messages scheduling campaigns advisories webhooks pools connect official templates].freeze
78
86
 
79
87
  private
80
88
 
@@ -95,6 +103,8 @@ module Bzapper
95
103
  @webhooks = Resources::Webhooks.new(transport)
96
104
  @pools = Resources::Pools.new(transport)
97
105
  @connect = Resources::Connect.new(transport)
106
+ @official = Resources::Official.new(transport)
107
+ @templates = Resources::Templates.new(transport)
98
108
  end
99
109
  end
100
110
  end
@@ -3,5 +3,5 @@
3
3
  module Bzapper
4
4
  # Versão da gem. O `scripts/release-sdks.sh` do monorepo bumpa a linha abaixo por regex
5
5
  # (ancorada no início da linha) e o `bzapper.gemspec` lê daqui — não mude o formato dela.
6
- VERSION = "0.8.1"
6
+ VERSION = "0.9.0"
7
7
  end
@@ -30,6 +30,10 @@ module Bzapper
30
30
  group.joined group.left group.participant_added group.participant_removed
31
31
  group.participant_promoted group.participant_demoted
32
32
  group.subject_changed group.description_changed
33
+ template.approved template.rejected template.paused template.quality_changed
34
+ template.categorized instance.quality_changed instance.limit_changed
35
+ instance.name_decided account.status_changed account.alert contact.opted_in
36
+ usage.threshold billing.past_due billing.recovered advisory.published
33
37
  connect.completed connect.suspended connect.resumed connect.revoked
34
38
  ].freeze
35
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bzapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Berni Software
@@ -36,10 +36,12 @@ files:
36
36
  - lib/bzapper/resources/groups.rb
37
37
  - lib/bzapper/resources/instances.rb
38
38
  - lib/bzapper/resources/messages.rb
39
+ - lib/bzapper/resources/official.rb
39
40
  - lib/bzapper/resources/partner.rb
40
41
  - lib/bzapper/resources/pools.rb
41
42
  - lib/bzapper/resources/scheduling.rb
42
43
  - lib/bzapper/resources/system.rb
44
+ - lib/bzapper/resources/templates.rb
43
45
  - lib/bzapper/resources/usage.rb
44
46
  - lib/bzapper/resources/webhooks.rb
45
47
  - lib/bzapper/transport.rb