@paddle/paddle-node-sdk 0.2.4 → 0.2.6
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 +26 -1
- package/README.md +9 -6
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/price/price-with-includes.d.ts +2 -1
- package/dist/entities/price/price-with-includes.js +2 -0
- package/dist/entities/price/price.d.ts +2 -1
- package/dist/entities/price/price.js +2 -0
- package/dist/entities/pricing-preview/pricing-preview.d.ts +2 -0
- package/dist/entities/pricing-preview/pricing-preview.js +2 -1
- package/dist/entities/product/product-with-includes.d.ts +2 -1
- package/dist/entities/product/product-with-includes.js +2 -0
- package/dist/entities/product/product.d.ts +2 -1
- package/dist/entities/product/product.js +2 -0
- package/dist/entities/report/index.d.ts +4 -0
- package/dist/entities/report/index.js +20 -0
- package/dist/entities/report/report-collection.d.ts +6 -0
- package/dist/entities/report/report-collection.js +11 -0
- package/dist/entities/report/report-csv.d.ts +5 -0
- package/dist/entities/report/report-csv.js +9 -0
- package/dist/entities/report/report-filters.d.ts +8 -0
- package/dist/entities/report/report-filters.js +12 -0
- package/dist/entities/report/report.d.ts +13 -0
- package/dist/entities/report/report.js +17 -0
- package/dist/entities/transaction/transaction-preview.d.ts +2 -0
- package/dist/entities/transaction/transaction-preview.js +2 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.js +1 -0
- package/dist/enums/report/index.d.ts +4 -0
- package/dist/enums/report/index.js +20 -0
- package/dist/enums/report/report-filter-name.d.ts +1 -0
- package/dist/enums/report/report-filter-name.js +2 -0
- package/dist/enums/report/report-filter-operator.d.ts +1 -0
- package/dist/enums/report/report-filter-operator.js +2 -0
- package/dist/enums/report/report-status.d.ts +1 -0
- package/dist/enums/report/report-status.js +2 -0
- package/dist/enums/report/report-type.d.ts +1 -0
- package/dist/enums/report/report-type.js +2 -0
- package/dist/enums/shared/available-payment-methods.d.ts +1 -0
- package/dist/enums/shared/available-payment-methods.js +2 -0
- package/dist/enums/shared/catalog-type.d.ts +1 -0
- package/dist/enums/shared/catalog-type.js +2 -0
- package/dist/enums/shared/index.d.ts +1 -0
- package/dist/enums/shared/index.js +1 -0
- package/dist/enums/subscription/index.d.ts +1 -0
- package/dist/enums/subscription/index.js +1 -0
- package/dist/enums/subscription/subscription-on-payment-failure.d.ts +1 -0
- package/dist/enums/subscription/subscription-on-payment-failure.js +2 -0
- package/dist/internal/api/client.js +2 -2
- package/dist/notifications/events/address/address-imported-event.d.ts +9 -0
- package/dist/notifications/events/address/address-imported-event.js +14 -0
- package/dist/notifications/events/address/index.d.ts +1 -0
- package/dist/notifications/events/address/index.js +1 -0
- package/dist/notifications/events/business/business-imported-event.d.ts +9 -0
- package/dist/notifications/events/business/business-imported-event.js +14 -0
- package/dist/notifications/events/business/index.d.ts +1 -0
- package/dist/notifications/events/business/index.js +1 -0
- package/dist/notifications/events/customer/customer-imported-event.d.ts +9 -0
- package/dist/notifications/events/customer/customer-imported-event.js +14 -0
- package/dist/notifications/events/customer/index.d.ts +1 -0
- package/dist/notifications/events/customer/index.js +1 -0
- package/dist/notifications/events/index.d.ts +1 -0
- package/dist/notifications/events/index.js +1 -0
- package/dist/notifications/events/price/index.d.ts +1 -0
- package/dist/notifications/events/price/index.js +1 -0
- package/dist/notifications/events/price/price-imported-event.d.ts +9 -0
- package/dist/notifications/events/price/price-imported-event.js +14 -0
- package/dist/notifications/events/product/index.d.ts +1 -0
- package/dist/notifications/events/product/index.js +1 -0
- package/dist/notifications/events/product/product-imported-event.d.ts +9 -0
- package/dist/notifications/events/product/product-imported-event.js +14 -0
- package/dist/notifications/events/report/index.d.ts +2 -0
- package/dist/notifications/events/report/index.js +18 -0
- package/dist/notifications/events/report/report-created-event.d.ts +9 -0
- package/dist/notifications/events/report/report-created-event.js +14 -0
- package/dist/notifications/events/report/report-updated-event.d.ts +9 -0
- package/dist/notifications/events/report/report-updated-event.js +14 -0
- package/dist/notifications/helpers/types.d.ts +11 -4
- package/dist/notifications/helpers/types.js +7 -0
- package/dist/notifications/helpers/webhooks.js +15 -1
- package/dist/paddle.d.ts +2 -1
- package/dist/paddle.js +1 -0
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.js +1 -0
- package/dist/resources/prices/operations/create-price-request-body.d.ts +2 -1
- package/dist/resources/prices/operations/list-price-query-parameters.d.ts +2 -1
- package/dist/resources/prices/operations/update-price-request-body.d.ts +2 -1
- package/dist/resources/products/operations/create-product-request-body.d.ts +2 -1
- package/dist/resources/products/operations/list-product-query-parameters.d.ts +2 -1
- package/dist/resources/products/operations/update-product-request-body.d.ts +2 -1
- package/dist/resources/reports/index.d.ts +10 -0
- package/dist/resources/reports/index.js +69 -0
- package/dist/resources/reports/operations/create-report-request-object.d.ts +6 -0
- package/dist/resources/reports/operations/create-report-request-object.js +2 -0
- package/dist/resources/reports/operations/index.d.ts +2 -0
- package/dist/resources/reports/operations/index.js +18 -0
- package/dist/resources/reports/operations/list-report-query-parameters.d.ts +7 -0
- package/dist/resources/reports/operations/list-report-query-parameters.js +2 -0
- package/dist/resources/subscriptions/operations/create-subscription-charge-request-object.d.ts +16 -2
- package/dist/resources/subscriptions/operations/update-subscription-request-body.d.ts +2 -1
- package/dist/resources/transactions/operations/create-transaction-request-body.d.ts +2 -2
- package/dist/resources/transactions/operations/update-transaction-request-body.d.ts +2 -2
- package/dist/types/events/events-response.d.ts +23 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/price/index.d.ts +2 -0
- package/dist/types/price/index.js +2 -0
- package/dist/types/price/non-catalog-price-request.d.ts +24 -0
- package/dist/types/price/non-catalog-price-request.js +2 -0
- package/dist/types/price/price-response.d.ts +2 -1
- package/dist/types/price/subscription-non-catalog-price-request.d.ts +22 -0
- package/dist/types/price/subscription-non-catalog-price-request.js +2 -0
- package/dist/types/pricing-preview/pricing-preview-response.d.ts +2 -0
- package/dist/types/product/product-response.d.ts +2 -1
- package/dist/types/report/index.d.ts +3 -0
- package/dist/types/report/index.js +19 -0
- package/dist/types/report/report-filters.d.ts +6 -0
- package/dist/types/report/report-filters.js +2 -0
- package/dist/types/report/report.d.ts +11 -0
- package/dist/types/report/report.js +2 -0
- package/dist/types/report/reports-csv.d.ts +3 -0
- package/dist/types/report/reports-csv.js +2 -0
- package/dist/types/shared/shared-price-response.d.ts +2 -1
- package/dist/types/shared/shared-product-response.d.ts +2 -1
- package/dist/types/transaction/transaction-item.d.ts +9 -1
- package/dist/types/transaction/transaction-preview-item.d.ts +12 -2
- package/dist/types/transaction/transaction-preview-response.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerImportedEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class CustomerImportedEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.CustomerImported;
|
|
11
|
+
this.data = new entities_1.Customer(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.CustomerImportedEvent = CustomerImportedEvent;
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./customer-created-event"), exports);
|
|
18
18
|
__exportStar(require("./customer-updated-event"), exports);
|
|
19
|
+
__exportStar(require("./customer-imported-event"), exports);
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./price-created-event"), exports);
|
|
18
18
|
__exportStar(require("./price-updated-event"), exports);
|
|
19
|
+
__exportStar(require("./price-imported-event"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Price } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type IPriceResponse } from '../../../types';
|
|
5
|
+
export declare class PriceImportedEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.PriceImported;
|
|
7
|
+
readonly data: Price;
|
|
8
|
+
constructor(response: IEventsResponse<IPriceResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PriceImportedEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class PriceImportedEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.PriceImported;
|
|
11
|
+
this.data = new entities_1.Price(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.PriceImportedEvent = PriceImportedEvent;
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./product-created-event"), exports);
|
|
18
18
|
__exportStar(require("./product-updated-event"), exports);
|
|
19
|
+
__exportStar(require("./product-imported-event"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { Product } from '../../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse, type IProductResponse } from '../../../types';
|
|
5
|
+
export declare class ProductImportedEvent extends Event {
|
|
6
|
+
readonly eventType = EventName.ProductImported;
|
|
7
|
+
readonly data: Product;
|
|
8
|
+
constructor(response: IEventsResponse<IProductResponse>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductImportedEvent = void 0;
|
|
4
|
+
const event_1 = require("../../../entities/events/event");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
class ProductImportedEvent extends event_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = helpers_1.EventName.ProductImported;
|
|
11
|
+
this.data = new entities_1.Product(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.ProductImportedEvent = ProductImportedEvent;
|
|
@@ -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,14 +1,17 @@
|
|
|
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 AddressImportedEvent, 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, type BusinessImportedEvent, type CustomerImportedEvent, type PriceImportedEvent, type ProductImportedEvent } from '../events';
|
|
2
|
+
export type EventEntity = AddressCreatedEvent | AddressUpdatedEvent | AddressImportedEvent | AdjustmentUpdatedEvent | AdjustmentCreatedEvent | BusinessCreatedEvent | BusinessUpdatedEvent | BusinessImportedEvent | CustomerCreatedEvent | CustomerUpdatedEvent | CustomerImportedEvent | DiscountCreatedEvent | DiscountUpdatedEvent | DiscountImportedEvent | PayoutCreatedEvent | PayoutPaidEvent | PriceCreatedEvent | PriceUpdatedEvent | PriceImportedEvent | ProductCreatedEvent | ProductUpdatedEvent | ProductImportedEvent | 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",
|
|
6
|
+
AddressImported = "address.imported",
|
|
6
7
|
AdjustmentCreated = "adjustment.created",
|
|
7
8
|
AdjustmentUpdated = "adjustment.updated",
|
|
8
9
|
BusinessCreated = "business.created",
|
|
10
|
+
BusinessImported = "business.imported",
|
|
9
11
|
BusinessUpdated = "business.updated",
|
|
10
12
|
CustomerCreated = "customer.created",
|
|
11
13
|
CustomerUpdated = "customer.updated",
|
|
14
|
+
CustomerImported = "customer.imported",
|
|
12
15
|
DiscountCreated = "discount.created",
|
|
13
16
|
DiscountUpdated = "discount.updated",
|
|
14
17
|
DiscountImported = "discount.imported",
|
|
@@ -16,8 +19,10 @@ export declare enum EventName {
|
|
|
16
19
|
PayoutPaid = "payout.paid",
|
|
17
20
|
PriceCreated = "price.created",
|
|
18
21
|
PriceUpdated = "price.updated",
|
|
22
|
+
PriceImported = "price.imported",
|
|
19
23
|
ProductCreated = "product.created",
|
|
20
24
|
ProductUpdated = "product.updated",
|
|
25
|
+
ProductImported = "product.imported",
|
|
21
26
|
SubscriptionActivated = "subscription.activated",
|
|
22
27
|
SubscriptionCanceled = "subscription.canceled",
|
|
23
28
|
SubscriptionImported = "subscription.imported",
|
|
@@ -35,6 +40,8 @@ export declare enum EventName {
|
|
|
35
40
|
TransactionPastDue = "transaction.past_due",
|
|
36
41
|
TransactionPaymentFailed = "transaction.payment_failed",
|
|
37
42
|
TransactionReady = "transaction.ready",
|
|
38
|
-
TransactionUpdated = "transaction.updated"
|
|
43
|
+
TransactionUpdated = "transaction.updated",
|
|
44
|
+
ReportCreated = "report.created",
|
|
45
|
+
ReportUpdated = "report.updated"
|
|
39
46
|
}
|
|
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';
|
|
47
|
+
export type IEventName = 'address.created' | 'address.updated' | 'address.imported' | 'adjustment.created' | 'adjustment.updated' | 'business.created' | 'business.updated' | 'business.imported' | 'customer.created' | 'customer.updated' | 'discount.created' | 'discount.updated' | 'discount.imported' | 'payout.updated' | 'payout.paid' | 'price.updated' | 'price.created' | 'price.imported' | 'product.updated' | 'product.created' | 'product.imported' | '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';
|
|
@@ -5,12 +5,15 @@ var EventName;
|
|
|
5
5
|
(function (EventName) {
|
|
6
6
|
EventName["AddressCreated"] = "address.created";
|
|
7
7
|
EventName["AddressUpdated"] = "address.updated";
|
|
8
|
+
EventName["AddressImported"] = "address.imported";
|
|
8
9
|
EventName["AdjustmentCreated"] = "adjustment.created";
|
|
9
10
|
EventName["AdjustmentUpdated"] = "adjustment.updated";
|
|
10
11
|
EventName["BusinessCreated"] = "business.created";
|
|
12
|
+
EventName["BusinessImported"] = "business.imported";
|
|
11
13
|
EventName["BusinessUpdated"] = "business.updated";
|
|
12
14
|
EventName["CustomerCreated"] = "customer.created";
|
|
13
15
|
EventName["CustomerUpdated"] = "customer.updated";
|
|
16
|
+
EventName["CustomerImported"] = "customer.imported";
|
|
14
17
|
EventName["DiscountCreated"] = "discount.created";
|
|
15
18
|
EventName["DiscountUpdated"] = "discount.updated";
|
|
16
19
|
EventName["DiscountImported"] = "discount.imported";
|
|
@@ -18,8 +21,10 @@ var EventName;
|
|
|
18
21
|
EventName["PayoutPaid"] = "payout.paid";
|
|
19
22
|
EventName["PriceCreated"] = "price.created";
|
|
20
23
|
EventName["PriceUpdated"] = "price.updated";
|
|
24
|
+
EventName["PriceImported"] = "price.imported";
|
|
21
25
|
EventName["ProductCreated"] = "product.created";
|
|
22
26
|
EventName["ProductUpdated"] = "product.updated";
|
|
27
|
+
EventName["ProductImported"] = "product.imported";
|
|
23
28
|
EventName["SubscriptionActivated"] = "subscription.activated";
|
|
24
29
|
EventName["SubscriptionCanceled"] = "subscription.canceled";
|
|
25
30
|
EventName["SubscriptionImported"] = "subscription.imported";
|
|
@@ -38,4 +43,6 @@ var EventName;
|
|
|
38
43
|
EventName["TransactionPaymentFailed"] = "transaction.payment_failed";
|
|
39
44
|
EventName["TransactionReady"] = "transaction.ready";
|
|
40
45
|
EventName["TransactionUpdated"] = "transaction.updated";
|
|
46
|
+
EventName["ReportCreated"] = "report.created";
|
|
47
|
+
EventName["ReportUpdated"] = "report.updated";
|
|
41
48
|
})(EventName || (exports.EventName = EventName = {}));
|
|
@@ -25,6 +25,8 @@ class Webhooks {
|
|
|
25
25
|
return new events_1.AddressCreatedEvent(data);
|
|
26
26
|
case types_1.EventName.AddressUpdated:
|
|
27
27
|
return new events_1.AddressUpdatedEvent(data);
|
|
28
|
+
case types_1.EventName.AddressImported:
|
|
29
|
+
return new events_1.AddressImportedEvent(data);
|
|
28
30
|
case types_1.EventName.AdjustmentCreated:
|
|
29
31
|
return new events_1.AdjustmentCreatedEvent(data);
|
|
30
32
|
case types_1.EventName.AdjustmentUpdated:
|
|
@@ -33,10 +35,14 @@ class Webhooks {
|
|
|
33
35
|
return new events_1.BusinessCreatedEvent(data);
|
|
34
36
|
case types_1.EventName.BusinessUpdated:
|
|
35
37
|
return new events_1.BusinessUpdatedEvent(data);
|
|
38
|
+
case types_1.EventName.BusinessImported:
|
|
39
|
+
return new events_1.BusinessImportedEvent(data);
|
|
36
40
|
case types_1.EventName.CustomerCreated:
|
|
37
41
|
return new events_1.CustomerCreatedEvent(data);
|
|
38
42
|
case types_1.EventName.CustomerUpdated:
|
|
39
43
|
return new events_1.CustomerUpdatedEvent(data);
|
|
44
|
+
case types_1.EventName.CustomerImported:
|
|
45
|
+
return new events_1.CustomerImportedEvent(data);
|
|
40
46
|
case types_1.EventName.DiscountCreated:
|
|
41
47
|
return new events_1.DiscountCreatedEvent(data);
|
|
42
48
|
case types_1.EventName.DiscountImported:
|
|
@@ -51,10 +57,14 @@ class Webhooks {
|
|
|
51
57
|
return new events_1.PriceCreatedEvent(data);
|
|
52
58
|
case types_1.EventName.PriceUpdated:
|
|
53
59
|
return new events_1.PriceUpdatedEvent(data);
|
|
60
|
+
case types_1.EventName.PriceImported:
|
|
61
|
+
return new events_1.PriceImportedEvent(data);
|
|
54
62
|
case types_1.EventName.ProductCreated:
|
|
55
63
|
return new events_1.ProductCreatedEvent(data);
|
|
56
64
|
case types_1.EventName.ProductUpdated:
|
|
57
65
|
return new events_1.ProductUpdatedEvent(data);
|
|
66
|
+
case types_1.EventName.ProductImported:
|
|
67
|
+
return new events_1.ProductImportedEvent(data);
|
|
58
68
|
case types_1.EventName.SubscriptionActivated:
|
|
59
69
|
return new events_1.SubscriptionActivatedEvent(data);
|
|
60
70
|
case types_1.EventName.SubscriptionCanceled:
|
|
@@ -91,8 +101,12 @@ class Webhooks {
|
|
|
91
101
|
return new events_1.TransactionReadyEvent(data);
|
|
92
102
|
case types_1.EventName.TransactionUpdated:
|
|
93
103
|
return new events_1.TransactionUpdatedEvent(data);
|
|
104
|
+
case types_1.EventName.ReportCreated:
|
|
105
|
+
return new events_1.ReportCreatedEvent(data);
|
|
106
|
+
case types_1.EventName.ReportUpdated:
|
|
107
|
+
return new events_1.ReportUpdatedEvent(data);
|
|
94
108
|
default:
|
|
95
|
-
logger_1.Logger.log(
|
|
109
|
+
logger_1.Logger.log(`Unknown event_type ${data.event_type}`);
|
|
96
110
|
return null;
|
|
97
111
|
}
|
|
98
112
|
}
|
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;
|
package/dist/resources/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type ICustomData, type IMoney, type IPriceQuantity, type ITimePeriod, type IUnitPriceOverride } from '../../../types';
|
|
2
|
-
import { type TaxMode } from '../../../enums';
|
|
2
|
+
import { type CatalogType, type TaxMode } from '../../../enums';
|
|
3
3
|
export interface CreatePriceRequestBody {
|
|
4
4
|
name?: string | null;
|
|
5
5
|
description: string;
|
|
6
|
+
type?: CatalogType | null;
|
|
6
7
|
productId: string;
|
|
7
8
|
unitPrice: IMoney;
|
|
8
9
|
billingCycle?: ITimePeriod | null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type Status } from '../../../enums';
|
|
1
|
+
import { type CatalogType, type Status } from '../../../enums';
|
|
2
2
|
export interface ListPriceQueryParameters {
|
|
3
3
|
after?: string;
|
|
4
4
|
id?: string[];
|
|
5
|
+
type?: CatalogType[];
|
|
5
6
|
include?: string[];
|
|
6
7
|
orderBy?: string;
|
|
7
8
|
perPage?: number;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type ICustomData, type IMoney, type IPriceQuantity, type ITimePeriod, type IUnitPriceOverride } from '../../../types';
|
|
2
|
-
import { type Status, type TaxMode } from '../../../enums';
|
|
2
|
+
import { type CatalogType, type Status, type TaxMode } from '../../../enums';
|
|
3
3
|
export interface UpdatePriceRequestBody {
|
|
4
4
|
description?: string;
|
|
5
5
|
name?: string | null;
|
|
6
|
+
type?: CatalogType | null;
|
|
6
7
|
billingCycle?: ITimePeriod | null;
|
|
7
8
|
trialPeriod?: ITimePeriod | null;
|
|
8
9
|
taxMode?: TaxMode;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type ICustomData } from '../../../types';
|
|
2
|
-
import { type TaxCategory } from '../../../enums';
|
|
2
|
+
import { type CatalogType, type TaxCategory } from '../../../enums';
|
|
3
3
|
export interface CreateProductRequestBody {
|
|
4
4
|
name: string;
|
|
5
5
|
taxCategory: TaxCategory;
|
|
6
|
+
type?: CatalogType | null;
|
|
6
7
|
description?: string | null;
|
|
7
8
|
imageUrl?: string | null;
|
|
8
9
|
customData?: ICustomData | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type Status, type TaxCategory } from '../../../enums';
|
|
1
|
+
import { type CatalogType, type Status, type TaxCategory } from '../../../enums';
|
|
2
2
|
export interface ListProductQueryParameters {
|
|
3
3
|
after?: string;
|
|
4
|
+
type?: CatalogType[];
|
|
4
5
|
id?: string[];
|
|
5
6
|
include?: string[];
|
|
6
7
|
orderBy?: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type ICustomData } from '../../../types';
|
|
2
|
-
import { type TaxCategory, type Status } from '../../../enums';
|
|
2
|
+
import { type TaxCategory, type Status, type CatalogType } from '../../../enums';
|
|
3
3
|
export interface UpdateProductRequestBody {
|
|
4
4
|
name?: string;
|
|
5
5
|
description?: string | null;
|
|
6
|
+
type?: CatalogType | null;
|
|
6
7
|
taxCategory?: TaxCategory;
|
|
7
8
|
imageUrl?: string | null;
|
|
8
9
|
customData?: ICustomData | null;
|
|
@@ -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,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);
|
package/dist/resources/subscriptions/operations/create-subscription-charge-request-object.d.ts
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
import { type SubscriptionEffectiveFrom } from '../../../enums';
|
|
2
|
-
import { type
|
|
1
|
+
import { type SubscriptionEffectiveFrom, type SubscriptionOnPaymentFailure } from '../../../enums';
|
|
2
|
+
import { type ISubscriptionNonCatalogPriceRequest } from '../../../types';
|
|
3
|
+
interface ITransactionItemBase {
|
|
4
|
+
quantity: number;
|
|
5
|
+
}
|
|
6
|
+
interface ITransactionItemWithPriceId extends ITransactionItemBase {
|
|
7
|
+
priceId: string;
|
|
8
|
+
price?: never;
|
|
9
|
+
}
|
|
10
|
+
interface ITransactionItemWithPrice extends ITransactionItemBase {
|
|
11
|
+
priceId?: never;
|
|
12
|
+
price: ISubscriptionNonCatalogPriceRequest;
|
|
13
|
+
}
|
|
14
|
+
type ITransactionItem = ITransactionItemWithPriceId | ITransactionItemWithPrice;
|
|
3
15
|
export interface CreateSubscriptionCharge {
|
|
4
16
|
effectiveFrom: SubscriptionEffectiveFrom;
|
|
5
17
|
items: ITransactionItem[];
|
|
18
|
+
onPaymentFailure?: SubscriptionOnPaymentFailure;
|
|
6
19
|
}
|
|
20
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IBillingDetailsUpdate, type ICustomData, type ISubscriptionUpdateItem } from '../../../types';
|
|
2
|
-
import { type CollectionMode, type CurrencyCode, type ProrationBillingMode, type SubscriptionEffectiveFrom } from '../../../enums';
|
|
2
|
+
import { type CollectionMode, type CurrencyCode, type ProrationBillingMode, type SubscriptionEffectiveFrom, type SubscriptionOnPaymentFailure } from '../../../enums';
|
|
3
3
|
export interface UpdateSubscriptionDiscount {
|
|
4
4
|
id: string;
|
|
5
5
|
effectiveFrom: SubscriptionEffectiveFrom;
|
|
@@ -22,4 +22,5 @@ export interface UpdateSubscriptionRequestBody {
|
|
|
22
22
|
items?: ISubscriptionUpdateItem[];
|
|
23
23
|
customData?: ICustomData | null;
|
|
24
24
|
prorationBillingMode?: ProrationBillingMode;
|
|
25
|
+
onPaymentFailure?: SubscriptionOnPaymentFailure;
|
|
25
26
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type IBillingDetailsCreate, type ICustomData, type ITransactionCheckout, type
|
|
1
|
+
import { type IBillingDetailsCreate, type ICustomData, type ITransactionCheckout, type ITransactionItemWithNonCatalogPrice, type ITransactionsTimePeriod } from '../../../types';
|
|
2
2
|
import { type CollectionMode, type CurrencyCode, type TransactionStatus } from '../../../enums';
|
|
3
3
|
export interface CreateTransactionRequestBody {
|
|
4
|
-
items:
|
|
4
|
+
items: ITransactionItemWithNonCatalogPrice[];
|
|
5
5
|
status?: TransactionStatus;
|
|
6
6
|
customerId?: string | null;
|
|
7
7
|
addressId?: string | null;
|