stigg 0.1.0.pre.beta.38 → 0.1.0.pre.beta.39

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: 4e0e92df7b7ef44bad7572a7b5d14baaa0ce98c352666f620e38a437e9862df6
4
- data.tar.gz: bf983b28a667ba6ec6ad39f87627dd7366f16e37a326d1e3471542ce7d01f486
3
+ metadata.gz: 1ca8af19b360c0e53c61b068cb9a1c035eb1ad282bc3e66f09b9054afbd6150c
4
+ data.tar.gz: a24b6c21c2dd7f37696fba89035eb3b557a6be4663a549309b268ff327fc16bf
5
5
  SHA512:
6
- metadata.gz: 364a7c6388ef68986a013a4860547b7f31361d684f69e755813fee90badd38447e4830dee0ffca367cf4a986969419a871ba629ca6b1b266bae58a9493804583
7
- data.tar.gz: 4fbc4116877914ad6db5f6048d8317ee3d787695da0ee3fac6fff1cec10c33ab396cdf4a2fc6194254290c77ded25aa68a2e016ddcd6e5567b6833097d18fde7
6
+ metadata.gz: e6fd739bce4d9b2be72e402caca86f297a519482e5b512f48864bbdfa9d2b21c8e029cb5b87fd7e23460ed4d2cc2f39cf25ae4e642b4e31714dad2eebb188703
7
+ data.tar.gz: c8235a7e6d019fa08a4d9b3295de9eb6b9614985d81d46b11b6da1725e6cb19e82ef64ef7bc59a4ecd31e806b3077eb988c1f40807ed7ed519418887f7416d54
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-beta.39 (2026-07-12)
4
+
5
+ Full Changelog: [v0.1.0-beta.38...v0.1.0-beta.39](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.38...v0.1.0-beta.39)
6
+
7
+ ### Features
8
+
9
+ * **api:** add consumed field to consumption/usage credit responses ([ee2eae5](https://github.com/stiggio/stigg-ruby/commit/ee2eae5db2e9042d5f47b1265fe638e07e955f6a))
10
+
3
11
  ## 0.1.0-beta.38 (2026-07-08)
4
12
 
5
13
  Full Changelog: [v0.1.0-beta.37...v0.1.0-beta.38](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.37...v0.1.0-beta.38)
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
24
24
  <!-- x-release-please-start-version -->
25
25
 
26
26
  ```ruby
27
- gem "stigg", "~> 0.1.0.pre.beta.38"
27
+ gem "stigg", "~> 0.1.0.pre.beta.39"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
@@ -83,7 +83,10 @@ module Stigg
83
83
  required :currency_id, String, api_name: :currencyId
84
84
 
85
85
  # @!attribute current_usage
86
- # The credits consumed (optimistic — includes not-yet-reconciled usage)
86
+ # The wallet's total consumed credits for this currency (optimistic — includes
87
+ # not-yet-reconciled usage), shared across every feature that draws on the
88
+ # currency. This is the running balance, not this call's deduction — see
89
+ # `consumed` for that.
87
90
  #
88
91
  # @return [Float]
89
92
  required :current_usage, Float, api_name: :currentUsage
@@ -118,7 +121,7 @@ module Stigg
118
121
  #
119
122
  # @param currency_id [String] The credit currency identifier
120
123
  #
121
- # @param current_usage [Float] The credits consumed (optimistic — includes not-yet-reconciled usage)
124
+ # @param current_usage [Float] The wallet's total consumed credits for this currency (optimistic — includes not
122
125
  #
123
126
  # @param timestamp [Time] The grant-version timestamp of this balance, used by the SDK for last-write-wins
124
127
  #
@@ -124,6 +124,15 @@ module Stigg
124
124
 
125
125
  # @see Stigg::Models::V1::UsageReportResponse::Data#credit
126
126
  class Credit < Stigg::Internal::Type::BaseModel
127
+ # @!attribute consumed
128
+ # The credits this single reportUsage call deducted, in credit units — scoped to
129
+ # this one measurement (0 for idempotency duplicates). Contrast `currentUsage`,
130
+ # which is the wallet-wide running total shared across all features on this
131
+ # currency. Use it to reconcile expected per-call deductions.
132
+ #
133
+ # @return [Float]
134
+ required :consumed, Float
135
+
127
136
  # @!attribute currency_id
128
137
  # The credit currency identifier
129
138
  #
@@ -131,7 +140,10 @@ module Stigg
131
140
  required :currency_id, String, api_name: :currencyId
132
141
 
133
142
  # @!attribute current_usage
134
- # The credits consumed (optimistic — includes not-yet-reconciled usage)
143
+ # The wallet's total consumed credits for this currency (optimistic — includes
144
+ # not-yet-reconciled usage), shared across every feature that draws on the
145
+ # currency. This is the running balance, not this call's deduction — see
146
+ # `consumed` for that.
135
147
  #
136
148
  # @return [Float]
137
149
  required :current_usage, Float, api_name: :currentUsage
@@ -156,15 +168,17 @@ module Stigg
156
168
  # @return [Time, nil]
157
169
  optional :usage_period_end, Time, api_name: :usagePeriodEnd, nil?: true
158
170
 
159
- # @!method initialize(currency_id:, current_usage:, timestamp:, usage_limit:, usage_period_end: nil)
171
+ # @!method initialize(consumed:, currency_id:, current_usage:, timestamp:, usage_limit:, usage_period_end: nil)
160
172
  # Some parameter documentations has been truncated, see
161
173
  # {Stigg::Models::V1::UsageReportResponse::Data::Credit} for more details.
162
174
  #
163
175
  # Optimistic credit balance for a credit-backed feature
164
176
  #
177
+ # @param consumed [Float] The credits this single reportUsage call deducted, in credit units — scoped to t
178
+ #
165
179
  # @param currency_id [String] The credit currency identifier
166
180
  #
167
- # @param current_usage [Float] The credits consumed (optimistic — includes not-yet-reconciled usage)
181
+ # @param current_usage [Float] The wallet's total consumed credits for this currency (optimistic — includes not
168
182
  #
169
183
  # @param timestamp [Time] The grant-version timestamp of this balance, used by the SDK for last-write-wins
170
184
  #
data/lib/stigg/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stigg
4
- VERSION = "0.1.0.pre.beta.38"
4
+ VERSION = "0.1.0.pre.beta.39"
5
5
  end
@@ -165,7 +165,10 @@ module Stigg
165
165
  sig { returns(String) }
166
166
  attr_accessor :currency_id
167
167
 
168
- # The credits consumed (optimistic — includes not-yet-reconciled usage)
168
+ # The wallet's total consumed credits for this currency (optimistic — includes
169
+ # not-yet-reconciled usage), shared across every feature that draws on the
170
+ # currency. This is the running balance, not this call's deduction — see
171
+ # `consumed` for that.
169
172
  sig { returns(Float) }
170
173
  attr_accessor :current_usage
171
174
 
@@ -197,7 +200,10 @@ module Stigg
197
200
  def self.new(
198
201
  # The credit currency identifier
199
202
  currency_id:,
200
- # The credits consumed (optimistic — includes not-yet-reconciled usage)
203
+ # The wallet's total consumed credits for this currency (optimistic — includes
204
+ # not-yet-reconciled usage), shared across every feature that draws on the
205
+ # currency. This is the running balance, not this call's deduction — see
206
+ # `consumed` for that.
201
207
  current_usage:,
202
208
  # The grant-version timestamp of this balance, used by the SDK for last-write-wins
203
209
  # reconciliation
@@ -193,11 +193,21 @@ module Stigg
193
193
  )
194
194
  end
195
195
 
196
+ # The credits this single reportUsage call deducted, in credit units — scoped to
197
+ # this one measurement (0 for idempotency duplicates). Contrast `currentUsage`,
198
+ # which is the wallet-wide running total shared across all features on this
199
+ # currency. Use it to reconcile expected per-call deductions.
200
+ sig { returns(Float) }
201
+ attr_accessor :consumed
202
+
196
203
  # The credit currency identifier
197
204
  sig { returns(String) }
198
205
  attr_accessor :currency_id
199
206
 
200
- # The credits consumed (optimistic — includes not-yet-reconciled usage)
207
+ # The wallet's total consumed credits for this currency (optimistic — includes
208
+ # not-yet-reconciled usage), shared across every feature that draws on the
209
+ # currency. This is the running balance, not this call's deduction — see
210
+ # `consumed` for that.
201
211
  sig { returns(Float) }
202
212
  attr_accessor :current_usage
203
213
 
@@ -218,6 +228,7 @@ module Stigg
218
228
  # Optimistic credit balance for a credit-backed feature
219
229
  sig do
220
230
  params(
231
+ consumed: Float,
221
232
  currency_id: String,
222
233
  current_usage: Float,
223
234
  timestamp: Time,
@@ -226,9 +237,17 @@ module Stigg
226
237
  ).returns(T.attached_class)
227
238
  end
228
239
  def self.new(
240
+ # The credits this single reportUsage call deducted, in credit units — scoped to
241
+ # this one measurement (0 for idempotency duplicates). Contrast `currentUsage`,
242
+ # which is the wallet-wide running total shared across all features on this
243
+ # currency. Use it to reconcile expected per-call deductions.
244
+ consumed:,
229
245
  # The credit currency identifier
230
246
  currency_id:,
231
- # The credits consumed (optimistic — includes not-yet-reconciled usage)
247
+ # The wallet's total consumed credits for this currency (optimistic — includes
248
+ # not-yet-reconciled usage), shared across every feature that draws on the
249
+ # currency. This is the running balance, not this call's deduction — see
250
+ # `consumed` for that.
232
251
  current_usage:,
233
252
  # The grant-version timestamp of this balance, used by the SDK for last-write-wins
234
253
  # reconciliation
@@ -244,6 +263,7 @@ module Stigg
244
263
  sig do
245
264
  override.returns(
246
265
  {
266
+ consumed: Float,
247
267
  currency_id: String,
248
268
  current_usage: Float,
249
269
  timestamp: Time,
@@ -88,6 +88,7 @@ module Stigg
88
88
 
89
89
  type credit =
90
90
  {
91
+ consumed: Float,
91
92
  currency_id: String,
92
93
  current_usage: Float,
93
94
  timestamp: Time,
@@ -96,6 +97,8 @@ module Stigg
96
97
  }
97
98
 
98
99
  class Credit < Stigg::Internal::Type::BaseModel
100
+ attr_accessor consumed: Float
101
+
99
102
  attr_accessor currency_id: String
100
103
 
101
104
  attr_accessor current_usage: Float
@@ -107,6 +110,7 @@ module Stigg
107
110
  attr_accessor usage_period_end: Time?
108
111
 
109
112
  def initialize: (
113
+ consumed: Float,
110
114
  currency_id: String,
111
115
  current_usage: Float,
112
116
  timestamp: Time,
@@ -115,6 +119,7 @@ module Stigg
115
119
  ) -> void
116
120
 
117
121
  def to_hash: -> {
122
+ consumed: Float,
118
123
  currency_id: String,
119
124
  current_usage: Float,
120
125
  timestamp: Time,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stigg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.beta.38
4
+ version: 0.1.0.pre.beta.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stigg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-08 00:00:00.000000000 Z
11
+ date: 2026-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi