@adonis-agora/payments 0.17.0 → 0.18.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.
- package/CHANGELOG.md +12 -0
- package/dist/assets/spa/assets/index-CmP4DYhG.js +10 -0
- package/dist/assets/spa/assets/index-CmP4DYhG.js.map +1 -0
- package/dist/assets/spa/index.html +1 -1
- package/dist/src/billing/billing_store.d.ts +26 -2
- package/dist/src/billing/billing_store.d.ts.map +1 -1
- package/dist/src/billing/billing_store.js.map +1 -1
- package/dist/src/billing/lucid_billing_store.d.ts +3 -1
- package/dist/src/billing/lucid_billing_store.d.ts.map +1 -1
- package/dist/src/billing/lucid_billing_store.js +9 -1
- package/dist/src/billing/lucid_billing_store.js.map +1 -1
- package/dist/src/billing/managed_subscriptions.d.ts +12 -0
- package/dist/src/billing/managed_subscriptions.d.ts.map +1 -1
- package/dist/src/billing/managed_subscriptions.js +13 -3
- package/dist/src/billing/managed_subscriptions.js.map +1 -1
- package/dist/src/billing/mixins/with_subscription.d.ts +5 -1
- package/dist/src/billing/mixins/with_subscription.d.ts.map +1 -1
- package/dist/src/billing/mixins/with_subscription.js.map +1 -1
- package/dist/src/billing/mixins/with_usage_event.d.ts +8 -0
- package/dist/src/billing/mixins/with_usage_event.d.ts.map +1 -1
- package/dist/src/billing/mixins/with_usage_event.js +6 -0
- package/dist/src/billing/mixins/with_usage_event.js.map +1 -1
- package/dist/src/billing/schema.d.ts.map +1 -1
- package/dist/src/billing/schema.js +15 -0
- package/dist/src/billing/schema.js.map +1 -1
- package/dist/src/billing/usage.d.ts +121 -0
- package/dist/src/billing/usage.d.ts.map +1 -0
- package/dist/src/billing/usage.js +123 -0
- package/dist/src/billing/usage.js.map +1 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/payments_manager.d.ts +19 -0
- package/dist/src/payments_manager.d.ts.map +1 -1
- package/dist/src/payments_manager.js +28 -0
- package/dist/src/payments_manager.js.map +1 -1
- package/dist/src/testing/in_memory_billing_store.d.ts +5 -1
- package/dist/src/testing/in_memory_billing_store.d.ts.map +1 -1
- package/dist/src/testing/in_memory_billing_store.js +6 -0
- package/dist/src/testing/in_memory_billing_store.js.map +1 -1
- package/package.json +5 -5
- package/dist/assets/spa/assets/index-C1ih3Kth.js +0 -10
- package/dist/assets/spa/assets/index-C1ih3Kth.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @adonis-agora/payments
|
|
2
2
|
|
|
3
|
+
## 0.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#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.
|
|
8
|
+
|
|
9
|
+
- `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.
|
|
10
|
+
- `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.
|
|
11
|
+
- `advancePeriodBy(from, cycle, count)` — anchored multi-cycle arithmetic, without the drift chained clamps accumulate.
|
|
12
|
+
- **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.
|
|
13
|
+
- `LucidBillingStore.usageReport` now applies `customerId` together with `subscriptionId` instead of dropping it, matching `InMemoryBillingStore`.
|
|
14
|
+
|
|
3
15
|
## 0.17.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|