@paddle/paddle-node-sdk 1.1.0 → 1.2.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/CHANGELOG.md CHANGED
@@ -12,6 +12,21 @@ 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
+ ## 1.2.1 - 2024-03-20
16
+
17
+ ### Fixed
18
+
19
+ - Handled missing `unitPriceOverrides` in the `subscriptions.getPaymentMethodChangeTransaction` operation.
20
+
21
+ ---
22
+
23
+ ## 1.2.0 - 2024-03-19
24
+
25
+ ### Changed
26
+
27
+ - Updated `ErrorCode` enum in `TransactionPaymentAttempt` to include a new error code `declined_not_retryable`
28
+
29
+ ---
15
30
 
16
31
  ## 1.1.0 - 2024-03-13
17
32
 
@@ -4,6 +4,7 @@ exports.Price = void 0;
4
4
  const index_1 = require("../index");
5
5
  class Price {
6
6
  constructor(price) {
7
+ var _a, _b;
7
8
  this.id = price.id;
8
9
  this.productId = price.product_id;
9
10
  this.description = price.description;
@@ -13,7 +14,8 @@ class Price {
13
14
  this.trialPeriod = price.trial_period ? new index_1.TimePeriod(price.trial_period) : null;
14
15
  this.taxMode = price.tax_mode;
15
16
  this.unitPrice = new index_1.Money(price.unit_price);
16
- this.unitPriceOverrides = price.unit_price_overrides.map((unit_price_override) => new index_1.UnitPriceOverride(unit_price_override));
17
+ this.unitPriceOverrides =
18
+ (_b = (_a = price.unit_price_overrides) === null || _a === void 0 ? void 0 : _a.map((unit_price_override) => new index_1.UnitPriceOverride(unit_price_override))) !== null && _b !== void 0 ? _b : [];
17
19
  this.quantity = new index_1.PriceQuantity(price.quantity);
18
20
  this.status = price.status;
19
21
  this.createdAt = price.created_at;
@@ -1 +1 @@
1
- export type ErrorCode = 'already_canceled' | 'already_refunded' | 'authentication_failed' | 'blocked_card' | 'canceled' | 'declined' | 'expired_card' | 'fraud' | 'invalid_amount' | 'invalid_payment_details' | 'issuer_unavailable' | 'not_enough_balance' | 'psp_error' | 'redacted_payment_method' | 'system_error' | 'transaction_not_permitted' | 'unknown';
1
+ export type ErrorCode = 'already_canceled' | 'already_refunded' | 'authentication_failed' | 'blocked_card' | 'canceled' | 'declined' | 'declined_not_retryable' | 'expired_card' | 'fraud' | 'invalid_amount' | 'invalid_payment_details' | 'issuer_unavailable' | 'not_enough_balance' | 'psp_error' | 'redacted_payment_method' | 'system_error' | 'transaction_not_permitted' | 'unknown';
@@ -4,7 +4,7 @@ exports.PriceNotification = void 0;
4
4
  const index_1 = require("../index");
5
5
  class PriceNotification {
6
6
  constructor(price) {
7
- var _a, _b;
7
+ var _a, _b, _c, _d;
8
8
  this.id = price.id;
9
9
  this.productId = price.product_id;
10
10
  this.description = price.description;
@@ -14,11 +14,12 @@ class PriceNotification {
14
14
  this.trialPeriod = price.trial_period ? new index_1.TimePeriodNotification(price.trial_period) : null;
15
15
  this.taxMode = price.tax_mode;
16
16
  this.unitPrice = new index_1.MoneyNotification(price.unit_price);
17
- this.unitPriceOverrides = price.unit_price_overrides.map((unit_price_override) => new index_1.UnitPriceOverrideNotification(unit_price_override));
17
+ this.unitPriceOverrides =
18
+ (_b = (_a = price.unit_price_overrides) === null || _a === void 0 ? void 0 : _a.map((unit_price_override) => new index_1.UnitPriceOverrideNotification(unit_price_override))) !== null && _b !== void 0 ? _b : [];
18
19
  this.quantity = new index_1.PriceQuantityNotification(price.quantity);
19
20
  this.status = price.status;
20
- this.createdAt = (_a = price.created_at) !== null && _a !== void 0 ? _a : null;
21
- this.updatedAt = (_b = price.updated_at) !== null && _b !== void 0 ? _b : null;
21
+ this.createdAt = (_c = price.created_at) !== null && _c !== void 0 ? _c : null;
22
+ this.updatedAt = (_d = price.updated_at) !== null && _d !== void 0 ? _d : null;
22
23
  this.customData = price.custom_data ? price.custom_data : null;
23
24
  this.importMeta = price.import_meta ? new index_1.ImportMetaNotification(price.import_meta) : null;
24
25
  }
@@ -11,7 +11,7 @@ export interface IPriceNotificationResponse {
11
11
  trial_period?: ITimePeriodNotification | null;
12
12
  tax_mode: TaxMode;
13
13
  unit_price: IMoneyNotificationResponse;
14
- unit_price_overrides: IUnitPriceOverrideNotificationResponse[];
14
+ unit_price_overrides: IUnitPriceOverrideNotificationResponse[] | null;
15
15
  quantity: IPriceQuantityNotification;
16
16
  status: Status;
17
17
  created_at?: string | null;
@@ -10,7 +10,7 @@ export interface IPriceResponse {
10
10
  trial_period?: ITimePeriod | null;
11
11
  tax_mode: TaxMode;
12
12
  unit_price: IMoneyResponse;
13
- unit_price_overrides: IUnitPriceOverrideResponse[];
13
+ unit_price_overrides: IUnitPriceOverrideResponse[] | null;
14
14
  quantity: IPriceQuantity;
15
15
  status: Status;
16
16
  created_at: string;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.1.0";
1
+ export declare const SDK_VERSION = "1.2.1";
package/dist/version.js CHANGED
@@ -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 = '1.1.0';
4
+ exports.SDK_VERSION = '1.2.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paddle/paddle-node-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
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/index.js",
6
6
  "types": "./dist/index.d.ts",