@paddle/paddle-node-sdk 0.2.2 → 0.2.4
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 +32 -0
- package/README.md +14 -14
- package/dist/entities/address/address.d.ts +2 -1
- package/dist/entities/address/address.js +2 -0
- package/dist/entities/business/business.d.ts +2 -1
- package/dist/entities/business/business.js +1 -0
- package/dist/entities/customer/customer.d.ts +2 -1
- package/dist/entities/customer/customer.js +2 -0
- package/dist/entities/discount/discount.d.ts +2 -1
- package/dist/entities/discount/discount.js +2 -0
- package/dist/entities/event-types/event-type.d.ts +9 -0
- package/dist/entities/event-types/event-type.js +12 -0
- package/dist/entities/event-types/index.d.ts +1 -0
- package/dist/entities/event-types/index.js +17 -0
- package/dist/entities/events/event-collection.d.ts +2 -2
- package/dist/entities/index.d.ts +3 -0
- package/dist/entities/index.js +3 -0
- package/dist/entities/notification-settings/index.d.ts +1 -0
- package/dist/entities/notification-settings/index.js +17 -0
- package/dist/entities/notification-settings/notification-settings.d.ts +15 -0
- package/dist/entities/notification-settings/notification-settings.js +18 -0
- package/dist/entities/notifications/index.d.ts +5 -0
- package/dist/entities/notifications/index.js +21 -0
- package/dist/entities/notifications/notification-collection.d.ts +6 -0
- package/dist/entities/notifications/notification-collection.js +11 -0
- package/dist/entities/notifications/notification-log-collection.d.ts +6 -0
- package/dist/entities/notifications/notification-log-collection.js +11 -0
- package/dist/entities/notifications/notification-log.d.ts +8 -0
- package/dist/entities/notifications/notification-log.js +14 -0
- package/dist/entities/notifications/notification.d.ts +18 -0
- package/dist/entities/notifications/notification.js +22 -0
- package/dist/entities/notifications/replay-notification.d.ts +5 -0
- package/dist/entities/notifications/replay-notification.js +9 -0
- package/dist/entities/shared/transaction-payout-totals.d.ts +1 -0
- package/dist/entities/shared/transaction-payout-totals.js +1 -0
- package/dist/entities/shared/transaction-totals.d.ts +1 -0
- package/dist/entities/shared/transaction-totals.js +1 -0
- package/dist/entities/subscription/subscription-includes.d.ts +2 -1
- package/dist/entities/subscription/subscription-includes.js +1 -0
- package/dist/entities/subscription/subscription-preview.d.ts +2 -1
- package/dist/entities/subscription/subscription-preview.js +1 -0
- package/dist/entities/subscription/subscription-scheduled-change.d.ts +2 -2
- package/dist/entities/subscription/subscription.d.ts +2 -1
- package/dist/entities/subscription/subscription.js +1 -0
- package/dist/enums/index.d.ts +2 -0
- package/dist/enums/index.js +2 -0
- package/dist/enums/notification/index.d.ts +2 -0
- package/dist/enums/notification/index.js +18 -0
- package/dist/enums/notification/notification-status.d.ts +1 -0
- package/dist/enums/notification/notification-status.js +2 -0
- package/dist/enums/notification/origin.d.ts +1 -0
- package/dist/enums/notification/origin.js +2 -0
- package/dist/enums/notification-settings/index.d.ts +1 -0
- package/dist/enums/notification-settings/index.js +17 -0
- package/dist/enums/notification-settings/notification-settings-type.d.ts +1 -0
- package/dist/enums/notification-settings/notification-settings-type.js +2 -0
- package/dist/internal/api/client.d.ts +2 -0
- package/dist/internal/api/client.js +14 -0
- package/dist/notifications/helpers/webhooks.d.ts +2 -2
- package/dist/notifications/helpers/webhooks.js +3 -1
- package/dist/paddle.d.ts +4 -1
- package/dist/paddle.js +3 -0
- package/dist/resources/event-types/index.d.ts +5 -0
- package/dist/resources/event-types/index.js +27 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.js +3 -0
- package/dist/resources/notification-settings/index.d.ts +11 -0
- package/dist/resources/notification-settings/index.js +84 -0
- package/dist/resources/notification-settings/operations/create-notification-settings-request-body.d.ts +10 -0
- package/dist/resources/notification-settings/operations/create-notification-settings-request-body.js +2 -0
- package/dist/resources/notification-settings/operations/index.d.ts +2 -0
- package/dist/resources/notification-settings/operations/index.js +18 -0
- package/dist/resources/notification-settings/operations/update-notification-settings-request-body.d.ts +9 -0
- package/dist/resources/notification-settings/operations/update-notification-settings-request-body.js +2 -0
- package/dist/resources/notifications/index.d.ts +10 -0
- package/dist/resources/notifications/index.js +69 -0
- package/dist/resources/notifications/operations/index.d.ts +2 -0
- package/dist/resources/notifications/operations/index.js +18 -0
- package/dist/resources/notifications/operations/list-notification-log-query-parameters.d.ts +4 -0
- package/dist/resources/notifications/operations/list-notification-log-query-parameters.js +2 -0
- package/dist/resources/notifications/operations/list-notification-query-parameters.d.ts +12 -0
- package/dist/resources/notifications/operations/list-notification-query-parameters.js +2 -0
- package/dist/resources/transactions/operations/list-transaction-query-parameters.d.ts +2 -1
- package/dist/types/address/address-response.d.ts +2 -1
- package/dist/types/business/business-response.d.ts +2 -1
- package/dist/types/customer/customer-response.d.ts +2 -1
- package/dist/types/discount/discount-response.d.ts +2 -1
- package/dist/types/event-types/event-type-response.d.ts +7 -0
- package/dist/types/event-types/event-type-response.js +2 -0
- package/dist/types/event-types/index.d.ts +1 -0
- package/dist/types/event-types/index.js +17 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/dist/types/notification-settings/index.d.ts +1 -0
- package/dist/types/notification-settings/index.js +17 -0
- package/dist/types/notification-settings/notification-settings-response.d.ts +13 -0
- package/dist/types/notification-settings/notification-settings-response.js +2 -0
- package/dist/types/notifications/index.d.ts +3 -0
- package/dist/types/notifications/index.js +19 -0
- package/dist/types/notifications/notification-log.d.ts +7 -0
- package/dist/types/notifications/notification-log.js +2 -0
- package/dist/types/notifications/notification.d.ts +17 -0
- package/dist/types/notifications/notification.js +2 -0
- package/dist/types/notifications/replay-notification.d.ts +3 -0
- package/dist/types/notifications/replay-notification.js +2 -0
- package/dist/types/shared/transaction-payout-totals-response.d.ts +1 -0
- package/dist/types/shared/transaction-totals-response.d.ts +1 -0
- package/dist/types/subscription/subscription-preview-response.d.ts +2 -1
- package/dist/types/subscription/subscription-response.d.ts +2 -1
- package/dist/types/subscription/subscription-scheduled-change-response.d.ts +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,38 @@ 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.4 - 2023-12-14
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Added `importMeta` to address, business, customer, discount and subscription entities
|
|
16
|
+
- Added `creditToBalance` to `transaction.details.payoutTotals` and `transaction.details.totals`
|
|
17
|
+
- 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).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 0.2.3 - 2023-12-12
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- Added `eventTypes.list()` to [list all event types](https://developer.paddle.com/api-reference/event-types/list-event-types?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
26
|
+
- Added `notificationSettings.list()` to [list all notification settings](https://developer.paddle.com/api-reference/notification-settings/list-notification-settings?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
27
|
+
- Added `notificationSettings.create()` to [create a notification settings](https://developer.paddle.com/api-reference/notification-settings/create-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
28
|
+
- Added `notificationSettings.get()` to [get a notification settings](https://developer.paddle.com/api-reference/notification-settings/get-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
29
|
+
- Added `notificationSettings.update()` to [update a notification settings](https://developer.paddle.com/api-reference/notification-settings/update-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
30
|
+
- Added `notificationSettings.delete()` to [delete a notification settings](https://developer.paddle.com/api-reference/notification-settings/delete-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
31
|
+
- Added `notifications.list()` to [list all notifications](https://developer.paddle.com/api-reference/notifications/list-notifications?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
32
|
+
- Added `notifications.get()` to [get a notification](https://developer.paddle.com/api-reference/notifications/get-notification?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
33
|
+
- Added `notifications.replay()` to [replay a notification](https://developer.paddle.com/api-reference/notifications/replay-notification?utm_source=dx&utm_medium=paddle-node-sdk)
|
|
34
|
+
- 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)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- Fixed incorrect type of `action` in `subscriptions.scheduled_change`
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
11
43
|
## 0.2.2 - 2023-12-01
|
|
12
44
|
|
|
13
45
|
### Added
|
package/README.md
CHANGED
|
@@ -330,22 +330,22 @@ This table shows which operations are available as of the latest release.
|
|
|
330
330
|
| Create an adjustment | ✅ |
|
|
331
331
|
| **Pricing preview** | **Full** |
|
|
332
332
|
| Preview prices | ✅ |
|
|
333
|
-
| **Event types** | **
|
|
334
|
-
| List event types |
|
|
333
|
+
| **Event types** | **Full** |
|
|
334
|
+
| List event types | ✅ |
|
|
335
335
|
| **Events** | **Full** |
|
|
336
336
|
| List events | ✅ |
|
|
337
|
-
| **Notification settings** | **
|
|
338
|
-
| List notification settings |
|
|
339
|
-
| Create a notification setting |
|
|
340
|
-
| Get a notification setting |
|
|
341
|
-
| Update a notification setting |
|
|
342
|
-
| Delete a notification setting |
|
|
343
|
-
| **Notifications** | **
|
|
344
|
-
| List notifications |
|
|
345
|
-
| Get a notification |
|
|
346
|
-
| Replay a notification |
|
|
347
|
-
| **Notification logs** | **
|
|
348
|
-
| List logs for a notification |
|
|
337
|
+
| **Notification settings** | **Full** |
|
|
338
|
+
| List notification settings | ✅ |
|
|
339
|
+
| Create a notification setting | ✅ |
|
|
340
|
+
| Get a notification setting | ✅ |
|
|
341
|
+
| Update a notification setting | ✅ |
|
|
342
|
+
| Delete a notification setting | ✅ |
|
|
343
|
+
| **Notifications** | **Full** |
|
|
344
|
+
| List notifications | ✅ |
|
|
345
|
+
| Get a notification | ✅ |
|
|
346
|
+
| Replay a notification | ✅ |
|
|
347
|
+
| **Notification logs** | **Full** |
|
|
348
|
+
| List logs for a notification | ✅ |
|
|
349
349
|
|
|
350
350
|
## Learn more
|
|
351
351
|
|
|
@@ -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;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type IEventTypeResponse } from '../../types';
|
|
2
|
+
import { type IEventName } from '../../notifications';
|
|
3
|
+
export declare class EventType {
|
|
4
|
+
readonly name: IEventName;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
readonly group: string;
|
|
7
|
+
readonly availableVersions: number[];
|
|
8
|
+
constructor(eventType: IEventTypeResponse);
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventType = void 0;
|
|
4
|
+
class EventType {
|
|
5
|
+
constructor(eventType) {
|
|
6
|
+
this.name = eventType.name;
|
|
7
|
+
this.description = eventType.description;
|
|
8
|
+
this.group = eventType.group;
|
|
9
|
+
this.availableVersions = eventType.available_versions;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.EventType = EventType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './event-type';
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./event-type"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Collection } from '../../internal/base';
|
|
2
2
|
import { type IEvents, type IEventsResponse } from '../../types';
|
|
3
3
|
import { type EventEntity } from '../../notifications';
|
|
4
|
-
export declare class EventCollection extends Collection<IEventsResponse, EventEntity> {
|
|
5
|
-
fromJson(data: IEvents): EventEntity;
|
|
4
|
+
export declare class EventCollection extends Collection<IEventsResponse, EventEntity | null> {
|
|
5
|
+
fromJson(data: IEvents): EventEntity | null;
|
|
6
6
|
}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -10,4 +10,7 @@ export * from './address';
|
|
|
10
10
|
export * from './discount';
|
|
11
11
|
export * from './events';
|
|
12
12
|
export * from './payout';
|
|
13
|
+
export * from './event-types';
|
|
14
|
+
export * from './notification-settings';
|
|
15
|
+
export * from './notifications';
|
|
13
16
|
export type CustomData = object;
|
package/dist/entities/index.js
CHANGED
|
@@ -26,3 +26,6 @@ __exportStar(require("./address"), exports);
|
|
|
26
26
|
__exportStar(require("./discount"), exports);
|
|
27
27
|
__exportStar(require("./events"), exports);
|
|
28
28
|
__exportStar(require("./payout"), exports);
|
|
29
|
+
__exportStar(require("./event-types"), exports);
|
|
30
|
+
__exportStar(require("./notification-settings"), exports);
|
|
31
|
+
__exportStar(require("./notifications"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './notification-settings';
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./notification-settings"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type NotificationSettingsType } from '../../enums';
|
|
2
|
+
import { EventType } from '../event-types';
|
|
3
|
+
import { type INotificationSettingsResponse } from '../../types/notification-settings';
|
|
4
|
+
export declare class NotificationSettings {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly description: string;
|
|
7
|
+
readonly type: NotificationSettingsType;
|
|
8
|
+
readonly destination: string;
|
|
9
|
+
readonly active: boolean;
|
|
10
|
+
readonly apiVersion: number;
|
|
11
|
+
readonly includeSensitiveFields: boolean;
|
|
12
|
+
readonly subscribedEvents: EventType[];
|
|
13
|
+
readonly endpointSecretKey: string;
|
|
14
|
+
constructor(notificationSettings: INotificationSettingsResponse);
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationSettings = void 0;
|
|
4
|
+
const event_types_1 = require("../event-types");
|
|
5
|
+
class NotificationSettings {
|
|
6
|
+
constructor(notificationSettings) {
|
|
7
|
+
this.id = notificationSettings.id;
|
|
8
|
+
this.description = notificationSettings.description;
|
|
9
|
+
this.type = notificationSettings.type;
|
|
10
|
+
this.destination = notificationSettings.destination;
|
|
11
|
+
this.active = notificationSettings.active;
|
|
12
|
+
this.apiVersion = notificationSettings.api_version;
|
|
13
|
+
this.includeSensitiveFields = notificationSettings.include_sensitive_fields;
|
|
14
|
+
this.subscribedEvents = notificationSettings.subscribed_events.map((subscribed_event) => new event_types_1.EventType(subscribed_event));
|
|
15
|
+
this.endpointSecretKey = notificationSettings.endpoint_secret_key;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.NotificationSettings = NotificationSettings;
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./notification"), exports);
|
|
18
|
+
__exportStar(require("./notification-log"), exports);
|
|
19
|
+
__exportStar(require("./notification-collection"), exports);
|
|
20
|
+
__exportStar(require("./replay-notification"), exports);
|
|
21
|
+
__exportStar(require("./notification-log-collection"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Collection } from '../../internal/base';
|
|
2
|
+
import { Notification } from './notification';
|
|
3
|
+
import { type INotificationResponse } from '../../types/notifications';
|
|
4
|
+
export declare class NotificationCollection extends Collection<INotificationResponse, Notification> {
|
|
5
|
+
fromJson(data: INotificationResponse): Notification;
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationCollection = void 0;
|
|
4
|
+
const base_1 = require("../../internal/base");
|
|
5
|
+
const notification_1 = require("./notification");
|
|
6
|
+
class NotificationCollection extends base_1.Collection {
|
|
7
|
+
fromJson(data) {
|
|
8
|
+
return new notification_1.Notification(data);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.NotificationCollection = NotificationCollection;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Collection } from '../../internal/base';
|
|
2
|
+
import { type INotificationLogResponse } from '../../types';
|
|
3
|
+
import { NotificationLog } from './notification-log';
|
|
4
|
+
export declare class NotificationLogCollection extends Collection<INotificationLogResponse, NotificationLog> {
|
|
5
|
+
fromJson(data: INotificationLogResponse): NotificationLog;
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationLogCollection = void 0;
|
|
4
|
+
const base_1 = require("../../internal/base");
|
|
5
|
+
const notification_log_1 = require("./notification-log");
|
|
6
|
+
class NotificationLogCollection extends base_1.Collection {
|
|
7
|
+
fromJson(data) {
|
|
8
|
+
return new notification_log_1.NotificationLog(data);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.NotificationLogCollection = NotificationLogCollection;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationLog = void 0;
|
|
4
|
+
class NotificationLog {
|
|
5
|
+
constructor(notificationLogResponse) {
|
|
6
|
+
var _a;
|
|
7
|
+
this.id = notificationLogResponse.id;
|
|
8
|
+
this.responseCode = notificationLogResponse.response_code;
|
|
9
|
+
this.responseContentType = (_a = notificationLogResponse.response_content_type) !== null && _a !== void 0 ? _a : null;
|
|
10
|
+
this.responseBody = notificationLogResponse.response_body;
|
|
11
|
+
this.attemptedAt = notificationLogResponse.attempted_at;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.NotificationLog = NotificationLog;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type NotificationStatus, type Origin } from '../../enums';
|
|
2
|
+
import { type EventEntity, type IEventName } from '../../notifications';
|
|
3
|
+
import { type INotificationResponse } from '../../types';
|
|
4
|
+
export declare class Notification {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly type: IEventName;
|
|
7
|
+
readonly status: NotificationStatus;
|
|
8
|
+
readonly payload: EventEntity | null;
|
|
9
|
+
readonly occurredAt: string;
|
|
10
|
+
readonly deliveredAt: null | string;
|
|
11
|
+
readonly replayedAt: null | string;
|
|
12
|
+
readonly origin: Origin;
|
|
13
|
+
readonly lastAttemptAt: null | string;
|
|
14
|
+
readonly retryAt: null | string;
|
|
15
|
+
readonly timesAttempted: number;
|
|
16
|
+
readonly notificationSettingId: string;
|
|
17
|
+
constructor(notificationResponse: INotificationResponse);
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Notification = void 0;
|
|
4
|
+
const notifications_1 = require("../../notifications");
|
|
5
|
+
class Notification {
|
|
6
|
+
constructor(notificationResponse) {
|
|
7
|
+
var _a, _b, _c, _d;
|
|
8
|
+
this.id = notificationResponse.id;
|
|
9
|
+
this.type = notificationResponse.type;
|
|
10
|
+
this.status = notificationResponse.status;
|
|
11
|
+
this.payload = notifications_1.Webhooks.fromJson(notificationResponse.payload);
|
|
12
|
+
this.occurredAt = notificationResponse.occurred_at;
|
|
13
|
+
this.deliveredAt = (_a = notificationResponse.delivered_at) !== null && _a !== void 0 ? _a : null;
|
|
14
|
+
this.replayedAt = (_b = notificationResponse.replayed_at) !== null && _b !== void 0 ? _b : null;
|
|
15
|
+
this.origin = notificationResponse.origin;
|
|
16
|
+
this.lastAttemptAt = (_c = notificationResponse.last_attempt_at) !== null && _c !== void 0 ? _c : null;
|
|
17
|
+
this.retryAt = (_d = notificationResponse.retry_at) !== null && _d !== void 0 ? _d : null;
|
|
18
|
+
this.timesAttempted = notificationResponse.times_attempted;
|
|
19
|
+
this.notificationSettingId = notificationResponse.notification_setting_id;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.Notification = Notification;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplayNotification = void 0;
|
|
4
|
+
class ReplayNotification {
|
|
5
|
+
constructor(notificationResponse) {
|
|
6
|
+
this.notificationId = notificationResponse.notification_id;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.ReplayNotification = ReplayNotification;
|
|
@@ -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;
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { type ISubscriptionScheduledChangeResponse } from '../../types';
|
|
2
|
-
import { type
|
|
2
|
+
import { type ScheduledChangeAction } from '../../enums';
|
|
3
3
|
export declare class SubscriptionScheduledChange {
|
|
4
|
-
readonly action:
|
|
4
|
+
readonly action: ScheduledChangeAction;
|
|
5
5
|
readonly effectiveAt: string;
|
|
6
6
|
readonly resumeAt: string | null;
|
|
7
7
|
constructor(subscriptionScheduledChange: ISubscriptionScheduledChangeResponse);
|
|
@@ -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;
|
package/dist/enums/index.d.ts
CHANGED
package/dist/enums/index.js
CHANGED
|
@@ -20,3 +20,5 @@ __exportStar(require("./discount"), exports);
|
|
|
20
20
|
__exportStar(require("./adjustment"), exports);
|
|
21
21
|
__exportStar(require("./transaction"), exports);
|
|
22
22
|
__exportStar(require("./payout"), exports);
|
|
23
|
+
__exportStar(require("./notification-settings"), exports);
|
|
24
|
+
__exportStar(require("./notification"), exports);
|