@paddle/paddle-node-sdk 0.1.5 → 0.1.7

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 ADDED
@@ -0,0 +1,81 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+
7
+ > **Important:** While in early access(version 0.X.Y) we may introduce breaking changes. Where we can, we'll tag breaking changes in this changelog and communicate ahead of time.
8
+
9
+ Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-node-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools.
10
+
11
+
12
+ ## 0.1.7 - 2023-11-23
13
+
14
+ ### Added
15
+
16
+ - Added changelog.
17
+
18
+ ---
19
+
20
+ ## 0.1.6 - 2023-11-22
21
+
22
+ ### Fixed
23
+
24
+ - Fixed optional management URL object in subscription entities.
25
+
26
+ ---
27
+
28
+ ## 0.1.5 - 2023-11-14
29
+
30
+ ### Added
31
+
32
+ - Added `transactions.getInvoicePDF()` for the [get a PDF invoice for a transaction](https://developer.paddle.com/api-reference/transactions/get-invoice-pdf?utm_source=dx&utm_medium=paddle-node-sdk) operation.
33
+ - Enabled request and response logging.
34
+
35
+ ---
36
+
37
+ ## 0.1.4 - 2023-11-09
38
+
39
+ ### Removed
40
+
41
+ - Removed unused dependency `lodash`.
42
+
43
+ ---
44
+
45
+ ## 0.1.3 - 2023-11-08
46
+
47
+ ### Fixed
48
+
49
+ - Added missing query parameters for the [list transactions](https://developer.paddle.com/api-reference/transactions/list-transactions?utm_source=dx&utm_medium=paddle-node-sdk) operation.
50
+
51
+ ---
52
+
53
+ ## 0.1.2 - 2023-11-06
54
+
55
+ ### Fixed
56
+
57
+ - Fixed incorrect update subscription request body TypeScript definition.
58
+
59
+ ---
60
+
61
+ ## 0.1.1 - 2023-11-06
62
+
63
+ ### Added
64
+
65
+ - Added `customers.getCreditBalance()` for the [list credit balances for a customer](https://developer.paddle.com/api-reference/customers/list-credit-balances?utm_source=dx&utm_medium=paddle-node-sdk) operation.
66
+ - Added `subscriptions.previewUpdate()` for the [preview an update to a subscription](https://developer.paddle.com/api-reference/subscriptions/preview-subscription?utm_source=dx&utm_medium=paddle-node-sdk) operation.
67
+ - Added `subscriptions.activate()` for the [activate a trialing subscription](https://developer.paddle.com/api-reference/subscriptions/activate-subscription?utm_source=dx&utm_medium=paddle-node-sdk) operation.
68
+ - Added `subscriptions.pause()` for the [pause a subscription](https://developer.paddle.com/api-reference/subscriptions/pause-subscription?utm_source=dx&utm_medium=paddle-node-sdk) operation.
69
+ - Added `subscriptions.resume()` for the [resume a paused subscription](https://developer.paddle.com/api-reference/subscriptions/resume-subscription?utm_source=dx&utm_medium=paddle-node-sdk) operation.
70
+ - Added `subscriptions.cancel()` for the [cancel a subscription](https://developer.paddle.com/api-reference/subscriptions/cancel-subscription?utm_source=dx&utm_medium=paddle-node-sdk) operation.
71
+ - Added `subscriptions.createOneTimeCharge()` for the [create a one-time charge for a subscription](https://developer.paddle.com/api-reference/subscriptions/create-one-time-charge?utm_source=dx&utm_medium=paddle-node-sdk) operation.
72
+ - Added `subscriptions.previewOneTimeCharge()` for the [preview a one-time charge for a subscription](https://developer.paddle.com/api-reference/subscriptions/preview-subscription-charge?utm_source=dx&utm_medium=paddle-node-sdk) operation.
73
+ - Added `subscriptions.getPaymentMethodChangeTransaction()` for the [get a transaction to update payment method](https://developer.paddle.com/api-reference/subscriptions/update-payment-method?utm_source=dx&utm_medium=paddle-node-sdk) operation.
74
+
75
+ ---
76
+
77
+ ## 0.1.0 - 2023-11-03
78
+
79
+ ### Added
80
+
81
+ - Initial early access release. Added support for the most frequently used Paddle Billing entities and API operations. Check the [README](./README.md) for more information.
@@ -21,7 +21,7 @@ export declare class SubscriptionIncludes {
21
21
  readonly current_billing_period?: SubscriptionTimePeriod | null | undefined;
22
22
  readonly billing_cycle: TimePeriod;
23
23
  readonly scheduled_change?: SubscriptionScheduledChange | null | undefined;
24
- readonly management_urls: SubscriptionManagement;
24
+ readonly management_urls?: SubscriptionManagement | null | undefined;
25
25
  readonly items: SubscriptionItem[];
26
26
  readonly custom_data?: CustomData | null | undefined;
27
27
  readonly next_transaction?: NextTransaction | null | undefined;
@@ -27,7 +27,9 @@ class SubscriptionIncludes {
27
27
  this.scheduled_change = subscription.scheduled_change
28
28
  ? new index_1.SubscriptionScheduledChange(subscription.scheduled_change)
29
29
  : null;
30
- this.management_urls = new index_1.SubscriptionManagement(subscription.management_urls);
30
+ this.management_urls = subscription.management_urls
31
+ ? new index_1.SubscriptionManagement(subscription.management_urls)
32
+ : null;
31
33
  this.items = subscription.items.map((item) => new index_1.SubscriptionItem(item));
32
34
  this.custom_data = subscription.custom_data;
33
35
  this.next_transaction = subscription.next_transaction ? new index_1.NextTransaction(subscription.next_transaction) : null;
@@ -21,7 +21,7 @@ export declare class Subscription {
21
21
  readonly current_billing_period?: SubscriptionTimePeriod | undefined | null;
22
22
  readonly billing_cycle: TimePeriod;
23
23
  readonly scheduled_change?: SubscriptionScheduledChange | undefined | null;
24
- readonly management_urls: SubscriptionManagement;
24
+ readonly management_urls?: SubscriptionManagement | undefined | null;
25
25
  readonly items: SubscriptionItem[];
26
26
  readonly custom_data?: CustomData | undefined | null;
27
27
  constructor(subscription: ISubscription);
@@ -27,7 +27,9 @@ class Subscription {
27
27
  this.scheduled_change = subscription.scheduled_change
28
28
  ? new index_1.SubscriptionScheduledChange(subscription.scheduled_change)
29
29
  : undefined;
30
- this.management_urls = new index_1.SubscriptionManagement(subscription.management_urls);
30
+ this.management_urls = subscription.management_urls
31
+ ? new index_1.SubscriptionManagement(subscription.management_urls)
32
+ : undefined;
31
33
  this.items = subscription.items.map((item) => new index_1.SubscriptionItem(item));
32
34
  this.custom_data = subscription.custom_data;
33
35
  }
@@ -12,10 +12,10 @@ class Logger {
12
12
  console.error('[Paddle] [ERROR]', ...args);
13
13
  }
14
14
  static logRequest(method, url, headers) {
15
- Logger.log(method, url, 'Transaction ID:', headers['X-Transaction-ID']);
15
+ Logger.log('[Request]', method, url, 'Transaction ID:', headers['X-Transaction-ID']);
16
16
  }
17
17
  static logResponse(method, url, headers, promise) {
18
- Logger.log(method, url, promise.status.toString(), 'Transaction ID:', headers['X-Transaction-ID'], 'Request ID:', promise.headers.get('Request-Id'));
18
+ Logger.log('[Response]', method, url, promise.status.toString(), 'Transaction ID:', headers['X-Transaction-ID'], 'Request ID:', promise.headers.get('Request-Id'));
19
19
  }
20
20
  }
21
21
  exports.Logger = Logger;
@@ -20,7 +20,7 @@ export interface ISubscription {
20
20
  current_billing_period?: ISubscriptionTimePeriod | undefined | null;
21
21
  billing_cycle: ITimePeriod;
22
22
  scheduled_change?: ISubscriptionScheduledChange | undefined | null;
23
- management_urls: ISubscriptionManagement;
23
+ management_urls: ISubscriptionManagement | undefined | null;
24
24
  items: ISubscriptionItem[];
25
25
  custom_data?: ICustomData | undefined | null;
26
26
  next_transaction?: INextTransaction | undefined | null;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.5";
1
+ export declare const SDK_VERSION = "0.1.7";
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 = '0.1.5';
4
+ exports.SDK_VERSION = '0.1.7';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paddle/paddle-node-sdk",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "A NodeJS SDK for Paddle Billing API",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",