@paddle/paddle-node-sdk 3.0.0 → 3.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/dist/cjs/entities/client-token/client-token-collection.js +11 -0
- package/dist/cjs/entities/client-token/client-token.js +24 -0
- package/dist/cjs/entities/client-token/index.js +18 -0
- package/dist/cjs/entities/discount/discount.js +4 -0
- package/dist/cjs/entities/shared/transaction-payout-totals-adjusted.js +2 -0
- package/dist/cjs/entities/shared/transaction-payout-totals.js +4 -0
- package/dist/cjs/enums/client-tokens/client-token-status.js +2 -0
- package/dist/cjs/enums/client-tokens/index.js +17 -0
- package/dist/cjs/enums/index.js +1 -0
- package/dist/cjs/notifications/entities/client-token/client-token-notification.js +24 -0
- package/dist/cjs/notifications/entities/client-token/index.js +17 -0
- package/dist/cjs/notifications/entities/discount/discount-notification.js +2 -0
- package/dist/cjs/notifications/entities/index.js +1 -0
- package/dist/cjs/notifications/entities/shared/transaction-payout-totals-adjusted-notification.js +2 -0
- package/dist/cjs/notifications/events/client-token/client-token-created-event.js +15 -0
- package/dist/cjs/notifications/events/client-token/client-token-revoked-event.js +15 -0
- package/dist/cjs/notifications/events/client-token/client-token-updated-event.js +15 -0
- package/dist/cjs/notifications/events/client-token/index.js +19 -0
- package/dist/cjs/notifications/events/discount-group/discount-group-updated-event.js +15 -0
- package/dist/cjs/notifications/events/discount-group/index.js +1 -0
- package/dist/cjs/notifications/events/index.js +1 -0
- package/dist/cjs/notifications/helpers/types.js +4 -0
- package/dist/cjs/notifications/helpers/webhooks.js +8 -0
- package/dist/cjs/notifications/types/client-token/client-token-notification-response.js +2 -0
- package/dist/cjs/notifications/types/client-token/index.js +17 -0
- package/dist/cjs/notifications/types/index.js +1 -0
- package/dist/cjs/paddle.js +2 -0
- package/dist/cjs/resources/client-tokens/index.js +57 -0
- package/dist/cjs/resources/client-tokens/operations/create-client-token-request-body.js +2 -0
- package/dist/cjs/resources/client-tokens/operations/index.js +19 -0
- package/dist/cjs/resources/client-tokens/operations/list-client-token-query-parameters.js +2 -0
- package/dist/cjs/resources/client-tokens/operations/update-client-token-request-body.js +2 -0
- package/dist/cjs/resources/discount-groups/index.js +21 -0
- package/dist/cjs/resources/discount-groups/operations/index.js +1 -0
- package/dist/cjs/resources/discount-groups/operations/update-discount-group-request-body.js +2 -0
- package/dist/cjs/resources/discounts/index.js +3 -2
- package/dist/cjs/resources/discounts/operations/get-discount-query-parameters.js +2 -0
- package/dist/cjs/resources/discounts/operations/index.js +1 -0
- package/dist/cjs/resources/index.js +1 -0
- package/dist/cjs/types/client-token/client-token-response.js +2 -0
- package/dist/cjs/types/client-token/index.js +17 -0
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/version.js +1 -1
- package/dist/esm/entities/client-token/client-token-collection.js +7 -0
- package/dist/esm/entities/client-token/client-token.js +20 -0
- package/dist/esm/entities/client-token/index.js +2 -0
- package/dist/esm/entities/discount/discount.js +5 -1
- package/dist/esm/entities/shared/transaction-payout-totals-adjusted.js +2 -0
- package/dist/esm/entities/shared/transaction-payout-totals.js +4 -0
- package/dist/esm/enums/client-tokens/client-token-status.js +1 -0
- package/dist/esm/enums/client-tokens/index.js +1 -0
- package/dist/esm/enums/index.js +1 -0
- package/dist/esm/notifications/entities/client-token/client-token-notification.js +20 -0
- package/dist/esm/notifications/entities/client-token/index.js +1 -0
- package/dist/esm/notifications/entities/discount/discount-notification.js +2 -0
- package/dist/esm/notifications/entities/index.js +1 -0
- package/dist/esm/notifications/entities/shared/transaction-payout-totals-adjusted-notification.js +2 -0
- package/dist/esm/notifications/events/client-token/client-token-created-event.js +11 -0
- package/dist/esm/notifications/events/client-token/client-token-revoked-event.js +11 -0
- package/dist/esm/notifications/events/client-token/client-token-updated-event.js +11 -0
- package/dist/esm/notifications/events/client-token/index.js +3 -0
- package/dist/esm/notifications/events/discount-group/discount-group-updated-event.js +11 -0
- package/dist/esm/notifications/events/discount-group/index.js +1 -0
- package/dist/esm/notifications/events/index.js +1 -0
- package/dist/esm/notifications/helpers/types.js +4 -0
- package/dist/esm/notifications/helpers/webhooks.js +9 -1
- package/dist/esm/notifications/types/client-token/client-token-notification-response.js +1 -0
- package/dist/esm/notifications/types/client-token/index.js +1 -0
- package/dist/esm/notifications/types/index.js +1 -0
- package/dist/esm/paddle.js +3 -1
- package/dist/esm/resources/client-tokens/index.js +39 -0
- package/dist/esm/resources/client-tokens/operations/create-client-token-request-body.js +1 -0
- package/dist/esm/resources/client-tokens/operations/index.js +3 -0
- package/dist/esm/resources/client-tokens/operations/list-client-token-query-parameters.js +1 -0
- package/dist/esm/resources/client-tokens/operations/update-client-token-request-body.js +1 -0
- package/dist/esm/resources/discount-groups/index.js +22 -1
- package/dist/esm/resources/discount-groups/operations/index.js +1 -0
- package/dist/esm/resources/discount-groups/operations/update-discount-group-request-body.js +1 -0
- package/dist/esm/resources/discounts/index.js +3 -2
- package/dist/esm/resources/discounts/operations/get-discount-query-parameters.js +1 -0
- package/dist/esm/resources/discounts/operations/index.js +1 -0
- package/dist/esm/resources/index.js +1 -0
- package/dist/esm/types/client-token/client-token-response.js +1 -0
- package/dist/esm/types/client-token/index.js +1 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/entities/client-token/client-token-collection.d.ts +6 -0
- package/dist/types/entities/client-token/client-token.d.ts +13 -0
- package/dist/types/entities/client-token/index.d.ts +2 -0
- package/dist/types/entities/discount/discount.d.ts +3 -1
- package/dist/types/entities/shared/transaction-payout-totals-adjusted.d.ts +1 -0
- package/dist/types/entities/shared/transaction-payout-totals.d.ts +2 -0
- package/dist/types/enums/api-key/api-key-permission.d.ts +1 -1
- package/dist/types/enums/client-tokens/client-token-status.d.ts +1 -0
- package/dist/types/enums/client-tokens/index.d.ts +1 -0
- package/dist/types/enums/index.d.ts +1 -0
- package/dist/types/notifications/entities/client-token/client-token-notification.d.ts +13 -0
- package/dist/types/notifications/entities/client-token/index.d.ts +1 -0
- package/dist/types/notifications/entities/discount/discount-notification.d.ts +1 -0
- package/dist/types/notifications/entities/index.d.ts +1 -0
- package/dist/types/notifications/entities/shared/transaction-payout-totals-adjusted-notification.d.ts +1 -0
- package/dist/types/notifications/events/client-token/client-token-created-event.d.ts +10 -0
- package/dist/types/notifications/events/client-token/client-token-revoked-event.d.ts +10 -0
- package/dist/types/notifications/events/client-token/client-token-updated-event.d.ts +10 -0
- package/dist/types/notifications/events/client-token/index.d.ts +3 -0
- package/dist/types/notifications/events/discount-group/discount-group-updated-event.d.ts +10 -0
- package/dist/types/notifications/events/discount-group/index.d.ts +1 -0
- package/dist/types/notifications/events/index.d.ts +1 -0
- package/dist/types/notifications/helpers/types.d.ts +7 -3
- package/dist/types/notifications/types/client-token/client-token-notification-response.d.ts +11 -0
- package/dist/types/notifications/types/client-token/index.d.ts +1 -0
- package/dist/types/notifications/types/discount/discount-notification-response.d.ts +1 -0
- package/dist/types/notifications/types/index.d.ts +1 -0
- package/dist/types/notifications/types/shared/payment-method-details.d.ts +1 -1
- package/dist/types/notifications/types/shared/transaction-payout-totals-adjusted-notification-response.d.ts +1 -0
- package/dist/types/paddle.d.ts +2 -1
- package/dist/types/resources/client-tokens/index.d.ts +11 -0
- package/dist/types/resources/client-tokens/operations/create-client-token-request-body.d.ts +4 -0
- package/dist/types/resources/client-tokens/operations/index.d.ts +3 -0
- package/dist/types/resources/client-tokens/operations/list-client-token-query-parameters.d.ts +7 -0
- package/dist/types/resources/client-tokens/operations/update-client-token-request-body.d.ts +4 -0
- package/dist/types/resources/discount-groups/index.d.ts +4 -1
- package/dist/types/resources/discount-groups/operations/index.d.ts +1 -0
- package/dist/types/resources/discount-groups/operations/update-discount-group-request-body.d.ts +5 -0
- package/dist/types/resources/discounts/index.d.ts +2 -2
- package/dist/types/resources/discounts/operations/create-discount-request-body.d.ts +1 -0
- package/dist/types/resources/discounts/operations/get-discount-query-parameters.d.ts +3 -0
- package/dist/types/resources/discounts/operations/index.d.ts +1 -0
- package/dist/types/resources/discounts/operations/list-discount-query-parameters.d.ts +2 -0
- package/dist/types/resources/discounts/operations/update-discount-request-body.d.ts +1 -0
- package/dist/types/resources/events/operations/list-events-query-parameters.d.ts +2 -0
- package/dist/types/resources/index.d.ts +1 -0
- package/dist/types/types/client-token/client-token-response.d.ts +11 -0
- package/dist/types/types/client-token/index.d.ts +1 -0
- package/dist/types/types/discount/discount-response.d.ts +4 -1
- package/dist/types/types/events/events-response.d.ts +14 -2
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/shared/payment-method-details.d.ts +1 -1
- package/dist/types/types/shared/transaction-payout-totals-adjusted-response.d.ts +1 -0
- package/dist/types/types/shared/transaction-payout-totals-response.d.ts +2 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class ClientToken {
|
|
2
|
+
id;
|
|
3
|
+
token;
|
|
4
|
+
name;
|
|
5
|
+
description;
|
|
6
|
+
status;
|
|
7
|
+
createdAt;
|
|
8
|
+
updatedAt;
|
|
9
|
+
revokedAt;
|
|
10
|
+
constructor(clientToken) {
|
|
11
|
+
this.id = clientToken.id;
|
|
12
|
+
this.token = clientToken.token;
|
|
13
|
+
this.name = clientToken.name;
|
|
14
|
+
this.description = clientToken.description ?? null;
|
|
15
|
+
this.status = clientToken.status;
|
|
16
|
+
this.createdAt = clientToken.created_at;
|
|
17
|
+
this.updatedAt = clientToken.updated_at;
|
|
18
|
+
this.revokedAt = clientToken.revoked_at ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ImportMeta } from '../index.js';
|
|
1
|
+
import { DiscountGroup, ImportMeta } from '../index.js';
|
|
2
2
|
export class Discount {
|
|
3
3
|
id;
|
|
4
4
|
status;
|
|
@@ -19,6 +19,8 @@ export class Discount {
|
|
|
19
19
|
createdAt;
|
|
20
20
|
updatedAt;
|
|
21
21
|
importMeta;
|
|
22
|
+
discountGroupId;
|
|
23
|
+
discountGroup;
|
|
22
24
|
constructor(discount) {
|
|
23
25
|
this.id = discount.id;
|
|
24
26
|
this.status = discount.status;
|
|
@@ -39,5 +41,7 @@ export class Discount {
|
|
|
39
41
|
this.createdAt = discount.created_at;
|
|
40
42
|
this.updatedAt = discount.updated_at;
|
|
41
43
|
this.importMeta = discount.import_meta ? new ImportMeta(discount.import_meta) : null;
|
|
44
|
+
this.discountGroupId = discount.discount_group_id ? discount.discount_group_id : null;
|
|
45
|
+
this.discountGroup = discount.discount_group ? new DiscountGroup(discount.discount_group) : null;
|
|
42
46
|
}
|
|
43
47
|
}
|
|
@@ -7,6 +7,7 @@ export class TransactionPayoutTotalsAdjusted {
|
|
|
7
7
|
chargebackFee;
|
|
8
8
|
earnings;
|
|
9
9
|
currencyCode;
|
|
10
|
+
exchangeRate;
|
|
10
11
|
constructor(transactionPayoutTotalsAdjusted) {
|
|
11
12
|
this.subtotal = transactionPayoutTotalsAdjusted.subtotal;
|
|
12
13
|
this.tax = transactionPayoutTotalsAdjusted.tax;
|
|
@@ -17,5 +18,6 @@ export class TransactionPayoutTotalsAdjusted {
|
|
|
17
18
|
: null;
|
|
18
19
|
this.earnings = transactionPayoutTotalsAdjusted.earnings;
|
|
19
20
|
this.currencyCode = transactionPayoutTotalsAdjusted.currency_code;
|
|
21
|
+
this.exchangeRate = transactionPayoutTotalsAdjusted.exchange_rate;
|
|
20
22
|
}
|
|
21
23
|
}
|
|
@@ -10,6 +10,8 @@ export class TransactionPayoutTotals {
|
|
|
10
10
|
fee;
|
|
11
11
|
earnings;
|
|
12
12
|
currencyCode;
|
|
13
|
+
exchangeRate;
|
|
14
|
+
feeRate;
|
|
13
15
|
constructor(transactionPayoutTotals) {
|
|
14
16
|
this.subtotal = transactionPayoutTotals.subtotal;
|
|
15
17
|
this.discount = transactionPayoutTotals.discount;
|
|
@@ -22,5 +24,7 @@ export class TransactionPayoutTotals {
|
|
|
22
24
|
this.fee = transactionPayoutTotals.fee;
|
|
23
25
|
this.earnings = transactionPayoutTotals.earnings;
|
|
24
26
|
this.currencyCode = transactionPayoutTotals.currency_code;
|
|
27
|
+
this.exchangeRate = transactionPayoutTotals.exchange_rate;
|
|
28
|
+
this.feeRate = transactionPayoutTotals.fee_rate;
|
|
25
29
|
}
|
|
26
30
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './client-token-status.js';
|
package/dist/esm/enums/index.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class ClientTokenNotification {
|
|
2
|
+
id;
|
|
3
|
+
token;
|
|
4
|
+
name;
|
|
5
|
+
description;
|
|
6
|
+
status;
|
|
7
|
+
createdAt;
|
|
8
|
+
updatedAt;
|
|
9
|
+
revokedAt;
|
|
10
|
+
constructor(clientToken) {
|
|
11
|
+
this.id = clientToken.id;
|
|
12
|
+
this.token = clientToken.token;
|
|
13
|
+
this.name = clientToken.name;
|
|
14
|
+
this.description = clientToken.description ?? null;
|
|
15
|
+
this.status = clientToken.status;
|
|
16
|
+
this.createdAt = clientToken.created_at;
|
|
17
|
+
this.updatedAt = clientToken.updated_at;
|
|
18
|
+
this.revokedAt = clientToken.revoked_at ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './client-token-notification.js';
|
|
@@ -19,6 +19,7 @@ export class DiscountNotification {
|
|
|
19
19
|
createdAt;
|
|
20
20
|
updatedAt;
|
|
21
21
|
importMeta;
|
|
22
|
+
discountGroupId;
|
|
22
23
|
constructor(discount) {
|
|
23
24
|
this.id = discount.id;
|
|
24
25
|
this.status = discount.status;
|
|
@@ -39,5 +40,6 @@ export class DiscountNotification {
|
|
|
39
40
|
this.createdAt = discount.created_at;
|
|
40
41
|
this.updatedAt = discount.updated_at;
|
|
41
42
|
this.importMeta = discount.import_meta ? new ImportMetaNotification(discount.import_meta) : null;
|
|
43
|
+
this.discountGroupId = discount.discount_group_id ? discount.discount_group_id : null;
|
|
42
44
|
}
|
|
43
45
|
}
|
package/dist/esm/notifications/entities/shared/transaction-payout-totals-adjusted-notification.js
CHANGED
|
@@ -7,6 +7,7 @@ export class TransactionPayoutTotalsAdjustedNotification {
|
|
|
7
7
|
chargebackFee;
|
|
8
8
|
earnings;
|
|
9
9
|
currencyCode;
|
|
10
|
+
exchangeRate;
|
|
10
11
|
constructor(transactionPayoutTotalsAdjusted) {
|
|
11
12
|
this.subtotal = transactionPayoutTotalsAdjusted.subtotal;
|
|
12
13
|
this.tax = transactionPayoutTotalsAdjusted.tax;
|
|
@@ -17,5 +18,6 @@ export class TransactionPayoutTotalsAdjustedNotification {
|
|
|
17
18
|
: null;
|
|
18
19
|
this.earnings = transactionPayoutTotalsAdjusted.earnings;
|
|
19
20
|
this.currencyCode = transactionPayoutTotalsAdjusted.currency_code;
|
|
21
|
+
this.exchangeRate = transactionPayoutTotalsAdjusted.exchange_rate;
|
|
20
22
|
}
|
|
21
23
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event.js';
|
|
2
|
+
import { EventName } from '../../helpers/index.js';
|
|
3
|
+
import { ClientTokenNotification } from '../../entities/index.js';
|
|
4
|
+
export class ClientTokenCreatedEvent extends Event {
|
|
5
|
+
eventType = EventName.ClientTokenCreated;
|
|
6
|
+
data;
|
|
7
|
+
constructor(response) {
|
|
8
|
+
super(response);
|
|
9
|
+
this.data = new ClientTokenNotification(response.data);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event.js';
|
|
2
|
+
import { EventName } from '../../helpers/index.js';
|
|
3
|
+
import { ClientTokenNotification } from '../../entities/index.js';
|
|
4
|
+
export class ClientTokenRevokedEvent extends Event {
|
|
5
|
+
eventType = EventName.ClientTokenRevoked;
|
|
6
|
+
data;
|
|
7
|
+
constructor(response) {
|
|
8
|
+
super(response);
|
|
9
|
+
this.data = new ClientTokenNotification(response.data);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event.js';
|
|
2
|
+
import { EventName } from '../../helpers/index.js';
|
|
3
|
+
import { ClientTokenNotification } from '../../entities/index.js';
|
|
4
|
+
export class ClientTokenUpdatedEvent extends Event {
|
|
5
|
+
eventType = EventName.ClientTokenUpdated;
|
|
6
|
+
data;
|
|
7
|
+
constructor(response) {
|
|
8
|
+
super(response);
|
|
9
|
+
this.data = new ClientTokenNotification(response.data);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event.js';
|
|
2
|
+
import { EventName } from '../../helpers/index.js';
|
|
3
|
+
import { DiscountGroupNotification } from '../../entities/index.js';
|
|
4
|
+
export class DiscountGroupUpdatedEvent extends Event {
|
|
5
|
+
eventType = EventName.DiscountGroupUpdated;
|
|
6
|
+
data;
|
|
7
|
+
constructor(response) {
|
|
8
|
+
super(response);
|
|
9
|
+
this.data = new DiscountGroupNotification(response.data);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -13,6 +13,9 @@ export var EventName;
|
|
|
13
13
|
EventName["BusinessCreated"] = "business.created";
|
|
14
14
|
EventName["BusinessImported"] = "business.imported";
|
|
15
15
|
EventName["BusinessUpdated"] = "business.updated";
|
|
16
|
+
EventName["ClientTokenCreated"] = "client_token.created";
|
|
17
|
+
EventName["ClientTokenUpdated"] = "client_token.updated";
|
|
18
|
+
EventName["ClientTokenRevoked"] = "client_token.revoked";
|
|
16
19
|
EventName["CustomerCreated"] = "customer.created";
|
|
17
20
|
EventName["CustomerUpdated"] = "customer.updated";
|
|
18
21
|
EventName["CustomerImported"] = "customer.imported";
|
|
@@ -20,6 +23,7 @@ export var EventName;
|
|
|
20
23
|
EventName["DiscountUpdated"] = "discount.updated";
|
|
21
24
|
EventName["DiscountImported"] = "discount.imported";
|
|
22
25
|
EventName["DiscountGroupCreated"] = "discount_group.created";
|
|
26
|
+
EventName["DiscountGroupUpdated"] = "discount_group.updated";
|
|
23
27
|
EventName["PaymentMethodDeleted"] = "payment_method.deleted";
|
|
24
28
|
EventName["PaymentMethodSaved"] = "payment_method.saved";
|
|
25
29
|
EventName["PayoutCreated"] = "payout.created";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WebhooksValidator } from './webhooks-validator.js';
|
|
2
2
|
import { EventName } from './types.js';
|
|
3
|
-
import { AddressCreatedEvent, AddressImportedEvent, AddressUpdatedEvent, AdjustmentCreatedEvent, AdjustmentUpdatedEvent, ApiKeyCreatedEvent, ApiKeyExpiredEvent, ApiKeyExpiringEvent, ApiKeyRevokedEvent, ApiKeyUpdatedEvent, BusinessCreatedEvent, BusinessImportedEvent, BusinessUpdatedEvent, CustomerCreatedEvent, CustomerImportedEvent, CustomerUpdatedEvent, DiscountCreatedEvent, DiscountGroupCreatedEvent, 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, TransactionRevisedEvent, TransactionUpdatedEvent, } from '../events/index.js';
|
|
3
|
+
import { AddressCreatedEvent, AddressImportedEvent, AddressUpdatedEvent, AdjustmentCreatedEvent, AdjustmentUpdatedEvent, ApiKeyCreatedEvent, ApiKeyExpiredEvent, ApiKeyExpiringEvent, ApiKeyRevokedEvent, ApiKeyUpdatedEvent, BusinessCreatedEvent, BusinessImportedEvent, BusinessUpdatedEvent, ClientTokenCreatedEvent, ClientTokenRevokedEvent, ClientTokenUpdatedEvent, CustomerCreatedEvent, CustomerImportedEvent, CustomerUpdatedEvent, DiscountCreatedEvent, DiscountGroupCreatedEvent, DiscountGroupUpdatedEvent, 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, TransactionRevisedEvent, TransactionUpdatedEvent, } from '../events/index.js';
|
|
4
4
|
import { Logger } from '../../internal/base/logger.js';
|
|
5
5
|
export class Webhooks {
|
|
6
6
|
async unmarshal(requestBody, secretKey, signature) {
|
|
@@ -44,6 +44,12 @@ export class Webhooks {
|
|
|
44
44
|
return new BusinessUpdatedEvent(data);
|
|
45
45
|
case EventName.BusinessImported:
|
|
46
46
|
return new BusinessImportedEvent(data);
|
|
47
|
+
case EventName.ClientTokenCreated:
|
|
48
|
+
return new ClientTokenCreatedEvent(data);
|
|
49
|
+
case EventName.ClientTokenUpdated:
|
|
50
|
+
return new ClientTokenUpdatedEvent(data);
|
|
51
|
+
case EventName.ClientTokenRevoked:
|
|
52
|
+
return new ClientTokenRevokedEvent(data);
|
|
47
53
|
case EventName.CustomerCreated:
|
|
48
54
|
return new CustomerCreatedEvent(data);
|
|
49
55
|
case EventName.CustomerUpdated:
|
|
@@ -58,6 +64,8 @@ export class Webhooks {
|
|
|
58
64
|
return new DiscountUpdatedEvent(data);
|
|
59
65
|
case EventName.DiscountGroupCreated:
|
|
60
66
|
return new DiscountGroupCreatedEvent(data);
|
|
67
|
+
case EventName.DiscountGroupUpdated:
|
|
68
|
+
return new DiscountGroupUpdatedEvent(data);
|
|
61
69
|
case EventName.PaymentMethodDeleted:
|
|
62
70
|
return new PaymentMethodDeletedEvent(data);
|
|
63
71
|
case EventName.PaymentMethodSaved:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './client-token-notification-response.js';
|
package/dist/esm/paddle.js
CHANGED
|
@@ -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, CustomerPortalSessionsResource, CustomersResource, DiscountGroupsResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PaymentMethodsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationRunEventsResource, SimulationRunsResource, SimulationsResource, SimulationTypesResource, SubscriptionsResource, TransactionsResource, } from './resources/index.js';
|
|
3
|
+
import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomerPortalSessionsResource, CustomersResource, DiscountGroupsResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PaymentMethodsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationRunEventsResource, SimulationRunsResource, SimulationsResource, SimulationTypesResource, SubscriptionsResource, TransactionsResource, ClientTokensResource, } 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 {
|
|
@@ -32,6 +32,7 @@ export class Paddle {
|
|
|
32
32
|
simulations;
|
|
33
33
|
simulationRuns;
|
|
34
34
|
simulationRunEvents;
|
|
35
|
+
clientTokens;
|
|
35
36
|
constructor(apiKey, options) {
|
|
36
37
|
this.client = new Client(apiKey, options ? { ...this.defaultPaddleOptions, ...options } : { ...this.defaultPaddleOptions });
|
|
37
38
|
this.products = new ProductsResource(this.client);
|
|
@@ -57,5 +58,6 @@ export class Paddle {
|
|
|
57
58
|
this.simulations = new SimulationsResource(this.client);
|
|
58
59
|
this.simulationRuns = new SimulationRunsResource(this.client);
|
|
59
60
|
this.simulationRunEvents = new SimulationRunEventsResource(this.client);
|
|
61
|
+
this.clientTokens = new ClientTokensResource(this.client);
|
|
60
62
|
}
|
|
61
63
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BaseResource, PathParameters, QueryParameters } from '../../internal/base/index.js';
|
|
2
|
+
import { ClientToken, ClientTokenCollection } from '../../entities/client-token/index.js';
|
|
3
|
+
const ClientTokenPaths = {
|
|
4
|
+
list: '/client-tokens',
|
|
5
|
+
create: '/client-tokens',
|
|
6
|
+
get: '/client-tokens/{client_token_id}',
|
|
7
|
+
update: '/client-tokens/{client_token_id}',
|
|
8
|
+
};
|
|
9
|
+
export * from './operations/index.js';
|
|
10
|
+
export class ClientTokensResource extends BaseResource {
|
|
11
|
+
list(queryParams) {
|
|
12
|
+
const queryParameters = new QueryParameters(queryParams);
|
|
13
|
+
return new ClientTokenCollection(this.client, ClientTokenPaths.list + queryParameters.toQueryString());
|
|
14
|
+
}
|
|
15
|
+
async create(createClientTokenRequestBody) {
|
|
16
|
+
const response = await this.client.post(ClientTokenPaths.create, createClientTokenRequestBody);
|
|
17
|
+
const data = this.handleResponse(response);
|
|
18
|
+
return new ClientToken(data);
|
|
19
|
+
}
|
|
20
|
+
async get(clientTokenId) {
|
|
21
|
+
const urlWithPathParams = new PathParameters(ClientTokenPaths.get, {
|
|
22
|
+
client_token_id: clientTokenId,
|
|
23
|
+
}).deriveUrl();
|
|
24
|
+
const response = await this.client.get(urlWithPathParams);
|
|
25
|
+
const data = this.handleResponse(response);
|
|
26
|
+
return new ClientToken(data);
|
|
27
|
+
}
|
|
28
|
+
async update(clientTokenId, updateClientToken) {
|
|
29
|
+
const urlWithPathParams = new PathParameters(ClientTokenPaths.update, {
|
|
30
|
+
client_token_id: clientTokenId,
|
|
31
|
+
}).deriveUrl();
|
|
32
|
+
const response = await this.client.patch(urlWithPathParams, updateClientToken);
|
|
33
|
+
const data = this.handleResponse(response);
|
|
34
|
+
return new ClientToken(data);
|
|
35
|
+
}
|
|
36
|
+
async revoke(clientTokenId) {
|
|
37
|
+
return await this.update(clientTokenId, { status: 'revoked' });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { DiscountGroup, DiscountGroupCollection } from '../../entities/index.js';
|
|
2
|
-
import { BaseResource, QueryParameters } from '../../internal/base/index.js';
|
|
2
|
+
import { BaseResource, PathParameters, QueryParameters } from '../../internal/base/index.js';
|
|
3
3
|
const DiscountGroupPaths = {
|
|
4
4
|
list: '/discount-groups',
|
|
5
5
|
create: '/discount-groups',
|
|
6
|
+
get: '/discount-groups/{discount_group_id}',
|
|
7
|
+
update: '/discount-groups/{discount_group_id}',
|
|
6
8
|
};
|
|
7
9
|
export * from './operations/index.js';
|
|
8
10
|
export class DiscountGroupsResource extends BaseResource {
|
|
@@ -15,4 +17,23 @@ export class DiscountGroupsResource extends BaseResource {
|
|
|
15
17
|
const data = this.handleResponse(response);
|
|
16
18
|
return new DiscountGroup(data);
|
|
17
19
|
}
|
|
20
|
+
async get(discountGroupId) {
|
|
21
|
+
const urlWithPathParams = new PathParameters(DiscountGroupPaths.get, {
|
|
22
|
+
discount_group_id: discountGroupId,
|
|
23
|
+
}).deriveUrl();
|
|
24
|
+
const response = await this.client.get(urlWithPathParams);
|
|
25
|
+
const data = this.handleResponse(response);
|
|
26
|
+
return new DiscountGroup(data);
|
|
27
|
+
}
|
|
28
|
+
async update(discountGroupId, updateDiscountGroup) {
|
|
29
|
+
const urlWithPathParams = new PathParameters(DiscountGroupPaths.update, {
|
|
30
|
+
discount_group_id: discountGroupId,
|
|
31
|
+
}).deriveUrl();
|
|
32
|
+
const response = await this.client.patch(urlWithPathParams, updateDiscountGroup);
|
|
33
|
+
const data = this.handleResponse(response);
|
|
34
|
+
return new DiscountGroup(data);
|
|
35
|
+
}
|
|
36
|
+
async archive(discountGroupId) {
|
|
37
|
+
return await this.update(discountGroupId, { status: 'archived' });
|
|
38
|
+
}
|
|
18
39
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -17,11 +17,12 @@ export class DiscountsResource extends BaseResource {
|
|
|
17
17
|
const data = this.handleResponse(response);
|
|
18
18
|
return new Discount(data);
|
|
19
19
|
}
|
|
20
|
-
async get(discountId) {
|
|
20
|
+
async get(discountId, queryParams) {
|
|
21
|
+
const queryParameters = new QueryParameters(queryParams);
|
|
21
22
|
const urlWithPathParams = new PathParameters(DiscountPaths.get, {
|
|
22
23
|
discount_id: discountId,
|
|
23
24
|
}).deriveUrl();
|
|
24
|
-
const response = await this.client.get(urlWithPathParams);
|
|
25
|
+
const response = await this.client.get(urlWithPathParams + queryParameters.toQueryString());
|
|
25
26
|
const data = this.handleResponse(response);
|
|
26
27
|
return new Discount(data);
|
|
27
28
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './client-token-response.js';
|
package/dist/esm/types/index.js
CHANGED
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = '3.
|
|
1
|
+
export const SDK_VERSION = '3.2.0';
|