didit-sdk 2.30.0 → 2.32.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2879af83ff330c43bf51c0d2a6b9cd17ad6963efc5d0be99b7c147613c26b5ed
4
- data.tar.gz: b627a005c08687783f35d4f5ed6b5db194dca7b8b4ccb63e01dd42951ae4944c
3
+ metadata.gz: a6fb463b33c41cd8003bb411c0391f84dc1c4843301688b9b37e8384f0ed7851
4
+ data.tar.gz: cb5116a88431b5fd3523b9350a66de8e61d5f2d3084275bf06419ff799c421e3
5
5
  SHA512:
6
- metadata.gz: c812ee201a3fa242a1fbb954dfdaa08159df873cf64cf11180193753b6ae4947a9005998c1451f9b1ad2cbc0721ddbec5c119a814935f469a4b08acb5f4a14c0
7
- data.tar.gz: 2bd3ac9272f0b22430edabc564c3316054ab3c740fdb07649ae6a79bc7e589e81c3b14f2db8638c573c36a13896495f368c5dc307fa04ec9cd308240fc0a6aed
6
+ metadata.gz: 986aca896264124dc75103cd31756a9faaa38463966467618257a805540ea2fa14c0284070c2cc2ef7a89bf8b2cdca493581c539830a3e4c03407a99dc91e580
7
+ data.tar.gz: b454fc8dbf3f5b074868a23c2c3ddc54e2bb0d334659406b31a95cfd63b885b8a92e3f2244a2c1071b0755c592b4a8eac99cca48346a05e1bdef94234149377a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.32.0](https://github.com/didit-protocol/sdk-ruby/compare/v2.31.0...v2.32.0) (2026-11-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * **bank:** Bank data operations and typed bank.* webhook events ([#111](https://github.com/didit-protocol/sdk-ruby/issues/111)) ([a784b44](https://github.com/didit-protocol/sdk-ruby/commit/a784b44b5c55a27033b124122868f2b882f1f42b))
9
+
10
+ ## [2.31.0](https://github.com/didit-protocol/sdk-ruby/compare/v2.30.0...v2.31.0) (2026-11-22)
11
+
12
+
13
+ ### Features
14
+
15
+ * **spec:** sync API spec 2026-11-22 ([326263f](https://github.com/didit-protocol/sdk-ruby/commit/326263fc429c237e2424cb0d417fdb0b223c8cf5))
16
+
3
17
  ## [2.30.0](https://github.com/didit-protocol/sdk-ruby/compare/v2.29.0...v2.30.0) (2026-11-22)
4
18
 
5
19
 
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  The official [Didit](https://didit.me) Ruby library.
4
4
  Identity verification (KYC), business verification (KYB), AML screening, biometrics, transaction monitoring, Travel Rule and customer authentication, from your backend.
5
5
 
6
- - Every Didit server API: sessions, standalone checks, KYB, users and businesses, workflows, webhooks, cases, transactions, wallet screening, Travel Rule and account management.
6
+ - Every Didit server API: sessions, standalone checks, KYB, users and businesses, workflows, webhooks, cases, bank data, transactions, wallet screening, Travel Rule and account management.
7
7
  - Typed results with RBS signatures (checked with Steep), generated from the [OpenAPI contract](openapi/).
8
8
  - Webhook verification and Didit Authentication (OpenID Connect) token verification built in.
9
9
  - Standard library `net/http` with persistent connections, retries and timeouts. The only dependency is `jwt`, and only the Authentication module loads it.
@@ -51,7 +51,7 @@ else nil
51
51
  end
52
52
  ```
53
53
 
54
- [`examples/quickstart.rb`](examples/quickstart.rb) runs the same steps. [`examples/`](examples/) also has standalone ID verification, AML screening, transaction screening, Travel Rule, Authentication, and webhook receivers for Rails, Sinatra and Rack.
54
+ [`examples/quickstart.rb`](examples/quickstart.rb) runs the same steps. [`examples/`](examples/) also has standalone ID verification, AML screening, transaction screening, Travel Rule, Bank data, Authentication, and webhook receivers for Rails, Sinatra and Rack.
55
55
 
56
56
  ## Configuration
57
57
 
@@ -185,11 +185,36 @@ event = Didit::Webhooks.verify(raw_body, headers, [new_secret, old_secret]) # du
185
185
  - `verify_parsed(payload, headers, secret)` is for frameworks that only give you the parsed JSON; it can check `X-Signature-V2` only.
186
186
  - The deprecated `X-Signature-Simple` counts only with `allow_simple: true`; then `event.body_authenticated?` is false and you should re-fetch the record from the API.
187
187
  - Failures raise `Didit::WebhookVerificationError` with `reason`: `:missing_signature`, `:invalid_signature`, `:missing_timestamp`, `:timestamp_mismatch`, `:timestamp_out_of_tolerance` or `:invalid_payload`.
188
- - Events are typed: `StatusUpdatedEvent`, `DataUpdatedEvent`, `UserStatusUpdatedEvent`, `UserDataUpdatedEvent`, `BusinessStatusUpdatedEvent`, `BusinessDataUpdatedEvent`, `ActivityCreatedEvent`, `TransactionCreatedEvent`, `TransactionStatusUpdatedEvent`, `TravelRuleStatusUpdatedEvent`, `WorkflowComplianceChangedEvent`, `KybRegistrySearchResolvedEvent`, and `UnknownEvent` for anything else. Session events carry the typed `decision`.
188
+ - Events are typed: `StatusUpdatedEvent`, `DataUpdatedEvent`, `UserStatusUpdatedEvent`, `UserDataUpdatedEvent`, `BusinessStatusUpdatedEvent`, `BusinessDataUpdatedEvent`, `ActivityCreatedEvent`, `TransactionCreatedEvent`, `TransactionStatusUpdatedEvent`, `TravelRuleStatusUpdatedEvent`, `WorkflowComplianceChangedEvent`, `KybRegistrySearchResolvedEvent`, the `Bank*Event` classes for every `bank.*` type, and `UnknownEvent` for anything else. Session events carry the typed `decision`.
189
189
  - `kyb.registry_search.resolved` callbacks arrive unsigned, so `verify` rejects them (with `:missing_signature`, or a timestamp reason when their timestamp fails the checks that come first). `Didit::Webhooks.parse_event(JSON.parse(body))` reads one without verifying it; treat it as untrusted and re-fetch the data from the API.
190
190
 
191
191
  See [`examples/webhooks/`](examples/webhooks/) for Rails, Sinatra and Rack receivers. In a Rails controller that inherits from `ActionController::Base`, skip CSRF protection for the webhook action.
192
192
 
193
+ ## Bank data
194
+
195
+ `didit.bank` runs account checks and reads bank data after the person connects a bank once.
196
+
197
+ ```ruby
198
+ link = didit.bank.create_link(access: "ongoing", data: ["accounts"])
199
+ # Deliver link.url privately to the person connecting their bank.
200
+
201
+ # In the webhook handler, using the link ID saved for this person:
202
+ event = didit.webhooks.verify(raw_body, headers, ENV.fetch("DIDIT_WEBHOOK_SECRET"))
203
+ if event.is_a?(Didit::Webhooks::BankConnectionCreatedEvent) && event.connection_id &&
204
+ didit.bank.get_link(link.id).connection_id == event.connection_id
205
+ accounts = didit.bank.list_accounts(event.connection_id, limit: 50)
206
+ accounts.items.size # accounts on this page
207
+ end
208
+ ```
209
+
210
+ - `create_link` returns the hosted `url`, a `client_token` for Bank Link in a modal or inline, `expires_at` and `quote`. A completed link creates a connection (`bank.connection.created`) or a `bank.link.failed` event with its `error_code`.
211
+ - Cursor lists (`list_accounts`, `list_connections`) return `items` and `next_cursor`; `list_transactions` returns `items`, `next_page_token` and `has_more`. `sync_transactions` reads the change feed from a `cursor`.
212
+ - Bank data needs the `bank-data` permission on the API key: without it the API answers `403` with code `bank_data_access_denied`. A live sync past the bank's daily limit answers `429` with code `refresh_limit_reached` and `Retry-After`.
213
+ - `delete_connection` stops access at the bank and deletes the stored accounts, balances and transactions; it cannot be undone. `revoke_connection` stops access; stored data stays readable until the retention window ends.
214
+ - In production Bank data is on for sandbox applications first; a live application's calls answer `404` until it is enabled.
215
+
216
+ [`examples/bank_connection.ru`](examples/bank_connection.ru) runs the same steps.
217
+
193
218
  ## Transactions and Travel Rule
194
219
 
195
220
  ```ruby
@@ -109,9 +109,10 @@ module Didit
109
109
  # Preview a sign-in email
110
110
  #
111
111
  # Returns one email as it renders, with sample codes and links. An invitation preview uses a sample organization
112
- # for a grant or named key. A console session can see a customer organization's name. The address of a console
113
- # member is left out for a grant or a key, which have no mailbox. An email Authentication does not send answers
114
- # `{"error": "email_not_sent_by_authentication"}`.
112
+ # for a grant or named key, or the `organization` and `role` you pass. `agentoff` is the email a person receives
113
+ # when your team ends an agent's access with a notification; `agent` names the agent. A console session can see
114
+ # a customer organization's name. The address of a console member is left out for a grant or a key, which have
115
+ # no mailbox. An email Authentication does not send answers `{"error": "email_not_sent_by_authentication"}`.
115
116
  #
116
117
  # +GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/+
117
118
  #
@@ -119,13 +120,33 @@ module Didit
119
120
  # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
120
121
  # application only.
121
122
  # @param key [String] The email: `code`, `magic`, `reset`, `device`, `invite`, `org`, `agent` or `agentoff`.
123
+ # @param organization [String] For `org` only: the organization the invitation is for, so the preview shows it
124
+ # as it will be sent. At most 200 characters, the longest organization name an application holds. Without it, a
125
+ # sample organization (a console session sees the application's first customer organization).
126
+ # @param role [String] For `org` only: the role the invitation grants.
127
+ # @param agent [String] For `agentoff` only: the name of the agent whose access ends. At most 200 characters,
128
+ # the longest agent name an application registers. Without it, the agent of the application's latest agent
129
+ # client in a console session, or a sample name.
122
130
  # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
123
131
  # @return [Didit::Types::SetupEmail]
124
- def get_email(organization_id, application_id, key, request_options: nil)
132
+ def get_email(
133
+ organization_id,
134
+ application_id,
135
+ key,
136
+ organization: OMIT,
137
+ role: OMIT,
138
+ agent: OMIT,
139
+ request_options: nil
140
+ )
125
141
  @client.request(
126
142
  :get,
127
143
  "/organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/",
128
144
  path_params: { "organization_id" => organization_id, "application_id" => application_id, "key" => key },
145
+ query: {
146
+ "organization" => organization,
147
+ "role" => role,
148
+ "agent" => agent
149
+ },
129
150
  api: :account,
130
151
  response: Types::SetupEmail,
131
152
  request_options: request_options
@@ -239,19 +239,20 @@ module Didit
239
239
 
240
240
  # Delete a bank connection
241
241
  #
242
- # Deletes the connection's bank data and stops access at the bank. The connection's accounts, balances,
243
- # transactions, sync history, consent records and ownership results are deleted. Deletion is irreversible.
242
+ # Deletes the connection's bank data and stops access at the bank. Deletion is immediate and irreversible: when
243
+ # the call returns, the connection's accounts, balances, transactions, sync history, consent records and
244
+ # ownership results are deleted, and its data operations (refresh, sync runs, accounts, balances, transactions
245
+ # and the change feed) answer `409 connection_not_active`.
244
246
  #
245
- # It starts at once: the response is `202` with `erasure.status` `pending`, and from that moment the
246
- # connection's data operations (refresh, sync runs, accounts, balances, transactions and the change feed) answer
247
- # `409 connection_not_active`. The connection then reads with `erasure.status` `erased`, or `failed` if deletion
248
- # could not be confirmed within 24 hours; a failed deletion is retried until it completes. A deleted connection
249
- # reads as a minimal record: its id, `status: deleted`, the reason, its dates and its `erasure` status, and it
250
- # holds no accounts, balances, transactions, consent or sync data.
247
+ # A deleted connection reads as a minimal record: its id, `status: deleted`, the reason, its dates and its
248
+ # `erasure` record (`requested_at`, `erased_at` and `status`, the confirmation of the deletion: `pending` while
249
+ # it is being confirmed, including the end of access at the bank, `erased` once confirmed, `failed` if the
250
+ # confirmation has not arrived yet and is repeated automatically, with nothing needed from you). It holds no
251
+ # accounts, balances, transactions, consent or sync data. `bank.connection.deleted` confirms the deletion.
251
252
  #
252
253
  # Not affected: your other connections, the charges already made (they are not refunded), and any data you
253
- # already downloaded, which is your own copy. Repeating the call returns the current state. To stop access
254
- # without deleting, use `revoke_connection`.
254
+ # already downloaded, which is your own copy. Repeating the call is safe. To stop access without deleting, use
255
+ # `revoke_connection`.
255
256
  #
256
257
  # Needs an API key with the Bank data permission (`bank-data`): write for this operation, which changes
257
258
  # something. A key with full access does not include it: grant it explicitly when you create the key, or the
@@ -3,6 +3,15 @@
3
3
 
4
4
  module Didit
5
5
  module Types
6
+ # Known values of an open enum: the API may send others.
7
+ module AuthenticationSetupGetEmailParamsRole
8
+ MEMBER = "member"
9
+ BILLING = "billing"
10
+ ADMIN = "admin"
11
+
12
+ VALUES = [MEMBER, BILLING, ADMIN].freeze
13
+ end
14
+
6
15
  # `didit_test` uses Didit's own sandbox app, and is refused on a live application with `sandbox_only`. Omitted:
7
16
  # `own` when you send `credentials`, the stored source otherwise, and `didit_test` for a sandbox application's
8
17
  # social method that was never configured.
@@ -515,9 +515,9 @@ module Didit
515
515
  VALUES = [LIVE, SANDBOX].freeze
516
516
  end
517
517
 
518
- # `pending` while deletion runs, `erased` when no stored copy and no access at the bank remain, `failed` when it
519
- # could not be confirmed within 24 hours. A failed deletion keeps the connection's data closed, is retried, and
520
- # Didit is alerted.
518
+ # The confirmation of the deletion. `pending`: the deletion is being confirmed, including the end of access at the
519
+ # bank. `erased`: confirmed, with `erased_at`. `failed`: the confirmation has not arrived yet and is repeated
520
+ # automatically; nothing is needed from you. The data is deleted and not readable in any of the three.
521
521
  module BankConnectionErasureStatus
522
522
  PENDING = "pending"
523
523
  ERASED = "erased"
@@ -8554,8 +8554,8 @@ module Didit
8554
8554
  field :ended_by, "ended_by", :string
8555
8555
  end
8556
8556
 
8557
- # Accepted deletion. The connection's bank data is being deleted and its data operations answer `409
8558
- # connection_not_active`; reading the connection returns a minimal record with this `erasure` status.
8557
+ # The record of a deletion. The connection's bank data is deleted and its data operations answer `409
8558
+ # connection_not_active`; reading the connection returns a minimal record with this `erasure` record.
8559
8559
  class BankConnectionDeletion < Didit::Model
8560
8560
  field :id, "id", :string
8561
8561
  field :erasure, "erasure", "BankConnectionErasure"
@@ -8565,7 +8565,8 @@ module Didit
8565
8565
  field :reference, "reference", :string
8566
8566
  end
8567
8567
 
8568
- # Progress of a deletion you asked for.
8568
+ # The record of a deletion you asked for. The deletion itself is immediate: the connection's data is deleted and
8569
+ # unreadable when the call returns. `status` is the confirmation of it.
8569
8570
  class BankConnectionErasure < Didit::Model
8570
8571
  field :status, "status", :string
8571
8572
  field :requested_at, "requested_at", :datetime
data/lib/didit/types.rb CHANGED
@@ -148,6 +148,7 @@ module Didit
148
148
  autoload :AsyncReportListCounts, "didit/types/components"
149
149
  autoload :AsyncReportReportType, "didit/types/components"
150
150
  autoload :AsyncReportStatus, "didit/types/components"
151
+ autoload :AuthenticationSetupGetEmailParamsRole, "didit/types/authentication_setup"
151
152
  autoload :AuthenticationSetupSetMethodParamsCredentialSource, "didit/types/authentication_setup"
152
153
  autoload :AuthenticationSetupUpdateConfigurationParamsSignupPolicy, "didit/types/authentication_setup"
153
154
  autoload :AuthenticationSetupUpdateOnboardingParamsSignInUi, "didit/types/authentication_setup"
data/lib/didit/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Didit
4
- VERSION = "2.30.0" # x-release-please-version
4
+ VERSION = "2.32.0" # x-release-please-version
5
5
  end
@@ -197,6 +197,206 @@ module Didit
197
197
  field :kyb_registry, "kyb_registry", :any
198
198
  end
199
199
 
200
+ # The link fields of the four +bank.link.*+ events. The backend nests them under +data+,
201
+ # unlike the connection, data and sync events, whose fields sit next to the envelope.
202
+ class BankLinkEventData < Didit::Model
203
+ field :link_id, "link_id", :string
204
+ # +"completed"+, +"cancelled"+, +"expired"+ or +"failed"+.
205
+ field :status, "status", :string
206
+ # The connection the link created or renewed, when there is one.
207
+ field :connection_id, "connection_id", :string
208
+ # The ownership result, when one was asked for.
209
+ field :check_id, "check_id", :string
210
+ # With +bank.link.failed+, for example +"consent_declined"+.
211
+ field :error_code, "error_code", :string
212
+ end
213
+
214
+ # Fields of the Bank Link events; ids and statuses only, fetch the link from the API to read it.
215
+ # The payload keeps them under +data+: read {#data}, or the readers, which look there.
216
+ class BankLinkEvent < Event
217
+ field :data, "data", BankLinkEventData
218
+
219
+ def link_id
220
+ link_data&.link_id
221
+ end
222
+
223
+ def status
224
+ link_data&.status
225
+ end
226
+
227
+ def connection_id
228
+ link_data&.connection_id
229
+ end
230
+
231
+ def check_id
232
+ link_data&.check_id
233
+ end
234
+
235
+ def error_code
236
+ link_data&.error_code
237
+ end
238
+
239
+ # Pattern matching reads the link fields too, although they live under +data+.
240
+ def deconstruct_keys(keys)
241
+ out = super
242
+ names = BankLinkEventData.fields.keys
243
+ names &= keys if keys
244
+ names.each { |name| out[name] = public_send(name) }
245
+ out
246
+ end
247
+
248
+ private
249
+
250
+ def link_data
251
+ value = data
252
+ value if value.is_a?(BankLinkEventData)
253
+ end
254
+ end
255
+
256
+ # +bank.link.completed+: the person finished Bank Link.
257
+ class BankLinkCompletedEvent < BankLinkEvent
258
+ WEBHOOK_TYPE = "bank.link.completed"
259
+ end
260
+
261
+ # +bank.link.cancelled+: the person cancelled Bank Link.
262
+ class BankLinkCancelledEvent < BankLinkEvent
263
+ WEBHOOK_TYPE = "bank.link.cancelled"
264
+ end
265
+
266
+ # +bank.link.expired+: Bank Link expired before the person finished.
267
+ class BankLinkExpiredEvent < BankLinkEvent
268
+ WEBHOOK_TYPE = "bank.link.expired"
269
+ end
270
+
271
+ # +bank.link.failed+: Bank Link failed; +error_code+ says why.
272
+ class BankLinkFailedEvent < BankLinkEvent
273
+ WEBHOOK_TYPE = "bank.link.failed"
274
+ end
275
+
276
+ # Fields shared by the Bank connection events; ids and statuses only.
277
+ class BankConnectionEvent < Event
278
+ field :connection_id, "connection_id", :string
279
+ end
280
+
281
+ # +bank.connection.created+: the first sync of a connection finished.
282
+ class BankConnectionCreatedEvent < BankConnectionEvent
283
+ WEBHOOK_TYPE = "bank.connection.created"
284
+
285
+ # +"succeeded"+ or +"partial"+.
286
+ field :initial_status, "initial_status", :string
287
+ end
288
+
289
+ # +bank.connection.updated+: a connection changed status; +revocation_status+ is +"pending"+
290
+ # while a revocation waits for the bank.
291
+ class BankConnectionUpdatedEvent < BankConnectionEvent
292
+ WEBHOOK_TYPE = "bank.connection.updated"
293
+
294
+ field :status, "status", :string
295
+ field :revocation_status, "revocation_status", :string
296
+ end
297
+
298
+ # +bank.connection.consent_expiring+: the consent ends in 14, 7 or 1 day.
299
+ class BankConnectionConsentExpiringEvent < BankConnectionEvent
300
+ WEBHOOK_TYPE = "bank.connection.consent_expiring"
301
+
302
+ field :days_left, "days_left", :integer
303
+ field :consent_expires_at, "consent_expires_at", :datetime
304
+ # Renew before this moment for no gap.
305
+ field :renew_by, "renew_by", :datetime
306
+ end
307
+
308
+ # +bank.connection.renewal_required+: the consent ended or the bank asks the person to sign in.
309
+ class BankConnectionRenewalRequiredEvent < BankConnectionEvent
310
+ WEBHOOK_TYPE = "bank.connection.renewal_required"
311
+
312
+ field :status, "status", :string
313
+ # +"consent_expired"+ or +"bank_requires_sign_in"+.
314
+ field :reason, "reason", :string
315
+ field :renew_by, "renew_by", :datetime
316
+ # The last moment the same connection can be revived.
317
+ field :renewable_until, "renewable_until", :datetime
318
+ end
319
+
320
+ # +bank.connection.renewed+: a renew link completed and the connection is readable again.
321
+ class BankConnectionRenewedEvent < BankConnectionEvent
322
+ WEBHOOK_TYPE = "bank.connection.renewed"
323
+
324
+ field :status, "status", :string
325
+ field :consent_version, "consent_version", :integer
326
+ # The renew link that completed, when there is one.
327
+ field :link_id, "link_id", :string
328
+ field :consent_expires_at, "consent_expires_at", :datetime
329
+ end
330
+
331
+ # +bank.connection.revoked+: access ended and the bank confirmed it.
332
+ class BankConnectionRevokedEvent < BankConnectionEvent
333
+ WEBHOOK_TYPE = "bank.connection.revoked"
334
+
335
+ field :status, "status", :string
336
+ # +"end_user"+, +"bank"+, +"customer"+ or +"unknown"+.
337
+ field :ended_by, "ended_by", :string
338
+ field :status_reason, "status_reason", :string
339
+ field :ended_at, "ended_at", :datetime
340
+ # How long the stored data stays readable.
341
+ field :retain_until, "retain_until", :datetime
342
+ end
343
+
344
+ # +bank.connection.deleted+: the stored data of a connection was deleted.
345
+ class BankConnectionDeletedEvent < BankConnectionEvent
346
+ WEBHOOK_TYPE = "bank.connection.deleted"
347
+
348
+ field :status, "status", :string
349
+ field :erasure_status, "erasure_status", :string
350
+ field :reason, "reason", :string
351
+ field :erased_at, "erased_at", :datetime
352
+ end
353
+
354
+ # +bank.connection.history_complete+: the history backfill of a connection ended.
355
+ class BankConnectionHistoryCompleteEvent < BankConnectionEvent
356
+ WEBHOOK_TYPE = "bank.connection.history_complete"
357
+
358
+ field :status, "status", :string
359
+ end
360
+
361
+ # +bank.data.updated+: a sync stored new or changed bank data.
362
+ class BankDataUpdatedEvent < BankConnectionEvent
363
+ WEBHOOK_TYPE = "bank.data.updated"
364
+
365
+ field :sync_id, "sync_id", :string
366
+ # +"initial"+, +"scheduled"+ or +"requested"+.
367
+ field :trigger, "trigger", :string
368
+ # One entry per changed account: +account_id+, +added+, +modified+ and +removed+.
369
+ field :accounts, "accounts", :any
370
+ field :balances_changed, "balances_changed", :boolean
371
+ end
372
+
373
+ # +bank.sync.completed+: a sync ended.
374
+ class BankSyncCompletedEvent < BankConnectionEvent
375
+ WEBHOOK_TYPE = "bank.sync.completed"
376
+
377
+ field :sync_id, "sync_id", :string
378
+ field :trigger, "trigger", :string
379
+ # +"succeeded"+, +"partial"+ or +"failed"+.
380
+ field :outcome, "outcome", :string
381
+ field :changed, "changed", :boolean
382
+ end
383
+
384
+ # +bank.sync.failed+: a sync failed; +failing_since+ says when the failures started.
385
+ class BankSyncFailedEvent < BankConnectionEvent
386
+ WEBHOOK_TYPE = "bank.sync.failed"
387
+
388
+ field :sync_id, "sync_id", :string
389
+ field :error_code, "error_code", :string
390
+ field :failing_since, "failing_since", :datetime
391
+ end
392
+
393
+ # +bank.sync.recovered+: a sync succeeded after failures.
394
+ class BankSyncRecoveredEvent < BankConnectionEvent
395
+ WEBHOOK_TYPE = "bank.sync.recovered"
396
+
397
+ field :sync_id, "sync_id", :string
398
+ end
399
+
200
400
  # An event type this version of the SDK does not know; the whole payload stays readable
201
401
  # with #[] and #to_h.
202
402
  class UnknownEvent < Event
@@ -215,7 +415,23 @@ module Didit
215
415
  TransactionStatusUpdatedEvent::WEBHOOK_TYPE => TransactionStatusUpdatedEvent,
216
416
  TravelRuleStatusUpdatedEvent::WEBHOOK_TYPE => TravelRuleStatusUpdatedEvent,
217
417
  WorkflowComplianceChangedEvent::WEBHOOK_TYPE => WorkflowComplianceChangedEvent,
218
- KybRegistrySearchResolvedEvent::WEBHOOK_TYPE => KybRegistrySearchResolvedEvent
418
+ KybRegistrySearchResolvedEvent::WEBHOOK_TYPE => KybRegistrySearchResolvedEvent,
419
+ BankLinkCompletedEvent::WEBHOOK_TYPE => BankLinkCompletedEvent,
420
+ BankLinkCancelledEvent::WEBHOOK_TYPE => BankLinkCancelledEvent,
421
+ BankLinkExpiredEvent::WEBHOOK_TYPE => BankLinkExpiredEvent,
422
+ BankLinkFailedEvent::WEBHOOK_TYPE => BankLinkFailedEvent,
423
+ BankConnectionCreatedEvent::WEBHOOK_TYPE => BankConnectionCreatedEvent,
424
+ BankConnectionUpdatedEvent::WEBHOOK_TYPE => BankConnectionUpdatedEvent,
425
+ BankConnectionConsentExpiringEvent::WEBHOOK_TYPE => BankConnectionConsentExpiringEvent,
426
+ BankConnectionRenewalRequiredEvent::WEBHOOK_TYPE => BankConnectionRenewalRequiredEvent,
427
+ BankConnectionRenewedEvent::WEBHOOK_TYPE => BankConnectionRenewedEvent,
428
+ BankConnectionRevokedEvent::WEBHOOK_TYPE => BankConnectionRevokedEvent,
429
+ BankConnectionDeletedEvent::WEBHOOK_TYPE => BankConnectionDeletedEvent,
430
+ BankConnectionHistoryCompleteEvent::WEBHOOK_TYPE => BankConnectionHistoryCompleteEvent,
431
+ BankDataUpdatedEvent::WEBHOOK_TYPE => BankDataUpdatedEvent,
432
+ BankSyncCompletedEvent::WEBHOOK_TYPE => BankSyncCompletedEvent,
433
+ BankSyncFailedEvent::WEBHOOK_TYPE => BankSyncFailedEvent,
434
+ BankSyncRecoveredEvent::WEBHOOK_TYPE => BankSyncRecoveredEvent
219
435
  }.freeze
220
436
  end
221
437
  end
@@ -7,7 +7,7 @@ module Didit
7
7
  def get_branding: (String organization_id, String application_id, ?language: String, ?request_options: Didit::request_options?) -> Didit::Types::SetupBranding
8
8
  def get_configuration: (String organization_id, String application_id, ?request_options: Didit::request_options?) -> Didit::Types::SetupConfiguration
9
9
  def get_domain: (String organization_id, String application_id, ?request_options: Didit::request_options?) -> Didit::Types::SetupDomain
10
- def get_email: (String organization_id, String application_id, String key, ?request_options: Didit::request_options?) -> Didit::Types::SetupEmail
10
+ def get_email: (String organization_id, String application_id, String key, ?organization: String, ?role: String, ?agent: String, ?request_options: Didit::request_options?) -> Didit::Types::SetupEmail
11
11
  def get_emails: (String organization_id, String application_id, ?language: String, ?request_options: Didit::request_options?) -> Didit::Types::SetupEmails
12
12
  def get_native_apps: (String organization_id, String application_id, ?request_options: Didit::request_options?) -> Didit::Types::SetupNativeApps
13
13
  def get_onboarding: (String organization_id, String application_id, ?request_options: Didit::request_options?) -> Didit::Types::SetupOnboarding
@@ -2,6 +2,14 @@
2
2
 
3
3
  module Didit
4
4
  module Types
5
+ module AuthenticationSetupGetEmailParamsRole
6
+ MEMBER: String
7
+ BILLING: String
8
+ ADMIN: String
9
+
10
+ VALUES: Array[String]
11
+ end
12
+
5
13
  module AuthenticationSetupSetMethodParamsCredentialSource
6
14
  OWN: String
7
15
  DIDIT_TEST: String
@@ -121,5 +121,139 @@ module Didit
121
121
 
122
122
  class UnknownEvent < Event
123
123
  end
124
+
125
+ class BankLinkEventData < Didit::Model
126
+ def link_id: () -> String?
127
+ def status: () -> String?
128
+ def connection_id: () -> String?
129
+ def check_id: () -> String?
130
+ def error_code: () -> String?
131
+ end
132
+
133
+ class BankLinkEvent < Event
134
+ def data: () -> BankLinkEventData?
135
+ private def link_data: () -> BankLinkEventData?
136
+ def link_id: () -> String?
137
+ def status: () -> String?
138
+ def connection_id: () -> String?
139
+ def check_id: () -> String?
140
+ def error_code: () -> String?
141
+ end
142
+
143
+ class BankLinkCompletedEvent < BankLinkEvent
144
+ WEBHOOK_TYPE: String
145
+ end
146
+
147
+ class BankLinkCancelledEvent < BankLinkEvent
148
+ WEBHOOK_TYPE: String
149
+ end
150
+
151
+ class BankLinkExpiredEvent < BankLinkEvent
152
+ WEBHOOK_TYPE: String
153
+ end
154
+
155
+ class BankLinkFailedEvent < BankLinkEvent
156
+ WEBHOOK_TYPE: String
157
+ end
158
+
159
+ class BankConnectionEvent < Event
160
+ def connection_id: () -> String?
161
+ end
162
+
163
+ class BankConnectionCreatedEvent < BankConnectionEvent
164
+ WEBHOOK_TYPE: String
165
+
166
+ def initial_status: () -> String?
167
+ end
168
+
169
+ class BankConnectionUpdatedEvent < BankConnectionEvent
170
+ WEBHOOK_TYPE: String
171
+
172
+ def status: () -> String?
173
+ def revocation_status: () -> String?
174
+ end
175
+
176
+ class BankConnectionConsentExpiringEvent < BankConnectionEvent
177
+ WEBHOOK_TYPE: String
178
+
179
+ def days_left: () -> Integer?
180
+ def consent_expires_at: () -> Time?
181
+ def renew_by: () -> Time?
182
+ end
183
+
184
+ class BankConnectionRenewalRequiredEvent < BankConnectionEvent
185
+ WEBHOOK_TYPE: String
186
+
187
+ def status: () -> String?
188
+ def reason: () -> String?
189
+ def renew_by: () -> Time?
190
+ def renewable_until: () -> Time?
191
+ end
192
+
193
+ class BankConnectionRenewedEvent < BankConnectionEvent
194
+ WEBHOOK_TYPE: String
195
+
196
+ def status: () -> String?
197
+ def consent_version: () -> Integer?
198
+ def link_id: () -> String?
199
+ def consent_expires_at: () -> Time?
200
+ end
201
+
202
+ class BankConnectionRevokedEvent < BankConnectionEvent
203
+ WEBHOOK_TYPE: String
204
+
205
+ def status: () -> String?
206
+ def ended_by: () -> String?
207
+ def status_reason: () -> String?
208
+ def ended_at: () -> Time?
209
+ def retain_until: () -> Time?
210
+ end
211
+
212
+ class BankConnectionDeletedEvent < BankConnectionEvent
213
+ WEBHOOK_TYPE: String
214
+
215
+ def status: () -> String?
216
+ def erasure_status: () -> String?
217
+ def reason: () -> String?
218
+ def erased_at: () -> Time?
219
+ end
220
+
221
+ class BankConnectionHistoryCompleteEvent < BankConnectionEvent
222
+ WEBHOOK_TYPE: String
223
+
224
+ def status: () -> String?
225
+ end
226
+
227
+ class BankDataUpdatedEvent < BankConnectionEvent
228
+ WEBHOOK_TYPE: String
229
+
230
+ def sync_id: () -> String?
231
+ def trigger: () -> String?
232
+ def accounts: () -> untyped
233
+ def balances_changed: () -> bool?
234
+ end
235
+
236
+ class BankSyncCompletedEvent < BankConnectionEvent
237
+ WEBHOOK_TYPE: String
238
+
239
+ def sync_id: () -> String?
240
+ def trigger: () -> String?
241
+ def outcome: () -> String?
242
+ def changed: () -> bool?
243
+ end
244
+
245
+ class BankSyncFailedEvent < BankConnectionEvent
246
+ WEBHOOK_TYPE: String
247
+
248
+ def sync_id: () -> String?
249
+ def error_code: () -> String?
250
+ def failing_since: () -> Time?
251
+ end
252
+
253
+ class BankSyncRecoveredEvent < BankConnectionEvent
254
+ WEBHOOK_TYPE: String
255
+
256
+ def sync_id: () -> String?
257
+ end
124
258
  end
125
259
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: didit-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.30.0
4
+ version: 2.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didit