@paddle/paddle-node-sdk 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/entities/customer-portal-session/customer-portal-session.js +13 -0
  3. package/dist/cjs/entities/customer-portal-session/customer-portal-subscription-url.js +11 -0
  4. package/dist/cjs/entities/customer-portal-session/general.js +9 -0
  5. package/dist/cjs/entities/customer-portal-session/index.js +18 -0
  6. package/dist/cjs/entities/customer-portal-session/urls.js +13 -0
  7. package/dist/cjs/entities/index.js +1 -0
  8. package/dist/cjs/paddle.js +1 -0
  9. package/dist/cjs/resources/customer-portal-sessions/index.js +32 -0
  10. package/dist/cjs/resources/customer-portal-sessions/operations/create-customer-portal-session-request-object.js +2 -0
  11. package/dist/cjs/resources/customer-portal-sessions/operations/index.js +17 -0
  12. package/dist/cjs/resources/index.js +1 -0
  13. package/dist/cjs/types/customer-portal-session/customer-portal-session-response.js +2 -0
  14. package/dist/cjs/types/customer-portal-session/customer-portal-subscription-url.js +2 -0
  15. package/dist/cjs/types/customer-portal-session/general.js +2 -0
  16. package/dist/cjs/types/customer-portal-session/index.js +20 -0
  17. package/dist/cjs/types/customer-portal-session/urls.js +2 -0
  18. package/dist/cjs/types/index.js +1 -0
  19. package/dist/cjs/version.js +1 -1
  20. package/dist/esm/entities/customer-portal-session/customer-portal-session.js +9 -0
  21. package/dist/esm/entities/customer-portal-session/customer-portal-subscription-url.js +7 -0
  22. package/dist/esm/entities/customer-portal-session/general.js +5 -0
  23. package/dist/esm/entities/customer-portal-session/index.js +2 -0
  24. package/dist/esm/entities/customer-portal-session/urls.js +9 -0
  25. package/dist/esm/entities/index.js +1 -0
  26. package/dist/esm/paddle.js +2 -1
  27. package/dist/esm/resources/customer-portal-sessions/index.js +28 -0
  28. package/dist/esm/resources/customer-portal-sessions/operations/create-customer-portal-session-request-object.js +1 -0
  29. package/dist/esm/resources/customer-portal-sessions/operations/index.js +1 -0
  30. package/dist/esm/resources/index.js +1 -0
  31. package/dist/esm/types/customer-portal-session/customer-portal-session-response.js +1 -0
  32. package/dist/esm/types/customer-portal-session/customer-portal-subscription-url.js +1 -0
  33. package/dist/esm/types/customer-portal-session/general.js +1 -0
  34. package/dist/esm/types/customer-portal-session/index.js +4 -0
  35. package/dist/esm/types/customer-portal-session/urls.js +1 -0
  36. package/dist/esm/types/index.js +1 -0
  37. package/dist/esm/version.js +1 -1
  38. package/dist/types/entities/customer-portal-session/customer-portal-session.d.ts +9 -0
  39. package/dist/types/entities/customer-portal-session/customer-portal-subscription-url.d.ts +7 -0
  40. package/dist/types/entities/customer-portal-session/general.d.ts +5 -0
  41. package/dist/types/entities/customer-portal-session/index.d.ts +2 -0
  42. package/dist/types/entities/customer-portal-session/urls.d.ts +8 -0
  43. package/dist/types/entities/index.d.ts +1 -0
  44. package/dist/types/paddle.d.ts +2 -1
  45. package/dist/types/resources/customer-portal-sessions/index.d.ts +5 -0
  46. package/dist/types/resources/customer-portal-sessions/operations/create-customer-portal-session-request-object.d.ts +3 -0
  47. package/dist/types/resources/customer-portal-sessions/operations/index.d.ts +1 -0
  48. package/dist/types/resources/index.d.ts +1 -0
  49. package/dist/types/types/customer-portal-session/customer-portal-session-response.d.ts +7 -0
  50. package/dist/types/types/customer-portal-session/customer-portal-subscription-url.d.ts +5 -0
  51. package/dist/types/types/customer-portal-session/general.d.ts +3 -0
  52. package/dist/types/types/customer-portal-session/index.d.ts +4 -0
  53. package/dist/types/types/customer-portal-session/urls.d.ts +6 -0
  54. package/dist/types/types/index.d.ts +1 -0
  55. package/dist/types/version.d.ts +1 -1
  56. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -12,6 +12,18 @@ When we make [non-breaking changes](https://developer.paddle.com/api-reference/a
12
12
 
13
13
  This means when upgrading minor versions of the SDK, you may notice type errors. You can safely ignore these or fix by adding additional type guards.
14
14
 
15
+ ## 2.1.1 - 2024-11-25
16
+
17
+ ### Fixed
18
+
19
+ - Updated imports to use `.js` extension
20
+
21
+ ## 2.1.0 - 2024-11-21
22
+
23
+ ### Added
24
+
25
+ - Added `customerPortalSessions` resources
26
+
15
27
  ## 2.0.0 - 2024-11-20
16
28
 
17
29
  > **Breaking changes:** This version includes major improvements that introduce breaking changes. These are called out below.
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerPortalSession = void 0;
4
+ const urls_js_1 = require("./urls.js");
5
+ class CustomerPortalSession {
6
+ constructor(customerPortalSessionResponse) {
7
+ this.id = customerPortalSessionResponse.id;
8
+ this.customerId = customerPortalSessionResponse.customer_id;
9
+ this.urls = new urls_js_1.Urls(customerPortalSessionResponse.urls);
10
+ this.createdAt = customerPortalSessionResponse.created_at;
11
+ }
12
+ }
13
+ exports.CustomerPortalSession = CustomerPortalSession;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerPortalSubscriptionUrl = void 0;
4
+ class CustomerPortalSubscriptionUrl {
5
+ constructor(customerPortalSubscriptionUrlResponse) {
6
+ this.id = customerPortalSubscriptionUrlResponse.id;
7
+ this.cancelSubscription = customerPortalSubscriptionUrlResponse.cancel_subscription;
8
+ this.updateSubscriptionPaymentMethod = customerPortalSubscriptionUrlResponse.update_subscription_payment_method;
9
+ }
10
+ }
11
+ exports.CustomerPortalSubscriptionUrl = CustomerPortalSubscriptionUrl;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.General = void 0;
4
+ class General {
5
+ constructor(generalResponse) {
6
+ this.overview = generalResponse.overview;
7
+ }
8
+ }
9
+ exports.General = General;
@@ -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("./customer-portal-subscription-url.js"), exports);
18
+ __exportStar(require("./customer-portal-session.js"), exports);
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Urls = void 0;
4
+ const general_js_1 = require("./general.js");
5
+ const customer_portal_subscription_url_js_1 = require("./customer-portal-subscription-url.js");
6
+ class Urls {
7
+ constructor(urlsResponse) {
8
+ var _a;
9
+ this.general = new general_js_1.General(urlsResponse.general);
10
+ this.subscriptions = (_a = urlsResponse.subscriptions) === null || _a === void 0 ? void 0 : _a.map((subscription) => { var _a; return (_a = new customer_portal_subscription_url_js_1.CustomerPortalSubscriptionUrl(subscription)) !== null && _a !== void 0 ? _a : []; });
11
+ }
12
+ }
13
+ exports.Urls = Urls;
@@ -20,6 +20,7 @@ __exportStar(require("./price/index.js"), exports);
20
20
  __exportStar(require("./transaction/index.js"), exports);
21
21
  __exportStar(require("./adjustment/index.js"), exports);
22
22
  __exportStar(require("./customer/index.js"), exports);
23
+ __exportStar(require("./customer-portal-session/index.js"), exports);
23
24
  __exportStar(require("./business/index.js"), exports);
24
25
  __exportStar(require("./subscription/index.js"), exports);
25
26
  __exportStar(require("./address/index.js"), exports);
@@ -18,6 +18,7 @@ class Paddle {
18
18
  this.transactions = new index_js_2.TransactionsResource(this.client);
19
19
  this.adjustments = new index_js_2.AdjustmentsResource(this.client);
20
20
  this.customers = new index_js_2.CustomersResource(this.client);
21
+ this.customerPortalSessions = new index_js_2.CustomerPortalSessionsResource(this.client);
21
22
  this.addresses = new index_js_2.AddressesResource(this.client);
22
23
  this.businesses = new index_js_2.BusinessesResource(this.client);
23
24
  this.discounts = new index_js_2.DiscountsResource(this.client);
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CustomerPortalSessionsResource = void 0;
13
+ const index_js_1 = require("../../entities/index.js");
14
+ const index_js_2 = require("../../internal/base/index.js");
15
+ const CustomerPortalSessionPaths = {
16
+ create: '/customers/{customer_id}/portal-sessions',
17
+ };
18
+ class CustomerPortalSessionsResource extends index_js_2.BaseResource {
19
+ create(customerId, subscriptionIds) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const urlWithPathParams = new index_js_2.PathParameters(CustomerPortalSessionPaths.create, {
22
+ customer_id: customerId,
23
+ }).deriveUrl();
24
+ const response = yield this.client.post(urlWithPathParams, {
25
+ subscriptionIds,
26
+ });
27
+ const data = this.handleResponse(response);
28
+ return new index_js_1.CustomerPortalSession(data);
29
+ });
30
+ }
31
+ }
32
+ exports.CustomerPortalSessionsResource = CustomerPortalSessionsResource;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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("./create-customer-portal-session-request-object.js"), exports);
@@ -18,6 +18,7 @@ __exportStar(require("./addresses/index.js"), exports);
18
18
  __exportStar(require("./adjustments/index.js"), exports);
19
19
  __exportStar(require("./businesses/index.js"), exports);
20
20
  __exportStar(require("./customers/index.js"), exports);
21
+ __exportStar(require("./customer-portal-sessions/index.js"), exports);
21
22
  __exportStar(require("./discounts/index.js"), exports);
22
23
  __exportStar(require("./prices/index.js"), exports);
23
24
  __exportStar(require("./products/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./general.js"), exports);
18
+ __exportStar(require("./customer-portal-subscription-url.js"), exports);
19
+ __exportStar(require("./urls.js"), exports);
20
+ __exportStar(require("./customer-portal-session-response.js"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -20,6 +20,7 @@ __exportStar(require("./price/index.js"), exports);
20
20
  __exportStar(require("./transaction/index.js"), exports);
21
21
  __exportStar(require("./adjustment/index.js"), exports);
22
22
  __exportStar(require("./customer/index.js"), exports);
23
+ __exportStar(require("./customer-portal-session/index.js"), exports);
23
24
  __exportStar(require("./business/index.js"), exports);
24
25
  __exportStar(require("./subscription/index.js"), exports);
25
26
  __exportStar(require("./address/index.js"), exports);
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = '2.0.0';
4
+ exports.SDK_VERSION = '2.1.1';
@@ -0,0 +1,9 @@
1
+ import { Urls } from './urls.js';
2
+ export class CustomerPortalSession {
3
+ constructor(customerPortalSessionResponse) {
4
+ this.id = customerPortalSessionResponse.id;
5
+ this.customerId = customerPortalSessionResponse.customer_id;
6
+ this.urls = new Urls(customerPortalSessionResponse.urls);
7
+ this.createdAt = customerPortalSessionResponse.created_at;
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ export class CustomerPortalSubscriptionUrl {
2
+ constructor(customerPortalSubscriptionUrlResponse) {
3
+ this.id = customerPortalSubscriptionUrlResponse.id;
4
+ this.cancelSubscription = customerPortalSubscriptionUrlResponse.cancel_subscription;
5
+ this.updateSubscriptionPaymentMethod = customerPortalSubscriptionUrlResponse.update_subscription_payment_method;
6
+ }
7
+ }
@@ -0,0 +1,5 @@
1
+ export class General {
2
+ constructor(generalResponse) {
3
+ this.overview = generalResponse.overview;
4
+ }
5
+ }
@@ -0,0 +1,2 @@
1
+ export * from './customer-portal-subscription-url.js';
2
+ export * from './customer-portal-session.js';
@@ -0,0 +1,9 @@
1
+ import { General } from './general.js';
2
+ import { CustomerPortalSubscriptionUrl } from './customer-portal-subscription-url.js';
3
+ export class Urls {
4
+ constructor(urlsResponse) {
5
+ var _a;
6
+ this.general = new General(urlsResponse.general);
7
+ this.subscriptions = (_a = urlsResponse.subscriptions) === null || _a === void 0 ? void 0 : _a.map((subscription) => { var _a; return (_a = new CustomerPortalSubscriptionUrl(subscription)) !== null && _a !== void 0 ? _a : []; });
8
+ }
9
+ }
@@ -4,6 +4,7 @@ export * from './price/index.js';
4
4
  export * from './transaction/index.js';
5
5
  export * from './adjustment/index.js';
6
6
  export * from './customer/index.js';
7
+ export * from './customer-portal-session/index.js';
7
8
  export * from './business/index.js';
8
9
  export * from './subscription/index.js';
9
10
  export * from './address/index.js';
@@ -1,6 +1,6 @@
1
1
  import { Client } from './internal/api/client.js';
2
2
  import { Environment, LogLevel } from './internal/index.js';
3
- import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PaymentMethodsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationTypesResource, SimulationsResource, SimulationRunsResource, SimulationRunEventsResource, SubscriptionsResource, TransactionsResource, } from './resources/index.js';
3
+ import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, CustomerPortalSessionsResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PaymentMethodsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationTypesResource, SimulationsResource, SimulationRunsResource, SimulationRunEventsResource, SubscriptionsResource, TransactionsResource, } from './resources/index.js';
4
4
  import { EventsResource } from './resources/events/index.js';
5
5
  import { Webhooks } from './notifications/index.js';
6
6
  export class Paddle {
@@ -15,6 +15,7 @@ export class Paddle {
15
15
  this.transactions = new TransactionsResource(this.client);
16
16
  this.adjustments = new AdjustmentsResource(this.client);
17
17
  this.customers = new CustomersResource(this.client);
18
+ this.customerPortalSessions = new CustomerPortalSessionsResource(this.client);
18
19
  this.addresses = new AddressesResource(this.client);
19
20
  this.businesses = new BusinessesResource(this.client);
20
21
  this.discounts = new DiscountsResource(this.client);
@@ -0,0 +1,28 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { CustomerPortalSession } from '../../entities/index.js';
11
+ import { BaseResource, PathParameters } from '../../internal/base/index.js';
12
+ const CustomerPortalSessionPaths = {
13
+ create: '/customers/{customer_id}/portal-sessions',
14
+ };
15
+ export class CustomerPortalSessionsResource extends BaseResource {
16
+ create(customerId, subscriptionIds) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ const urlWithPathParams = new PathParameters(CustomerPortalSessionPaths.create, {
19
+ customer_id: customerId,
20
+ }).deriveUrl();
21
+ const response = yield this.client.post(urlWithPathParams, {
22
+ subscriptionIds,
23
+ });
24
+ const data = this.handleResponse(response);
25
+ return new CustomerPortalSession(data);
26
+ });
27
+ }
28
+ }
@@ -0,0 +1 @@
1
+ export * from './create-customer-portal-session-request-object.js';
@@ -2,6 +2,7 @@ export * from './addresses/index.js';
2
2
  export * from './adjustments/index.js';
3
3
  export * from './businesses/index.js';
4
4
  export * from './customers/index.js';
5
+ export * from './customer-portal-sessions/index.js';
5
6
  export * from './discounts/index.js';
6
7
  export * from './prices/index.js';
7
8
  export * from './products/index.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from './general.js';
2
+ export * from './customer-portal-subscription-url.js';
3
+ export * from './urls.js';
4
+ export * from './customer-portal-session-response.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -4,6 +4,7 @@ export * from './price/index.js';
4
4
  export * from './transaction/index.js';
5
5
  export * from './adjustment/index.js';
6
6
  export * from './customer/index.js';
7
+ export * from './customer-portal-session/index.js';
7
8
  export * from './business/index.js';
8
9
  export * from './subscription/index.js';
9
10
  export * from './address/index.js';
@@ -1 +1 @@
1
- export const SDK_VERSION = '2.0.0';
1
+ export const SDK_VERSION = '2.1.1';
@@ -0,0 +1,9 @@
1
+ import { type ICustomerPortalSessionResponse } from '../../types/index.js';
2
+ import { Urls } from './urls.js';
3
+ export declare class CustomerPortalSession {
4
+ readonly id: string;
5
+ readonly customerId: string | null;
6
+ readonly urls: Urls;
7
+ readonly createdAt: string;
8
+ constructor(customerPortalSessionResponse: ICustomerPortalSessionResponse);
9
+ }
@@ -0,0 +1,7 @@
1
+ import { type ICustomerPortalSubscriptionUrl } from '../../types/index.js';
2
+ export declare class CustomerPortalSubscriptionUrl {
3
+ readonly id: string;
4
+ readonly cancelSubscription: string;
5
+ readonly updateSubscriptionPaymentMethod: string;
6
+ constructor(customerPortalSubscriptionUrlResponse: ICustomerPortalSubscriptionUrl);
7
+ }
@@ -0,0 +1,5 @@
1
+ import { type IGeneralResponse } from '../../types/index.js';
2
+ export declare class General {
3
+ readonly overview: string;
4
+ constructor(generalResponse: IGeneralResponse);
5
+ }
@@ -0,0 +1,2 @@
1
+ export * from './customer-portal-subscription-url.js';
2
+ export * from './customer-portal-session.js';
@@ -0,0 +1,8 @@
1
+ import { type IUrlsResponse } from '../../types/index.js';
2
+ import { General } from './general.js';
3
+ import { CustomerPortalSubscriptionUrl } from './customer-portal-subscription-url.js';
4
+ export declare class Urls {
5
+ readonly general: General;
6
+ readonly subscriptions: CustomerPortalSubscriptionUrl[];
7
+ constructor(urlsResponse: IUrlsResponse);
8
+ }
@@ -4,6 +4,7 @@ export * from './price/index.js';
4
4
  export * from './transaction/index.js';
5
5
  export * from './adjustment/index.js';
6
6
  export * from './customer/index.js';
7
+ export * from './customer-portal-session/index.js';
7
8
  export * from './business/index.js';
8
9
  export * from './subscription/index.js';
9
10
  export * from './address/index.js';
@@ -1,5 +1,5 @@
1
1
  import { type PaddleOptions } from './internal/index.js';
2
- import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PaymentMethodsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationTypesResource, SimulationsResource, SimulationRunsResource, SimulationRunEventsResource, SubscriptionsResource, TransactionsResource } from './resources/index.js';
2
+ import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, CustomerPortalSessionsResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PaymentMethodsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationTypesResource, SimulationsResource, SimulationRunsResource, SimulationRunEventsResource, SubscriptionsResource, TransactionsResource } from './resources/index.js';
3
3
  import { EventsResource } from './resources/events/index.js';
4
4
  import { Webhooks } from './notifications/index.js';
5
5
  export declare class Paddle {
@@ -10,6 +10,7 @@ export declare class Paddle {
10
10
  transactions: TransactionsResource;
11
11
  adjustments: AdjustmentsResource;
12
12
  customers: CustomersResource;
13
+ customerPortalSessions: CustomerPortalSessionsResource;
13
14
  addresses: AddressesResource;
14
15
  businesses: BusinessesResource;
15
16
  discounts: DiscountsResource;
@@ -0,0 +1,5 @@
1
+ import { CustomerPortalSession } from '../../entities/index.js';
2
+ import { BaseResource } from '../../internal/base/index.js';
3
+ export declare class CustomerPortalSessionsResource extends BaseResource {
4
+ create(customerId: string, subscriptionIds: string[]): Promise<CustomerPortalSession>;
5
+ }
@@ -0,0 +1,3 @@
1
+ export interface CreateCustomerPortalSessionRequestBody {
2
+ subscriptionIds: string[];
3
+ }
@@ -0,0 +1 @@
1
+ export * from './create-customer-portal-session-request-object.js';
@@ -2,6 +2,7 @@ export * from './addresses/index.js';
2
2
  export * from './adjustments/index.js';
3
3
  export * from './businesses/index.js';
4
4
  export * from './customers/index.js';
5
+ export * from './customer-portal-sessions/index.js';
5
6
  export * from './discounts/index.js';
6
7
  export * from './prices/index.js';
7
8
  export * from './products/index.js';
@@ -0,0 +1,7 @@
1
+ import { type IUrlsResponse } from './urls.js';
2
+ export interface ICustomerPortalSessionResponse {
3
+ id: string;
4
+ customer_id: string;
5
+ urls: IUrlsResponse;
6
+ created_at: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ export interface ICustomerPortalSubscriptionUrl {
2
+ id: string;
3
+ cancel_subscription: string;
4
+ update_subscription_payment_method: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ export interface IGeneralResponse {
2
+ overview: string;
3
+ }
@@ -0,0 +1,4 @@
1
+ export * from './general.js';
2
+ export * from './customer-portal-subscription-url.js';
3
+ export * from './urls.js';
4
+ export * from './customer-portal-session-response.js';
@@ -0,0 +1,6 @@
1
+ import { type IGeneralResponse } from './general.js';
2
+ import { type ICustomerPortalSubscriptionUrl } from './customer-portal-subscription-url.js';
3
+ export interface IUrlsResponse {
4
+ general: IGeneralResponse;
5
+ subscriptions: ICustomerPortalSubscriptionUrl[];
6
+ }
@@ -4,6 +4,7 @@ export * from './price/index.js';
4
4
  export * from './transaction/index.js';
5
5
  export * from './adjustment/index.js';
6
6
  export * from './customer/index.js';
7
+ export * from './customer-portal-session/index.js';
7
8
  export * from './business/index.js';
8
9
  export * from './subscription/index.js';
9
10
  export * from './address/index.js';
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.0";
1
+ export declare const SDK_VERSION = "2.1.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paddle/paddle-node-sdk",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.",
5
5
  "main": "dist/cjs/index.cjs.node.js",
6
6
  "module": "dist/esm/index.esm.node.js",