@billkit-eu/sdk 0.8.0 → 0.8.1

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/dist/index.d.cts CHANGED
@@ -408,7 +408,9 @@ interface UpdateProductParams extends IdempotencyOptions {
408
408
  name?: string;
409
409
  /** An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone. */
410
410
  description?: string | null;
411
- marketing_features?: string[];
411
+ /** `null` empties the list. An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone. */
412
+ marketing_features?: string[] | null;
413
+ /** Replaces the stored object whole; send `{}` to empty it. */
412
414
  metadata?: Record<string, string>;
413
415
  /** Set false to stop selling a product without deleting history. */
414
416
  active?: boolean;
@@ -439,6 +441,9 @@ interface UpdateProductParams extends IdempotencyOptions {
439
441
  * the price is still `"unspecified"` and never changed again, because
440
442
  * flipping it would restate whether tax was inside or on top of an amount
441
443
  * somebody has already paid.
444
+ *
445
+ * Only the two refund windows accept `null`, which clears the price's
446
+ * override. The API refuses a `null` on any other field here with a 400.
442
447
  */
443
448
  interface UpdatePriceParams extends IdempotencyOptions {
444
449
  /** `false` withdraws the price from sale, `true` puts it back. */
@@ -449,9 +454,13 @@ interface UpdatePriceParams extends IdempotencyOptions {
449
454
  /** Read when a checkout opens. At least one entry. */
450
455
  payment_methods?: Array<"creditcard" | "directdebit" | "ideal" | "eps" | "applepay" | "paypal" | (string & {})>;
451
456
  refund_on_cancel?: "none" | "full" | "prorated";
452
- /** `0` disables refunds for that charge type; `N > 0` is an N-day window. */
453
- refund_window_initial_days?: number;
454
- refund_window_renewal_days?: number;
457
+ /**
458
+ * `0` disables refunds for that charge type; `N > 0` is an N-day window.
459
+ * `null` drops the price's override. An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone.
460
+ */
461
+ refund_window_initial_days?: number | null;
462
+ /** As {@link UpdatePriceParams.refund_window_initial_days}, for renewals. */
463
+ refund_window_renewal_days?: number | null;
455
464
  }
456
465
  /**
457
466
  * One band of a tiered price.
@@ -807,8 +816,10 @@ interface UpdateCouponParams extends IdempotencyOptions {
807
816
  max_redemptions?: number | null;
808
817
  /** Epoch seconds. `null` removes the expiry. An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone. */
809
818
  redeem_by?: number | null;
810
- applies_to_price_ids?: string[];
811
- min_amount_cents?: number;
819
+ /** `null` lifts the price restriction. An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone. */
820
+ applies_to_price_ids?: string[] | null;
821
+ /** `null` lifts the minimum. An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone. */
822
+ min_amount_cents?: number | null;
812
823
  }
813
824
  interface ValidateCouponParams {
814
825
  code: string;
@@ -1666,7 +1677,7 @@ declare class RateLimitError extends BillKitError {
1666
1677
  });
1667
1678
  }
1668
1679
 
1669
- declare const VERSION = "0.8.0";
1680
+ declare const VERSION = "0.8.1";
1670
1681
 
1671
1682
  /**
1672
1683
  * Verify `BillKit-Signature: t=<unix>,v1=<hex>` headers.
package/dist/index.d.ts CHANGED
@@ -408,7 +408,9 @@ interface UpdateProductParams extends IdempotencyOptions {
408
408
  name?: string;
409
409
  /** An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone. */
410
410
  description?: string | null;
411
- marketing_features?: string[];
411
+ /** `null` empties the list. An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone. */
412
+ marketing_features?: string[] | null;
413
+ /** Replaces the stored object whole; send `{}` to empty it. */
412
414
  metadata?: Record<string, string>;
413
415
  /** Set false to stop selling a product without deleting history. */
414
416
  active?: boolean;
@@ -439,6 +441,9 @@ interface UpdateProductParams extends IdempotencyOptions {
439
441
  * the price is still `"unspecified"` and never changed again, because
440
442
  * flipping it would restate whether tax was inside or on top of an amount
441
443
  * somebody has already paid.
444
+ *
445
+ * Only the two refund windows accept `null`, which clears the price's
446
+ * override. The API refuses a `null` on any other field here with a 400.
442
447
  */
443
448
  interface UpdatePriceParams extends IdempotencyOptions {
444
449
  /** `false` withdraws the price from sale, `true` puts it back. */
@@ -449,9 +454,13 @@ interface UpdatePriceParams extends IdempotencyOptions {
449
454
  /** Read when a checkout opens. At least one entry. */
450
455
  payment_methods?: Array<"creditcard" | "directdebit" | "ideal" | "eps" | "applepay" | "paypal" | (string & {})>;
451
456
  refund_on_cancel?: "none" | "full" | "prorated";
452
- /** `0` disables refunds for that charge type; `N > 0` is an N-day window. */
453
- refund_window_initial_days?: number;
454
- refund_window_renewal_days?: number;
457
+ /**
458
+ * `0` disables refunds for that charge type; `N > 0` is an N-day window.
459
+ * `null` drops the price's override. An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone.
460
+ */
461
+ refund_window_initial_days?: number | null;
462
+ /** As {@link UpdatePriceParams.refund_window_initial_days}, for renewals. */
463
+ refund_window_renewal_days?: number | null;
455
464
  }
456
465
  /**
457
466
  * One band of a tiered price.
@@ -807,8 +816,10 @@ interface UpdateCouponParams extends IdempotencyOptions {
807
816
  max_redemptions?: number | null;
808
817
  /** Epoch seconds. `null` removes the expiry. An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone. */
809
818
  redeem_by?: number | null;
810
- applies_to_price_ids?: string[];
811
- min_amount_cents?: number;
819
+ /** `null` lifts the price restriction. An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone. */
820
+ applies_to_price_ids?: string[] | null;
821
+ /** `null` lifts the minimum. An explicit `null` **clears** it and is sent as a JSON null rather than pruned (only `undefined` is dropped); omit the field to leave it alone. */
822
+ min_amount_cents?: number | null;
812
823
  }
813
824
  interface ValidateCouponParams {
814
825
  code: string;
@@ -1666,7 +1677,7 @@ declare class RateLimitError extends BillKitError {
1666
1677
  });
1667
1678
  }
1668
1679
 
1669
- declare const VERSION = "0.8.0";
1680
+ declare const VERSION = "0.8.1";
1670
1681
 
1671
1682
  /**
1672
1683
  * Verify `BillKit-Signature: t=<unix>,v1=<hex>` headers.
package/dist/index.js CHANGED
@@ -997,7 +997,7 @@ function sleep(ms) {
997
997
  }
998
998
 
999
999
  // src/version.ts
1000
- var VERSION = "0.8.0";
1000
+ var VERSION = "0.8.1";
1001
1001
 
1002
1002
  // src/transport.ts
1003
1003
  var DEFAULT_BASE_URL = "https://api.billkit.eu";