@billkit-eu/sdk 0.5.0 → 0.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@billkit-eu/sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Official Node.js SDK for BillKit: a Stripe-Billing-shape multi-tenant SaaS API on Mollie.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
package/src/resources.ts CHANGED
@@ -257,7 +257,9 @@ export interface CreatePriceParams extends IdempotencyOptions {
257
257
  metadata?: Record<string, string>;
258
258
  trial_days?: number;
259
259
  trial_verification_cents?: number;
260
- payment_methods?: Array<"creditcard" | "directdebit" | "ideal" | "applepay" | (string & {})>;
260
+ payment_methods?: Array<
261
+ "creditcard" | "directdebit" | "ideal" | "eps" | "applepay" | "paypal" | (string & {})
262
+ >;
261
263
  /**
262
264
  * What a cancellation refunds without being asked. `"none"` (the default)
263
265
  * nothing; `"full"` the whole last charge; `"prorated"` the unused part
@@ -371,8 +373,21 @@ export interface CreateCheckoutSessionParams extends IdempotencyOptions {
371
373
  * Pin the Mollie payment method. `undefined` lets Mollie pick from
372
374
  * the customer's available methods; when set, must be in the price's
373
375
  * `payment_methods` allowlist.
376
+ *
377
+ * Subscription-starting only, so this is deliberately NARROWER than the
378
+ * one-shot union: `bancontact` and `banktransfer` are absent because
379
+ * neither can mint the mandate a renewal needs. Mollie refuses the
380
+ * latter outright with "The payment method does not support sequence
381
+ * type".
374
382
  */
375
- method?: "creditcard" | "directdebit" | "ideal" | "applepay" | (string & {});
383
+ method?:
384
+ | "creditcard"
385
+ | "directdebit"
386
+ | "ideal"
387
+ | "eps"
388
+ | "applepay"
389
+ | "paypal"
390
+ | (string & {});
376
391
  /** Optional coupon code applied at checkout; atomically claimed. */
377
392
  coupon_code?: string;
378
393
  /**
@@ -430,8 +445,12 @@ export interface CreateOneShotPaymentParams extends IdempotencyOptions {
430
445
  /**
431
446
  * Concrete Mollie method to charge with. Required, because a one-shot commits
432
447
  * up front). Validated against the tenant's capability allowlist for
433
- * `currency`; one-off methods like `bancontact`/`eps` are allowed here
434
- * even though they can't back a subscription.
448
+ * `currency`; one-off methods like `bancontact` and `banktransfer` are
449
+ * allowed here even though they can't back a subscription.
450
+ *
451
+ * `banktransfer` settles in DAYS, not seconds: the payer is handed bank
452
+ * details and Mollie holds the payment `open` for about a fortnight. Expect
453
+ * `one_shot_payment.paid` long after the call returns.
435
454
  *
436
455
  * `giropay` was removed: the scheme shut down at the end of 2024 and the
437
456
  * server now 422s it. The `(string & {})` tail keeps this open on
@@ -446,6 +465,8 @@ export interface CreateOneShotPaymentParams extends IdempotencyOptions {
446
465
  | "bancontact"
447
466
  | "eps"
448
467
  | "applepay"
468
+ | "paypal"
469
+ | "banktransfer"
449
470
  | (string & {});
450
471
  /** Where Mollie returns the payer after the hosted checkout. */
451
472
  success_url: string;
@@ -560,9 +581,18 @@ export interface UpdateTaxRateParams extends IdempotencyOptions {
560
581
  active?: boolean;
561
582
  }
562
583
 
584
+ /**
585
+ * `auditLogs.list` params. All four filters match exactly and combine.
586
+ *
587
+ * `resource_type` narrows to a kind (`"customer"`, `"price"`);
588
+ * `resource_id` narrows to one row, which is the "everything that ever
589
+ * happened to this customer" question an audit log mostly exists for.
590
+ * Pair them or use `resource_id` alone — ids are already unique.
591
+ */
563
592
  export interface AuditLogsListParams extends BaseListParams {
564
593
  action?: string;
565
594
  resource_type?: string;
595
+ resource_id?: string;
566
596
  actor_id?: string;
567
597
  }
568
598
 
@@ -1462,13 +1492,20 @@ export class AuditLogs extends BaseResource {
1462
1492
  }
1463
1493
 
1464
1494
  iter<T = unknown>(
1465
- options: { pageSize?: number; action?: string; resource_type?: string; actor_id?: string } = {},
1495
+ options: {
1496
+ pageSize?: number;
1497
+ action?: string;
1498
+ resource_type?: string;
1499
+ resource_id?: string;
1500
+ actor_id?: string;
1501
+ } = {},
1466
1502
  ): AsyncIterableIterator<T> {
1467
1503
  return paginate<T>((p) => this.get("/v1/audit_logs", p), {
1468
1504
  pageSize: options.pageSize,
1469
1505
  filters: {
1470
1506
  action: options.action,
1471
1507
  resource_type: options.resource_type,
1508
+ resource_id: options.resource_id,
1472
1509
  actor_id: options.actor_id,
1473
1510
  },
1474
1511
  });
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.5.0";
1
+ export const VERSION = "0.6.0";