@adonis-agora/payments 0.17.0 → 0.19.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/assets/spa/assets/index-DBJQRh8m.js +10 -0
  3. package/dist/assets/spa/assets/index-DBJQRh8m.js.map +1 -0
  4. package/dist/assets/spa/index.html +1 -1
  5. package/dist/src/billing/billing_store.d.ts +26 -2
  6. package/dist/src/billing/billing_store.d.ts.map +1 -1
  7. package/dist/src/billing/billing_store.js.map +1 -1
  8. package/dist/src/billing/lucid_billing_store.d.ts +3 -1
  9. package/dist/src/billing/lucid_billing_store.d.ts.map +1 -1
  10. package/dist/src/billing/lucid_billing_store.js +9 -1
  11. package/dist/src/billing/lucid_billing_store.js.map +1 -1
  12. package/dist/src/billing/managed_subscriptions.d.ts +12 -0
  13. package/dist/src/billing/managed_subscriptions.d.ts.map +1 -1
  14. package/dist/src/billing/managed_subscriptions.js +13 -3
  15. package/dist/src/billing/managed_subscriptions.js.map +1 -1
  16. package/dist/src/billing/mixins/with_subscription.d.ts +5 -1
  17. package/dist/src/billing/mixins/with_subscription.d.ts.map +1 -1
  18. package/dist/src/billing/mixins/with_subscription.js.map +1 -1
  19. package/dist/src/billing/mixins/with_usage_event.d.ts +8 -0
  20. package/dist/src/billing/mixins/with_usage_event.d.ts.map +1 -1
  21. package/dist/src/billing/mixins/with_usage_event.js +6 -0
  22. package/dist/src/billing/mixins/with_usage_event.js.map +1 -1
  23. package/dist/src/billing/schema.d.ts.map +1 -1
  24. package/dist/src/billing/schema.js +15 -0
  25. package/dist/src/billing/schema.js.map +1 -1
  26. package/dist/src/billing/usage.d.ts +121 -0
  27. package/dist/src/billing/usage.d.ts.map +1 -0
  28. package/dist/src/billing/usage.js +123 -0
  29. package/dist/src/billing/usage.js.map +1 -0
  30. package/dist/src/drivers/stripe.d.ts.map +1 -1
  31. package/dist/src/drivers/stripe.js +20 -2
  32. package/dist/src/drivers/stripe.js.map +1 -1
  33. package/dist/src/index.d.ts +4 -2
  34. package/dist/src/index.d.ts.map +1 -1
  35. package/dist/src/index.js +2 -1
  36. package/dist/src/index.js.map +1 -1
  37. package/dist/src/payments_manager.d.ts +19 -0
  38. package/dist/src/payments_manager.d.ts.map +1 -1
  39. package/dist/src/payments_manager.js +29 -1
  40. package/dist/src/payments_manager.js.map +1 -1
  41. package/dist/src/testing/in_memory_billing_store.d.ts +5 -1
  42. package/dist/src/testing/in_memory_billing_store.d.ts.map +1 -1
  43. package/dist/src/testing/in_memory_billing_store.js +6 -0
  44. package/dist/src/testing/in_memory_billing_store.js.map +1 -1
  45. package/package.json +7 -7
  46. package/dist/assets/spa/assets/index-C1ih3Kth.js +0 -10
  47. package/dist/assets/spa/assets/index-C1ih3Kth.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @adonis-agora/payments
2
2
 
3
+ ## 0.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#144](https://github.com/DavideCarvalho/adonis-agora-payments/pull/144) [`876b94a`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/876b94a62c9e29d5f1bee733174e654de1bd3f1e) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Support stripe-node 23. Its default API version (`2026-09-30.endive`) removed `payment_method_types` from PaymentIntent creation in favour of `allowed_payment_method_types`, and the Stripe driver used the old field to hold a charge to its method (Pix stays Pix): on stripe 23 every charge that named a method would have sent a parameter the API no longer takes. The driver now reads `Stripe.API_VERSION` from the SDK the app installed and sends `allowed_payment_method_types` from 2026-09-30 on, `payment_method_types` before it, so stripe 17 through 23 all work. The `stripe` peer range now includes `^23.0.0`.
8
+
9
+ ## 0.18.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#142](https://github.com/DavideCarvalho/adonis-agora-payments/pull/142) [`6dfa41b`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/6dfa41b887fa646e232523e1e1229395c8677152) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Meter usage against an application resource, read it back against a quota, and type free-plan subscriptions honestly.
14
+
15
+ - `billing_usage_events` gains `scope_type` / `scope_id` and an index on `(scope_type, scope_id, meter)`. `recordUsage` and `usageReport` take `scope: { type, id }` — a project, a workspace, a site — alongside `subscriptionId` / `customerId`, so per-resource usage no longer has to live in `metadata`. Added through the existing `createBillingTables()` upgrade path: an existing install picks the columns up on the next boot (or the next run of the published migration), no new migration to publish. Existing rows read as unscoped.
16
+ - `payments.usage()` — `record`, `total`, `remaining` and `period` — plus the standalone `usageTotal`, `usageRemaining` and `usagePeriodFor`. `period: { subscription }` derives the window from the subscription's billing cycle: the stored current period when it is current, otherwise stepped by `cycle` from its anchor, so a free row nothing renews still resets every cycle.
17
+ - `advancePeriodBy(from, cycle, count)` — anchored multi-cycle arithmetic, without the drift chained clamps accumulate.
18
+ - **Source-breaking:** `SubscriptionRow.gatewayId` (the `withSubscription()` mixin) widens to `string | null`, matching `BillingSubscription` and the column, which was always nullable. Free plans, local trials and comped subscriptions have no gateway subscription to point at. Code assigning `row.gatewayId` into a `string` needs a null check.
19
+ - `LucidBillingStore.usageReport` now applies `customerId` together with `subscriptionId` instead of dropping it, matching `InMemoryBillingStore`.
20
+
3
21
  ## 0.17.0
4
22
 
5
23
  ### Minor Changes