@adonis-agora/payments 0.11.0 → 0.13.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 +55 -0
- package/dist/assets/spa/assets/{index-Q4Eewxjq.js → index-DYQO0uZL.js} +2 -2
- package/dist/assets/spa/assets/{index-Q4Eewxjq.js.map → index-DYQO0uZL.js.map} +1 -1
- package/dist/assets/spa/index.html +1 -1
- package/dist/commands/payments_sync.js +9 -9
- package/dist/commands/payments_sync.js.map +1 -1
- package/dist/src/billing/arrears.d.ts +46 -0
- package/dist/src/billing/arrears.d.ts.map +1 -0
- package/dist/src/billing/arrears.js +60 -0
- package/dist/src/billing/arrears.js.map +1 -0
- package/dist/src/billing/billing_health.js +2 -2
- package/dist/src/billing/billing_health.js.map +1 -1
- package/dist/src/billing/billing_store.d.ts +83 -14
- 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/index.d.ts +1 -1
- package/dist/src/billing/index.d.ts.map +1 -1
- package/dist/src/billing/index.js +1 -1
- package/dist/src/billing/index.js.map +1 -1
- package/dist/src/billing/list_query.d.ts +23 -7
- package/dist/src/billing/list_query.d.ts.map +1 -1
- package/dist/src/billing/list_query.js +33 -16
- package/dist/src/billing/list_query.js.map +1 -1
- package/dist/src/billing/lucid_billing_store.d.ts +4 -4
- package/dist/src/billing/lucid_billing_store.d.ts.map +1 -1
- package/dist/src/billing/lucid_billing_store.js +27 -18
- package/dist/src/billing/lucid_billing_store.js.map +1 -1
- package/dist/src/dashboard/handlers.d.ts +3 -3
- package/dist/src/dashboard/handlers.d.ts.map +1 -1
- package/dist/src/dashboard/handlers.js +68 -54
- package/dist/src/dashboard/handlers.js.map +1 -1
- package/dist/src/define_config.d.ts +42 -2
- package/dist/src/define_config.d.ts.map +1 -1
- package/dist/src/define_config.js +24 -0
- package/dist/src/define_config.js.map +1 -1
- 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.map +1 -1
- package/dist/src/payments_manager.js +5 -0
- package/dist/src/payments_manager.js.map +1 -1
- package/dist/src/subscriptions_api.d.ts.map +1 -1
- package/dist/src/subscriptions_api.js +36 -0
- package/dist/src/subscriptions_api.js.map +1 -1
- package/dist/src/testing/in_memory_billing_store.d.ts +5 -4
- package/dist/src/testing/in_memory_billing_store.d.ts.map +1 -1
- package/dist/src/testing/in_memory_billing_store.js +21 -9
- package/dist/src/testing/in_memory_billing_store.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# @adonis-agora/payments
|
|
2
2
|
|
|
3
|
+
## 0.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#55](https://github.com/DavideCarvalho/adonis-agora-payments/pull/55) [`a9b6177`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/a9b61779c12eb9faa264b30947fbdb91d62b11e0) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Three gaps found wiring a real B2B subscription in `gateway` mode.
|
|
8
|
+
|
|
9
|
+
**`externalReference` now survives on subscriptions.** `CreateSubscriptionInput.externalReference` is documented as the id webhook handlers route on, and the column already existed — but `saveSubscription` had no field for it, `SubscriptionListItem` did not expose it and `listSubscriptions` could not filter by it. So the app could send the id, watch the gateway echo it onto every charge, query payments by it, and still have no way to ask "which subscription belongs to this customer of mine?". Added to the store contract, to the returned item and to a new `SubscriptionListQuery`. Related: gateway-mode `SubscriptionsApi.create()` never persisted a subscription row at all, leaving the record to appear only if and when a webhook arrived; it now writes one at creation.
|
|
10
|
+
|
|
11
|
+
**`arrears(store, { externalReference })`.** `renewalFailureCount` and friends are filled by this library's renewal pass, which only runs for `managed` subscriptions — in `gateway` mode (the default) the gateway retries and those fields stay null forever. Answering "is this customer behind, and since when?" meant walking `billing_payments` by hand in every app. The helper does it once, including the non-obvious part: the arrears are dated from the START of the current failure run, because dunning retries the same bill for days and dating from the newest attempt keeps resetting the clock on the customer who is furthest behind.
|
|
12
|
+
|
|
13
|
+
**A provider slot may now be `undefined`, and is skipped.** Every declared provider was built during boot and drivers validate credentials in their constructor, so `payments.asaas({ apiKey: env.get('ASAAS_API_KEY') })` without a key did not disable payments — it stopped the process from starting, which hits CI and every developer machine. `payments.when(condition, () => payments.asaas({ apiKey }))` defers the construction and leaves the slot out. A provider that IS declared and throws still fails the boot, and `ASAAS_WEBHOOK_TOKEN` still refuses to boot on purpose: a missing API key means "cannot charge", a missing webhook token means a public route that marks invoices paid for anyone who posts to it.
|
|
14
|
+
|
|
15
|
+
## 0.12.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#43](https://github.com/DavideCarvalho/adonis-agora-payments/pull/43) [`ea598e8`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/ea598e840aa85e4b2634863165da6bd4fcde90f8) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Pagination is now `{ page, size }` everywhere, matching `@adonis-agora/filter`.
|
|
20
|
+
|
|
21
|
+
**Breaking rename.** Every list read took `{ limit?, offset? }` with a **0-based** `offset`; it now
|
|
22
|
+
takes `{ page?, size? }` with a **1-based** `page` (default `1`) and `size` as the page size
|
|
23
|
+
(default 50, capped at 200 — the same numbers as before). The 0-based SQL offset became an internal
|
|
24
|
+
detail computed by the store, so it can no longer leak into a public type or a query string.
|
|
25
|
+
|
|
26
|
+
The reason is ecosystem consistency, not taste: `@adonis-agora/filter` exposes `FilterInput.page`
|
|
27
|
+
/`.size` and resolves them to `{ page, size }`, and every `@adonis-agora/*` library is being moved
|
|
28
|
+
onto that one shape so an app (or a console) never has to remember which library counts from zero.
|
|
29
|
+
The match is **structural** — this package still depends on no filter package.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
// before
|
|
33
|
+
await store.listPayments({ status: 'failed', limit: 20, offset: 40 })
|
|
34
|
+
// after — page 3 of 20, 1-based
|
|
35
|
+
await store.listPayments({ status: 'failed', size: 20, page: 3 })
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
What changed, concretely:
|
|
39
|
+
|
|
40
|
+
- `BillingListQuery`, `PaymentListQuery`, `WebhookEventListQuery`, `CustomerListQuery`,
|
|
41
|
+
`AuditEventQuery`, `DisputeDeadlineQuery`, `OpenDisputeQuery` and
|
|
42
|
+
`listWebhookEventsForPayment`'s options: `limit`/`offset` → `size`/`page`.
|
|
43
|
+
- `AuditEventCountQuery` is now `Omit<AuditEventQuery, 'page' | 'size'>`, and
|
|
44
|
+
`countDisputesDueWithin` takes `Omit<DisputeDeadlineQuery, 'page' | 'size'>`.
|
|
45
|
+
- `BILLING_LIST_DEFAULT_LIMIT` → `BILLING_LIST_DEFAULT_SIZE` (still 50);
|
|
46
|
+
`BILLING_LIST_MAX_LIMIT` → `BILLING_LIST_MAX_SIZE` (still 200).
|
|
47
|
+
- `clampLimit`/`clampOffset` → `clampSize`/`clampPage`, plus `listOffset(page, size)` for stores
|
|
48
|
+
that need the SQL offset.
|
|
49
|
+
- Dashboard JSON API: lists read `?page=1&size=25` instead of `?limit=25&offset=0`, and echo the
|
|
50
|
+
paging back under `meta: { page, size, count, … }` instead of `page: { limit, offset, … }`.
|
|
51
|
+
`count === size` is still the only "there might be more" signal. `meta` is Lucid's own spelling —
|
|
52
|
+
`.paginate()` answers `{ meta, data }` — and it is the envelope key every `@adonis-agora` console
|
|
53
|
+
now uses.
|
|
54
|
+
- Dashboard SPA: `paymentsClient` list options take `{ page, size }`, the `Page` wire type is now
|
|
55
|
+
`ListMeta` and every list response carries it as `meta`, and the `Pager` control is page-based
|
|
56
|
+
(`page`/`size`/`onPage`). `ScanNotice` takes a `meta` prop.
|
|
57
|
+
|
|
3
58
|
## 0.11.0
|
|
4
59
|
|
|
5
60
|
### Minor Changes
|