@paddle/paddle-node-sdk 1.5.0 → 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.
Files changed (60) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/entities/adjustment/adjustment-credit-note-pdf.js +9 -0
  3. package/dist/cjs/entities/adjustment/index.js +1 -0
  4. package/dist/cjs/enums/shared/disposition.js +2 -0
  5. package/dist/cjs/enums/shared/index.js +1 -0
  6. package/dist/cjs/internal/base/query-parameters.js +10 -6
  7. package/dist/cjs/resources/adjustments/index.js +12 -0
  8. package/dist/cjs/resources/adjustments/operations/get-adjustment-credit-note-query-parameters.js +2 -0
  9. package/dist/cjs/resources/adjustments/operations/index.js +1 -0
  10. package/dist/cjs/resources/notification-settings/index.js +3 -2
  11. package/dist/cjs/resources/notification-settings/operations/index.js +1 -0
  12. package/dist/cjs/resources/notification-settings/operations/list-notification-settings-query-parameters.js +2 -0
  13. package/dist/cjs/resources/transactions/index.js +3 -2
  14. package/dist/cjs/resources/transactions/operations/get-transaction-invoice-pdf-query-parameters.js +2 -0
  15. package/dist/cjs/resources/transactions/operations/index.js +1 -0
  16. package/dist/cjs/types/adjustment/adjustment-credit-note-pdf.js +2 -0
  17. package/dist/cjs/types/adjustment/index.js +1 -0
  18. package/dist/cjs/types/subscription/index.js +1 -0
  19. package/dist/cjs/types/subscription/subscription-update-non-catalog-price-request.js +2 -0
  20. package/dist/cjs/version.js +1 -1
  21. package/dist/esm/entities/adjustment/adjustment-credit-note-pdf.js +5 -0
  22. package/dist/esm/entities/adjustment/index.js +1 -0
  23. package/dist/esm/enums/shared/disposition.js +1 -0
  24. package/dist/esm/enums/shared/index.js +1 -0
  25. package/dist/esm/internal/base/query-parameters.js +10 -3
  26. package/dist/esm/resources/adjustments/index.js +14 -2
  27. package/dist/esm/resources/adjustments/operations/get-adjustment-credit-note-query-parameters.js +1 -0
  28. package/dist/esm/resources/adjustments/operations/index.js +1 -0
  29. package/dist/esm/resources/notification-settings/index.js +4 -3
  30. package/dist/esm/resources/notification-settings/operations/index.js +1 -0
  31. package/dist/esm/resources/notification-settings/operations/list-notification-settings-query-parameters.js +1 -0
  32. package/dist/esm/resources/transactions/index.js +3 -2
  33. package/dist/esm/resources/transactions/operations/get-transaction-invoice-pdf-query-parameters.js +1 -0
  34. package/dist/esm/resources/transactions/operations/index.js +1 -0
  35. package/dist/esm/types/adjustment/adjustment-credit-note-pdf.js +1 -0
  36. package/dist/esm/types/adjustment/index.js +1 -0
  37. package/dist/esm/types/subscription/index.js +1 -0
  38. package/dist/esm/types/subscription/subscription-update-non-catalog-price-request.js +1 -0
  39. package/dist/esm/version.js +1 -1
  40. package/dist/types/entities/adjustment/adjustment-credit-note-pdf.d.ts +5 -0
  41. package/dist/types/entities/adjustment/index.d.ts +1 -0
  42. package/dist/types/enums/shared/disposition.d.ts +1 -0
  43. package/dist/types/enums/shared/index.d.ts +1 -0
  44. package/dist/types/resources/adjustments/index.d.ts +3 -2
  45. package/dist/types/resources/adjustments/operations/get-adjustment-credit-note-query-parameters.d.ts +4 -0
  46. package/dist/types/resources/adjustments/operations/index.d.ts +1 -0
  47. package/dist/types/resources/notification-settings/index.d.ts +2 -2
  48. package/dist/types/resources/notification-settings/operations/index.d.ts +1 -0
  49. package/dist/types/resources/notification-settings/operations/list-notification-settings-query-parameters.d.ts +6 -0
  50. package/dist/types/resources/transactions/index.d.ts +2 -2
  51. package/dist/types/resources/transactions/operations/get-transaction-invoice-pdf-query-parameters.d.ts +4 -0
  52. package/dist/types/resources/transactions/operations/index.d.ts +1 -0
  53. package/dist/types/types/adjustment/adjustment-credit-note-pdf.d.ts +3 -0
  54. package/dist/types/types/adjustment/index.d.ts +1 -0
  55. package/dist/types/types/events/events-response.d.ts +1 -1
  56. package/dist/types/types/subscription/index.d.ts +1 -0
  57. package/dist/types/types/subscription/subscription-update-item.d.ts +12 -2
  58. package/dist/types/types/subscription/subscription-update-non-catalog-price-request.d.ts +13 -0
  59. package/dist/types/version.d.ts +1 -1
  60. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -12,6 +12,31 @@ 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
+
31
+ ## 1.5.1 - 2024-09-10
32
+
33
+ ### Fixed
34
+
35
+ - Fixed a bug where query parameters with special characters were not passed correctly to the API.
36
+ - Dependabot security updates.
37
+
38
+ ---
39
+
15
40
  ## 1.5.0 - 2024-08-16
16
41
 
17
42
  ### Added
@@ -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);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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);
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.QueryParameters = void 0;
7
- const snakeCase_1 = __importDefault(require("lodash/snakeCase"));
4
+ function convertCamelCaseToSnakeCase(input) {
5
+ return input.replace(/\b(\w+)([A-Z][a-z])/g, (_match, p1, p2) => {
6
+ return p1.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase() + '_' + p2.toLowerCase();
7
+ });
8
+ }
9
+ function isValidValue(value) {
10
+ return value !== undefined && value !== null && value !== '';
11
+ }
8
12
  class QueryParameters {
9
13
  constructor(queryParameters) {
10
14
  this.queryParameters = queryParameters;
@@ -13,8 +17,8 @@ class QueryParameters {
13
17
  const urlSearchParam = new URLSearchParams();
14
18
  for (const key in this.queryParameters) {
15
19
  const value = this.queryParameters[key];
16
- if (key && value) {
17
- urlSearchParam.append((0, snakeCase_1.default)(key), `${value}`);
20
+ if (key && isValidValue(value)) {
21
+ urlSearchParam.append(convertCamelCaseToSnakeCase(key), `${value}`);
18
22
  }
19
23
  }
20
24
  return '?' + urlSearchParam.toString();
@@ -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;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 response = yield this.client.get(NotificationSettingsPaths.list);
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);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
  });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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.5.0';
4
+ exports.SDK_VERSION = '1.6.0';
@@ -0,0 +1,5 @@
1
+ export class AdjustmentCreditNotePDF {
2
+ constructor(adjustment) {
3
+ this.url = adjustment.url;
4
+ }
5
+ }
@@ -4,3 +4,4 @@ export * from './adjustment-item';
4
4
  export * from './adjustment';
5
5
  export * from './adjustment-collection';
6
6
  export * from './adjustment-item-totals';
7
+ export * from './adjustment-credit-note-pdf';
@@ -0,0 +1 @@
1
+ export {};
@@ -13,3 +13,4 @@ export * from './error-code';
13
13
  export * from './payment-type';
14
14
  export * from './catalog-type';
15
15
  export * from './available-payment-methods';
16
+ export * from './disposition';
@@ -1,4 +1,11 @@
1
- import snakeCase from 'lodash/snakeCase';
1
+ function convertCamelCaseToSnakeCase(input) {
2
+ return input.replace(/\b(\w+)([A-Z][a-z])/g, (_match, p1, p2) => {
3
+ return p1.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase() + '_' + p2.toLowerCase();
4
+ });
5
+ }
6
+ function isValidValue(value) {
7
+ return value !== undefined && value !== null && value !== '';
8
+ }
2
9
  export class QueryParameters {
3
10
  constructor(queryParameters) {
4
11
  this.queryParameters = queryParameters;
@@ -7,8 +14,8 @@ export class QueryParameters {
7
14
  const urlSearchParam = new URLSearchParams();
8
15
  for (const key in this.queryParameters) {
9
16
  const value = this.queryParameters[key];
10
- if (key && value) {
11
- urlSearchParam.append(snakeCase(key), `${value}`);
17
+ if (key && isValidValue(value)) {
18
+ urlSearchParam.append(convertCamelCaseToSnakeCase(key), `${value}`);
12
19
  }
13
20
  }
14
21
  return '?' + urlSearchParam.toString();
@@ -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, Adjustment } from '../../entities';
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
  }
@@ -1,2 +1,3 @@
1
1
  export * from './list-adjustment-query-parameters';
2
2
  export * from './create-adjustment-request-body';
3
+ export * from './get-adjustment-credit-note-query-parameters';
@@ -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 response = yield this.client.get(NotificationSettingsPaths.list);
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
  });
@@ -1,2 +1,3 @@
1
1
  export * from './create-notification-settings-request-body';
2
2
  export * from './update-notification-settings-request-body';
3
+ export * from './list-notification-settings-query-parameters';
@@ -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
  });
@@ -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';
@@ -2,3 +2,4 @@ export * from './adjustments-time-period-response';
2
2
  export * from './adjustments-proration-response';
3
3
  export * from './adjustment-item-response';
4
4
  export * from './adjustment-response';
5
+ export * from './adjustment-credit-note-pdf';
@@ -10,3 +10,4 @@ export * from './subscription-response';
10
10
  export * from './subscription-preview-response';
11
11
  export * from './subscription-preview-update-summary';
12
12
  export * from './subscription-result-response';
13
+ export * from './subscription-update-non-catalog-price-request';
@@ -1 +1 @@
1
- export const SDK_VERSION = '1.5.0';
1
+ export const SDK_VERSION = '1.6.0';
@@ -0,0 +1,5 @@
1
+ import { type IAdjustmentCreditNotePDF } from '../../types';
2
+ export declare class AdjustmentCreditNotePDF {
3
+ readonly url: string;
4
+ constructor(adjustment: IAdjustmentCreditNotePDF);
5
+ }
@@ -4,3 +4,4 @@ export * from './adjustment-item';
4
4
  export * from './adjustment';
5
5
  export * from './adjustment-collection';
6
6
  export * from './adjustment-item-totals';
7
+ export * from './adjustment-credit-note-pdf';
@@ -0,0 +1 @@
1
+ export type Disposition = 'attachment' | 'inline';
@@ -13,3 +13,4 @@ export * from './error-code';
13
13
  export * from './payment-type';
14
14
  export * from './catalog-type';
15
15
  export * from './available-payment-methods';
16
+ export * from './disposition';
@@ -1,8 +1,9 @@
1
- import { AdjustmentCollection, Adjustment } from '../../entities';
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
  }
@@ -0,0 +1,4 @@
1
+ import { type Disposition } from '../../../enums';
2
+ export interface GetAdjustmentCreditNoteQueryParameters {
3
+ disposition?: Disposition;
4
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './list-adjustment-query-parameters';
2
2
  export * from './create-adjustment-request-body';
3
+ export * from './get-adjustment-credit-note-query-parameters';
@@ -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,2 +1,3 @@
1
1
  export * from './create-notification-settings-request-body';
2
2
  export * from './update-notification-settings-request-body';
3
+ export * from './list-notification-settings-query-parameters';
@@ -0,0 +1,6 @@
1
+ export interface ListNotificationSettingsQueryParameters {
2
+ after?: string;
3
+ perPage?: number;
4
+ orderBy?: string;
5
+ active?: boolean;
6
+ }
@@ -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
  }
@@ -0,0 +1,4 @@
1
+ import { type Disposition } from '../../../enums';
2
+ export interface GetTransactionInvoicePdfQueryParameters {
3
+ disposition?: Disposition;
4
+ }
@@ -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,3 @@
1
+ export interface IAdjustmentCreditNotePDF {
2
+ url: string;
3
+ }
@@ -2,3 +2,4 @@ export * from './adjustments-time-period-response';
2
2
  export * from './adjustments-proration-response';
3
3
  export * from './adjustment-item-response';
4
4
  export * from './adjustment-response';
5
+ export * from './adjustment-credit-note-pdf';
@@ -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;
@@ -10,3 +10,4 @@ export * from './subscription-response';
10
10
  export * from './subscription-preview-response';
11
11
  export * from './subscription-preview-update-summary';
12
12
  export * from './subscription-result-response';
13
+ export * from './subscription-update-non-catalog-price-request';
@@ -1,4 +1,14 @@
1
- export interface ISubscriptionUpdateItem {
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
- quantity?: number | null;
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 {};
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.5.0";
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.5.0",
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",