@paddle/paddle-node-sdk 0.2.1 → 0.2.2
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 +11 -0
- package/README.md +43 -4
- package/dist/entities/discount/discount.d.ts +1 -1
- package/dist/entities/discount/discount.js +2 -1
- package/dist/entities/events/event-collection.d.ts +6 -0
- package/dist/entities/events/event-collection.js +11 -0
- package/dist/entities/events/event.d.ts +9 -0
- package/dist/entities/events/event.js +14 -0
- package/dist/entities/events/index.d.ts +1 -0
- package/dist/entities/events/index.js +17 -0
- package/dist/entities/index.d.ts +2 -0
- package/dist/entities/index.js +2 -0
- package/dist/entities/payout/index.d.ts +1 -0
- package/dist/entities/payout/index.js +17 -0
- package/dist/entities/payout/payout.d.ts +9 -0
- package/dist/entities/payout/payout.js +12 -0
- package/dist/entities/subscription/index.d.ts +1 -0
- package/dist/entities/subscription/index.js +1 -0
- package/dist/entities/subscription/subscription-notification.d.ts +28 -0
- package/dist/entities/subscription/subscription-notification.js +35 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.js +1 -0
- package/dist/enums/payout/index.d.ts +1 -0
- package/dist/enums/payout/index.js +17 -0
- package/dist/enums/payout/payout-status.d.ts +1 -0
- package/dist/enums/payout/payout-status.js +2 -0
- package/dist/notifications/events/address/address-created-event.d.ts +9 -0
- package/dist/notifications/events/address/address-created-event.js +14 -0
- package/dist/notifications/events/address/address-updated-event.d.ts +9 -0
- package/dist/notifications/events/address/address-updated-event.js +14 -0
- package/dist/notifications/events/address/index.d.ts +2 -0
- package/dist/notifications/events/address/index.js +18 -0
- package/dist/notifications/events/adjustment/adjustment-created-event.d.ts +9 -0
- package/dist/notifications/events/adjustment/adjustment-created-event.js +14 -0
- package/dist/notifications/events/adjustment/adjustment-updated-event.d.ts +9 -0
- package/dist/notifications/events/adjustment/adjustment-updated-event.js +14 -0
- package/dist/notifications/events/adjustment/index.d.ts +2 -0
- package/dist/notifications/events/adjustment/index.js +18 -0
- package/dist/notifications/events/business/business-created-event.d.ts +9 -0
- package/dist/notifications/events/business/business-created-event.js +14 -0
- package/dist/notifications/events/business/business-updated-event.d.ts +9 -0
- package/dist/notifications/events/business/business-updated-event.js +14 -0
- package/dist/notifications/events/business/index.d.ts +2 -0
- package/dist/notifications/events/business/index.js +18 -0
- package/dist/notifications/events/customer/customer-created-event.d.ts +9 -0
- package/dist/notifications/events/customer/customer-created-event.js +14 -0
- package/dist/notifications/events/customer/customer-updated-event.d.ts +9 -0
- package/dist/notifications/events/customer/customer-updated-event.js +14 -0
- package/dist/notifications/events/customer/index.d.ts +2 -0
- package/dist/notifications/events/customer/index.js +18 -0
- package/dist/notifications/events/discount/discount-created-event.d.ts +9 -0
- package/dist/notifications/events/discount/discount-created-event.js +14 -0
- package/dist/notifications/events/discount/discount-imported-event.d.ts +9 -0
- package/dist/notifications/events/discount/discount-imported-event.js +14 -0
- package/dist/notifications/events/discount/discount-updated-event.d.ts +9 -0
- package/dist/notifications/events/discount/discount-updated-event.js +14 -0
- package/dist/notifications/events/discount/index.d.ts +3 -0
- package/dist/notifications/events/discount/index.js +19 -0
- package/dist/notifications/events/index.d.ts +10 -0
- package/dist/notifications/events/index.js +26 -0
- package/dist/notifications/events/payout/index.d.ts +2 -0
- package/dist/notifications/events/payout/index.js +18 -0
- package/dist/notifications/events/payout/payout-created-event.d.ts +9 -0
- package/dist/notifications/events/payout/payout-created-event.js +14 -0
- package/dist/notifications/events/payout/payout-paid-event.d.ts +9 -0
- package/dist/notifications/events/payout/payout-paid-event.js +14 -0
- package/dist/notifications/events/price/index.d.ts +2 -0
- package/dist/notifications/events/price/index.js +18 -0
- package/dist/notifications/events/price/price-created-event.d.ts +9 -0
- package/dist/notifications/events/price/price-created-event.js +14 -0
- package/dist/notifications/events/price/price-updated-event.d.ts +9 -0
- package/dist/notifications/events/price/price-updated-event.js +14 -0
- package/dist/notifications/events/product/index.d.ts +2 -0
- package/dist/notifications/events/product/index.js +18 -0
- package/dist/notifications/events/product/product-created-event.d.ts +9 -0
- package/dist/notifications/events/product/product-created-event.js +14 -0
- package/dist/notifications/events/product/product-updated-event.d.ts +9 -0
- package/dist/notifications/events/product/product-updated-event.js +14 -0
- package/dist/notifications/events/subscription/index.d.ts +9 -0
- package/dist/notifications/events/subscription/index.js +25 -0
- package/dist/notifications/events/subscription/subscription-activated-event.d.ts +9 -0
- package/dist/notifications/events/subscription/subscription-activated-event.js +14 -0
- package/dist/notifications/events/subscription/subscription-canceled-event.d.ts +9 -0
- package/dist/notifications/events/subscription/subscription-canceled-event.js +14 -0
- package/dist/notifications/events/subscription/subscription-created-event.d.ts +9 -0
- package/dist/notifications/events/subscription/subscription-created-event.js +14 -0
- package/dist/notifications/events/subscription/subscription-imported-event.d.ts +9 -0
- package/dist/notifications/events/subscription/subscription-imported-event.js +14 -0
- package/dist/notifications/events/subscription/subscription-past-due-event.d.ts +9 -0
- package/dist/notifications/events/subscription/subscription-past-due-event.js +14 -0
- package/dist/notifications/events/subscription/subscription-paused-event.d.ts +9 -0
- package/dist/notifications/events/subscription/subscription-paused-event.js +14 -0
- package/dist/notifications/events/subscription/subscription-resumed-event.d.ts +9 -0
- package/dist/notifications/events/subscription/subscription-resumed-event.js +14 -0
- package/dist/notifications/events/subscription/subscription-trialing-event.d.ts +9 -0
- package/dist/notifications/events/subscription/subscription-trialing-event.js +14 -0
- package/dist/notifications/events/subscription/subscription-updated-event.d.ts +9 -0
- package/dist/notifications/events/subscription/subscription-updated-event.js +14 -0
- package/dist/notifications/events/transaction/index.d.ts +9 -0
- package/dist/notifications/events/transaction/index.js +25 -0
- package/dist/notifications/events/transaction/transaction-billed-event.d.ts +9 -0
- package/dist/notifications/events/transaction/transaction-billed-event.js +14 -0
- package/dist/notifications/events/transaction/transaction-canceled-event.d.ts +9 -0
- package/dist/notifications/events/transaction/transaction-canceled-event.js +14 -0
- package/dist/notifications/events/transaction/transaction-completed-event.d.ts +9 -0
- package/dist/notifications/events/transaction/transaction-completed-event.js +14 -0
- package/dist/notifications/events/transaction/transaction-created-event.d.ts +9 -0
- package/dist/notifications/events/transaction/transaction-created-event.js +14 -0
- package/dist/notifications/events/transaction/transaction-paid-event.d.ts +9 -0
- package/dist/notifications/events/transaction/transaction-paid-event.js +14 -0
- package/dist/notifications/events/transaction/transaction-past-due-event.d.ts +9 -0
- package/dist/notifications/events/transaction/transaction-past-due-event.js +14 -0
- package/dist/notifications/events/transaction/transaction-payment-failed-event.d.ts +9 -0
- package/dist/notifications/events/transaction/transaction-payment-failed-event.js +14 -0
- package/dist/notifications/events/transaction/transaction-ready-event.d.ts +9 -0
- package/dist/notifications/events/transaction/transaction-ready-event.js +14 -0
- package/dist/notifications/events/transaction/transaction-updated-event.d.ts +9 -0
- package/dist/notifications/events/transaction/transaction-updated-event.js +14 -0
- package/dist/notifications/helpers/index.d.ts +3 -0
- package/dist/notifications/helpers/index.js +19 -0
- package/dist/notifications/helpers/types.d.ts +40 -0
- package/dist/notifications/helpers/types.js +41 -0
- package/dist/notifications/{validator/notifications-validator.d.ts → helpers/webhooks-validator.d.ts} +1 -1
- package/dist/notifications/{validator/notifications-validator.js → helpers/webhooks-validator.js} +6 -6
- package/dist/notifications/helpers/webhooks.d.ts +7 -0
- package/dist/notifications/helpers/webhooks.js +98 -0
- package/dist/notifications/index.d.ts +2 -1
- package/dist/notifications/index.js +2 -1
- package/dist/paddle.d.ts +5 -1
- package/dist/paddle.js +5 -1
- package/dist/resources/events/index.d.ts +7 -0
- package/dist/resources/events/index.js +30 -0
- package/dist/resources/events/operations/index.d.ts +1 -0
- package/dist/resources/events/operations/index.js +17 -0
- package/dist/resources/events/operations/list-events-query-parameters.d.ts +5 -0
- package/dist/resources/events/operations/list-events-query-parameters.js +2 -0
- package/dist/types/events/events-response.d.ts +125 -0
- package/dist/types/events/events-response.js +2 -0
- package/dist/types/events/index.d.ts +1 -0
- package/dist/types/events/index.js +17 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/payout/index.d.ts +1 -0
- package/dist/types/payout/index.js +17 -0
- package/dist/types/payout/payout-response.d.ts +7 -0
- package/dist/types/payout/payout-response.js +2 -0
- package/dist/types/subscription/index.d.ts +1 -0
- package/dist/types/subscription/index.js +1 -0
- package/dist/types/subscription/subscription-notification-response.d.ts +28 -0
- package/dist/types/subscription/subscription-notification-response.js +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { SubscriptionNotification } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types';
|
|
5
|
+
export declare class SubscriptionResumedEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.SubscriptionResumed;
|
|
7
|
+
readonly data: Omit<SubscriptionNotification, 'transactionId'>;
|
|
8
|
+
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionResumedEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class SubscriptionResumedEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.SubscriptionResumed;
|
|
11
|
+
this.data = new entities_1.SubscriptionNotification(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.SubscriptionResumedEvent = SubscriptionResumedEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { SubscriptionNotification } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types';
|
|
5
|
+
export declare class SubscriptionTrialingEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.SubscriptionTrialing;
|
|
7
|
+
readonly data: Omit<SubscriptionNotification, 'transactionId'>;
|
|
8
|
+
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionTrialingEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class SubscriptionTrialingEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.SubscriptionTrialing;
|
|
11
|
+
this.data = new entities_1.SubscriptionNotification(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.SubscriptionTrialingEvent = SubscriptionTrialingEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { SubscriptionNotification } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types';
|
|
5
|
+
export declare class SubscriptionUpdatedEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.SubscriptionUpdated;
|
|
7
|
+
readonly data: Omit<SubscriptionNotification, 'transactionId'>;
|
|
8
|
+
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionUpdatedEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class SubscriptionUpdatedEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.SubscriptionUpdated;
|
|
11
|
+
this.data = new entities_1.SubscriptionNotification(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.SubscriptionUpdatedEvent = SubscriptionUpdatedEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './transaction-billed-event';
|
|
2
|
+
export * from './transaction-canceled-event';
|
|
3
|
+
export * from './transaction-created-event';
|
|
4
|
+
export * from './transaction-completed-event';
|
|
5
|
+
export * from './transaction-paid-event';
|
|
6
|
+
export * from './transaction-past-due-event';
|
|
7
|
+
export * from './transaction-payment-failed-event';
|
|
8
|
+
export * from './transaction-ready-event';
|
|
9
|
+
export * from './transaction-updated-event';
|
|
@@ -0,0 +1,25 @@
|
|
|
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("./transaction-billed-event"), exports);
|
|
18
|
+
__exportStar(require("./transaction-canceled-event"), exports);
|
|
19
|
+
__exportStar(require("./transaction-created-event"), exports);
|
|
20
|
+
__exportStar(require("./transaction-completed-event"), exports);
|
|
21
|
+
__exportStar(require("./transaction-paid-event"), exports);
|
|
22
|
+
__exportStar(require("./transaction-past-due-event"), exports);
|
|
23
|
+
__exportStar(require("./transaction-payment-failed-event"), exports);
|
|
24
|
+
__exportStar(require("./transaction-ready-event"), exports);
|
|
25
|
+
__exportStar(require("./transaction-updated-event"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Transaction } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ITransactionResponse } from '../../../types';
|
|
5
|
+
export declare class TransactionBilledEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.TransactionBilled;
|
|
7
|
+
readonly data: Transaction;
|
|
8
|
+
constructor(response: IEventsResponse<ITransactionResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionBilledEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class TransactionBilledEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.TransactionBilled;
|
|
11
|
+
this.data = new entities_1.Transaction(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TransactionBilledEvent = TransactionBilledEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Transaction } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ITransactionResponse } from '../../../types';
|
|
5
|
+
export declare class TransactionCanceledEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.TransactionCanceled;
|
|
7
|
+
readonly data: Transaction;
|
|
8
|
+
constructor(response: IEventsResponse<ITransactionResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionCanceledEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class TransactionCanceledEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.TransactionCanceled;
|
|
11
|
+
this.data = new entities_1.Transaction(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TransactionCanceledEvent = TransactionCanceledEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Transaction } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ITransactionResponse } from '../../../types';
|
|
5
|
+
export declare class TransactionCompletedEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.TransactionCompleted;
|
|
7
|
+
readonly data: Transaction;
|
|
8
|
+
constructor(response: IEventsResponse<ITransactionResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionCompletedEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class TransactionCompletedEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.TransactionCompleted;
|
|
11
|
+
this.data = new entities_1.Transaction(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TransactionCompletedEvent = TransactionCompletedEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Transaction } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ITransactionResponse } from '../../../types';
|
|
5
|
+
export declare class TransactionCreatedEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.TransactionCreated;
|
|
7
|
+
readonly data: Transaction;
|
|
8
|
+
constructor(response: IEventsResponse<ITransactionResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionCreatedEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class TransactionCreatedEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.TransactionCreated;
|
|
11
|
+
this.data = new entities_1.Transaction(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TransactionCreatedEvent = TransactionCreatedEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Transaction } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ITransactionResponse } from '../../../types';
|
|
5
|
+
export declare class TransactionPaidEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.TransactionPaid;
|
|
7
|
+
readonly data: Transaction;
|
|
8
|
+
constructor(response: IEventsResponse<ITransactionResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionPaidEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class TransactionPaidEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.TransactionPaid;
|
|
11
|
+
this.data = new entities_1.Transaction(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TransactionPaidEvent = TransactionPaidEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Transaction } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ITransactionResponse } from '../../../types';
|
|
5
|
+
export declare class TransactionPastDueEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.TransactionPastDue;
|
|
7
|
+
readonly data: Transaction;
|
|
8
|
+
constructor(response: IEventsResponse<ITransactionResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionPastDueEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class TransactionPastDueEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.TransactionPastDue;
|
|
11
|
+
this.data = new entities_1.Transaction(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TransactionPastDueEvent = TransactionPastDueEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Transaction } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ITransactionResponse } from '../../../types';
|
|
5
|
+
export declare class TransactionPaymentFailedEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.TransactionPaymentFailed;
|
|
7
|
+
readonly data: Transaction;
|
|
8
|
+
constructor(response: IEventsResponse<ITransactionResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionPaymentFailedEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class TransactionPaymentFailedEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.TransactionPaymentFailed;
|
|
11
|
+
this.data = new entities_1.Transaction(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TransactionPaymentFailedEvent = TransactionPaymentFailedEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Transaction } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ITransactionResponse } from '../../../types';
|
|
5
|
+
export declare class TransactionReadyEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.TransactionReady;
|
|
7
|
+
readonly data: Transaction;
|
|
8
|
+
constructor(response: IEventsResponse<ITransactionResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionReadyEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class TransactionReadyEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.TransactionReady;
|
|
11
|
+
this.data = new entities_1.Transaction(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TransactionReadyEvent = TransactionReadyEvent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Transaction } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type ITransactionResponse } from '../../../types';
|
|
5
|
+
export declare class TransactionUpdatedEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.TransactionUpdated;
|
|
7
|
+
readonly data: Transaction;
|
|
8
|
+
constructor(response: IEventsResponse<ITransactionResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionUpdatedEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class TransactionUpdatedEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.TransactionUpdated;
|
|
11
|
+
this.data = new entities_1.Transaction(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TransactionUpdatedEvent = TransactionUpdatedEvent;
|
|
@@ -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("./types"), exports);
|
|
18
|
+
__exportStar(require("./webhooks"), exports);
|
|
19
|
+
__exportStar(require("./webhooks-validator"), exports);
|
|
@@ -0,0 +1,40 @@
|
|
|
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;
|
|
3
|
+
export declare enum EventName {
|
|
4
|
+
AddressCreated = "address.created",
|
|
5
|
+
AddressUpdated = "address.updated",
|
|
6
|
+
AdjustmentCreated = "adjustment.created",
|
|
7
|
+
AdjustmentUpdated = "adjustment.updated",
|
|
8
|
+
BusinessCreated = "business.created",
|
|
9
|
+
BusinessUpdated = "business.updated",
|
|
10
|
+
CustomerCreated = "customer.created",
|
|
11
|
+
CustomerUpdated = "customer.updated",
|
|
12
|
+
DiscountCreated = "discount.created",
|
|
13
|
+
DiscountUpdated = "discount.updated",
|
|
14
|
+
DiscountImported = "discount.imported",
|
|
15
|
+
PayoutCreated = "payout.created",
|
|
16
|
+
PayoutPaid = "payout.paid",
|
|
17
|
+
PriceCreated = "price.created",
|
|
18
|
+
PriceUpdated = "price.updated",
|
|
19
|
+
ProductCreated = "product.created",
|
|
20
|
+
ProductUpdated = "product.updated",
|
|
21
|
+
SubscriptionActivated = "subscription.activated",
|
|
22
|
+
SubscriptionCanceled = "subscription.canceled",
|
|
23
|
+
SubscriptionImported = "subscription.imported",
|
|
24
|
+
SubscriptionCreated = "subscription.created",
|
|
25
|
+
SubscriptionPastDue = "subscription.past_due",
|
|
26
|
+
SubscriptionPaused = "subscription.paused",
|
|
27
|
+
SubscriptionResumed = "subscription.resumed",
|
|
28
|
+
SubscriptionTrialing = "subscription.trialing",
|
|
29
|
+
SubscriptionUpdated = "subscription.updated",
|
|
30
|
+
TransactionBilled = "transaction.billed",
|
|
31
|
+
TransactionCanceled = "transaction.canceled",
|
|
32
|
+
TransactionCompleted = "transaction.completed",
|
|
33
|
+
TransactionPaid = "transaction.paid",
|
|
34
|
+
TransactionCreated = "transaction.created",
|
|
35
|
+
TransactionPastDue = "transaction.past_due",
|
|
36
|
+
TransactionPaymentFailed = "transaction.payment_failed",
|
|
37
|
+
TransactionReady = "transaction.ready",
|
|
38
|
+
TransactionUpdated = "transaction.updated"
|
|
39
|
+
}
|
|
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';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventName = void 0;
|
|
4
|
+
var EventName;
|
|
5
|
+
(function (EventName) {
|
|
6
|
+
EventName["AddressCreated"] = "address.created";
|
|
7
|
+
EventName["AddressUpdated"] = "address.updated";
|
|
8
|
+
EventName["AdjustmentCreated"] = "adjustment.created";
|
|
9
|
+
EventName["AdjustmentUpdated"] = "adjustment.updated";
|
|
10
|
+
EventName["BusinessCreated"] = "business.created";
|
|
11
|
+
EventName["BusinessUpdated"] = "business.updated";
|
|
12
|
+
EventName["CustomerCreated"] = "customer.created";
|
|
13
|
+
EventName["CustomerUpdated"] = "customer.updated";
|
|
14
|
+
EventName["DiscountCreated"] = "discount.created";
|
|
15
|
+
EventName["DiscountUpdated"] = "discount.updated";
|
|
16
|
+
EventName["DiscountImported"] = "discount.imported";
|
|
17
|
+
EventName["PayoutCreated"] = "payout.created";
|
|
18
|
+
EventName["PayoutPaid"] = "payout.paid";
|
|
19
|
+
EventName["PriceCreated"] = "price.created";
|
|
20
|
+
EventName["PriceUpdated"] = "price.updated";
|
|
21
|
+
EventName["ProductCreated"] = "product.created";
|
|
22
|
+
EventName["ProductUpdated"] = "product.updated";
|
|
23
|
+
EventName["SubscriptionActivated"] = "subscription.activated";
|
|
24
|
+
EventName["SubscriptionCanceled"] = "subscription.canceled";
|
|
25
|
+
EventName["SubscriptionImported"] = "subscription.imported";
|
|
26
|
+
EventName["SubscriptionCreated"] = "subscription.created";
|
|
27
|
+
EventName["SubscriptionPastDue"] = "subscription.past_due";
|
|
28
|
+
EventName["SubscriptionPaused"] = "subscription.paused";
|
|
29
|
+
EventName["SubscriptionResumed"] = "subscription.resumed";
|
|
30
|
+
EventName["SubscriptionTrialing"] = "subscription.trialing";
|
|
31
|
+
EventName["SubscriptionUpdated"] = "subscription.updated";
|
|
32
|
+
EventName["TransactionBilled"] = "transaction.billed";
|
|
33
|
+
EventName["TransactionCanceled"] = "transaction.canceled";
|
|
34
|
+
EventName["TransactionCompleted"] = "transaction.completed";
|
|
35
|
+
EventName["TransactionPaid"] = "transaction.paid";
|
|
36
|
+
EventName["TransactionCreated"] = "transaction.created";
|
|
37
|
+
EventName["TransactionPastDue"] = "transaction.past_due";
|
|
38
|
+
EventName["TransactionPaymentFailed"] = "transaction.payment_failed";
|
|
39
|
+
EventName["TransactionReady"] = "transaction.ready";
|
|
40
|
+
EventName["TransactionUpdated"] = "transaction.updated";
|
|
41
|
+
})(EventName || (exports.EventName = EventName = {}));
|
package/dist/notifications/{validator/notifications-validator.js → helpers/webhooks-validator.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WebhooksValidator = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
|
-
class
|
|
5
|
+
class WebhooksValidator {
|
|
6
6
|
extractHeader(header) {
|
|
7
7
|
const parts = header.split(';');
|
|
8
8
|
let ts = '';
|
|
@@ -22,13 +22,13 @@ class NotificationsValidator {
|
|
|
22
22
|
return { ts: parseInt(ts), h1 };
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
|
-
throw new Error('Invalid
|
|
25
|
+
throw new Error('[Paddle] Invalid webhook signature');
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
isValidSignature(requestBody, secretKey, signature) {
|
|
29
29
|
const headers = this.extractHeader(signature);
|
|
30
30
|
const payloadWithTime = `${headers.ts}:${requestBody}`;
|
|
31
|
-
if (new Date().getTime() > new Date((headers.ts +
|
|
31
|
+
if (new Date().getTime() > new Date((headers.ts + WebhooksValidator.MAX_VALID_TIME_DIFFERENCE) * 1000).getTime()) {
|
|
32
32
|
return false;
|
|
33
33
|
}
|
|
34
34
|
const hmac = (0, crypto_1.createHmac)('sha256', secretKey);
|
|
@@ -37,5 +37,5 @@ class NotificationsValidator {
|
|
|
37
37
|
return computedHash === headers.h1;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
exports.
|
|
41
|
-
|
|
40
|
+
exports.WebhooksValidator = WebhooksValidator;
|
|
41
|
+
WebhooksValidator.MAX_VALID_TIME_DIFFERENCE = 5;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type IEvents } from '../../types';
|
|
2
|
+
import { type EventEntity } from './types';
|
|
3
|
+
export declare class Webhooks {
|
|
4
|
+
unmarshal(requestBody: string, secretKey: string, signature: string): EventEntity;
|
|
5
|
+
isSignatureValid(requestBody: string, secretKey: string, signature: string): boolean;
|
|
6
|
+
static fromJson(data: IEvents): EventEntity;
|
|
7
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Webhooks = void 0;
|
|
4
|
+
const events_1 = require("../events");
|
|
5
|
+
const types_1 = require("./types");
|
|
6
|
+
const webhooks_validator_1 = require("./webhooks-validator");
|
|
7
|
+
class Webhooks {
|
|
8
|
+
unmarshal(requestBody, secretKey, signature) {
|
|
9
|
+
const isSignatureValid = new webhooks_validator_1.WebhooksValidator().isValidSignature(requestBody, secretKey, signature);
|
|
10
|
+
if (isSignatureValid) {
|
|
11
|
+
const parsedRequest = JSON.parse(requestBody);
|
|
12
|
+
return Webhooks.fromJson(parsedRequest);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
throw new Error('[Paddle] Webhook signature verification failed');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
isSignatureValid(requestBody, secretKey, signature) {
|
|
19
|
+
return new webhooks_validator_1.WebhooksValidator().isValidSignature(requestBody, secretKey, signature);
|
|
20
|
+
}
|
|
21
|
+
static fromJson(data) {
|
|
22
|
+
switch (data.event_type) {
|
|
23
|
+
case types_1.EventName.AddressCreated:
|
|
24
|
+
return new events_1.AddressCreatedEvent(data);
|
|
25
|
+
case types_1.EventName.AddressUpdated:
|
|
26
|
+
return new events_1.AddressUpdatedEvent(data);
|
|
27
|
+
case types_1.EventName.AdjustmentCreated:
|
|
28
|
+
return new events_1.AdjustmentCreatedEvent(data);
|
|
29
|
+
case types_1.EventName.AdjustmentUpdated:
|
|
30
|
+
return new events_1.AdjustmentUpdatedEvent(data);
|
|
31
|
+
case types_1.EventName.BusinessCreated:
|
|
32
|
+
return new events_1.BusinessCreatedEvent(data);
|
|
33
|
+
case types_1.EventName.BusinessUpdated:
|
|
34
|
+
return new events_1.BusinessUpdatedEvent(data);
|
|
35
|
+
case types_1.EventName.CustomerCreated:
|
|
36
|
+
return new events_1.CustomerCreatedEvent(data);
|
|
37
|
+
case types_1.EventName.CustomerUpdated:
|
|
38
|
+
return new events_1.CustomerUpdatedEvent(data);
|
|
39
|
+
case types_1.EventName.DiscountCreated:
|
|
40
|
+
return new events_1.DiscountCreatedEvent(data);
|
|
41
|
+
case types_1.EventName.DiscountImported:
|
|
42
|
+
return new events_1.DiscountImportedEvent(data);
|
|
43
|
+
case types_1.EventName.DiscountUpdated:
|
|
44
|
+
return new events_1.DiscountUpdatedEvent(data);
|
|
45
|
+
case types_1.EventName.PayoutCreated:
|
|
46
|
+
return new events_1.PayoutCreatedEvent(data);
|
|
47
|
+
case types_1.EventName.PayoutPaid:
|
|
48
|
+
return new events_1.PayoutPaidEvent(data);
|
|
49
|
+
case types_1.EventName.PriceCreated:
|
|
50
|
+
return new events_1.PriceCreatedEvent(data);
|
|
51
|
+
case types_1.EventName.PriceUpdated:
|
|
52
|
+
return new events_1.PriceUpdatedEvent(data);
|
|
53
|
+
case types_1.EventName.ProductCreated:
|
|
54
|
+
return new events_1.ProductCreatedEvent(data);
|
|
55
|
+
case types_1.EventName.ProductUpdated:
|
|
56
|
+
return new events_1.ProductUpdatedEvent(data);
|
|
57
|
+
case types_1.EventName.SubscriptionActivated:
|
|
58
|
+
return new events_1.SubscriptionActivatedEvent(data);
|
|
59
|
+
case types_1.EventName.SubscriptionCanceled:
|
|
60
|
+
return new events_1.SubscriptionCanceledEvent(data);
|
|
61
|
+
case types_1.EventName.SubscriptionCreated:
|
|
62
|
+
return new events_1.SubscriptionCreatedEvent(data);
|
|
63
|
+
case types_1.EventName.SubscriptionImported:
|
|
64
|
+
return new events_1.SubscriptionImportedEvent(data);
|
|
65
|
+
case types_1.EventName.SubscriptionPastDue:
|
|
66
|
+
return new events_1.SubscriptionPastDueEvent(data);
|
|
67
|
+
case types_1.EventName.SubscriptionPaused:
|
|
68
|
+
return new events_1.SubscriptionPausedEvent(data);
|
|
69
|
+
case types_1.EventName.SubscriptionResumed:
|
|
70
|
+
return new events_1.SubscriptionResumedEvent(data);
|
|
71
|
+
case types_1.EventName.SubscriptionTrialing:
|
|
72
|
+
return new events_1.SubscriptionTrialingEvent(data);
|
|
73
|
+
case types_1.EventName.SubscriptionUpdated:
|
|
74
|
+
return new events_1.SubscriptionUpdatedEvent(data);
|
|
75
|
+
case types_1.EventName.TransactionBilled:
|
|
76
|
+
return new events_1.TransactionBilledEvent(data);
|
|
77
|
+
case types_1.EventName.TransactionCanceled:
|
|
78
|
+
return new events_1.TransactionCanceledEvent(data);
|
|
79
|
+
case types_1.EventName.TransactionCompleted:
|
|
80
|
+
return new events_1.TransactionCompletedEvent(data);
|
|
81
|
+
case types_1.EventName.TransactionCreated:
|
|
82
|
+
return new events_1.TransactionCreatedEvent(data);
|
|
83
|
+
case types_1.EventName.TransactionPaid:
|
|
84
|
+
return new events_1.TransactionPaidEvent(data);
|
|
85
|
+
case types_1.EventName.TransactionPastDue:
|
|
86
|
+
return new events_1.TransactionPastDueEvent(data);
|
|
87
|
+
case types_1.EventName.TransactionPaymentFailed:
|
|
88
|
+
return new events_1.TransactionPaymentFailedEvent(data);
|
|
89
|
+
case types_1.EventName.TransactionReady:
|
|
90
|
+
return new events_1.TransactionReadyEvent(data);
|
|
91
|
+
case types_1.EventName.TransactionUpdated:
|
|
92
|
+
return new events_1.TransactionUpdatedEvent(data);
|
|
93
|
+
default:
|
|
94
|
+
throw new Error('[Paddle] Unknown event_type');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.Webhooks = Webhooks;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './helpers';
|
|
2
|
+
export * from './events';
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./helpers"), exports);
|
|
18
|
+
__exportStar(require("./events"), exports);
|