bzapper 0.9.1 → 0.9.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 316cbd15dfc092ac463fe8962cc28654cf759bd05b4beff64e6a416d1efb9bd0
4
- data.tar.gz: 0a5366e02dde82845b9bfcb3052cf3729c65ff5768f5e2fc2ce09717fed6545e
3
+ metadata.gz: 2e9d9112e9be7a83c45c8477b44610c4b6b133f1bc4f43eafbfe4774c72ffab2
4
+ data.tar.gz: 1d1a9d4d5998d14defee4c9e1fee42bbd24fa7c2eb5f44a842eb10f403a9193c
5
5
  SHA512:
6
- metadata.gz: 6b0eaebe936d54f02ef34fb9157a2e586b4845b5e516618b6e0cf3035e915a744b53930bf12435f138ebba738bd4f771b20e4cae29720d750cd168dfd00a72dd
7
- data.tar.gz: 553b87a95d514d5582b6a64cc59abf2d87ee5a0361eb3ce5e509726b92102ebd9d69759f521fd93924b5af7e6252f0359871ec055e0d62e1bbd39a7266566f3a
6
+ metadata.gz: 75e018e04203961849d44f7cc48d11945bc5eaaf275c0814281b4a621dbed944f5aee88b0d1512f650eff6d797b8c70e4cf5f791b8a06db3ece1bbeada955081
7
+ data.tar.gz: 01372d0b22c40ec8ca69e8aa0acbf7ab13dda7cfd082bffacc5c22fac69e9d03c70e68046cc8d49aabdec2c60975eb430b55e224680cf005ba0cb55b23b94f98
data/README.md CHANGED
@@ -10,13 +10,13 @@ Zero dependências de runtime (só biblioteca padrão: `net/http`, `json`, `open
10
10
  ## Instalação
11
11
 
12
12
  ```bash
13
- gem install bzapper -v 0.9.1
13
+ gem install bzapper -v 0.9.2
14
14
  ```
15
15
 
16
16
  Ou no `Gemfile` — **fixe a versão exata** (cada release declara se muda a superfície pública):
17
17
 
18
18
  ```ruby
19
- gem "bzapper", "0.9.1"
19
+ gem "bzapper", "0.9.2"
20
20
  ```
21
21
 
22
22
  ## Hello world
@@ -123,6 +123,33 @@ module Bzapper
123
123
  request("GET", "/official/status", timeout: timeout)
124
124
  end
125
125
 
126
+ # Estimated Meta cost and official-rail KPIs for a period. `GET /official/insights`
127
+ #
128
+ # What Meta will charge the customer (bZapper charges only the subscription), estimated per
129
+ # category — marketing, utility, authentication and service — for the period, the previous
130
+ # period of the same length, the current month so far and its projection, plus delivery and read
131
+ # rates, free messages, conversations from ads, marketing opt-outs, the templates sent, the most
132
+ # common failure reasons and each number's quality and limit. The estimate uses the category and
133
+ # `billable` flag Meta reports in each status webhook and, when missing, the template's category
134
+ # (conservative: utility counts as charged). Prices follow the recipient's country; the rate
135
+ # card used (Meta's, for Brazil, in BRL) comes in `rate_card`. Messages to other countries are
136
+ # counted in `cost.other_countries` but not priced.
137
+ #
138
+ # @param days [Integer, nil] (query) Period ending now: 7, 30 or 90 (default 30; up to 366).
139
+ # @param from [Time, String, nil] (query) Period start (RFC 3339). Overrides `days`.
140
+ # @param to [Time, String, nil] (query) Period end (RFC 3339). Default: now.
141
+ # @param timeout [Numeric, nil] segundos por tentativa (padrão: o do cliente).
142
+ # @return [Hash, Array, nil] o JSON da resposta, inteiro (nil em 204).
143
+ # @raise [Bzapper::Error] resposta fora de 2xx ou falha de rede.
144
+ def get_official_insights(days: nil, from: nil, to: nil, timeout: nil)
145
+ query = {
146
+ "days" => days,
147
+ "from" => from,
148
+ "to" => to
149
+ }
150
+ request("GET", "/official/insights", query: query, timeout: timeout)
151
+ end
152
+
126
153
  # Upload a file to Meta once and reuse it in many sends (multipart). `POST /official/media`
127
154
  #
128
155
  # Uploads the file to Meta through the project's default number (or `instance_id`) and returns
@@ -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.9.1"
6
+ VERSION = "0.9.2"
7
7
  end
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.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Berni Software