@paddle/paddle-node-sdk 2.1.2 → 2.2.0
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 +13 -0
- package/dist/cjs/entities/adjustment/adjustment.js +1 -0
- package/dist/cjs/enums/adjustment/adjustment-action-type.js +2 -0
- package/dist/cjs/enums/adjustment/index.js +3 -2
- package/dist/cjs/internal/base/index.js +1 -0
- package/dist/cjs/internal/base/transform.js +21 -0
- package/dist/cjs/notifications/entities/adjustment/adjustment-notification.js +1 -0
- package/dist/cjs/notifications/events/generic/generic-event.js +12 -0
- package/dist/cjs/notifications/events/generic/index.js +17 -0
- package/dist/cjs/notifications/events/index.js +1 -0
- package/dist/cjs/notifications/helpers/webhooks.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/entities/adjustment/adjustment.js +1 -0
- package/dist/esm/enums/adjustment/adjustment-action-type.js +1 -0
- package/dist/esm/enums/adjustment/index.js +3 -2
- package/dist/esm/internal/base/index.js +1 -0
- package/dist/esm/internal/base/transform.js +17 -0
- package/dist/esm/notifications/entities/adjustment/adjustment-notification.js +1 -0
- package/dist/esm/notifications/events/generic/generic-event.js +8 -0
- package/dist/esm/notifications/events/generic/index.js +1 -0
- package/dist/esm/notifications/events/index.js +1 -0
- package/dist/esm/notifications/helpers/webhooks.js +2 -2
- package/dist/esm/version.js +1 -1
- package/dist/types/entities/adjustment/adjustment.d.ts +2 -1
- package/dist/types/entities/events/event-collection.d.ts +2 -2
- package/dist/types/entities/notifications/notification.d.ts +1 -1
- package/dist/types/enums/adjustment/adjustment-action-type.d.ts +1 -0
- package/dist/types/enums/adjustment/index.d.ts +3 -2
- package/dist/types/enums/shared/currency-code.d.ts +1 -1
- package/dist/types/internal/base/index.d.ts +1 -0
- package/dist/types/internal/base/transform.d.ts +1 -0
- package/dist/types/notifications/entities/adjustment/adjustment-notification.d.ts +2 -1
- package/dist/types/notifications/events/generic/generic-event.d.ts +6 -0
- package/dist/types/notifications/events/generic/index.d.ts +1 -0
- package/dist/types/notifications/events/index.d.ts +1 -0
- package/dist/types/notifications/helpers/webhooks.d.ts +2 -2
- package/dist/types/notifications/types/adjustment/adjustment-notification-response.d.ts +2 -1
- package/dist/types/resources/adjustments/operations/create-adjustment-request-body.d.ts +10 -1
- package/dist/types/types/adjustment/adjustment-response.d.ts +2 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,19 @@ 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.2.0 - 2024-12-12
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- `VND` (Vietnamese dong) as new currency
|
|
20
|
+
- Added `adjustment.type` which is either `partial` which should include `items` or `full` where `items` are not required
|
|
21
|
+
|
|
22
|
+
## 2.1.3 - 2024-11-29
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- `paddle.webhooks.unmarshal` will now return an event for unhandled event types instead of `null` this is only possible for legacy/no longer supported events or for new events that have not been added to the sdk yet
|
|
27
|
+
|
|
15
28
|
## 2.1.2 - 2024-11-26
|
|
16
29
|
|
|
17
30
|
### Fixed
|
|
@@ -7,6 +7,7 @@ class Adjustment {
|
|
|
7
7
|
constructor(adjustment) {
|
|
8
8
|
this.id = adjustment.id;
|
|
9
9
|
this.action = adjustment.action;
|
|
10
|
+
this.type = adjustment.type;
|
|
10
11
|
this.transactionId = adjustment.transaction_id;
|
|
11
12
|
this.subscriptionId = adjustment.subscription_id ? adjustment.subscription_id : null;
|
|
12
13
|
this.customerId = adjustment.customer_id;
|
|
@@ -14,7 +14,8 @@ 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("./adjustment-type.js"), exports);
|
|
18
|
-
__exportStar(require("./adjustment-currency-code.js"), exports);
|
|
17
|
+
__exportStar(require("./adjustment-action-type.js"), exports);
|
|
19
18
|
__exportStar(require("./adjustment-action.js"), exports);
|
|
19
|
+
__exportStar(require("./adjustment-currency-code.js"), exports);
|
|
20
20
|
__exportStar(require("./adjustment-status.js"), exports);
|
|
21
|
+
__exportStar(require("./adjustment-type.js"), exports);
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./base-resource.js"), exports);
|
|
|
18
18
|
__exportStar(require("./query-parameters.js"), exports);
|
|
19
19
|
__exportStar(require("./path-parameters.js"), exports);
|
|
20
20
|
__exportStar(require("./collection.js"), exports);
|
|
21
|
+
__exportStar(require("./transform.js"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertKeysToCamelCase = void 0;
|
|
4
|
+
function toCamelCase(str) {
|
|
5
|
+
return str.toLowerCase().replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
6
|
+
}
|
|
7
|
+
function convertKeysToCamelCase(obj) {
|
|
8
|
+
if (obj === null || typeof obj !== 'object') {
|
|
9
|
+
return obj;
|
|
10
|
+
}
|
|
11
|
+
if (Array.isArray(obj)) {
|
|
12
|
+
return obj.map(convertKeysToCamelCase);
|
|
13
|
+
}
|
|
14
|
+
const converted = {};
|
|
15
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
16
|
+
const camelCaseKey = toCamelCase(key);
|
|
17
|
+
converted[camelCaseKey] = convertKeysToCamelCase(value);
|
|
18
|
+
}
|
|
19
|
+
return converted;
|
|
20
|
+
}
|
|
21
|
+
exports.convertKeysToCamelCase = convertKeysToCamelCase;
|
|
@@ -7,6 +7,7 @@ class AdjustmentNotification {
|
|
|
7
7
|
constructor(adjustment) {
|
|
8
8
|
this.id = adjustment.id;
|
|
9
9
|
this.action = adjustment.action;
|
|
10
|
+
this.type = adjustment.type;
|
|
10
11
|
this.transactionId = adjustment.transaction_id;
|
|
11
12
|
this.subscriptionId = adjustment.subscription_id ? adjustment.subscription_id : null;
|
|
12
13
|
this.customerId = adjustment.customer_id;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenericEvent = void 0;
|
|
4
|
+
const event_js_1 = require("../../../entities/events/event.js");
|
|
5
|
+
const index_js_1 = require("../../../internal/base/index.js");
|
|
6
|
+
class GenericEvent extends event_js_1.Event {
|
|
7
|
+
constructor(response) {
|
|
8
|
+
super(response);
|
|
9
|
+
this.data = (0, index_js_1.convertKeysToCamelCase)(response.data);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.GenericEvent = GenericEvent;
|
|
@@ -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("./generic-event.js"), exports);
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./adjustment/index.js"), exports);
|
|
|
19
19
|
__exportStar(require("./business/index.js"), exports);
|
|
20
20
|
__exportStar(require("./customer/index.js"), exports);
|
|
21
21
|
__exportStar(require("./discount/index.js"), exports);
|
|
22
|
+
__exportStar(require("./generic/index.js"), exports);
|
|
22
23
|
__exportStar(require("./payment-method/index.js"), exports);
|
|
23
24
|
__exportStar(require("./payout/index.js"), exports);
|
|
24
25
|
__exportStar(require("./price/index.js"), exports);
|
package/dist/cjs/version.js
CHANGED
|
@@ -4,6 +4,7 @@ export class Adjustment {
|
|
|
4
4
|
constructor(adjustment) {
|
|
5
5
|
this.id = adjustment.id;
|
|
6
6
|
this.action = adjustment.action;
|
|
7
|
+
this.type = adjustment.type;
|
|
7
8
|
this.transactionId = adjustment.transaction_id;
|
|
8
9
|
this.subscriptionId = adjustment.subscription_id ? adjustment.subscription_id : null;
|
|
9
10
|
this.customerId = adjustment.customer_id;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export * from './adjustment-type.js';
|
|
2
|
-
export * from './adjustment-currency-code.js';
|
|
1
|
+
export * from './adjustment-action-type.js';
|
|
3
2
|
export * from './adjustment-action.js';
|
|
3
|
+
export * from './adjustment-currency-code.js';
|
|
4
4
|
export * from './adjustment-status.js';
|
|
5
|
+
export * from './adjustment-type.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function toCamelCase(str) {
|
|
2
|
+
return str.toLowerCase().replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
3
|
+
}
|
|
4
|
+
export function convertKeysToCamelCase(obj) {
|
|
5
|
+
if (obj === null || typeof obj !== 'object') {
|
|
6
|
+
return obj;
|
|
7
|
+
}
|
|
8
|
+
if (Array.isArray(obj)) {
|
|
9
|
+
return obj.map(convertKeysToCamelCase);
|
|
10
|
+
}
|
|
11
|
+
const converted = {};
|
|
12
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
13
|
+
const camelCaseKey = toCamelCase(key);
|
|
14
|
+
converted[camelCaseKey] = convertKeysToCamelCase(value);
|
|
15
|
+
}
|
|
16
|
+
return converted;
|
|
17
|
+
}
|
|
@@ -4,6 +4,7 @@ export class AdjustmentNotification {
|
|
|
4
4
|
constructor(adjustment) {
|
|
5
5
|
this.id = adjustment.id;
|
|
6
6
|
this.action = adjustment.action;
|
|
7
|
+
this.type = adjustment.type;
|
|
7
8
|
this.transactionId = adjustment.transaction_id;
|
|
8
9
|
this.subscriptionId = adjustment.subscription_id ? adjustment.subscription_id : null;
|
|
9
10
|
this.customerId = adjustment.customer_id;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event.js';
|
|
2
|
+
import { convertKeysToCamelCase } from '../../../internal/base/index.js';
|
|
3
|
+
export class GenericEvent extends Event {
|
|
4
|
+
constructor(response) {
|
|
5
|
+
super(response);
|
|
6
|
+
this.data = convertKeysToCamelCase(response.data);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generic-event.js';
|
|
@@ -3,6 +3,7 @@ export * from './adjustment/index.js';
|
|
|
3
3
|
export * from './business/index.js';
|
|
4
4
|
export * from './customer/index.js';
|
|
5
5
|
export * from './discount/index.js';
|
|
6
|
+
export * from './generic/index.js';
|
|
6
7
|
export * from './payment-method/index.js';
|
|
7
8
|
export * from './payout/index.js';
|
|
8
9
|
export * from './price/index.js';
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { WebhooksValidator } from './webhooks-validator.js';
|
|
11
11
|
import { EventName } from './types.js';
|
|
12
|
-
import { AddressCreatedEvent, AddressImportedEvent, AddressUpdatedEvent, AdjustmentCreatedEvent, AdjustmentUpdatedEvent, BusinessCreatedEvent, BusinessImportedEvent, BusinessUpdatedEvent, CustomerCreatedEvent, CustomerImportedEvent, CustomerUpdatedEvent, DiscountCreatedEvent, DiscountImportedEvent, DiscountUpdatedEvent, PaymentMethodDeletedEvent, PaymentMethodSavedEvent, PayoutCreatedEvent, PayoutPaidEvent, PriceCreatedEvent, PriceImportedEvent, PriceUpdatedEvent, ProductCreatedEvent, ProductImportedEvent, ProductUpdatedEvent, ReportCreatedEvent, ReportUpdatedEvent, SubscriptionActivatedEvent, SubscriptionCanceledEvent, SubscriptionCreatedEvent, SubscriptionImportedEvent, SubscriptionPastDueEvent, SubscriptionPausedEvent, SubscriptionResumedEvent, SubscriptionTrialingEvent, SubscriptionUpdatedEvent, TransactionBilledEvent, TransactionCanceledEvent, TransactionCompletedEvent, TransactionCreatedEvent, TransactionPaidEvent, TransactionPastDueEvent, TransactionPaymentFailedEvent, TransactionReadyEvent, TransactionUpdatedEvent, } from '../events/index.js';
|
|
12
|
+
import { AddressCreatedEvent, AddressImportedEvent, AddressUpdatedEvent, AdjustmentCreatedEvent, AdjustmentUpdatedEvent, BusinessCreatedEvent, BusinessImportedEvent, BusinessUpdatedEvent, CustomerCreatedEvent, CustomerImportedEvent, CustomerUpdatedEvent, DiscountCreatedEvent, DiscountImportedEvent, DiscountUpdatedEvent, GenericEvent, PaymentMethodDeletedEvent, PaymentMethodSavedEvent, PayoutCreatedEvent, PayoutPaidEvent, PriceCreatedEvent, PriceImportedEvent, PriceUpdatedEvent, ProductCreatedEvent, ProductImportedEvent, ProductUpdatedEvent, ReportCreatedEvent, ReportUpdatedEvent, SubscriptionActivatedEvent, SubscriptionCanceledEvent, SubscriptionCreatedEvent, SubscriptionImportedEvent, SubscriptionPastDueEvent, SubscriptionPausedEvent, SubscriptionResumedEvent, SubscriptionTrialingEvent, SubscriptionUpdatedEvent, TransactionBilledEvent, TransactionCanceledEvent, TransactionCompletedEvent, TransactionCreatedEvent, TransactionPaidEvent, TransactionPastDueEvent, TransactionPaymentFailedEvent, TransactionReadyEvent, TransactionUpdatedEvent, } from '../events/index.js';
|
|
13
13
|
import { Logger } from '../../internal/base/logger.js';
|
|
14
14
|
export class Webhooks {
|
|
15
15
|
unmarshal(requestBody, secretKey, signature) {
|
|
@@ -121,7 +121,7 @@ export class Webhooks {
|
|
|
121
121
|
return new ReportUpdatedEvent(data);
|
|
122
122
|
default:
|
|
123
123
|
Logger.log(`Unknown event_type ${data.event_type}`);
|
|
124
|
-
return
|
|
124
|
+
return new GenericEvent(data);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
}
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = '2.
|
|
1
|
+
export const SDK_VERSION = '2.2.0';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type AdjustmentAction, type AdjustmentStatus, type CurrencyCode } from '../../enums/index.js';
|
|
1
|
+
import { type AdjustmentActionType, type AdjustmentAction, type AdjustmentStatus, type CurrencyCode } from '../../enums/index.js';
|
|
2
2
|
import { AdjustmentItem } from './adjustment-item.js';
|
|
3
3
|
import { PayoutTotalsAdjustment, TotalAdjustments } from '../shared/index.js';
|
|
4
4
|
import { type IAdjustmentResponse } from '../../types/index.js';
|
|
5
5
|
export declare class Adjustment {
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly action: AdjustmentAction;
|
|
8
|
+
readonly type: AdjustmentActionType;
|
|
8
9
|
readonly transactionId: string;
|
|
9
10
|
readonly subscriptionId: string | null;
|
|
10
11
|
readonly customerId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type IEvents, type IEventsResponse } from '../../types/index.js';
|
|
2
2
|
import { Collection } from '../../internal/base/index.js';
|
|
3
3
|
import { type EventEntity } from '../../notifications/index.js';
|
|
4
|
-
export declare class EventCollection extends Collection<IEventsResponse, EventEntity
|
|
5
|
-
fromJson(data: IEvents): EventEntity
|
|
4
|
+
export declare class EventCollection extends Collection<IEventsResponse, EventEntity> {
|
|
5
|
+
fromJson(data: IEvents): EventEntity;
|
|
6
6
|
}
|
|
@@ -5,7 +5,7 @@ export declare class Notification {
|
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly type: IEventName;
|
|
7
7
|
readonly status: NotificationStatus;
|
|
8
|
-
readonly payload: EventEntity
|
|
8
|
+
readonly payload: EventEntity;
|
|
9
9
|
readonly occurredAt: string;
|
|
10
10
|
readonly deliveredAt: null | string;
|
|
11
11
|
readonly replayedAt: null | string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AdjustmentActionType = 'full' | 'partial';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export * from './adjustment-type.js';
|
|
2
|
-
export * from './adjustment-currency-code.js';
|
|
1
|
+
export * from './adjustment-action-type.js';
|
|
3
2
|
export * from './adjustment-action.js';
|
|
3
|
+
export * from './adjustment-currency-code.js';
|
|
4
4
|
export * from './adjustment-status.js';
|
|
5
|
+
export * from './adjustment-type.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type CurrencyCode = 'USD' | 'EUR' | 'GBP' | 'JPY' | 'AUD' | 'CAD' | 'CHF' | 'HKD' | 'SGD' | 'SEK' | 'ARS' | 'BRL' | 'CNY' | 'COP' | 'CZK' | 'DKK' | 'HUF' | 'ILS' | 'INR' | 'KRW' | 'MXN' | 'NOK' | 'NZD' | 'PLN' | 'RUB' | 'THB' | 'TRY' | 'TWD' | 'UAH' | 'ZAR';
|
|
1
|
+
export type CurrencyCode = 'USD' | 'EUR' | 'GBP' | 'JPY' | 'AUD' | 'CAD' | 'CHF' | 'HKD' | 'SGD' | 'SEK' | 'ARS' | 'BRL' | 'CNY' | 'COP' | 'CZK' | 'DKK' | 'HUF' | 'ILS' | 'INR' | 'KRW' | 'MXN' | 'NOK' | 'NZD' | 'PLN' | 'RUB' | 'THB' | 'TRY' | 'TWD' | 'UAH' | 'VND' | 'ZAR';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function convertKeysToCamelCase(obj: object): object;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type AdjustmentAction, type AdjustmentStatus, type CurrencyCode } from '../../../enums/index.js';
|
|
1
|
+
import { type AdjustmentActionType, type AdjustmentAction, type AdjustmentStatus, type CurrencyCode } from '../../../enums/index.js';
|
|
2
2
|
import { AdjustmentItemNotification } from './adjustment-item-notification.js';
|
|
3
3
|
import { PayoutTotalsAdjustmentNotification, TotalAdjustmentsNotification } from '../shared/index.js';
|
|
4
4
|
import { type IAdjustmentNotificationResponse } from '../../types/index.js';
|
|
5
5
|
export declare class AdjustmentNotification {
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly action: AdjustmentAction;
|
|
8
|
+
readonly type: AdjustmentActionType;
|
|
8
9
|
readonly transactionId: string;
|
|
9
10
|
readonly subscriptionId: string | null;
|
|
10
11
|
readonly customerId: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generic-event.js';
|
|
@@ -3,6 +3,7 @@ export * from './adjustment/index.js';
|
|
|
3
3
|
export * from './business/index.js';
|
|
4
4
|
export * from './customer/index.js';
|
|
5
5
|
export * from './discount/index.js';
|
|
6
|
+
export * from './generic/index.js';
|
|
6
7
|
export * from './payment-method/index.js';
|
|
7
8
|
export * from './payout/index.js';
|
|
8
9
|
export * from './price/index.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type IEvents } from '../../types/index.js';
|
|
2
2
|
import { type EventEntity } from './types.js';
|
|
3
3
|
export declare class Webhooks {
|
|
4
|
-
unmarshal(requestBody: string, secretKey: string, signature: string): Promise<EventEntity
|
|
4
|
+
unmarshal(requestBody: string, secretKey: string, signature: string): Promise<EventEntity>;
|
|
5
5
|
isSignatureValid(requestBody: string, secretKey: string, signature: string): Promise<boolean>;
|
|
6
|
-
static fromJson(data: IEvents): EventEntity
|
|
6
|
+
static fromJson(data: IEvents): EventEntity;
|
|
7
7
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type AdjustmentAction, type AdjustmentStatus, type CurrencyCode } from '../../../enums/index.js';
|
|
1
|
+
import { type AdjustmentActionType, type AdjustmentAction, type AdjustmentStatus, type CurrencyCode } from '../../../enums/index.js';
|
|
2
2
|
import { type IAdjustmentItemNotificationResponse } from './adjustment-item-notification-response.js';
|
|
3
3
|
import { type IPayoutTotalsAdjustmentNotificationResponse, type ITotalAdjustmentsNotificationResponse } from '../shared/index.js';
|
|
4
4
|
export interface IAdjustmentNotificationResponse {
|
|
5
5
|
id: string;
|
|
6
6
|
action: AdjustmentAction;
|
|
7
|
+
type: AdjustmentActionType;
|
|
7
8
|
transaction_id: string;
|
|
8
9
|
subscription_id?: string | null;
|
|
9
10
|
customer_id: string;
|
|
@@ -4,9 +4,18 @@ export interface CreateAdjustmentLineItem {
|
|
|
4
4
|
itemId: string;
|
|
5
5
|
type: AdjustmentType;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
interface CreatePartialAdjustmentRequestBody {
|
|
8
8
|
action: AdjustmentAction;
|
|
9
9
|
items: CreateAdjustmentLineItem[];
|
|
10
10
|
reason: string;
|
|
11
11
|
transactionId: string;
|
|
12
|
+
type?: 'partial';
|
|
12
13
|
}
|
|
14
|
+
interface CreateFullAdjustmentRequestBody {
|
|
15
|
+
action: AdjustmentAction;
|
|
16
|
+
reason: string;
|
|
17
|
+
transactionId: string;
|
|
18
|
+
type?: 'full';
|
|
19
|
+
}
|
|
20
|
+
export type CreateAdjustmentRequestBody = CreatePartialAdjustmentRequestBody | CreateFullAdjustmentRequestBody;
|
|
21
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type AdjustmentAction, type AdjustmentStatus, type CurrencyCode } from '../../enums/index.js';
|
|
1
|
+
import { type AdjustmentActionType, type AdjustmentAction, type AdjustmentStatus, type CurrencyCode } from '../../enums/index.js';
|
|
2
2
|
import { type IAdjustmentItemResponse } from './adjustment-item-response.js';
|
|
3
3
|
import { type IPayoutTotalsAdjustmentResponse, type ITotalAdjustmentsResponse } from '../shared/index.js';
|
|
4
4
|
export interface IAdjustmentResponse {
|
|
5
5
|
id: string;
|
|
6
6
|
action: AdjustmentAction;
|
|
7
|
+
type: AdjustmentActionType;
|
|
7
8
|
transaction_id: string;
|
|
8
9
|
subscription_id?: string | null;
|
|
9
10
|
customer_id: string;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.
|
|
1
|
+
export declare const SDK_VERSION = "2.2.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paddle/paddle-node-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
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",
|
|
@@ -68,5 +68,6 @@
|
|
|
68
68
|
"import": "./dist/esm/index.esm.node.js",
|
|
69
69
|
"require": "./dist/cjs/index.cjs.node.js"
|
|
70
70
|
}
|
|
71
|
-
}
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {}
|
|
72
73
|
}
|