@paddle/paddle-node-sdk 0.2.6 → 0.2.8
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 +18 -0
- package/README.md +0 -79
- package/dist/entities/price/price.d.ts +1 -1
- package/dist/entities/price/price.js +4 -2
- package/dist/entities/transaction/adjustment-totals-breakdown.d.ts +0 -1
- package/dist/entities/transaction/adjustment-totals-breakdown.js +0 -7
- package/dist/entities/transaction/transaction-adjustment-item.d.ts +3 -3
- package/dist/resources/notifications/index.js +2 -2
- package/dist/resources/notifications/operations/list-notification-query-parameters.d.ts +9 -9
- package/dist/resources/reports/index.js +1 -1
- package/dist/types/shared/shared-price-response.d.ts +1 -1
- package/dist/types/transaction/transaction-adjustment-item-response.d.ts +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
8
8
|
|
|
9
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
10
|
|
|
11
|
+
## 0.2.8 - 2024-01-09
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Marked `unitPriceOverrides` as optional in Price entity.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 0.2.7 - 2024-01-04
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Marked all properties in `ListNotificationQueryParameters` as optional.
|
|
24
|
+
- Removed additional `?` from URLS in List Reports and List Notifications functions.
|
|
25
|
+
- Fixed incorrect enum in Adjustment `type`
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
11
29
|
## 0.2.6 - 2023-12-22
|
|
12
30
|
|
|
13
31
|
### Added
|
package/README.md
CHANGED
|
@@ -271,85 +271,6 @@ app.listen(3000)
|
|
|
271
271
|
|
|
272
272
|
The Node.js SDK has complete feature parity with the Paddle API. All operations in the Paddle API are supported.
|
|
273
273
|
|
|
274
|
-
| Paddle API operation | Support |
|
|
275
|
-
|----------------------------------------------|:--------:|
|
|
276
|
-
| **Products** | **Full** |
|
|
277
|
-
| List products | ✅ |
|
|
278
|
-
| Create a product | ✅ |
|
|
279
|
-
| Get a product | ✅ |
|
|
280
|
-
| Update a product | ✅ |
|
|
281
|
-
| **Prices** | **Full** |
|
|
282
|
-
| List prices | ✅ |
|
|
283
|
-
| Create a price | ✅ |
|
|
284
|
-
| Get a price | ✅ |
|
|
285
|
-
| Update a price | ✅ |
|
|
286
|
-
| **Discounts** | **Full** |
|
|
287
|
-
| List discounts | ✅ |
|
|
288
|
-
| Create a discount | ✅ |
|
|
289
|
-
| Get a discount | ✅ |
|
|
290
|
-
| Update a discount | ✅ |
|
|
291
|
-
| **Customers** | **Full** |
|
|
292
|
-
| List customers | ✅ |
|
|
293
|
-
| Create a customer | ✅ |
|
|
294
|
-
| Get a customer | ✅ |
|
|
295
|
-
| Update a customer | ✅ |
|
|
296
|
-
| List credit balances for a customer | ✅ |
|
|
297
|
-
| **Addresses** | **Full** |
|
|
298
|
-
| List addresses for a customer | ✅ |
|
|
299
|
-
| Create an addresses for a customer | ✅ |
|
|
300
|
-
| Get an address for a customer | ✅ |
|
|
301
|
-
| Update an address for a customer | ✅ |
|
|
302
|
-
| **Businesses** | ✅ |
|
|
303
|
-
| List businesses for a customer | ✅ |
|
|
304
|
-
| Create a business for a customer | ✅ |
|
|
305
|
-
| Get a business for a customer | ✅ |
|
|
306
|
-
| Update a business for a customer | ✅ |
|
|
307
|
-
| **Transactions** | **Full** |
|
|
308
|
-
| List transactions | ✅ |
|
|
309
|
-
| Create a transaction | ✅ |
|
|
310
|
-
| Get a transaction | ✅ |
|
|
311
|
-
| Update a transaction | ✅ |
|
|
312
|
-
| Preview a transaction | ✅ |
|
|
313
|
-
| Get a PDF invoice for a transaction | ✅ |
|
|
314
|
-
| **Subscriptions** | **Full** |
|
|
315
|
-
| List subscriptions | ✅ |
|
|
316
|
-
| Get a subscription | ✅ |
|
|
317
|
-
| Preview an update to a subscription | ✅ |
|
|
318
|
-
| Update a subscription | ✅ |
|
|
319
|
-
| Get a transaction to update payment method | ✅ |
|
|
320
|
-
| Preview a one-time charge for a subscription | ✅ |
|
|
321
|
-
| Create a one-time charge for a subscription | ✅ |
|
|
322
|
-
| Activate a trialing subscription | ✅ |
|
|
323
|
-
| Pause a subscription | ✅ |
|
|
324
|
-
| Resume a paused subscription | ✅ |
|
|
325
|
-
| Cancel a subscription | ✅ |
|
|
326
|
-
| **Adjustments** | **Full** |
|
|
327
|
-
| List adjustments | ✅ |
|
|
328
|
-
| Create an adjustment | ✅ |
|
|
329
|
-
| **Pricing preview** | **Full** |
|
|
330
|
-
| Preview prices | ✅ |
|
|
331
|
-
| **Reports** | **Full** |
|
|
332
|
-
| List reports | ✅ |
|
|
333
|
-
| Create a report | ✅ |
|
|
334
|
-
| Get a report | ✅ |
|
|
335
|
-
| Get a CSV file for a report | ✅ |
|
|
336
|
-
| **Event types** | **Full** |
|
|
337
|
-
| List event types | ✅ |
|
|
338
|
-
| **Events** | **Full** |
|
|
339
|
-
| List events | ✅ |
|
|
340
|
-
| **Notification settings** | **Full** |
|
|
341
|
-
| List notification settings | ✅ |
|
|
342
|
-
| Create a notification setting | ✅ |
|
|
343
|
-
| Get a notification setting | ✅ |
|
|
344
|
-
| Update a notification setting | ✅ |
|
|
345
|
-
| Delete a notification setting | ✅ |
|
|
346
|
-
| **Notifications** | **Full** |
|
|
347
|
-
| List notifications | ✅ |
|
|
348
|
-
| Get a notification | ✅ |
|
|
349
|
-
| Replay a notification | ✅ |
|
|
350
|
-
| **Notification logs** | **Full** |
|
|
351
|
-
| List logs for a notification | ✅ |
|
|
352
|
-
|
|
353
274
|
## Learn more
|
|
354
275
|
|
|
355
276
|
- [Paddle API reference](https://developer.paddle.com/api-reference/overview?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
@@ -11,7 +11,7 @@ export declare class Price {
|
|
|
11
11
|
readonly trialPeriod: TimePeriod | null;
|
|
12
12
|
readonly taxMode: TaxMode;
|
|
13
13
|
readonly unitPrice: Money | null;
|
|
14
|
-
readonly unitPriceOverrides: UnitPriceOverride[];
|
|
14
|
+
readonly unitPriceOverrides: UnitPriceOverride[] | null;
|
|
15
15
|
readonly quantity: PriceQuantity | null;
|
|
16
16
|
readonly status: Status;
|
|
17
17
|
readonly customData: ICustomData | null;
|
|
@@ -4,7 +4,7 @@ exports.Price = void 0;
|
|
|
4
4
|
const index_1 = require("../index");
|
|
5
5
|
class Price {
|
|
6
6
|
constructor(price) {
|
|
7
|
-
var _a;
|
|
7
|
+
var _a, _b;
|
|
8
8
|
this.id = price.id;
|
|
9
9
|
this.productId = price.product_id;
|
|
10
10
|
this.description = price.description;
|
|
@@ -14,7 +14,9 @@ class Price {
|
|
|
14
14
|
this.trialPeriod = price.trial_period ? new index_1.TimePeriod(price.trial_period) : null;
|
|
15
15
|
this.taxMode = price.tax_mode;
|
|
16
16
|
this.unitPrice = price.unit_price ? new index_1.Money(price.unit_price) : null;
|
|
17
|
-
this.unitPriceOverrides = price.unit_price_overrides
|
|
17
|
+
this.unitPriceOverrides = price.unit_price_overrides
|
|
18
|
+
? (_b = price.unit_price_overrides) === null || _b === void 0 ? void 0 : _b.map((unit_price_override) => new index_1.UnitPriceOverride(unit_price_override))
|
|
19
|
+
: null;
|
|
18
20
|
this.quantity = price.quantity ? new index_1.PriceQuantity(price.quantity) : null;
|
|
19
21
|
this.status = price.status;
|
|
20
22
|
this.customData = price.custom_data ? price.custom_data : null;
|
|
@@ -7,12 +7,5 @@ class AdjustmentTotalsBreakdown {
|
|
|
7
7
|
this.refund = adjustmentTotalsBreakdown.refund;
|
|
8
8
|
this.chargeback = adjustmentTotalsBreakdown.chargeback;
|
|
9
9
|
}
|
|
10
|
-
toJson() {
|
|
11
|
-
return {
|
|
12
|
-
credit: this.credit,
|
|
13
|
-
refund: this.refund,
|
|
14
|
-
chargeback: this.chargeback,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
10
|
}
|
|
18
11
|
exports.AdjustmentTotalsBreakdown = AdjustmentTotalsBreakdown;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type ITransactionAdjustmentItemResponse } from '../../types';
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
2
|
+
import { AdjustmentItemTotals, TransactionProration } from '../index';
|
|
3
|
+
import { type AdjustmentType } from '../../enums';
|
|
4
4
|
export declare class TransactionAdjustmentItem {
|
|
5
5
|
readonly id: string | null;
|
|
6
6
|
readonly itemId: string;
|
|
7
|
-
readonly type:
|
|
7
|
+
readonly type: AdjustmentType;
|
|
8
8
|
readonly amount: string | null;
|
|
9
9
|
readonly proration: TransactionProration | null;
|
|
10
10
|
readonly totals: AdjustmentItemTotals | null;
|
|
@@ -36,7 +36,7 @@ __exportStar(require("./operations"), exports);
|
|
|
36
36
|
class NotificationsResource extends base_1.BaseResource {
|
|
37
37
|
list(queryParams) {
|
|
38
38
|
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
39
|
-
return new entities_1.NotificationCollection(this.client, NotificationPaths.list +
|
|
39
|
+
return new entities_1.NotificationCollection(this.client, NotificationPaths.list + queryParameters.toQueryString());
|
|
40
40
|
}
|
|
41
41
|
get(notificationId) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -63,7 +63,7 @@ class NotificationsResource extends base_1.BaseResource {
|
|
|
63
63
|
const urlWithPathParams = new base_1.PathParameters(NotificationPaths.getLogs, {
|
|
64
64
|
notification_id: notificationId,
|
|
65
65
|
}).deriveUrl();
|
|
66
|
-
return new entities_1.NotificationLogCollection(this.client, urlWithPathParams +
|
|
66
|
+
return new entities_1.NotificationLogCollection(this.client, urlWithPathParams + queryParameters.toQueryString());
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
exports.NotificationsResource = NotificationsResource;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type NotificationStatus } from '../../../enums';
|
|
2
2
|
export interface ListNotificationQueryParameters {
|
|
3
|
-
after
|
|
4
|
-
notificationSettingId
|
|
5
|
-
orderBy
|
|
6
|
-
perPage
|
|
7
|
-
search
|
|
8
|
-
status
|
|
9
|
-
filter
|
|
10
|
-
to
|
|
11
|
-
from
|
|
3
|
+
after?: string;
|
|
4
|
+
notificationSettingId?: string[];
|
|
5
|
+
orderBy?: string;
|
|
6
|
+
perPage?: number;
|
|
7
|
+
search?: string;
|
|
8
|
+
status?: NotificationStatus[];
|
|
9
|
+
filter?: string;
|
|
10
|
+
to?: string;
|
|
11
|
+
from?: string;
|
|
12
12
|
}
|
|
@@ -36,7 +36,7 @@ __exportStar(require("./operations"), exports);
|
|
|
36
36
|
class ReportsResource extends base_1.BaseResource {
|
|
37
37
|
list(queryParams) {
|
|
38
38
|
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
39
|
-
return new entities_1.ReportCollection(this.client, ReportPaths.list +
|
|
39
|
+
return new entities_1.ReportCollection(this.client, ReportPaths.list + queryParameters.toQueryString());
|
|
40
40
|
}
|
|
41
41
|
create(createReportParameters) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -10,7 +10,7 @@ export interface ISharedPriceResponse {
|
|
|
10
10
|
trial_period?: ITimePeriod | null;
|
|
11
11
|
tax_mode: TaxMode;
|
|
12
12
|
unit_price?: IMoneyResponse | null;
|
|
13
|
-
unit_price_overrides
|
|
13
|
+
unit_price_overrides?: IUnitPriceOverrideResponse[] | null;
|
|
14
14
|
quantity?: IPriceQuantity | null;
|
|
15
15
|
status: Status;
|
|
16
16
|
custom_data?: ICustomData | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type IAdjustmentItemTotals, type ITransactionProrationResponse } from '../index';
|
|
2
|
+
import { type AdjustmentType } from '../../enums';
|
|
3
3
|
export interface ITransactionAdjustmentItemResponse {
|
|
4
4
|
id?: string | null;
|
|
5
5
|
item_id: string;
|
|
6
|
-
type:
|
|
6
|
+
type: AdjustmentType;
|
|
7
7
|
amount?: string | null;
|
|
8
8
|
proration?: ITransactionProrationResponse | null;
|
|
9
9
|
totals?: IAdjustmentItemTotals | null;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.2.
|
|
1
|
+
export declare const SDK_VERSION = "0.2.8";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paddle/paddle-node-sdk",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "0.2.8",
|
|
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",
|
|
7
7
|
"scripts": {
|
|
@@ -13,12 +13,15 @@
|
|
|
13
13
|
"lint": "eslint --ext .ts,.tsx ./src",
|
|
14
14
|
"lint:fix": "eslint --ext .ts,.tsx ./src --fix",
|
|
15
15
|
"clean": "rm -rf ./dist",
|
|
16
|
-
"release:beta": "yarn version --prerelease --preid beta --no-git-tag-version --no-commit-hooks"
|
|
16
|
+
"release:beta": "yarn version --prerelease --preid beta --no-git-tag-version --no-commit-hooks",
|
|
17
|
+
"publish:beta": "yarn publish --tag beta",
|
|
18
|
+
"publish:latest": "yarn publish"
|
|
17
19
|
},
|
|
18
20
|
"files": [
|
|
19
21
|
"dist"
|
|
20
22
|
],
|
|
21
23
|
"keywords": [
|
|
24
|
+
"Paddle",
|
|
22
25
|
"SDK"
|
|
23
26
|
],
|
|
24
27
|
"author": "paddle.com",
|