@billkit-eu/sdk 0.4.0 → 0.5.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 +15 -0
- package/README.md +9 -5
- package/dist/index.cjs +16 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/resources.ts +16 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
8
8
|
Versioning is independent of the Python SDK; the two ship on their own cadence,
|
|
9
9
|
so the numbers will diverge after this first release.
|
|
10
10
|
|
|
11
|
+
## [0.5.0] - 2026-09-22
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- `webhookEndpoints.getDelivery()` is now `retrieveDelivery()`. Every other
|
|
15
|
+
single-row fetch in every BillKit SDK is `retrieve`, and python and php
|
|
16
|
+
already spelled this one `retrieve_delivery` / `retrieveDelivery`, so node
|
|
17
|
+
was the outlier and the obvious name was a type error. `getDelivery` stays as
|
|
18
|
+
a deprecated alias — removing it would break callers over a naming
|
|
19
|
+
preference — and goes in the next major.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- `CustomerListParams` is exported from the package entry point. The interface
|
|
23
|
+
documented the `provisional` filter but could not be imported, so callers
|
|
24
|
+
building the params object ahead of the call had nothing to type it with.
|
|
25
|
+
|
|
11
26
|
## [0.4.0]
|
|
12
27
|
|
|
13
28
|
### Added
|
package/README.md
CHANGED
|
@@ -92,19 +92,21 @@ The client exposes one accessor per resource family. Each mirrors the verbs from
|
|
|
92
92
|
|
|
93
93
|
| Accessor | Verbs |
|
|
94
94
|
| --- | --- |
|
|
95
|
-
| `client.customers` | `create`, `retrieve`, `update`, `delete`, `list
|
|
95
|
+
| `client.customers` | `create`, `retrieve`, `update`, `delete`, `list` (filter by `provisional`), `iter`, `setVatNumber`, `purge` |
|
|
96
96
|
| `client.products` | `create`, `retrieve`, `update` (archive with `active: false`), `list`, `iter` |
|
|
97
97
|
| `client.prices` | `create`, `retrieve`, `update` (archive with `active: false`, restore with `active: true`), `list`, `iter` |
|
|
98
98
|
| `client.checkoutSessions` | `create`, `retrieve` |
|
|
99
99
|
| `client.oneShotPayments` | `create`, `retrieve` |
|
|
100
100
|
| `client.subscriptions` | `retrieve`, `list`, `iter` (filter by `customer_id`, `status`, `renewal_state`), `cancel`, `pause`, `resume`, `reactivate`, `previewUpdate`, `update`, `reauthorizePaymentMethod`, `createUsageRecord`, `listUsageRecords`, `iterUsageRecords`, `retrieveUsageSummary` |
|
|
101
101
|
| `client.refunds` | `create`, `retrieve`, `list`, `iter` |
|
|
102
|
-
| `client.
|
|
102
|
+
| `client.disputes` | `retrieve`, `list`, `iter` |
|
|
103
|
+
| `client.webhookEndpoints` | `create`, `retrieve`, `update` (stop delivery with `status: "disabled"`), `delete`, `rotateSecret`, `list`, `iter`, `listDeliveries`, `iterDeliveries`, `retrieveDelivery`, `redeliver` |
|
|
103
104
|
| `client.events` | `retrieve`, `list`, `iter` (filter by `type`) |
|
|
104
105
|
| `client.tenant` | `capabilities`, `portalBranding`, `setPortalBranding`, `rotateProviderCredential` |
|
|
105
106
|
| `client.coupons` | `create`, `retrieve`, `update` (withdraw with `active: false`), `validate`, `list`, `iter` |
|
|
106
107
|
| `client.taxRates` | `create`, `retrieve`, `update` (retire with `active: false`), `list`, `iter` |
|
|
107
|
-
| `client.invoices` | `retrieve`, `retrievePdf`, `list`, `iter` |
|
|
108
|
+
| `client.invoices` | `retrieve`, `retrievePdf`, `list`, `iter`, `void` |
|
|
109
|
+
| `client.creditNotes` | `retrieve`, `retrievePdf`, `list`, `iter` (filter by `invoice_id`, `customer_id`) |
|
|
108
110
|
| `client.auditLogs` | `retrieve`, `list`, `iter` (filter by `action`, `resource_type`, `actor_id`) |
|
|
109
111
|
| `client.payments` | `retrieve`, `list`, `iter` |
|
|
110
112
|
| `client.billingPortalSessions` | `create`, `revoke` |
|
|
@@ -225,14 +227,16 @@ const session = await client.checkoutSessions.create<{ client_secret: string }>(
|
|
|
225
227
|
});
|
|
226
228
|
```
|
|
227
229
|
|
|
228
|
-
### Invoice PDFs
|
|
230
|
+
### Invoice and credit-note PDFs
|
|
229
231
|
|
|
230
232
|
```ts
|
|
231
233
|
const pdf = await client.invoices.retrievePdf("inv_123");
|
|
232
234
|
await writeFile("invoice.pdf", Buffer.from(pdf));
|
|
235
|
+
|
|
236
|
+
const credit = await client.creditNotes.retrievePdf("cn_123");
|
|
233
237
|
```
|
|
234
238
|
|
|
235
|
-
Returns the raw bytes. S3-backed deployments answer with a redirect to a presigned URL, which is followed transparently under the SDK's own timeout and retry policy, so both storage adapters look the same from here. A deployment with PDF rendering disabled throws a `ServerError` with `code: "rendering_pending"`; `retrieve()` still gives you the structured
|
|
239
|
+
Returns the raw bytes. S3-backed deployments answer with a redirect to a presigned URL, which is followed transparently under the SDK's own timeout and retry policy, so both storage adapters look the same from here — and the API key is never sent to the storage host, because the presigned URL carries its own credential. A deployment with PDF rendering disabled throws a `ServerError` with `code: "rendering_pending"`; `retrieve()` still gives you the structured document to render yourself.
|
|
236
240
|
|
|
237
241
|
## Auto-pagination
|
|
238
242
|
|
package/dist/index.cjs
CHANGED
|
@@ -462,9 +462,23 @@ var WebhookEndpoints = class extends BaseResource {
|
|
|
462
462
|
);
|
|
463
463
|
}
|
|
464
464
|
/** Fetch one delivery row for inspection before deciding to redeliver. */
|
|
465
|
-
|
|
465
|
+
retrieveDelivery(endpointId, deliveryId) {
|
|
466
466
|
return this.get(`/v1/webhook_endpoints/${endpointId}/deliveries/${deliveryId}`);
|
|
467
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* @deprecated Renamed to {@link WebhookEndpoints.retrieveDelivery}.
|
|
470
|
+
*
|
|
471
|
+
* Every other single-row fetch in every BillKit SDK is `retrieve`; this
|
|
472
|
+
* one method was `get`, which meant reaching for the obvious name and
|
|
473
|
+
* getting a type error. The python and php clients already spell it
|
|
474
|
+
* `retrieve_delivery` / `retrieveDelivery`, so node was the outlier.
|
|
475
|
+
*
|
|
476
|
+
* Kept as an alias because removing it would break callers for a naming
|
|
477
|
+
* preference. It will go in the next major.
|
|
478
|
+
*/
|
|
479
|
+
getDelivery(endpointId, deliveryId) {
|
|
480
|
+
return this.retrieveDelivery(endpointId, deliveryId);
|
|
481
|
+
}
|
|
468
482
|
/**
|
|
469
483
|
* Re-enqueue a delivery row for the dispatcher.
|
|
470
484
|
*
|
|
@@ -837,7 +851,7 @@ function sleep(ms) {
|
|
|
837
851
|
}
|
|
838
852
|
|
|
839
853
|
// src/version.ts
|
|
840
|
-
var VERSION = "0.
|
|
854
|
+
var VERSION = "0.5.0";
|
|
841
855
|
|
|
842
856
|
// src/transport.ts
|
|
843
857
|
var DEFAULT_BASE_URL = "https://api.billkit.eu";
|