@paddle/paddle-node-sdk 2.6.0 → 2.7.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.
package/README.md CHANGED
@@ -51,7 +51,10 @@ You can also pass an environment to work with the sandbox:
51
51
  ```typescript
52
52
  const paddle = new Paddle('API_KEY', {
53
53
  environment: Environment.production, // or Environment.sandbox for accessing sandbox API
54
- logLevel: LogLevel.verbose // or LogLevel.error for less verbose logging
54
+ logLevel: LogLevel.verbose, // or LogLevel.error for less verbose logging
55
+ customHeaders: {
56
+ 'X-Custom-Header': 'value' // Optional custom headers
57
+ }
55
58
  })
56
59
  ```
57
60
 
@@ -39,12 +39,7 @@ class Client {
39
39
  else {
40
40
  logger_js_1.Logger.error('Unknown runtime. Cannot generate uuid');
41
41
  }
42
- return {
43
- Authorization: `bearer ${this.apiKey}`,
44
- 'Content-Type': 'application/json',
45
- 'user-agent': `PaddleSDK/node ${version_js_1.SDK_VERSION}`,
46
- 'X-Transaction-ID': uuid !== null && uuid !== void 0 ? uuid : '',
47
- };
42
+ return Object.assign({ Authorization: `bearer ${this.apiKey}`, 'Content-Type': 'application/json', 'user-agent': `PaddleSDK/node ${version_js_1.SDK_VERSION}`, 'X-Transaction-ID': uuid !== null && uuid !== void 0 ? uuid : '' }, this.options.customHeaders);
48
43
  }
49
44
  get(url, queryParams) {
50
45
  return __awaiter(this, void 0, void 0, function* () {
@@ -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.6.0';
4
+ exports.SDK_VERSION = '2.7.1';
@@ -36,12 +36,7 @@ export class Client {
36
36
  else {
37
37
  Logger.error('Unknown runtime. Cannot generate uuid');
38
38
  }
39
- return {
40
- Authorization: `bearer ${this.apiKey}`,
41
- 'Content-Type': 'application/json',
42
- 'user-agent': `PaddleSDK/node ${SDK_VERSION}`,
43
- 'X-Transaction-ID': uuid !== null && uuid !== void 0 ? uuid : '',
44
- };
39
+ return Object.assign({ Authorization: `bearer ${this.apiKey}`, 'Content-Type': 'application/json', 'user-agent': `PaddleSDK/node ${SDK_VERSION}`, 'X-Transaction-ID': uuid !== null && uuid !== void 0 ? uuid : '' }, this.options.customHeaders);
45
40
  }
46
41
  get(url, queryParams) {
47
42
  return __awaiter(this, void 0, void 0, function* () {
@@ -1 +1 @@
1
- export const SDK_VERSION = '2.6.0';
1
+ export const SDK_VERSION = '2.7.1';
@@ -2,4 +2,5 @@ import { type Environment, type LogLevel } from '../api/index.js';
2
2
  export interface PaddleOptions {
3
3
  environment?: Environment;
4
4
  logLevel?: LogLevel;
5
+ customHeaders?: Record<string, string>;
5
6
  }
@@ -10,7 +10,7 @@ export declare class SubscriptionsResource extends BaseResource {
10
10
  activate(subscriptionId: string): Promise<Subscription>;
11
11
  pause(subscriptionId: string, requestBody: PauseSubscription): Promise<Subscription>;
12
12
  resume(subscriptionId: string, requestBody: ResumeSubscription): Promise<Subscription>;
13
- cancel(subscriptionId: string, requestBody: CancelSubscription): Promise<Subscription>;
13
+ cancel(subscriptionId: string, requestBody?: CancelSubscription): Promise<Subscription>;
14
14
  createOneTimeCharge(subscriptionId: string, requestBody: CreateSubscriptionCharge): Promise<Subscription>;
15
15
  previewOneTimeCharge(subscriptionId: string, requestBody: CreateSubscriptionCharge): Promise<SubscriptionPreview>;
16
16
  getPaymentMethodChangeTransaction(subscriptionId: string): Promise<Transaction>;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.6.0";
1
+ export declare const SDK_VERSION = "2.7.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paddle/paddle-node-sdk",
3
- "version": "2.6.0",
3
+ "version": "2.7.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",