@paddle/paddle-node-sdk
Version:
A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.
38 lines (37 loc) • 2.63 kB
JavaScript
import { Client } from './internal/api/client.js';
import { Environment, LogLevel } from './internal/index.js';
import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomerPortalSessionsResource, CustomersResource, DiscountGroupsResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PaymentMethodsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationRunEventsResource, SimulationRunsResource, SimulationsResource, SimulationTypesResource, SubscriptionsResource, TransactionsResource, } from './resources/index.js';
import { EventsResource } from './resources/events/index.js';
import { Webhooks } from './notifications/index.js';
export class Paddle {
constructor(apiKey, options) {
this.defaultPaddleOptions = {
environment: Environment.production,
logLevel: LogLevel.verbose,
};
this.client = new Client(apiKey, options ? Object.assign(Object.assign({}, this.defaultPaddleOptions), options) : Object.assign({}, this.defaultPaddleOptions));
this.products = new ProductsResource(this.client);
this.prices = new PricesResource(this.client);
this.transactions = new TransactionsResource(this.client);
this.adjustments = new AdjustmentsResource(this.client);
this.customers = new CustomersResource(this.client);
this.customerPortalSessions = new CustomerPortalSessionsResource(this.client);
this.addresses = new AddressesResource(this.client);
this.businesses = new BusinessesResource(this.client);
this.discounts = new DiscountsResource(this.client);
this.discountGroups = new DiscountGroupsResource(this.client);
this.subscriptions = new SubscriptionsResource(this.client);
this.paymentMethods = new PaymentMethodsResource(this.client);
this.pricingPreview = new PricingPreviewResource(this.client);
this.events = new EventsResource(this.client);
this.webhooks = new Webhooks();
this.eventTypes = new EventTypesResource(this.client);
this.notificationSettings = new NotificationSettingsResource(this.client);
this.notifications = new NotificationsResource(this.client);
this.reports = new ReportsResource(this.client);
this.simulationTypes = new SimulationTypesResource(this.client);
this.simulations = new SimulationsResource(this.client);
this.simulationRuns = new SimulationRunsResource(this.client);
this.simulationRunEvents = new SimulationRunEventsResource(this.client);
}
}