@paddle/paddle-node-sdk 1.5.1 → 1.6.0
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 +16 -0
- package/dist/cjs/entities/adjustment/adjustment-credit-note-pdf.js +9 -0
- package/dist/cjs/entities/adjustment/index.js +1 -0
- package/dist/cjs/enums/shared/disposition.js +2 -0
- package/dist/cjs/enums/shared/index.js +1 -0
- package/dist/cjs/internal/base/query-parameters.js +4 -1
- package/dist/cjs/resources/adjustments/index.js +12 -0
- package/dist/cjs/resources/adjustments/operations/get-adjustment-credit-note-query-parameters.js +2 -0
- package/dist/cjs/resources/adjustments/operations/index.js +1 -0
- package/dist/cjs/resources/notification-settings/index.js +3 -2
- package/dist/cjs/resources/notification-settings/operations/index.js +1 -0
- package/dist/cjs/resources/notification-settings/operations/list-notification-settings-query-parameters.js +2 -0
- package/dist/cjs/resources/transactions/index.js +3 -2
- package/dist/cjs/resources/transactions/operations/get-transaction-invoice-pdf-query-parameters.js +2 -0
- package/dist/cjs/resources/transactions/operations/index.js +1 -0
- package/dist/cjs/types/adjustment/adjustment-credit-note-pdf.js +2 -0
- package/dist/cjs/types/adjustment/index.js +1 -0
- package/dist/cjs/types/subscription/index.js +1 -0
- package/dist/cjs/types/subscription/subscription-update-non-catalog-price-request.js +2 -0
- package/dist/cjs/version.js +1 -1
- package/dist/esm/entities/adjustment/adjustment-credit-note-pdf.js +5 -0
- package/dist/esm/entities/adjustment/index.js +1 -0
- package/dist/esm/enums/shared/disposition.js +1 -0
- package/dist/esm/enums/shared/index.js +1 -0
- package/dist/esm/internal/base/query-parameters.js +4 -1
- package/dist/esm/resources/adjustments/index.js +14 -2
- package/dist/esm/resources/adjustments/operations/get-adjustment-credit-note-query-parameters.js +1 -0
- package/dist/esm/resources/adjustments/operations/index.js +1 -0
- package/dist/esm/resources/notification-settings/index.js +4 -3
- package/dist/esm/resources/notification-settings/operations/index.js +1 -0
- package/dist/esm/resources/notification-settings/operations/list-notification-settings-query-parameters.js +1 -0
- package/dist/esm/resources/transactions/index.js +3 -2
- package/dist/esm/resources/transactions/operations/get-transaction-invoice-pdf-query-parameters.js +1 -0
- package/dist/esm/resources/transactions/operations/index.js +1 -0
- package/dist/esm/types/adjustment/adjustment-credit-note-pdf.js +1 -0
- package/dist/esm/types/adjustment/index.js +1 -0
- package/dist/esm/types/subscription/index.js +1 -0
- package/dist/esm/types/subscription/subscription-update-non-catalog-price-request.js +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/entities/adjustment/adjustment-credit-note-pdf.d.ts +5 -0
- package/dist/types/entities/adjustment/index.d.ts +1 -0
- package/dist/types/enums/shared/disposition.d.ts +1 -0
- package/dist/types/enums/shared/index.d.ts +1 -0
- package/dist/types/resources/adjustments/index.d.ts +3 -2
- package/dist/types/resources/adjustments/operations/get-adjustment-credit-note-query-parameters.d.ts +4 -0
- package/dist/types/resources/adjustments/operations/index.d.ts +1 -0
- package/dist/types/resources/notification-settings/index.d.ts +2 -2
- package/dist/types/resources/notification-settings/operations/index.d.ts +1 -0
- package/dist/types/resources/notification-settings/operations/list-notification-settings-query-parameters.d.ts +6 -0
- package/dist/types/resources/transactions/index.d.ts +2 -2
- package/dist/types/resources/transactions/operations/get-transaction-invoice-pdf-query-parameters.d.ts +4 -0
- package/dist/types/resources/transactions/operations/index.d.ts +1 -0
- package/dist/types/types/adjustment/adjustment-credit-note-pdf.d.ts +3 -0
- package/dist/types/types/adjustment/index.d.ts +1 -0
- package/dist/types/types/events/events-response.d.ts +1 -1
- package/dist/types/types/subscription/index.d.ts +1 -0
- package/dist/types/types/subscription/subscription-update-item.d.ts +12 -2
- package/dist/types/types/subscription/subscription-update-non-catalog-price-request.d.ts +13 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,22 @@ 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.6.0 - 2024-09-16
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Added `adjustments.getCreditNotePDF()` to [get a credit note for an adjustment](https://developer.paddle.com/api-reference/adjustments/get-credit-note-pdf?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
20
|
+
- Added `disposition` query parameter to `adjustments.getCreditNotePDF()` and `transactions.getInvoicePDF()` operations, see [related changelog](https://developer.paddle.com/changelog/2024/invoice-pdf-open-in-browser?utm_source=dx&utm_medium=paddle-node-sdk).
|
|
21
|
+
- Added pagination support to `notificationSettings.list()` operation, see [related changelog](https://developer.paddle.com/changelog/2024/notification-settings-pagination?utm_source=dx&utm_medium=paddle-node-sdk).
|
|
22
|
+
- Added support for Non-catalog products and prices to the `subscriptions.update()` and `subscriptions.previewUpdate()` operations, see [related changelog](https://developer.paddle.com/changelog/2024/add-custom-items-subscription?utm_source=dx&utm_medium=paddle-node-sdk).
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Marked `notification_id` as optional in `IEventsResponse` interface.
|
|
27
|
+
- Fixed a bug where query parameters with false values were not passed correctly to the API.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
15
31
|
## 1.5.1 - 2024-09-10
|
|
16
32
|
|
|
17
33
|
### Fixed
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdjustmentCreditNotePDF = void 0;
|
|
4
|
+
class AdjustmentCreditNotePDF {
|
|
5
|
+
constructor(adjustment) {
|
|
6
|
+
this.url = adjustment.url;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.AdjustmentCreditNotePDF = AdjustmentCreditNotePDF;
|
|
@@ -20,3 +20,4 @@ __exportStar(require("./adjustment-item"), exports);
|
|
|
20
20
|
__exportStar(require("./adjustment"), exports);
|
|
21
21
|
__exportStar(require("./adjustment-collection"), exports);
|
|
22
22
|
__exportStar(require("./adjustment-item-totals"), exports);
|
|
23
|
+
__exportStar(require("./adjustment-credit-note-pdf"), exports);
|
|
@@ -29,3 +29,4 @@ __exportStar(require("./error-code"), exports);
|
|
|
29
29
|
__exportStar(require("./payment-type"), exports);
|
|
30
30
|
__exportStar(require("./catalog-type"), exports);
|
|
31
31
|
__exportStar(require("./available-payment-methods"), exports);
|
|
32
|
+
__exportStar(require("./disposition"), exports);
|
|
@@ -6,6 +6,9 @@ function convertCamelCaseToSnakeCase(input) {
|
|
|
6
6
|
return p1.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase() + '_' + p2.toLowerCase();
|
|
7
7
|
});
|
|
8
8
|
}
|
|
9
|
+
function isValidValue(value) {
|
|
10
|
+
return value !== undefined && value !== null && value !== '';
|
|
11
|
+
}
|
|
9
12
|
class QueryParameters {
|
|
10
13
|
constructor(queryParameters) {
|
|
11
14
|
this.queryParameters = queryParameters;
|
|
@@ -14,7 +17,7 @@ class QueryParameters {
|
|
|
14
17
|
const urlSearchParam = new URLSearchParams();
|
|
15
18
|
for (const key in this.queryParameters) {
|
|
16
19
|
const value = this.queryParameters[key];
|
|
17
|
-
if (key && value) {
|
|
20
|
+
if (key && isValidValue(value)) {
|
|
18
21
|
urlSearchParam.append(convertCamelCaseToSnakeCase(key), `${value}`);
|
|
19
22
|
}
|
|
20
23
|
}
|
|
@@ -29,6 +29,7 @@ const base_1 = require("../../internal/base");
|
|
|
29
29
|
const AdjustmentPaths = {
|
|
30
30
|
list: '/adjustments',
|
|
31
31
|
create: '/adjustments',
|
|
32
|
+
getCreditNotePDF: '/adjustments/{adjustment_id}/credit-note',
|
|
32
33
|
};
|
|
33
34
|
__exportStar(require("./operations"), exports);
|
|
34
35
|
class AdjustmentsResource extends base_1.BaseResource {
|
|
@@ -43,5 +44,16 @@ class AdjustmentsResource extends base_1.BaseResource {
|
|
|
43
44
|
return new entities_1.Adjustment(data);
|
|
44
45
|
});
|
|
45
46
|
}
|
|
47
|
+
getCreditNotePDF(adjustmentId, queryParams) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const urlWithPathParams = new base_1.PathParameters(AdjustmentPaths.getCreditNotePDF, {
|
|
50
|
+
adjustment_id: adjustmentId,
|
|
51
|
+
}).deriveUrl();
|
|
52
|
+
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
53
|
+
const response = yield this.client.get(urlWithPathParams + queryParameters.toQueryString());
|
|
54
|
+
const data = this.handleResponse(response);
|
|
55
|
+
return new entities_1.AdjustmentCreditNotePDF(data);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
46
58
|
}
|
|
47
59
|
exports.AdjustmentsResource = AdjustmentsResource;
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./list-adjustment-query-parameters"), exports);
|
|
18
18
|
__exportStar(require("./create-adjustment-request-body"), exports);
|
|
19
|
+
__exportStar(require("./get-adjustment-credit-note-query-parameters"), exports);
|
|
@@ -35,9 +35,10 @@ const NotificationSettingsPaths = {
|
|
|
35
35
|
};
|
|
36
36
|
__exportStar(require("./operations"), exports);
|
|
37
37
|
class NotificationSettingsResource extends base_1.BaseResource {
|
|
38
|
-
list() {
|
|
38
|
+
list(queryParams) {
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const
|
|
40
|
+
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
41
|
+
const response = yield this.client.get(NotificationSettingsPaths.list + queryParameters.toQueryString());
|
|
41
42
|
const data = this.handleResponse(response);
|
|
42
43
|
return data.map((notificationSetting) => new entities_1.NotificationSettings(notificationSetting));
|
|
43
44
|
});
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./create-notification-settings-request-body"), exports);
|
|
18
18
|
__exportStar(require("./update-notification-settings-request-body"), exports);
|
|
19
|
+
__exportStar(require("./list-notification-settings-query-parameters"), exports);
|
|
@@ -70,12 +70,13 @@ class TransactionsResource extends base_1.BaseResource {
|
|
|
70
70
|
return new entities_1.Transaction(data);
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
getInvoicePDF(transactionId) {
|
|
73
|
+
getInvoicePDF(transactionId, queryParams) {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
75
76
|
const urlWithPathParams = new base_1.PathParameters(TransactionPaths.getInvoicePDF, {
|
|
76
77
|
transaction_id: transactionId,
|
|
77
78
|
}).deriveUrl();
|
|
78
|
-
const response = yield this.client.get(urlWithPathParams);
|
|
79
|
+
const response = yield this.client.get(urlWithPathParams + queryParameters.toQueryString());
|
|
79
80
|
const data = this.handleResponse(response);
|
|
80
81
|
return new entities_1.TransactionInvoicePDF(data);
|
|
81
82
|
});
|
|
@@ -21,3 +21,4 @@ __exportStar(require("./create-transaction-request-body"), exports);
|
|
|
21
21
|
__exportStar(require("./get-transaction-query-parameters"), exports);
|
|
22
22
|
__exportStar(require("./update-transaction-request-body"), exports);
|
|
23
23
|
__exportStar(require("./transaction-preview-request-body"), exports);
|
|
24
|
+
__exportStar(require("./get-transaction-invoice-pdf-query-parameters"), exports);
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./adjustments-time-period-response"), exports);
|
|
|
18
18
|
__exportStar(require("./adjustments-proration-response"), exports);
|
|
19
19
|
__exportStar(require("./adjustment-item-response"), exports);
|
|
20
20
|
__exportStar(require("./adjustment-response"), exports);
|
|
21
|
+
__exportStar(require("./adjustment-credit-note-pdf"), exports);
|
|
@@ -26,3 +26,4 @@ __exportStar(require("./subscription-response"), exports);
|
|
|
26
26
|
__exportStar(require("./subscription-preview-response"), exports);
|
|
27
27
|
__exportStar(require("./subscription-preview-update-summary"), exports);
|
|
28
28
|
__exportStar(require("./subscription-result-response"), exports);
|
|
29
|
+
__exportStar(require("./subscription-update-non-catalog-price-request"), exports);
|
package/dist/cjs/version.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,9 @@ function convertCamelCaseToSnakeCase(input) {
|
|
|
3
3
|
return p1.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase() + '_' + p2.toLowerCase();
|
|
4
4
|
});
|
|
5
5
|
}
|
|
6
|
+
function isValidValue(value) {
|
|
7
|
+
return value !== undefined && value !== null && value !== '';
|
|
8
|
+
}
|
|
6
9
|
export class QueryParameters {
|
|
7
10
|
constructor(queryParameters) {
|
|
8
11
|
this.queryParameters = queryParameters;
|
|
@@ -11,7 +14,7 @@ export class QueryParameters {
|
|
|
11
14
|
const urlSearchParam = new URLSearchParams();
|
|
12
15
|
for (const key in this.queryParameters) {
|
|
13
16
|
const value = this.queryParameters[key];
|
|
14
|
-
if (key && value) {
|
|
17
|
+
if (key && isValidValue(value)) {
|
|
15
18
|
urlSearchParam.append(convertCamelCaseToSnakeCase(key), `${value}`);
|
|
16
19
|
}
|
|
17
20
|
}
|
|
@@ -7,11 +7,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { AdjustmentCollection,
|
|
11
|
-
import { BaseResource, QueryParameters } from '../../internal/base';
|
|
10
|
+
import { Adjustment, AdjustmentCollection, AdjustmentCreditNotePDF } from '../../entities';
|
|
11
|
+
import { BaseResource, PathParameters, QueryParameters } from '../../internal/base';
|
|
12
12
|
const AdjustmentPaths = {
|
|
13
13
|
list: '/adjustments',
|
|
14
14
|
create: '/adjustments',
|
|
15
|
+
getCreditNotePDF: '/adjustments/{adjustment_id}/credit-note',
|
|
15
16
|
};
|
|
16
17
|
export * from './operations';
|
|
17
18
|
export class AdjustmentsResource extends BaseResource {
|
|
@@ -26,4 +27,15 @@ export class AdjustmentsResource extends BaseResource {
|
|
|
26
27
|
return new Adjustment(data);
|
|
27
28
|
});
|
|
28
29
|
}
|
|
30
|
+
getCreditNotePDF(adjustmentId, queryParams) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const urlWithPathParams = new PathParameters(AdjustmentPaths.getCreditNotePDF, {
|
|
33
|
+
adjustment_id: adjustmentId,
|
|
34
|
+
}).deriveUrl();
|
|
35
|
+
const queryParameters = new QueryParameters(queryParams);
|
|
36
|
+
const response = yield this.client.get(urlWithPathParams + queryParameters.toQueryString());
|
|
37
|
+
const data = this.handleResponse(response);
|
|
38
|
+
return new AdjustmentCreditNotePDF(data);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
29
41
|
}
|
package/dist/esm/resources/adjustments/operations/get-adjustment-credit-note-query-parameters.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { BaseResource, PathParameters } from '../../internal/base';
|
|
10
|
+
import { BaseResource, PathParameters, QueryParameters } from '../../internal/base';
|
|
11
11
|
import { NotificationSettings } from '../../entities';
|
|
12
12
|
const NotificationSettingsPaths = {
|
|
13
13
|
list: '/notification-settings',
|
|
@@ -18,9 +18,10 @@ const NotificationSettingsPaths = {
|
|
|
18
18
|
};
|
|
19
19
|
export * from './operations';
|
|
20
20
|
export class NotificationSettingsResource extends BaseResource {
|
|
21
|
-
list() {
|
|
21
|
+
list(queryParams) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const
|
|
23
|
+
const queryParameters = new QueryParameters(queryParams);
|
|
24
|
+
const response = yield this.client.get(NotificationSettingsPaths.list + queryParameters.toQueryString());
|
|
24
25
|
const data = this.handleResponse(response);
|
|
25
26
|
return data.map((notificationSetting) => new NotificationSettings(notificationSetting));
|
|
26
27
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -53,12 +53,13 @@ export class TransactionsResource extends BaseResource {
|
|
|
53
53
|
return new Transaction(data);
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
getInvoicePDF(transactionId) {
|
|
56
|
+
getInvoicePDF(transactionId, queryParams) {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const queryParameters = new QueryParameters(queryParams);
|
|
58
59
|
const urlWithPathParams = new PathParameters(TransactionPaths.getInvoicePDF, {
|
|
59
60
|
transaction_id: transactionId,
|
|
60
61
|
}).deriveUrl();
|
|
61
|
-
const response = yield this.client.get(urlWithPathParams);
|
|
62
|
+
const response = yield this.client.get(urlWithPathParams + queryParameters.toQueryString());
|
|
62
63
|
const data = this.handleResponse(response);
|
|
63
64
|
return new TransactionInvoicePDF(data);
|
|
64
65
|
});
|
package/dist/esm/resources/transactions/operations/get-transaction-invoice-pdf-query-parameters.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,3 +5,4 @@ export * from './create-transaction-request-body';
|
|
|
5
5
|
export * from './get-transaction-query-parameters';
|
|
6
6
|
export * from './update-transaction-request-body';
|
|
7
7
|
export * from './transaction-preview-request-body';
|
|
8
|
+
export * from './get-transaction-invoice-pdf-query-parameters';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = '1.
|
|
1
|
+
export const SDK_VERSION = '1.6.0';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Disposition = 'attachment' | 'inline';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AdjustmentCollection,
|
|
1
|
+
import { Adjustment, AdjustmentCollection, AdjustmentCreditNotePDF } from '../../entities';
|
|
2
2
|
import { BaseResource } from '../../internal/base';
|
|
3
|
-
import { type CreateAdjustmentRequestBody, type ListAdjustmentQueryParameters } from './operations';
|
|
3
|
+
import { type CreateAdjustmentRequestBody, type ListAdjustmentQueryParameters, type GetAdjustmentCreditNoteQueryParameters } from './operations';
|
|
4
4
|
export * from './operations';
|
|
5
5
|
export declare class AdjustmentsResource extends BaseResource {
|
|
6
6
|
list(queryParams?: ListAdjustmentQueryParameters): AdjustmentCollection;
|
|
7
7
|
create(createAdjustmentParameters: CreateAdjustmentRequestBody): Promise<Adjustment>;
|
|
8
|
+
getCreditNotePDF(adjustmentId: string, queryParams?: GetAdjustmentCreditNoteQueryParameters): Promise<AdjustmentCreditNotePDF>;
|
|
8
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseResource } from '../../internal/base';
|
|
2
2
|
import { NotificationSettings } from '../../entities';
|
|
3
|
-
import { type CreateNotificationSettingsRequestBody, type UpdateNotificationSettingsRequestBody } from './operations';
|
|
3
|
+
import { type CreateNotificationSettingsRequestBody, type ListNotificationSettingsQueryParameters, type UpdateNotificationSettingsRequestBody } from './operations';
|
|
4
4
|
export * from './operations';
|
|
5
5
|
export declare class NotificationSettingsResource extends BaseResource {
|
|
6
|
-
list(): Promise<NotificationSettings[]>;
|
|
6
|
+
list(queryParams?: ListNotificationSettingsQueryParameters): Promise<NotificationSettings[]>;
|
|
7
7
|
create(createNotificationSettings: CreateNotificationSettingsRequestBody): Promise<NotificationSettings>;
|
|
8
8
|
get(notificationId: string): Promise<NotificationSettings>;
|
|
9
9
|
update(notificationId: string, updateNotificationSettings: UpdateNotificationSettingsRequestBody): Promise<NotificationSettings>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Transaction, TransactionCollection, TransactionInvoicePDF, TransactionPreview } from '../../entities';
|
|
2
2
|
import { BaseResource } from '../../internal/base';
|
|
3
|
-
import { type CreateTransactionQueryParameters, type CreateTransactionRequestBody, type GetTransactionQueryParameters, type ListTransactionQueryParameters, type TransactionPreviewRequestBody, type UpdateTransactionQueryParameters, type UpdateTransactionRequestBody } from './operations';
|
|
3
|
+
import { type CreateTransactionQueryParameters, type CreateTransactionRequestBody, type GetTransactionInvoicePdfQueryParameters, type GetTransactionQueryParameters, type ListTransactionQueryParameters, type TransactionPreviewRequestBody, type UpdateTransactionQueryParameters, type UpdateTransactionRequestBody } from './operations';
|
|
4
4
|
export * from './operations';
|
|
5
5
|
export declare class TransactionsResource extends BaseResource {
|
|
6
6
|
list(queryParams?: ListTransactionQueryParameters): TransactionCollection;
|
|
7
7
|
create(createTransactionParameters: CreateTransactionRequestBody, queryParams?: CreateTransactionQueryParameters): Promise<Transaction>;
|
|
8
8
|
update(transactionId: string, updateTransaction: UpdateTransactionRequestBody, queryParams?: UpdateTransactionQueryParameters): Promise<Transaction>;
|
|
9
9
|
get(transactionId: string, queryParams?: GetTransactionQueryParameters): Promise<Transaction>;
|
|
10
|
-
getInvoicePDF(transactionId: string): Promise<TransactionInvoicePDF>;
|
|
10
|
+
getInvoicePDF(transactionId: string, queryParams?: GetTransactionInvoicePdfQueryParameters): Promise<TransactionInvoicePDF>;
|
|
11
11
|
preview(previewTransactionParameters: TransactionPreviewRequestBody): Promise<TransactionPreview>;
|
|
12
12
|
}
|
|
@@ -5,3 +5,4 @@ export * from './create-transaction-request-body';
|
|
|
5
5
|
export * from './get-transaction-query-parameters';
|
|
6
6
|
export * from './update-transaction-request-body';
|
|
7
7
|
export * from './transaction-preview-request-body';
|
|
8
|
+
export * from './get-transaction-invoice-pdf-query-parameters';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type EventName, type IAddressNotificationResponse, type IAdjustmentNotificationResponse, type IBusinessNotificationResponse, type ICustomerNotificationResponse, type IDiscountNotificationResponse, type IPayoutNotificationResponse, type IPriceNotificationResponse, type IProductNotificationResponse, type IReportNotificationResponse, type ISubscriptionNotificationResponse, type ITransactionNotificationResponse } from '../../notifications';
|
|
2
2
|
export interface IEventsResponse<T = object> {
|
|
3
3
|
event_id: string;
|
|
4
|
-
notification_id: string;
|
|
4
|
+
notification_id: string | null;
|
|
5
5
|
event_type: string;
|
|
6
6
|
occurred_at: string;
|
|
7
7
|
data: T;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ISubscriptionUpdateItemCreateWithPriceRequest } from './subscription-update-non-catalog-price-request';
|
|
2
|
+
interface ISubscriptionUpdateBaseItem {
|
|
3
|
+
quantity: number;
|
|
4
|
+
}
|
|
5
|
+
interface ISubscriptionUpdateItemFromCatalog extends ISubscriptionUpdateBaseItem {
|
|
2
6
|
priceId: string;
|
|
3
|
-
|
|
7
|
+
price?: never;
|
|
8
|
+
}
|
|
9
|
+
interface ISubscriptionUpdateItemCreateWithPrice extends ISubscriptionUpdateBaseItem {
|
|
10
|
+
priceId?: never;
|
|
11
|
+
price: ISubscriptionUpdateItemCreateWithPriceRequest;
|
|
4
12
|
}
|
|
13
|
+
export type ISubscriptionUpdateItem = ISubscriptionUpdateItemFromCatalog | ISubscriptionUpdateItemCreateWithPrice;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CreatePriceRequestBody, type CreateProductRequestBody } from '../../resources';
|
|
2
|
+
interface ISubscriptionUpdateItemCreateWithPriceBaseRequest extends Omit<CreatePriceRequestBody, 'type' | 'productId'> {
|
|
3
|
+
}
|
|
4
|
+
interface ISubscriptionUpdateItemCreateWithProductId extends ISubscriptionUpdateItemCreateWithPriceBaseRequest {
|
|
5
|
+
productId: string;
|
|
6
|
+
product?: never;
|
|
7
|
+
}
|
|
8
|
+
interface ISubscriptionUpdateItemCreateWithProduct extends ISubscriptionUpdateItemCreateWithPriceBaseRequest {
|
|
9
|
+
productId?: never;
|
|
10
|
+
product: Omit<CreateProductRequestBody, 'type'>;
|
|
11
|
+
}
|
|
12
|
+
export type ISubscriptionUpdateItemCreateWithPriceRequest = ISubscriptionUpdateItemCreateWithProductId | ISubscriptionUpdateItemCreateWithProduct;
|
|
13
|
+
export {};
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.6.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paddle/paddle-node-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
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.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|