@clocknext/sdk 0.20.1 → 0.20.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.
- package/README.md +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/types.ts +4 -4
- package/src/webhooks.ts +9 -3
package/README.md
CHANGED
|
@@ -888,8 +888,8 @@ and types these events; it does not create or list endpoints.)
|
|
|
888
888
|
|
|
889
889
|
| Event | Fires when |
|
|
890
890
|
| --- | --- |
|
|
891
|
-
| `wallet.balance.update` | A customer's **main** wallet balance moves, credit or debit. Not for invoice settlements, and not for the Reserved Wallet. |
|
|
892
|
-
| `wallet.balance.drop` | A debit takes the balance from above a level to at or below it. Fires **once per drop** through the level, not on every debit while the balance stays under it. |
|
|
891
|
+
| `wallet.balance.update` | A customer's **main** wallet balance moves, credit or debit — a top-up, an adjustment, a dashboard change. **Not** for changes caused by signals (usage debits and outcome, unit and composite charges: they can arrive thousands of times a minute), not for invoice settlements, and not for the Reserved Wallet. To read the current balance use `customers.balances()`. |
|
|
892
|
+
| `wallet.balance.drop` | A debit takes the balance from above a level to at or below it. Fires **once per drop** through the level, not on every debit while the balance stays under it. A signal that crosses the level **does** fire it. |
|
|
893
893
|
|
|
894
894
|
The level for `wallet.balance.drop` is the customer's own alert level if they
|
|
895
895
|
have one, otherwise the endpoint's threshold. Set or clear a customer's own
|
|
@@ -900,7 +900,7 @@ await cnk.customers.setWalletAlert(customerId, 50); // alert at or below $50
|
|
|
900
900
|
await cnk.customers.setWalletAlert(customerId, null); // clear it: fall back to each endpoint's threshold
|
|
901
901
|
await cnk.customers.setWalletAlertByExternalId("acme-42", 50);
|
|
902
902
|
|
|
903
|
-
(await cnk.customers.wallet(customerId)).
|
|
903
|
+
(await cnk.customers.wallet(customerId)).lowBalanceThresholdUsd; // 50, or null
|
|
904
904
|
```
|
|
905
905
|
|
|
906
906
|
### Verify, then handle
|