@paddle/paddle-node-sdk 0.2.3 → 0.2.5

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 (90) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/README.md +6 -3
  3. package/dist/entities/address/address.d.ts +2 -1
  4. package/dist/entities/address/address.js +2 -0
  5. package/dist/entities/business/business.d.ts +2 -1
  6. package/dist/entities/business/business.js +1 -0
  7. package/dist/entities/customer/customer.d.ts +2 -1
  8. package/dist/entities/customer/customer.js +2 -0
  9. package/dist/entities/discount/discount.d.ts +2 -1
  10. package/dist/entities/discount/discount.js +2 -0
  11. package/dist/entities/index.d.ts +1 -0
  12. package/dist/entities/index.js +1 -0
  13. package/dist/entities/report/index.d.ts +4 -0
  14. package/dist/entities/report/index.js +20 -0
  15. package/dist/entities/report/report-collection.d.ts +6 -0
  16. package/dist/entities/report/report-collection.js +11 -0
  17. package/dist/entities/report/report-csv.d.ts +5 -0
  18. package/dist/entities/report/report-csv.js +9 -0
  19. package/dist/entities/report/report-filters.d.ts +8 -0
  20. package/dist/entities/report/report-filters.js +12 -0
  21. package/dist/entities/report/report.d.ts +13 -0
  22. package/dist/entities/report/report.js +17 -0
  23. package/dist/entities/shared/transaction-payout-totals.d.ts +1 -0
  24. package/dist/entities/shared/transaction-payout-totals.js +1 -0
  25. package/dist/entities/shared/transaction-totals.d.ts +1 -0
  26. package/dist/entities/shared/transaction-totals.js +1 -0
  27. package/dist/entities/subscription/subscription-includes.d.ts +2 -1
  28. package/dist/entities/subscription/subscription-includes.js +1 -0
  29. package/dist/entities/subscription/subscription-preview.d.ts +2 -1
  30. package/dist/entities/subscription/subscription-preview.js +1 -0
  31. package/dist/entities/subscription/subscription.d.ts +2 -1
  32. package/dist/entities/subscription/subscription.js +1 -0
  33. package/dist/enums/index.d.ts +1 -0
  34. package/dist/enums/index.js +1 -0
  35. package/dist/enums/report/index.d.ts +4 -0
  36. package/dist/enums/report/index.js +20 -0
  37. package/dist/enums/report/report-filter-name.d.ts +1 -0
  38. package/dist/enums/report/report-filter-name.js +2 -0
  39. package/dist/enums/report/report-filter-operator.d.ts +1 -0
  40. package/dist/enums/report/report-filter-operator.js +2 -0
  41. package/dist/enums/report/report-status.d.ts +1 -0
  42. package/dist/enums/report/report-status.js +2 -0
  43. package/dist/enums/report/report-type.d.ts +1 -0
  44. package/dist/enums/report/report-type.js +2 -0
  45. package/dist/notifications/events/index.d.ts +1 -0
  46. package/dist/notifications/events/index.js +1 -0
  47. package/dist/notifications/events/report/index.d.ts +2 -0
  48. package/dist/notifications/events/report/index.js +18 -0
  49. package/dist/notifications/events/report/report-created-event.d.ts +9 -0
  50. package/dist/notifications/events/report/report-created-event.js +14 -0
  51. package/dist/notifications/events/report/report-updated-event.d.ts +9 -0
  52. package/dist/notifications/events/report/report-updated-event.js +14 -0
  53. package/dist/notifications/helpers/types.d.ts +6 -4
  54. package/dist/notifications/helpers/types.js +2 -0
  55. package/dist/notifications/helpers/webhooks.js +4 -0
  56. package/dist/paddle.d.ts +2 -1
  57. package/dist/paddle.js +1 -0
  58. package/dist/resources/index.d.ts +1 -0
  59. package/dist/resources/index.js +1 -0
  60. package/dist/resources/reports/index.d.ts +10 -0
  61. package/dist/resources/reports/index.js +69 -0
  62. package/dist/resources/reports/operations/create-report-request-object.d.ts +6 -0
  63. package/dist/resources/reports/operations/create-report-request-object.js +2 -0
  64. package/dist/resources/reports/operations/index.d.ts +2 -0
  65. package/dist/resources/reports/operations/index.js +18 -0
  66. package/dist/resources/reports/operations/list-report-query-parameters.d.ts +7 -0
  67. package/dist/resources/reports/operations/list-report-query-parameters.js +2 -0
  68. package/dist/resources/transactions/operations/list-transaction-query-parameters.d.ts +2 -1
  69. package/dist/types/address/address-response.d.ts +2 -1
  70. package/dist/types/business/business-response.d.ts +2 -1
  71. package/dist/types/customer/customer-response.d.ts +2 -1
  72. package/dist/types/discount/discount-response.d.ts +2 -1
  73. package/dist/types/events/events-response.d.ts +8 -1
  74. package/dist/types/index.d.ts +1 -0
  75. package/dist/types/index.js +1 -0
  76. package/dist/types/report/index.d.ts +3 -0
  77. package/dist/types/report/index.js +19 -0
  78. package/dist/types/report/report-filters.d.ts +6 -0
  79. package/dist/types/report/report-filters.js +2 -0
  80. package/dist/types/report/report.d.ts +11 -0
  81. package/dist/types/report/report.js +2 -0
  82. package/dist/types/report/reports-csv.d.ts +3 -0
  83. package/dist/types/report/reports-csv.js +2 -0
  84. package/dist/types/shared/transaction-payout-totals-response.d.ts +1 -0
  85. package/dist/types/shared/transaction-totals-response.d.ts +1 -0
  86. package/dist/types/subscription/subscription-preview-response.d.ts +2 -1
  87. package/dist/types/subscription/subscription-response.d.ts +2 -1
  88. package/dist/version.d.ts +1 -1
  89. package/dist/version.js +1 -1
  90. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,27 @@ 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.5 - 2023-12-15
12
+
13
+ ### Added
14
+
15
+ - Added `reports.list()` to [list reports](https://developer.paddle.com/api-reference/reports/list-reports?utm_source=dx&utm_medium=paddle-node-sdk)
16
+ - Added `reports.create()` to [create a new report](https://developer.paddle.com/api-reference/reports/create-report?utm_source=dx&utm_medium=paddle-node-sdk)
17
+ - Added `reports.get()` to [get a report](https://developer.paddle.com/api-reference/reports/get-report?utm_source=dx&utm_medium=paddle-node-sdk)
18
+ - Added `reports.getReportCsv()` to [get a CSV file for a report](https://developer.paddle.com/api-reference/reports/get-report-csv?utm_source=dx&utm_medium=paddle-node-sdk)
19
+
20
+ ---
21
+
22
+ ## 0.2.4 - 2023-12-14
23
+
24
+ ### Changed
25
+
26
+ - Added `importMeta` to address, business, customer, discount and subscription entities
27
+ - Added `creditToBalance` to `transaction.details.payoutTotals` and `transaction.details.totals`
28
+ - Added `origin` query parameter to list transactions, see [related changelog](https://developer.paddle.com/changelog/2023/filter-transactions-origin?utm_source=dx&utm_medium=paddle-node-sdk).
29
+
30
+ ---
31
+
11
32
  ## 0.2.3 - 2023-12-12
12
33
 
13
34
  ### Added
@@ -23,7 +44,6 @@ Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx
23
44
  - Added `notifications.replay()` to [replay a notification](https://developer.paddle.com/api-reference/notifications/replay-notification?utm_source=dx&utm_medium=paddle-node-sdk)
24
45
  - Added `notifications.getLogs()` to [get all logs for a notification](https://developer.paddle.com/api-reference/notification-logs/list-notification-logs?utm_source=dx&utm_medium=paddle-node-sdk)
25
46
 
26
-
27
47
  ### Fixed
28
48
 
29
49
  - Fixed incorrect type of `action` in `subscriptions.scheduled_change`
package/README.md CHANGED
@@ -269,9 +269,7 @@ app.listen(3000)
269
269
 
270
270
  ## Feature parity
271
271
 
272
- While in early access, not all operations in the Paddle API are available in our Node.js SDK. We're working on complete feature parity for our final release.
273
-
274
- This table shows which operations are available as of the latest release.
272
+ The Node.js SDK has complete feature parity with the Paddle API. All operations in the Paddle API are supported.
275
273
 
276
274
  | Paddle API operation | Support |
277
275
  |----------------------------------------------|:--------:|
@@ -330,6 +328,11 @@ This table shows which operations are available as of the latest release.
330
328
  | Create an adjustment | ✅ |
331
329
  | **Pricing preview** | **Full** |
332
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 | ✅ |
333
336
  | **Event types** | **Full** |
334
337
  | List event types | ✅ |
335
338
  | **Events** | **Full** |
@@ -1,4 +1,4 @@
1
- import { type CustomData } from '../index';
1
+ import { type CustomData, ImportMeta } from '../index';
2
2
  import { type CountryCode, type Status } from '../../enums';
3
3
  import { type IAddressResponse } from '../../types';
4
4
  export declare class Address {
@@ -14,5 +14,6 @@ export declare class Address {
14
14
  readonly status: Status;
15
15
  readonly createdAt: string;
16
16
  readonly updatedAt: string;
17
+ readonly importMeta: ImportMeta | null;
17
18
  constructor(address: IAddressResponse);
18
19
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Address = void 0;
4
+ const index_1 = require("../index");
4
5
  class Address {
5
6
  constructor(address) {
6
7
  this.id = address.id;
@@ -15,6 +16,7 @@ class Address {
15
16
  this.status = address.status;
16
17
  this.createdAt = address.created_at;
17
18
  this.updatedAt = address.updated_at;
19
+ this.importMeta = address.import_meta ? new index_1.ImportMeta(address.import_meta) : null;
18
20
  }
19
21
  }
20
22
  exports.Address = Address;
@@ -1,4 +1,4 @@
1
- import { Contacts, type CustomData } from '../index';
1
+ import { Contacts, type CustomData, ImportMeta } from '../index';
2
2
  import { type Status } from '../../enums';
3
3
  import { type IBusinessResponse } from '../../types';
4
4
  export declare class Business {
@@ -11,5 +11,6 @@ export declare class Business {
11
11
  readonly createdAt: string;
12
12
  readonly updatedAt: string;
13
13
  readonly customData: CustomData | null;
14
+ readonly importMeta: ImportMeta | null;
14
15
  constructor(business: IBusinessResponse);
15
16
  }
@@ -13,6 +13,7 @@ class Business {
13
13
  this.createdAt = business.created_at;
14
14
  this.updatedAt = business.updated_at;
15
15
  this.customData = business.custom_data ? business.custom_data : null;
16
+ this.importMeta = business.import_meta ? new index_1.ImportMeta(business.import_meta) : null;
16
17
  }
17
18
  }
18
19
  exports.Business = Business;
@@ -1,4 +1,4 @@
1
- import { type CustomData } from '../index';
1
+ import { type CustomData, ImportMeta } from '../index';
2
2
  import { type Status } from '../../enums';
3
3
  import { type ICustomerResponse } from '../../types';
4
4
  export declare class Customer {
@@ -11,5 +11,6 @@ export declare class Customer {
11
11
  readonly locale: string;
12
12
  readonly createdAt: string;
13
13
  readonly updatedAt: string;
14
+ readonly importMeta: ImportMeta | null;
14
15
  constructor(customer: ICustomerResponse);
15
16
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Customer = void 0;
4
+ const index_1 = require("../index");
4
5
  class Customer {
5
6
  constructor(customer) {
6
7
  this.id = customer.id;
@@ -12,6 +13,7 @@ class Customer {
12
13
  this.locale = customer.locale;
13
14
  this.createdAt = customer.created_at;
14
15
  this.updatedAt = customer.updated_at;
16
+ this.importMeta = customer.import_meta ? new index_1.ImportMeta(customer.import_meta) : null;
15
17
  }
16
18
  }
17
19
  exports.Customer = Customer;
@@ -1,6 +1,6 @@
1
1
  import { type CurrencyCode, type DiscountStatus, type DiscountType } from '../../enums';
2
2
  import { type IDiscountResponse } from '../../types';
3
- import { type CustomData } from '../index';
3
+ import { type CustomData, ImportMeta } from '../index';
4
4
  export declare class Discount {
5
5
  readonly id: string;
6
6
  readonly status: DiscountStatus;
@@ -19,5 +19,6 @@ export declare class Discount {
19
19
  readonly timesUsed: number | null;
20
20
  readonly createdAt: string;
21
21
  readonly updatedAt: string;
22
+ readonly importMeta: ImportMeta | null;
22
23
  constructor(discount: IDiscountResponse);
23
24
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Discount = void 0;
4
+ const index_1 = require("../index");
4
5
  class Discount {
5
6
  constructor(discount) {
6
7
  var _a;
@@ -21,6 +22,7 @@ class Discount {
21
22
  this.timesUsed = (_a = discount.times_used) !== null && _a !== void 0 ? _a : null;
22
23
  this.createdAt = discount.created_at;
23
24
  this.updatedAt = discount.updated_at;
25
+ this.importMeta = discount.import_meta ? new index_1.ImportMeta(discount.import_meta) : null;
24
26
  }
25
27
  }
26
28
  exports.Discount = Discount;
@@ -13,4 +13,5 @@ export * from './payout';
13
13
  export * from './event-types';
14
14
  export * from './notification-settings';
15
15
  export * from './notifications';
16
+ export * from './report';
16
17
  export type CustomData = object;
@@ -29,3 +29,4 @@ __exportStar(require("./payout"), exports);
29
29
  __exportStar(require("./event-types"), exports);
30
30
  __exportStar(require("./notification-settings"), exports);
31
31
  __exportStar(require("./notifications"), exports);
32
+ __exportStar(require("./report"), exports);
@@ -0,0 +1,4 @@
1
+ export * from './report-filters';
2
+ export * from './report';
3
+ export * from './report-csv';
4
+ export * from './report-collection';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./report-filters"), exports);
18
+ __exportStar(require("./report"), exports);
19
+ __exportStar(require("./report-csv"), exports);
20
+ __exportStar(require("./report-collection"), exports);
@@ -0,0 +1,6 @@
1
+ import { Report } from '../../entities';
2
+ import { type IReportResponse } from '../../types';
3
+ import { Collection } from '../../internal/base';
4
+ export declare class ReportCollection extends Collection<IReportResponse, Report> {
5
+ fromJson(data: IReportResponse): Report;
6
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportCollection = void 0;
4
+ const entities_1 = require("../../entities");
5
+ const base_1 = require("../../internal/base");
6
+ class ReportCollection extends base_1.Collection {
7
+ fromJson(data) {
8
+ return new entities_1.Report(data);
9
+ }
10
+ }
11
+ exports.ReportCollection = ReportCollection;
@@ -0,0 +1,5 @@
1
+ import { type IReportCsvResponse } from '../../types';
2
+ export declare class ReportCsv {
3
+ readonly url: string;
4
+ constructor(response: IReportCsvResponse);
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportCsv = void 0;
4
+ class ReportCsv {
5
+ constructor(response) {
6
+ this.url = response.url;
7
+ }
8
+ }
9
+ exports.ReportCsv = ReportCsv;
@@ -0,0 +1,8 @@
1
+ import { type IReportFilters } from '../../types';
2
+ import { type ReportFilterName, type ReportFilterOperator } from '../../enums';
3
+ export declare class ReportFilters {
4
+ readonly name: ReportFilterName;
5
+ readonly operator: null | ReportFilterOperator;
6
+ readonly value: string[] | string;
7
+ constructor(reportFiltersResponse: IReportFilters);
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportFilters = void 0;
4
+ class ReportFilters {
5
+ constructor(reportFiltersResponse) {
6
+ var _a;
7
+ this.name = reportFiltersResponse.name;
8
+ this.operator = (_a = reportFiltersResponse.operator) !== null && _a !== void 0 ? _a : null;
9
+ this.value = reportFiltersResponse.value;
10
+ }
11
+ }
12
+ exports.ReportFilters = ReportFilters;
@@ -0,0 +1,13 @@
1
+ import { type IReportResponse } from '../../types';
2
+ import { ReportFilters } from '../index';
3
+ import { type ReportStatus, type ReportType } from '../../enums';
4
+ export declare class Report {
5
+ readonly id: string;
6
+ readonly status: ReportStatus;
7
+ readonly rows: number | null;
8
+ readonly type: ReportType;
9
+ readonly filters: ReportFilters[];
10
+ readonly expiresAt: string | null;
11
+ readonly createdAt: string;
12
+ constructor(reportResponse: IReportResponse);
13
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Report = void 0;
4
+ const index_1 = require("../index");
5
+ class Report {
6
+ constructor(reportResponse) {
7
+ var _a, _b, _c;
8
+ this.id = reportResponse.id;
9
+ this.status = reportResponse.status;
10
+ this.rows = (_a = reportResponse.rows) !== null && _a !== void 0 ? _a : null;
11
+ this.type = reportResponse.type;
12
+ this.filters = (_b = reportResponse.filters) === null || _b === void 0 ? void 0 : _b.map((filter) => new index_1.ReportFilters(filter));
13
+ this.expiresAt = (_c = reportResponse.expires_at) !== null && _c !== void 0 ? _c : null;
14
+ this.createdAt = reportResponse.created_at;
15
+ }
16
+ }
17
+ exports.Report = Report;
@@ -6,6 +6,7 @@ export declare class TransactionPayoutTotals {
6
6
  readonly tax: string;
7
7
  readonly total: string;
8
8
  readonly credit: string;
9
+ readonly creditToBalance: string;
9
10
  readonly balance: string;
10
11
  readonly grandTotal: string;
11
12
  readonly fee: string;
@@ -8,6 +8,7 @@ class TransactionPayoutTotals {
8
8
  this.tax = transactionPayoutTotals.tax;
9
9
  this.total = transactionPayoutTotals.total;
10
10
  this.credit = transactionPayoutTotals.credit;
11
+ this.creditToBalance = transactionPayoutTotals.credit_to_balance;
11
12
  this.balance = transactionPayoutTotals.balance;
12
13
  this.grandTotal = transactionPayoutTotals.grand_total;
13
14
  this.fee = transactionPayoutTotals.fee;
@@ -6,6 +6,7 @@ export declare class TransactionTotals {
6
6
  readonly tax: string;
7
7
  readonly total: string;
8
8
  readonly credit: string;
9
+ readonly creditToBalance: string;
9
10
  readonly balance: string;
10
11
  readonly grandTotal: string;
11
12
  readonly fee: string | null;
@@ -8,6 +8,7 @@ class TransactionTotals {
8
8
  this.tax = transactionTotals.tax;
9
9
  this.total = transactionTotals.total;
10
10
  this.credit = transactionTotals.credit;
11
+ this.creditToBalance = transactionTotals.credit_to_balance;
11
12
  this.balance = transactionTotals.balance;
12
13
  this.grandTotal = transactionTotals.grand_total;
13
14
  this.fee = transactionTotals.fee ? transactionTotals.fee : null;
@@ -1,4 +1,4 @@
1
- import { BillingDetails, type CustomData, NextTransaction, SubscriptionDiscount, SubscriptionItem, SubscriptionManagement, SubscriptionScheduledChange, SubscriptionTimePeriod, TimePeriod, TransactionDetailsPreview } from '../index';
1
+ import { BillingDetails, type CustomData, ImportMeta, NextTransaction, SubscriptionDiscount, SubscriptionItem, SubscriptionManagement, SubscriptionScheduledChange, SubscriptionTimePeriod, TimePeriod, TransactionDetailsPreview } from '../index';
2
2
  import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../enums';
3
3
  import { type ISubscriptionResponse } from '../../types';
4
4
  export declare class SubscriptionIncludes {
@@ -24,6 +24,7 @@ export declare class SubscriptionIncludes {
24
24
  readonly managementUrls: SubscriptionManagement | null;
25
25
  readonly items: SubscriptionItem[];
26
26
  readonly customData: CustomData | null;
27
+ readonly importMeta: ImportMeta | null;
27
28
  readonly nextTransaction: NextTransaction | null;
28
29
  readonly recurringTransactionDetails: TransactionDetailsPreview | null;
29
30
  constructor(subscription: ISubscriptionResponse);
@@ -32,6 +32,7 @@ class SubscriptionIncludes {
32
32
  : null;
33
33
  this.items = subscription.items.map((item) => new index_1.SubscriptionItem(item));
34
34
  this.customData = subscription.custom_data ? subscription.custom_data : null;
35
+ this.importMeta = subscription.import_meta ? new index_1.ImportMeta(subscription.import_meta) : null;
35
36
  this.nextTransaction = subscription.next_transaction ? new index_1.NextTransaction(subscription.next_transaction) : null;
36
37
  this.recurringTransactionDetails = subscription.recurring_transaction_details
37
38
  ? new index_1.TransactionDetailsPreview(subscription.recurring_transaction_details)
@@ -1,5 +1,5 @@
1
1
  import { type ISubscriptionPreviewResponse } from '../../types';
2
- import { BillingDetails, type CustomData, NextTransaction, SubscriptionDiscount, SubscriptionItem, SubscriptionManagement, SubscriptionPreviewUpdateSummary, SubscriptionScheduledChange, SubscriptionTimePeriod, TimePeriod, TransactionDetailsPreview } from '../index';
2
+ import { BillingDetails, type CustomData, ImportMeta, NextTransaction, SubscriptionDiscount, SubscriptionItem, SubscriptionManagement, SubscriptionPreviewUpdateSummary, SubscriptionScheduledChange, SubscriptionTimePeriod, TimePeriod, TransactionDetailsPreview } from '../index';
3
3
  import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../enums';
4
4
  export declare class SubscriptionPreview {
5
5
  readonly status: SubscriptionStatus;
@@ -27,5 +27,6 @@ export declare class SubscriptionPreview {
27
27
  readonly nextTransaction: NextTransaction | null;
28
28
  readonly recurringTransactionDetails: TransactionDetailsPreview | null;
29
29
  readonly updateSummary: SubscriptionPreviewUpdateSummary | null;
30
+ readonly importMeta: ImportMeta | null;
30
31
  constructor(subscriptionPreview: ISubscriptionPreviewResponse);
31
32
  }
@@ -45,6 +45,7 @@ class SubscriptionPreview {
45
45
  this.updateSummary = subscriptionPreview.update_summary
46
46
  ? new index_1.SubscriptionPreviewUpdateSummary(subscriptionPreview.update_summary)
47
47
  : null;
48
+ this.importMeta = subscriptionPreview.import_meta ? new index_1.ImportMeta(subscriptionPreview.import_meta) : null;
48
49
  }
49
50
  }
50
51
  exports.SubscriptionPreview = SubscriptionPreview;
@@ -1,4 +1,4 @@
1
- import { BillingDetails, type CustomData, SubscriptionDiscount, SubscriptionItem, SubscriptionManagement, SubscriptionScheduledChange, SubscriptionTimePeriod, TimePeriod } from '../index';
1
+ import { BillingDetails, type CustomData, ImportMeta, SubscriptionDiscount, SubscriptionItem, SubscriptionManagement, SubscriptionScheduledChange, SubscriptionTimePeriod, TimePeriod } from '../index';
2
2
  import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../enums';
3
3
  import { type ISubscriptionResponse } from '../../types';
4
4
  export declare class Subscription {
@@ -24,5 +24,6 @@ export declare class Subscription {
24
24
  readonly managementUrls: SubscriptionManagement | null;
25
25
  readonly items: SubscriptionItem[];
26
26
  readonly customData: CustomData | null;
27
+ readonly importMeta: ImportMeta | null;
27
28
  constructor(subscription: ISubscriptionResponse);
28
29
  }
@@ -32,6 +32,7 @@ class Subscription {
32
32
  : null;
33
33
  this.items = subscription.items.map((item) => new index_1.SubscriptionItem(item));
34
34
  this.customData = subscription.custom_data ? subscription.custom_data : null;
35
+ this.importMeta = subscription.import_meta ? new index_1.ImportMeta(subscription.import_meta) : null;
35
36
  }
36
37
  }
37
38
  exports.Subscription = Subscription;
@@ -6,3 +6,4 @@ export * from './transaction';
6
6
  export * from './payout';
7
7
  export * from './notification-settings';
8
8
  export * from './notification';
9
+ export * from './report';
@@ -22,3 +22,4 @@ __exportStar(require("./transaction"), exports);
22
22
  __exportStar(require("./payout"), exports);
23
23
  __exportStar(require("./notification-settings"), exports);
24
24
  __exportStar(require("./notification"), exports);
25
+ __exportStar(require("./report"), exports);
@@ -0,0 +1,4 @@
1
+ export * from './report-status';
2
+ export * from './report-type';
3
+ export * from './report-filter-name';
4
+ export * from './report-filter-operator';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./report-status"), exports);
18
+ __exportStar(require("./report-type"), exports);
19
+ __exportStar(require("./report-filter-name"), exports);
20
+ __exportStar(require("./report-filter-operator"), exports);
@@ -0,0 +1 @@
1
+ export type ReportFilterName = 'action' | 'collection_mode' | 'currency_code' | 'origin' | 'status' | 'updated_at';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type ReportFilterOperator = 'lt' | 'gte';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type ReportStatus = 'pending' | 'ready' | 'failed' | 'expired';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type ReportType = 'adjustments' | 'adjustment_line_items' | 'transactions' | 'transaction_line_items';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -8,3 +8,4 @@ export * from './price';
8
8
  export * from './product';
9
9
  export * from './subscription';
10
10
  export * from './transaction';
11
+ export * from './report';
@@ -24,3 +24,4 @@ __exportStar(require("./price"), exports);
24
24
  __exportStar(require("./product"), exports);
25
25
  __exportStar(require("./subscription"), exports);
26
26
  __exportStar(require("./transaction"), exports);
27
+ __exportStar(require("./report"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './report-created-event';
2
+ export * from './report-updated-event';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./report-created-event"), exports);
18
+ __exportStar(require("./report-updated-event"), exports);
@@ -0,0 +1,9 @@
1
+ import { Event } from '../../../entities/events/event';
2
+ import { Report } from '../../../entities';
3
+ import { EventName } from '../../helpers';
4
+ import { type IEventsResponse, type IReportResponse } from '../../../types';
5
+ export declare class ReportCreatedEvent extends Event {
6
+ readonly eventType = EventName.ReportCreated;
7
+ readonly data: Report;
8
+ constructor(response: IEventsResponse<IReportResponse>);
9
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportCreatedEvent = void 0;
4
+ const event_1 = require("../../../entities/events/event");
5
+ const entities_1 = require("../../../entities");
6
+ const helpers_1 = require("../../helpers");
7
+ class ReportCreatedEvent extends event_1.Event {
8
+ constructor(response) {
9
+ super(response);
10
+ this.eventType = helpers_1.EventName.ReportCreated;
11
+ this.data = new entities_1.Report(response.data);
12
+ }
13
+ }
14
+ exports.ReportCreatedEvent = ReportCreatedEvent;
@@ -0,0 +1,9 @@
1
+ import { Event } from '../../../entities/events/event';
2
+ import { Report } from '../../../entities';
3
+ import { EventName } from '../../helpers';
4
+ import { type IEventsResponse, type IReportResponse } from '../../../types';
5
+ export declare class ReportUpdatedEvent extends Event {
6
+ readonly eventType = EventName.ReportUpdated;
7
+ readonly data: Report;
8
+ constructor(response: IEventsResponse<IReportResponse>);
9
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportUpdatedEvent = void 0;
4
+ const event_1 = require("../../../entities/events/event");
5
+ const entities_1 = require("../../../entities");
6
+ const helpers_1 = require("../../helpers");
7
+ class ReportUpdatedEvent extends event_1.Event {
8
+ constructor(response) {
9
+ super(response);
10
+ this.eventType = helpers_1.EventName.ReportUpdated;
11
+ this.data = new entities_1.Report(response.data);
12
+ }
13
+ }
14
+ exports.ReportUpdatedEvent = ReportUpdatedEvent;
@@ -1,5 +1,5 @@
1
- import { type AddressCreatedEvent, type AddressUpdatedEvent, type BusinessCreatedEvent, type AdjustmentCreatedEvent, type AdjustmentUpdatedEvent, type BusinessUpdatedEvent, type CustomerCreatedEvent, type CustomerUpdatedEvent, type DiscountCreatedEvent, type DiscountImportedEvent, type DiscountUpdatedEvent, type PayoutCreatedEvent, type PayoutPaidEvent, type PriceCreatedEvent, type PriceUpdatedEvent, type ProductCreatedEvent, type ProductUpdatedEvent, type SubscriptionCreatedEvent, type SubscriptionActivatedEvent, type SubscriptionCanceledEvent, type SubscriptionImportedEvent, type SubscriptionPausedEvent, type SubscriptionResumedEvent, type SubscriptionTrialingEvent, type SubscriptionUpdatedEvent, type TransactionCanceledEvent, type TransactionBilledEvent, type TransactionCompletedEvent, type TransactionCreatedEvent, type TransactionPaidEvent, type SubscriptionPastDueEvent, type TransactionPastDueEvent, type TransactionPaymentFailedEvent, type TransactionReadyEvent, type TransactionUpdatedEvent } from '../events';
2
- export type EventEntity = AddressCreatedEvent | AddressUpdatedEvent | AdjustmentUpdatedEvent | AdjustmentCreatedEvent | BusinessCreatedEvent | BusinessUpdatedEvent | CustomerCreatedEvent | CustomerUpdatedEvent | DiscountCreatedEvent | DiscountUpdatedEvent | DiscountImportedEvent | PayoutCreatedEvent | PayoutPaidEvent | PriceCreatedEvent | PriceUpdatedEvent | ProductCreatedEvent | ProductUpdatedEvent | SubscriptionActivatedEvent | SubscriptionCanceledEvent | SubscriptionCreatedEvent | SubscriptionImportedEvent | SubscriptionPastDueEvent | SubscriptionPausedEvent | SubscriptionResumedEvent | SubscriptionTrialingEvent | SubscriptionUpdatedEvent | TransactionBilledEvent | TransactionCanceledEvent | TransactionCompletedEvent | TransactionCreatedEvent | TransactionPaidEvent | TransactionPastDueEvent | TransactionPaymentFailedEvent | TransactionReadyEvent | TransactionUpdatedEvent;
1
+ import { type AddressCreatedEvent, type AddressUpdatedEvent, type BusinessCreatedEvent, type AdjustmentCreatedEvent, type AdjustmentUpdatedEvent, type BusinessUpdatedEvent, type CustomerCreatedEvent, type CustomerUpdatedEvent, type DiscountCreatedEvent, type DiscountImportedEvent, type DiscountUpdatedEvent, type PayoutCreatedEvent, type PayoutPaidEvent, type PriceCreatedEvent, type PriceUpdatedEvent, type ProductCreatedEvent, type ProductUpdatedEvent, type SubscriptionCreatedEvent, type SubscriptionActivatedEvent, type SubscriptionCanceledEvent, type SubscriptionImportedEvent, type SubscriptionPausedEvent, type SubscriptionResumedEvent, type SubscriptionTrialingEvent, type SubscriptionUpdatedEvent, type TransactionCanceledEvent, type TransactionBilledEvent, type TransactionCompletedEvent, type TransactionCreatedEvent, type TransactionPaidEvent, type SubscriptionPastDueEvent, type TransactionPastDueEvent, type TransactionPaymentFailedEvent, type TransactionReadyEvent, type TransactionUpdatedEvent, type ReportUpdatedEvent, type ReportCreatedEvent } from '../events';
2
+ export type EventEntity = AddressCreatedEvent | AddressUpdatedEvent | AdjustmentUpdatedEvent | AdjustmentCreatedEvent | BusinessCreatedEvent | BusinessUpdatedEvent | CustomerCreatedEvent | CustomerUpdatedEvent | DiscountCreatedEvent | DiscountUpdatedEvent | DiscountImportedEvent | PayoutCreatedEvent | PayoutPaidEvent | PriceCreatedEvent | PriceUpdatedEvent | ProductCreatedEvent | ProductUpdatedEvent | SubscriptionActivatedEvent | SubscriptionCanceledEvent | SubscriptionCreatedEvent | SubscriptionImportedEvent | SubscriptionPastDueEvent | SubscriptionPausedEvent | SubscriptionResumedEvent | SubscriptionTrialingEvent | SubscriptionUpdatedEvent | TransactionBilledEvent | TransactionCanceledEvent | TransactionCompletedEvent | TransactionCreatedEvent | TransactionPaidEvent | TransactionPastDueEvent | TransactionPaymentFailedEvent | TransactionReadyEvent | TransactionUpdatedEvent | ReportUpdatedEvent | ReportCreatedEvent;
3
3
  export declare enum EventName {
4
4
  AddressCreated = "address.created",
5
5
  AddressUpdated = "address.updated",
@@ -35,6 +35,8 @@ export declare enum EventName {
35
35
  TransactionPastDue = "transaction.past_due",
36
36
  TransactionPaymentFailed = "transaction.payment_failed",
37
37
  TransactionReady = "transaction.ready",
38
- TransactionUpdated = "transaction.updated"
38
+ TransactionUpdated = "transaction.updated",
39
+ ReportCreated = "report.created",
40
+ ReportUpdated = "report.updated"
39
41
  }
40
- export type IEventName = 'address.created' | 'address.updated' | 'adjustment.created' | 'adjustment.updated' | 'business.created' | 'business.updated' | 'customer.created' | 'customer.updated' | 'discount.created' | 'discount.updated' | 'discount.imported' | 'payout.updated' | 'payout.paid' | 'price.updated' | 'price.created' | 'product.updated' | 'product.created' | 'subscription.activated' | 'subscription.canceled' | 'subscription.imported' | 'subscription.created' | 'subscription.past_due' | 'subscription.paused' | 'subscription.resumed' | 'subscription.trialing' | 'subscription.updated' | 'transaction.billed' | 'transaction.canceled' | 'transaction.completed' | 'transaction.paid' | 'transaction.created' | 'transaction.past_due' | 'transaction.payment_failed' | 'transaction.ready' | 'transaction.updated';
42
+ export type IEventName = 'address.created' | 'address.updated' | 'adjustment.created' | 'adjustment.updated' | 'business.created' | 'business.updated' | 'customer.created' | 'customer.updated' | 'discount.created' | 'discount.updated' | 'discount.imported' | 'payout.updated' | 'payout.paid' | 'price.updated' | 'price.created' | 'product.updated' | 'product.created' | 'subscription.activated' | 'subscription.canceled' | 'subscription.imported' | 'subscription.created' | 'subscription.past_due' | 'subscription.paused' | 'subscription.resumed' | 'subscription.trialing' | 'subscription.updated' | 'transaction.billed' | 'transaction.canceled' | 'transaction.completed' | 'transaction.paid' | 'transaction.created' | 'transaction.past_due' | 'transaction.payment_failed' | 'transaction.ready' | 'transaction.updated' | 'report.created' | 'report.updated';
@@ -38,4 +38,6 @@ var EventName;
38
38
  EventName["TransactionPaymentFailed"] = "transaction.payment_failed";
39
39
  EventName["TransactionReady"] = "transaction.ready";
40
40
  EventName["TransactionUpdated"] = "transaction.updated";
41
+ EventName["ReportCreated"] = "report.created";
42
+ EventName["ReportUpdated"] = "report.updated";
41
43
  })(EventName || (exports.EventName = EventName = {}));
@@ -91,6 +91,10 @@ class Webhooks {
91
91
  return new events_1.TransactionReadyEvent(data);
92
92
  case types_1.EventName.TransactionUpdated:
93
93
  return new events_1.TransactionUpdatedEvent(data);
94
+ case types_1.EventName.ReportCreated:
95
+ return new events_1.ReportCreatedEvent(data);
96
+ case types_1.EventName.ReportUpdated:
97
+ return new events_1.ReportUpdatedEvent(data);
94
98
  default:
95
99
  logger_1.Logger.log('Unknown event_type');
96
100
  return null;
package/dist/paddle.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PricesResource, PricingPreviewResource, ProductsResource, SubscriptionsResource, TransactionsResource } from './resources';
1
+ import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SubscriptionsResource, TransactionsResource } from './resources';
2
2
  import { type PaddleOptions } from './internal';
3
3
  import { EventsResource } from './resources/events';
4
4
  import { Webhooks } from './notifications';
@@ -20,5 +20,6 @@ export declare class Paddle {
20
20
  eventTypes: EventTypesResource;
21
21
  notificationSettings: NotificationSettingsResource;
22
22
  notifications: NotificationsResource;
23
+ reports: ReportsResource;
23
24
  constructor(apiKey: string, options?: PaddleOptions);
24
25
  }
package/dist/paddle.js CHANGED
@@ -27,6 +27,7 @@ class Paddle {
27
27
  this.eventTypes = new resources_1.EventTypesResource(this.client);
28
28
  this.notificationSettings = new resources_1.NotificationSettingsResource(this.client);
29
29
  this.notifications = new resources_1.NotificationsResource(this.client);
30
+ this.reports = new resources_1.ReportsResource(this.client);
30
31
  }
31
32
  }
32
33
  exports.Paddle = Paddle;
@@ -11,3 +11,4 @@ export * from './pricing-preview';
11
11
  export * from './event-types';
12
12
  export * from './notification-settings';
13
13
  export * from './notifications';
14
+ export * from './reports';
@@ -27,3 +27,4 @@ __exportStar(require("./pricing-preview"), exports);
27
27
  __exportStar(require("./event-types"), exports);
28
28
  __exportStar(require("./notification-settings"), exports);
29
29
  __exportStar(require("./notifications"), exports);
30
+ __exportStar(require("./reports"), exports);
@@ -0,0 +1,10 @@
1
+ import { Report, ReportCollection, ReportCsv } from '../../entities';
2
+ import { BaseResource } from '../../internal/base';
3
+ import { type CreateReportRequestBody, type ListReportQueryParameters } from './operations';
4
+ export * from './operations';
5
+ export declare class ReportsResource extends BaseResource {
6
+ list(queryParams?: ListReportQueryParameters): ReportCollection;
7
+ create(createReportParameters: CreateReportRequestBody): Promise<Report>;
8
+ get(reportId: string): Promise<Report>;
9
+ getReportCsv(reportId: string): Promise<ReportCsv>;
10
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.ReportsResource = void 0;
27
+ const entities_1 = require("../../entities");
28
+ const base_1 = require("../../internal/base");
29
+ const ReportPaths = {
30
+ list: '/reports',
31
+ create: '/reports',
32
+ get: '/reports/{report_id}',
33
+ getReportCsv: '/reports/{report_id}/download-url',
34
+ };
35
+ __exportStar(require("./operations"), exports);
36
+ class ReportsResource extends base_1.BaseResource {
37
+ list(queryParams) {
38
+ const queryParameters = new base_1.QueryParameters(queryParams);
39
+ return new entities_1.ReportCollection(this.client, ReportPaths.list + '?' + queryParameters.toQueryString());
40
+ }
41
+ create(createReportParameters) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const response = yield this.client.post(ReportPaths.create, createReportParameters);
44
+ const data = this.handleResponse(response);
45
+ return new entities_1.Report(data);
46
+ });
47
+ }
48
+ get(reportId) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ const urlWithPathParams = new base_1.PathParameters(ReportPaths.get, {
51
+ report_id: reportId,
52
+ }).deriveUrl();
53
+ const response = yield this.client.get(urlWithPathParams);
54
+ const data = this.handleResponse(response);
55
+ return new entities_1.Report(data);
56
+ });
57
+ }
58
+ getReportCsv(reportId) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const urlWithPathParams = new base_1.PathParameters(ReportPaths.getReportCsv, {
61
+ report_id: reportId,
62
+ }).deriveUrl();
63
+ const response = yield this.client.get(urlWithPathParams);
64
+ const data = this.handleResponse(response);
65
+ return new entities_1.ReportCsv(data);
66
+ });
67
+ }
68
+ }
69
+ exports.ReportsResource = ReportsResource;
@@ -0,0 +1,6 @@
1
+ import { type IReportFilters } from '../../../types';
2
+ import { type ReportType } from '../../../enums';
3
+ export interface CreateReportRequestBody {
4
+ type: ReportType;
5
+ filters?: IReportFilters[] | null;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './list-report-query-parameters';
2
+ export * from './create-report-request-object';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./list-report-query-parameters"), exports);
18
+ __exportStar(require("./create-report-request-object"), exports);
@@ -0,0 +1,7 @@
1
+ import { type ReportStatus } from '../../../enums';
2
+ export interface ListReportQueryParameters {
3
+ after?: string;
4
+ orderBy?: string;
5
+ perPage?: number;
6
+ status?: ReportStatus[];
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { type CollectionMode, type TransactionStatus } from '../../../enums';
1
+ import { type CollectionMode, type TransactionStatus, type TransactionOrigin } from '../../../enums';
2
2
  export interface ListTransactionQueryParameters {
3
3
  after?: string;
4
4
  billedAt?: string;
@@ -25,4 +25,5 @@ export interface ListTransactionQueryParameters {
25
25
  'updatedAt[GT]'?: string;
26
26
  'updatedAt[LTE]'?: string;
27
27
  'updatedAt[GTE]'?: string;
28
+ origin?: TransactionOrigin[];
28
29
  }
@@ -1,4 +1,4 @@
1
- import { type ICustomData } from '../index';
1
+ import { type ICustomData, type IImportMetaResponse } from '../index';
2
2
  import { type CountryCode, type Status } from '../../enums';
3
3
  export interface IAddressResponse {
4
4
  id: string;
@@ -13,4 +13,5 @@ export interface IAddressResponse {
13
13
  status: Status;
14
14
  created_at: string;
15
15
  updated_at: string;
16
+ import_meta?: IImportMetaResponse | null;
16
17
  }
@@ -1,4 +1,4 @@
1
- import { type IBusinessContacts, type ICustomData } from '../index';
1
+ import { type IBusinessContacts, type ICustomData, type IImportMetaResponse } from '../index';
2
2
  import { type Status } from '../../enums';
3
3
  export interface IBusinessResponse {
4
4
  id: string;
@@ -10,4 +10,5 @@ export interface IBusinessResponse {
10
10
  created_at: string;
11
11
  updated_at: string;
12
12
  custom_data?: ICustomData | null;
13
+ import_meta?: IImportMetaResponse | null;
13
14
  }
@@ -1,4 +1,4 @@
1
- import { type ICustomData } from '../index';
1
+ import { type ICustomData, type IImportMetaResponse } from '../index';
2
2
  import { type Status } from '../../enums';
3
3
  export interface ICustomerResponse {
4
4
  id: string;
@@ -10,4 +10,5 @@ export interface ICustomerResponse {
10
10
  locale: string;
11
11
  created_at: string;
12
12
  updated_at: string;
13
+ import_meta?: IImportMetaResponse | null;
13
14
  }
@@ -1,5 +1,5 @@
1
1
  import { type CurrencyCode, type DiscountStatus, type DiscountType } from '../../enums';
2
- import { type ICustomData } from '../shared';
2
+ import { type ICustomData, type IImportMetaResponse } from '../shared';
3
3
  export interface IDiscountResponse {
4
4
  id: string;
5
5
  status: DiscountStatus;
@@ -18,4 +18,5 @@ export interface IDiscountResponse {
18
18
  times_used: number;
19
19
  created_at: string;
20
20
  updated_at: string;
21
+ import_meta?: IImportMetaResponse | null;
21
22
  }
@@ -9,6 +9,7 @@ import { type IProductResponse } from '../product';
9
9
  import { type ISubscriptionNotificationResponse } from '../subscription';
10
10
  import { type ITransactionResponse } from '../transaction';
11
11
  import { type IPayoutResponse } from '../payout';
12
+ import { type IReportResponse } from '../report';
12
13
  export interface IEventsResponse<T = object> {
13
14
  event_id: string;
14
15
  notification_id: string;
@@ -121,5 +122,11 @@ interface ITransactionReady extends IEventsResponse<ITransactionResponse> {
121
122
  interface ITransactionUpdated extends IEventsResponse<ITransactionResponse> {
122
123
  event_type: EventName.TransactionUpdated;
123
124
  }
124
- export type IEvents = IAddressCreated | IAddressUpdated | IAdjustmentCreated | IAdjustmentUpdated | IBusinessCreated | IBusinessUpdated | ICustomerCreated | ICustomerUpdated | IDiscountCreated | IDiscountUpdated | IDiscountImported | IPayoutCreated | IPayoutPaid | IPriceCreated | IPriceUpdated | IProductCreated | IProductUpdated | ISubscriptionActivated | ISubscriptionCanceled | ISubscriptionCreated | ISubscriptionImported | ISubscriptionPastDue | ISubscriptionPaused | ISubscriptionResumed | ISubscriptionTrialing | ISubscriptionUpdated | ITransactionBilled | ITransactionCanceled | ITransactionCompleted | ITransactionCreated | ITransactionPaid | ITransactionPastDue | ITransactionPaymentFailed | ITransactionReady | ITransactionUpdated;
125
+ interface IReportCreated extends IEventsResponse<IReportResponse> {
126
+ event_type: EventName.ReportCreated;
127
+ }
128
+ interface IReportUpdated extends IEventsResponse<IReportResponse> {
129
+ event_type: EventName.ReportUpdated;
130
+ }
131
+ export type IEvents = IAddressCreated | IAddressUpdated | IAdjustmentCreated | IAdjustmentUpdated | IBusinessCreated | IBusinessUpdated | ICustomerCreated | ICustomerUpdated | IDiscountCreated | IDiscountUpdated | IDiscountImported | IPayoutCreated | IPayoutPaid | IPriceCreated | IPriceUpdated | IProductCreated | IProductUpdated | ISubscriptionActivated | ISubscriptionCanceled | ISubscriptionCreated | ISubscriptionImported | ISubscriptionPastDue | ISubscriptionPaused | ISubscriptionResumed | ISubscriptionTrialing | ISubscriptionUpdated | ITransactionBilled | ITransactionCanceled | ITransactionCompleted | ITransactionCreated | ITransactionPaid | ITransactionPastDue | ITransactionPaymentFailed | ITransactionReady | ITransactionUpdated | IReportCreated | IReportUpdated;
125
132
  export {};
@@ -14,3 +14,4 @@ export * from './payout';
14
14
  export * from './event-types';
15
15
  export * from './notification-settings';
16
16
  export * from './notifications';
17
+ export * from './report';
@@ -30,3 +30,4 @@ __exportStar(require("./payout"), exports);
30
30
  __exportStar(require("./event-types"), exports);
31
31
  __exportStar(require("./notification-settings"), exports);
32
32
  __exportStar(require("./notifications"), exports);
33
+ __exportStar(require("./report"), exports);
@@ -0,0 +1,3 @@
1
+ export * from './report-filters';
2
+ export * from './report';
3
+ export * from './reports-csv';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./report-filters"), exports);
18
+ __exportStar(require("./report"), exports);
19
+ __exportStar(require("./reports-csv"), exports);
@@ -0,0 +1,6 @@
1
+ import { type ReportFilterName, type ReportFilterOperator } from '../../enums';
2
+ export interface IReportFilters {
3
+ name: ReportFilterName;
4
+ operator?: null | ReportFilterOperator;
5
+ value: string[] | string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { type IReportFilters } from '../index';
2
+ import { type ReportType, type ReportStatus } from '../../enums';
3
+ export interface IReportResponse {
4
+ id: string;
5
+ status: ReportStatus;
6
+ rows?: number | null;
7
+ type: ReportType;
8
+ filters: IReportFilters[];
9
+ expires_at?: string | null;
10
+ created_at: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export interface IReportCsvResponse {
2
+ url: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,6 +7,7 @@ export interface ITransactionPayoutTotalsResponse {
7
7
  credit: string;
8
8
  balance: string;
9
9
  grand_total: string;
10
+ credit_to_balance: string;
10
11
  fee: string;
11
12
  earnings: string;
12
13
  currency_code: PayoutCurrencyCode;
@@ -5,6 +5,7 @@ export interface ITransactionTotalsResponse {
5
5
  tax: string;
6
6
  total: string;
7
7
  credit: string;
8
+ credit_to_balance: string;
8
9
  balance: string;
9
10
  grand_total: string;
10
11
  fee?: string | null;
@@ -1,4 +1,4 @@
1
- import { type ISubscriptionDiscountResponse, type IBillingDetailsResponse, type ITimePeriod, type ISubscriptionScheduledChangeResponse, type ISubscriptionItemResponse, type ICustomData, type INextTransactionResponse, type ITransactionDetailsPreviewResponse, type ISubscriptionTimePeriodResponse, type ISubscriptionManagementResponse, type ISubscriptionPreviewUpdateSummary } from '../index';
1
+ import { type ISubscriptionDiscountResponse, type IBillingDetailsResponse, type ITimePeriod, type ISubscriptionScheduledChangeResponse, type ISubscriptionItemResponse, type ICustomData, type INextTransactionResponse, type ITransactionDetailsPreviewResponse, type ISubscriptionTimePeriodResponse, type ISubscriptionManagementResponse, type ISubscriptionPreviewUpdateSummary, type IImportMetaResponse } from '../index';
2
2
  import { type CurrencyCode, type CollectionMode, type SubscriptionStatus } from '../../enums';
3
3
  export interface ISubscriptionPreviewResponse {
4
4
  status: SubscriptionStatus;
@@ -26,4 +26,5 @@ export interface ISubscriptionPreviewResponse {
26
26
  next_transaction?: INextTransactionResponse | null;
27
27
  recurring_transaction_details?: ITransactionDetailsPreviewResponse | null;
28
28
  update_summary?: ISubscriptionPreviewUpdateSummary | null;
29
+ import_meta?: IImportMetaResponse | null;
29
30
  }
@@ -1,4 +1,4 @@
1
- import { type IBillingDetailsResponse, type ICustomData, type INextTransactionResponse, type ISubscriptionDiscountResponse, type ISubscriptionItemResponse, type ISubscriptionManagementResponse, type ISubscriptionScheduledChangeResponse, type ISubscriptionTimePeriodResponse, type ITimePeriod, type ITransactionDetailsPreviewResponse } from '../index';
1
+ import { type IBillingDetailsResponse, type ICustomData, type IImportMetaResponse, type INextTransactionResponse, type ISubscriptionDiscountResponse, type ISubscriptionItemResponse, type ISubscriptionManagementResponse, type ISubscriptionScheduledChangeResponse, type ISubscriptionTimePeriodResponse, type ITimePeriod, type ITransactionDetailsPreviewResponse } from '../index';
2
2
  import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../enums';
3
3
  export interface ISubscriptionResponse {
4
4
  id: string;
@@ -25,4 +25,5 @@ export interface ISubscriptionResponse {
25
25
  custom_data?: ICustomData | null;
26
26
  next_transaction?: INextTransactionResponse | null;
27
27
  recurring_transaction_details?: ITransactionDetailsPreviewResponse | null;
28
+ import_meta?: IImportMetaResponse | null;
28
29
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.3";
1
+ export declare const SDK_VERSION = "0.2.5";
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.2.3';
4
+ exports.SDK_VERSION = '0.2.5';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paddle/paddle-node-sdk",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "A NodeJS SDK for Paddle Billing API",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",