@paddle/paddle-node-sdk 2.2.0 → 2.2.2

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 CHANGED
@@ -12,6 +12,18 @@ When we make [non-breaking changes](https://developer.paddle.com/api-reference/a
12
12
 
13
13
  This means when upgrading minor versions of the SDK, you may notice type errors. You can safely ignore these or fix by adding additional type guards.
14
14
 
15
+ ## 2.2.2 - 2024-12-16
16
+
17
+ ### Fixed
18
+
19
+ - `discount.startsAt` for Subscriptions can now be `null`
20
+
21
+ ## 2.2.1 - 2024-12-16
22
+
23
+ ### Fixed
24
+
25
+ - Added `proration` to transaction line items
26
+
15
27
  ## 2.2.0 - 2024-12-12
16
28
 
17
29
  ### Added
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SubscriptionDiscount = void 0;
4
4
  class SubscriptionDiscount {
5
5
  constructor(subscriptionDiscount) {
6
- var _a;
6
+ var _a, _b;
7
7
  this.id = subscriptionDiscount.id;
8
- this.startsAt = subscriptionDiscount.starts_at;
9
- this.endsAt = (_a = subscriptionDiscount.ends_at) !== null && _a !== void 0 ? _a : null;
8
+ this.startsAt = (_a = subscriptionDiscount.starts_at) !== null && _a !== void 0 ? _a : null;
9
+ this.endsAt = (_b = subscriptionDiscount.ends_at) !== null && _b !== void 0 ? _b : null;
10
10
  }
11
11
  }
12
12
  exports.SubscriptionDiscount = SubscriptionDiscount;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TransactionLineItemPreview = void 0;
4
4
  const index_js_1 = require("../shared/index.js");
5
5
  const index_js_2 = require("../product/index.js");
6
+ const proration_js_1 = require("../transaction/proration.js");
6
7
  class TransactionLineItemPreview {
7
8
  constructor(transactionLineItemPreview) {
8
9
  this.priceId = transactionLineItemPreview.price_id;
@@ -11,6 +12,7 @@ class TransactionLineItemPreview {
11
12
  this.unitTotals = new index_js_1.UnitTotals(transactionLineItemPreview.unit_totals);
12
13
  this.totals = new index_js_1.Totals(transactionLineItemPreview.totals);
13
14
  this.product = new index_js_2.Product(transactionLineItemPreview.product);
15
+ this.proration = transactionLineItemPreview.proration ? new proration_js_1.Proration(transactionLineItemPreview.proration) : null;
14
16
  }
15
17
  }
16
18
  exports.TransactionLineItemPreview = TransactionLineItemPreview;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = '2.2.0';
4
+ exports.SDK_VERSION = '2.2.2';
@@ -1,8 +1,8 @@
1
1
  export class SubscriptionDiscount {
2
2
  constructor(subscriptionDiscount) {
3
- var _a;
3
+ var _a, _b;
4
4
  this.id = subscriptionDiscount.id;
5
- this.startsAt = subscriptionDiscount.starts_at;
6
- this.endsAt = (_a = subscriptionDiscount.ends_at) !== null && _a !== void 0 ? _a : null;
5
+ this.startsAt = (_a = subscriptionDiscount.starts_at) !== null && _a !== void 0 ? _a : null;
6
+ this.endsAt = (_b = subscriptionDiscount.ends_at) !== null && _b !== void 0 ? _b : null;
7
7
  }
8
8
  }
@@ -1,5 +1,6 @@
1
1
  import { Totals, UnitTotals } from '../shared/index.js';
2
2
  import { Product } from '../product/index.js';
3
+ import { Proration } from '../transaction/proration.js';
3
4
  export class TransactionLineItemPreview {
4
5
  constructor(transactionLineItemPreview) {
5
6
  this.priceId = transactionLineItemPreview.price_id;
@@ -8,5 +9,6 @@ export class TransactionLineItemPreview {
8
9
  this.unitTotals = new UnitTotals(transactionLineItemPreview.unit_totals);
9
10
  this.totals = new Totals(transactionLineItemPreview.totals);
10
11
  this.product = new Product(transactionLineItemPreview.product);
12
+ this.proration = transactionLineItemPreview.proration ? new Proration(transactionLineItemPreview.proration) : null;
11
13
  }
12
14
  }
@@ -1 +1 @@
1
- export const SDK_VERSION = '2.2.0';
1
+ export const SDK_VERSION = '2.2.2';
@@ -1,7 +1,7 @@
1
1
  import { type ISubscriptionDiscountResponse } from '../../types/index.js';
2
2
  export declare class SubscriptionDiscount {
3
3
  readonly id: string;
4
- readonly startsAt: string;
4
+ readonly startsAt: string | null;
5
5
  readonly endsAt: string | null;
6
6
  constructor(subscriptionDiscount: ISubscriptionDiscountResponse);
7
7
  }
@@ -1,6 +1,7 @@
1
1
  import { Totals, UnitTotals } from '../shared/index.js';
2
2
  import { Product } from '../product/index.js';
3
3
  import { type ITransactionLineItemPreviewResponse } from '../../types/index.js';
4
+ import { Proration } from '../transaction/proration.js';
4
5
  export declare class TransactionLineItemPreview {
5
6
  readonly priceId: string;
6
7
  readonly quantity: number;
@@ -8,5 +9,6 @@ export declare class TransactionLineItemPreview {
8
9
  readonly unitTotals: UnitTotals;
9
10
  readonly totals: Totals;
10
11
  readonly product: Product;
12
+ readonly proration: Proration | null;
11
13
  constructor(transactionLineItemPreview: ITransactionLineItemPreviewResponse);
12
14
  }
@@ -1,6 +1,7 @@
1
1
  import { type IUnitTotals } from './unit-totals.js';
2
2
  import { type ITotals } from './totals.js';
3
3
  import { type IProductResponse } from '../product/index.js';
4
+ import { type IProrationResponse } from '../index.js';
4
5
  export interface ITransactionLineItemPreviewResponse {
5
6
  price_id: string;
6
7
  quantity: number;
@@ -8,4 +9,5 @@ export interface ITransactionLineItemPreviewResponse {
8
9
  unit_totals: IUnitTotals;
9
10
  totals: ITotals;
10
11
  product: IProductResponse;
12
+ proration?: IProrationResponse | null;
11
13
  }
@@ -1,5 +1,5 @@
1
1
  export interface ISubscriptionDiscountResponse {
2
2
  id: string;
3
- starts_at: string;
3
+ starts_at: string | null;
4
4
  ends_at?: string | null;
5
5
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.2.0";
1
+ export declare const SDK_VERSION = "2.2.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paddle/paddle-node-sdk",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.",
5
5
  "main": "dist/cjs/index.cjs.node.js",
6
6
  "module": "dist/esm/index.esm.node.js",