dodopayments 1.19.0 → 1.20.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 +15 -0
- package/README.md +3 -3
- package/index.d.mts +12 -9
- package/index.d.ts +12 -9
- package/index.d.ts.map +1 -1
- package/index.js +13 -8
- package/index.js.map +1 -1
- package/index.mjs +15 -10
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/addons.d.ts +108 -0
- package/resources/addons.d.ts.map +1 -0
- package/resources/addons.js +36 -0
- package/resources/addons.js.map +1 -0
- package/resources/addons.mjs +31 -0
- package/resources/addons.mjs.map +1 -0
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -2
- package/resources/index.mjs.map +1 -1
- package/resources/misc.d.ts +7 -1
- package/resources/misc.d.ts.map +1 -1
- package/resources/payments.d.ts +4 -4
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs.map +1 -1
- package/resources/payouts.d.ts +2 -1
- package/resources/payouts.d.ts.map +1 -1
- package/resources/payouts.js.map +1 -1
- package/resources/payouts.mjs.map +1 -1
- package/resources/products/products.d.ts +8 -7
- package/resources/products/products.d.ts.map +1 -1
- package/resources/products/products.js.map +1 -1
- package/resources/products/products.mjs.map +1 -1
- package/resources/refunds.d.ts +2 -1
- package/resources/refunds.d.ts.map +1 -1
- package/resources/refunds.js.map +1 -1
- package/resources/refunds.mjs.map +1 -1
- package/resources/subscriptions.d.ts +100 -6
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +6 -5
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +4 -3
- package/resources/subscriptions.mjs.map +1 -1
- package/src/index.ts +49 -14
- package/src/resources/addons.ts +173 -0
- package/src/resources/index.ts +19 -2
- package/src/resources/misc.ts +155 -0
- package/src/resources/payments.ts +4 -585
- package/src/resources/payouts.ts +2 -146
- package/src/resources/products/products.ts +8 -443
- package/src/resources/refunds.ts +2 -147
- package/src/resources/subscriptions.ts +134 -300
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.20.0 (2025-05-01)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.19.0...v1.20.0](https://github.com/dodopayments/dodopayments-node/compare/v1.19.0...v1.20.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** added addons ([1e02684](https://github.com/dodopayments/dodopayments-node/commit/1e02684522d2e02e95995880a99856106977e24e))
|
|
10
|
+
* **api:** updated readme example ([eaa2425](https://github.com/dodopayments/dodopayments-node/commit/eaa24252f843775f237441d2371f22c8397057ef))
|
|
11
|
+
* **api:** updated readme example ([5e589ad](https://github.com/dodopayments/dodopayments-node/commit/5e589ad233c6724dc29ca56d6a673dae5c7caf4a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Documentation
|
|
15
|
+
|
|
16
|
+
* **readme:** fix typo ([a3357ea](https://github.com/dodopayments/dodopayments-node/commit/a3357ea1d18caf29afef209a287e9b87a9d5da9a))
|
|
17
|
+
|
|
3
18
|
## 1.19.0 (2025-04-30)
|
|
4
19
|
|
|
5
20
|
Full Changelog: [v1.18.3...v1.19.0](https://github.com/dodopayments/dodopayments-node/compare/v1.18.3...v1.19.0)
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ The full API of this library can be found in [api.md](api.md).
|
|
|
23
23
|
import DodoPayments from 'dodopayments';
|
|
24
24
|
|
|
25
25
|
const client = new DodoPayments({
|
|
26
|
-
|
|
26
|
+
apiKey: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
|
|
27
27
|
environment: 'test_mode', // defaults to 'live_mode'
|
|
28
28
|
});
|
|
29
29
|
|
|
@@ -49,7 +49,7 @@ This library includes TypeScript definitions for all request params and response
|
|
|
49
49
|
import DodoPayments from 'dodopayments';
|
|
50
50
|
|
|
51
51
|
const client = new DodoPayments({
|
|
52
|
-
|
|
52
|
+
apiKey: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
|
|
53
53
|
environment: 'test_mode', // defaults to 'live_mode'
|
|
54
54
|
});
|
|
55
55
|
|
|
@@ -96,7 +96,7 @@ async function main() {
|
|
|
96
96
|
main();
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
Error codes are as
|
|
99
|
+
Error codes are as follows:
|
|
100
100
|
|
|
101
101
|
| Status Code | Error Type |
|
|
102
102
|
| ----------- | -------------------------- |
|
package/index.d.mts
CHANGED
|
@@ -5,16 +5,17 @@ import * as Pagination from "./pagination.js";
|
|
|
5
5
|
import { type DefaultPageNumberPaginationParams, DefaultPageNumberPaginationResponse } from "./pagination.js";
|
|
6
6
|
import * as Uploads from "./uploads.js";
|
|
7
7
|
import * as API from "./resources/index.js";
|
|
8
|
+
import { AddonCreateParams, AddonListParams, AddonResponse, AddonResponsesDefaultPageNumberPagination, AddonUpdateImagesResponse, AddonUpdateParams, Addons } from "./resources/addons.js";
|
|
8
9
|
import { Discount, DiscountCreateParams, DiscountListParams, DiscountType, DiscountUpdateParams, Discounts, DiscountsDefaultPageNumberPagination } from "./resources/discounts.js";
|
|
9
10
|
import { Dispute, DisputeListParams, DisputeStage, DisputeStatus, Disputes, DisputesDefaultPageNumberPagination } from "./resources/disputes.js";
|
|
10
11
|
import { LicenseKeyInstance, LicenseKeyInstanceListParams, LicenseKeyInstanceUpdateParams, LicenseKeyInstances, LicenseKeyInstancesDefaultPageNumberPagination } from "./resources/license-key-instances.js";
|
|
11
12
|
import { LicenseKey, LicenseKeyListParams, LicenseKeyStatus, LicenseKeyUpdateParams, LicenseKeys, LicenseKeysDefaultPageNumberPagination } from "./resources/license-keys.js";
|
|
12
13
|
import { LicenseActivateParams, LicenseDeactivateParams, LicenseValidateParams, LicenseValidateResponse, Licenses } from "./resources/licenses.js";
|
|
13
|
-
import { CountryCode, Misc, MiscListSupportedCountriesResponse } from "./resources/misc.js";
|
|
14
|
+
import { CountryCode, Currency, Misc, MiscListSupportedCountriesResponse, TaxCategory } from "./resources/misc.js";
|
|
14
15
|
import { AttachExistingCustomer, BillingAddress, CreateNewCustomer, CustomerLimitedDetails, CustomerRequest, IntentStatus, OneTimeProductCartItem, Payment, PaymentCreateParams, PaymentCreateResponse, PaymentListParams, PaymentListResponse, PaymentListResponsesDefaultPageNumberPagination, Payments } from "./resources/payments.js";
|
|
15
16
|
import { PayoutListParams, PayoutListResponse, PayoutListResponsesDefaultPageNumberPagination, Payouts } from "./resources/payouts.js";
|
|
16
17
|
import { Refund, RefundCreateParams, RefundListParams, RefundStatus, Refunds, RefundsDefaultPageNumberPagination } from "./resources/refunds.js";
|
|
17
|
-
import { Subscription, SubscriptionChangePlanParams, SubscriptionChargeParams, SubscriptionChargeResponse, SubscriptionCreateParams, SubscriptionCreateResponse, SubscriptionListParams, SubscriptionStatus, SubscriptionUpdateParams, Subscriptions,
|
|
18
|
+
import { AddonCartResponseItem, Subscription, SubscriptionChangePlanParams, SubscriptionChargeParams, SubscriptionChargeResponse, SubscriptionCreateParams, SubscriptionCreateResponse, SubscriptionListParams, SubscriptionListResponse, SubscriptionListResponsesDefaultPageNumberPagination, SubscriptionStatus, SubscriptionUpdateParams, Subscriptions, TimeInterval } from "./resources/subscriptions.js";
|
|
18
19
|
import { WebhookEvent, WebhookEventListParams, WebhookEvents, WebhookEventsDefaultPageNumberPagination } from "./resources/webhook-events.js";
|
|
19
20
|
import { Customer, CustomerCreateParams, CustomerListParams, CustomerPortalSession, CustomerUpdateParams, Customers, CustomersDefaultPageNumberPagination } from "./resources/customers/customers.js";
|
|
20
21
|
import { Invoices } from "./resources/invoices/invoices.js";
|
|
@@ -26,9 +27,9 @@ declare const environments: {
|
|
|
26
27
|
type Environment = keyof typeof environments;
|
|
27
28
|
export interface ClientOptions {
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
+
* Defaults to process.env['DODO_PAYMENTS_API_KEY'].
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
+
apiKey?: string | undefined;
|
|
32
33
|
/**
|
|
33
34
|
* Specifies the environment to use for the API.
|
|
34
35
|
*
|
|
@@ -91,12 +92,12 @@ export interface ClientOptions {
|
|
|
91
92
|
* API Client for interfacing with the Dodo Payments API.
|
|
92
93
|
*/
|
|
93
94
|
export declare class DodoPayments extends Core.APIClient {
|
|
94
|
-
|
|
95
|
+
apiKey: string;
|
|
95
96
|
private _options;
|
|
96
97
|
/**
|
|
97
98
|
* API Client for interfacing with the Dodo Payments API.
|
|
98
99
|
*
|
|
99
|
-
* @param {string | undefined} [opts.
|
|
100
|
+
* @param {string | undefined} [opts.apiKey=process.env['DODO_PAYMENTS_API_KEY'] ?? undefined]
|
|
100
101
|
* @param {Environment} [opts.environment=live_mode] - Specifies the environment URL to use for the API.
|
|
101
102
|
* @param {string} [opts.baseURL=process.env['DODO_PAYMENTS_BASE_URL'] ?? https://live.dodopayments.com] - Override the default base URL for the API.
|
|
102
103
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
@@ -106,7 +107,7 @@ export declare class DodoPayments extends Core.APIClient {
|
|
|
106
107
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
107
108
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
108
109
|
*/
|
|
109
|
-
constructor({ baseURL,
|
|
110
|
+
constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
|
|
110
111
|
payments: API.Payments;
|
|
111
112
|
subscriptions: API.Subscriptions;
|
|
112
113
|
invoices: API.Invoices;
|
|
@@ -121,6 +122,7 @@ export declare class DodoPayments extends Core.APIClient {
|
|
|
121
122
|
products: API.Products;
|
|
122
123
|
misc: API.Misc;
|
|
123
124
|
discounts: API.Discounts;
|
|
125
|
+
addons: API.Addons;
|
|
124
126
|
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
125
127
|
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
126
128
|
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
@@ -147,7 +149,7 @@ export declare namespace DodoPayments {
|
|
|
147
149
|
export import DefaultPageNumberPagination = Pagination.DefaultPageNumberPagination;
|
|
148
150
|
export { type DefaultPageNumberPaginationParams as DefaultPageNumberPaginationParams, type DefaultPageNumberPaginationResponse as DefaultPageNumberPaginationResponse, };
|
|
149
151
|
export { Payments as Payments, type AttachExistingCustomer as AttachExistingCustomer, type BillingAddress as BillingAddress, type CreateNewCustomer as CreateNewCustomer, type CustomerLimitedDetails as CustomerLimitedDetails, type CustomerRequest as CustomerRequest, type IntentStatus as IntentStatus, type OneTimeProductCartItem as OneTimeProductCartItem, type Payment as Payment, type PaymentCreateResponse as PaymentCreateResponse, type PaymentListResponse as PaymentListResponse, PaymentListResponsesDefaultPageNumberPagination as PaymentListResponsesDefaultPageNumberPagination, type PaymentCreateParams as PaymentCreateParams, type PaymentListParams as PaymentListParams, };
|
|
150
|
-
export { Subscriptions as Subscriptions, type Subscription as Subscription, type SubscriptionStatus as SubscriptionStatus, type TimeInterval as TimeInterval, type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionChargeResponse as SubscriptionChargeResponse,
|
|
152
|
+
export { Subscriptions as Subscriptions, type AddonCartResponseItem as AddonCartResponseItem, type Subscription as Subscription, type SubscriptionStatus as SubscriptionStatus, type TimeInterval as TimeInterval, type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionChargeResponse as SubscriptionChargeResponse, SubscriptionListResponsesDefaultPageNumberPagination as SubscriptionListResponsesDefaultPageNumberPagination, type SubscriptionCreateParams as SubscriptionCreateParams, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionChangePlanParams as SubscriptionChangePlanParams, type SubscriptionChargeParams as SubscriptionChargeParams, };
|
|
151
153
|
export { Invoices as Invoices };
|
|
152
154
|
export { Licenses as Licenses, type LicenseValidateResponse as LicenseValidateResponse, type LicenseActivateParams as LicenseActivateParams, type LicenseDeactivateParams as LicenseDeactivateParams, type LicenseValidateParams as LicenseValidateParams, };
|
|
153
155
|
export { LicenseKeys as LicenseKeys, type LicenseKey as LicenseKey, type LicenseKeyStatus as LicenseKeyStatus, LicenseKeysDefaultPageNumberPagination as LicenseKeysDefaultPageNumberPagination, type LicenseKeyUpdateParams as LicenseKeyUpdateParams, type LicenseKeyListParams as LicenseKeyListParams, };
|
|
@@ -158,8 +160,9 @@ export declare namespace DodoPayments {
|
|
|
158
160
|
export { Payouts as Payouts, type PayoutListResponse as PayoutListResponse, PayoutListResponsesDefaultPageNumberPagination as PayoutListResponsesDefaultPageNumberPagination, type PayoutListParams as PayoutListParams, };
|
|
159
161
|
export { WebhookEvents as WebhookEvents, type WebhookEvent as WebhookEvent, WebhookEventsDefaultPageNumberPagination as WebhookEventsDefaultPageNumberPagination, type WebhookEventListParams as WebhookEventListParams, };
|
|
160
162
|
export { Products as Products, type LicenseKeyDuration as LicenseKeyDuration, type Price as Price, type Product as Product, type ProductListResponse as ProductListResponse, ProductListResponsesDefaultPageNumberPagination as ProductListResponsesDefaultPageNumberPagination, type ProductCreateParams as ProductCreateParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, };
|
|
161
|
-
export { Misc as Misc, type CountryCode as CountryCode, type MiscListSupportedCountriesResponse as MiscListSupportedCountriesResponse, };
|
|
163
|
+
export { Misc as Misc, type CountryCode as CountryCode, type Currency as Currency, type TaxCategory as TaxCategory, type MiscListSupportedCountriesResponse as MiscListSupportedCountriesResponse, };
|
|
162
164
|
export { Discounts as Discounts, type Discount as Discount, type DiscountType as DiscountType, DiscountsDefaultPageNumberPagination as DiscountsDefaultPageNumberPagination, type DiscountCreateParams as DiscountCreateParams, type DiscountUpdateParams as DiscountUpdateParams, type DiscountListParams as DiscountListParams, };
|
|
165
|
+
export { Addons as Addons, type AddonResponse as AddonResponse, type AddonUpdateImagesResponse as AddonUpdateImagesResponse, AddonResponsesDefaultPageNumberPagination as AddonResponsesDefaultPageNumberPagination, type AddonCreateParams as AddonCreateParams, type AddonUpdateParams as AddonUpdateParams, type AddonListParams as AddonListParams, };
|
|
163
166
|
}
|
|
164
167
|
export { toFile, fileFromPath } from "./uploads.js";
|
|
165
168
|
export { DodoPaymentsError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
|
package/index.d.ts
CHANGED
|
@@ -5,16 +5,17 @@ import * as Pagination from "./pagination.js";
|
|
|
5
5
|
import { type DefaultPageNumberPaginationParams, DefaultPageNumberPaginationResponse } from "./pagination.js";
|
|
6
6
|
import * as Uploads from "./uploads.js";
|
|
7
7
|
import * as API from "./resources/index.js";
|
|
8
|
+
import { AddonCreateParams, AddonListParams, AddonResponse, AddonResponsesDefaultPageNumberPagination, AddonUpdateImagesResponse, AddonUpdateParams, Addons } from "./resources/addons.js";
|
|
8
9
|
import { Discount, DiscountCreateParams, DiscountListParams, DiscountType, DiscountUpdateParams, Discounts, DiscountsDefaultPageNumberPagination } from "./resources/discounts.js";
|
|
9
10
|
import { Dispute, DisputeListParams, DisputeStage, DisputeStatus, Disputes, DisputesDefaultPageNumberPagination } from "./resources/disputes.js";
|
|
10
11
|
import { LicenseKeyInstance, LicenseKeyInstanceListParams, LicenseKeyInstanceUpdateParams, LicenseKeyInstances, LicenseKeyInstancesDefaultPageNumberPagination } from "./resources/license-key-instances.js";
|
|
11
12
|
import { LicenseKey, LicenseKeyListParams, LicenseKeyStatus, LicenseKeyUpdateParams, LicenseKeys, LicenseKeysDefaultPageNumberPagination } from "./resources/license-keys.js";
|
|
12
13
|
import { LicenseActivateParams, LicenseDeactivateParams, LicenseValidateParams, LicenseValidateResponse, Licenses } from "./resources/licenses.js";
|
|
13
|
-
import { CountryCode, Misc, MiscListSupportedCountriesResponse } from "./resources/misc.js";
|
|
14
|
+
import { CountryCode, Currency, Misc, MiscListSupportedCountriesResponse, TaxCategory } from "./resources/misc.js";
|
|
14
15
|
import { AttachExistingCustomer, BillingAddress, CreateNewCustomer, CustomerLimitedDetails, CustomerRequest, IntentStatus, OneTimeProductCartItem, Payment, PaymentCreateParams, PaymentCreateResponse, PaymentListParams, PaymentListResponse, PaymentListResponsesDefaultPageNumberPagination, Payments } from "./resources/payments.js";
|
|
15
16
|
import { PayoutListParams, PayoutListResponse, PayoutListResponsesDefaultPageNumberPagination, Payouts } from "./resources/payouts.js";
|
|
16
17
|
import { Refund, RefundCreateParams, RefundListParams, RefundStatus, Refunds, RefundsDefaultPageNumberPagination } from "./resources/refunds.js";
|
|
17
|
-
import { Subscription, SubscriptionChangePlanParams, SubscriptionChargeParams, SubscriptionChargeResponse, SubscriptionCreateParams, SubscriptionCreateResponse, SubscriptionListParams, SubscriptionStatus, SubscriptionUpdateParams, Subscriptions,
|
|
18
|
+
import { AddonCartResponseItem, Subscription, SubscriptionChangePlanParams, SubscriptionChargeParams, SubscriptionChargeResponse, SubscriptionCreateParams, SubscriptionCreateResponse, SubscriptionListParams, SubscriptionListResponse, SubscriptionListResponsesDefaultPageNumberPagination, SubscriptionStatus, SubscriptionUpdateParams, Subscriptions, TimeInterval } from "./resources/subscriptions.js";
|
|
18
19
|
import { WebhookEvent, WebhookEventListParams, WebhookEvents, WebhookEventsDefaultPageNumberPagination } from "./resources/webhook-events.js";
|
|
19
20
|
import { Customer, CustomerCreateParams, CustomerListParams, CustomerPortalSession, CustomerUpdateParams, Customers, CustomersDefaultPageNumberPagination } from "./resources/customers/customers.js";
|
|
20
21
|
import { Invoices } from "./resources/invoices/invoices.js";
|
|
@@ -26,9 +27,9 @@ declare const environments: {
|
|
|
26
27
|
type Environment = keyof typeof environments;
|
|
27
28
|
export interface ClientOptions {
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
+
* Defaults to process.env['DODO_PAYMENTS_API_KEY'].
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
+
apiKey?: string | undefined;
|
|
32
33
|
/**
|
|
33
34
|
* Specifies the environment to use for the API.
|
|
34
35
|
*
|
|
@@ -91,12 +92,12 @@ export interface ClientOptions {
|
|
|
91
92
|
* API Client for interfacing with the Dodo Payments API.
|
|
92
93
|
*/
|
|
93
94
|
export declare class DodoPayments extends Core.APIClient {
|
|
94
|
-
|
|
95
|
+
apiKey: string;
|
|
95
96
|
private _options;
|
|
96
97
|
/**
|
|
97
98
|
* API Client for interfacing with the Dodo Payments API.
|
|
98
99
|
*
|
|
99
|
-
* @param {string | undefined} [opts.
|
|
100
|
+
* @param {string | undefined} [opts.apiKey=process.env['DODO_PAYMENTS_API_KEY'] ?? undefined]
|
|
100
101
|
* @param {Environment} [opts.environment=live_mode] - Specifies the environment URL to use for the API.
|
|
101
102
|
* @param {string} [opts.baseURL=process.env['DODO_PAYMENTS_BASE_URL'] ?? https://live.dodopayments.com] - Override the default base URL for the API.
|
|
102
103
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
@@ -106,7 +107,7 @@ export declare class DodoPayments extends Core.APIClient {
|
|
|
106
107
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
107
108
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
108
109
|
*/
|
|
109
|
-
constructor({ baseURL,
|
|
110
|
+
constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
|
|
110
111
|
payments: API.Payments;
|
|
111
112
|
subscriptions: API.Subscriptions;
|
|
112
113
|
invoices: API.Invoices;
|
|
@@ -121,6 +122,7 @@ export declare class DodoPayments extends Core.APIClient {
|
|
|
121
122
|
products: API.Products;
|
|
122
123
|
misc: API.Misc;
|
|
123
124
|
discounts: API.Discounts;
|
|
125
|
+
addons: API.Addons;
|
|
124
126
|
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
125
127
|
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
126
128
|
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
@@ -147,7 +149,7 @@ export declare namespace DodoPayments {
|
|
|
147
149
|
export import DefaultPageNumberPagination = Pagination.DefaultPageNumberPagination;
|
|
148
150
|
export { type DefaultPageNumberPaginationParams as DefaultPageNumberPaginationParams, type DefaultPageNumberPaginationResponse as DefaultPageNumberPaginationResponse, };
|
|
149
151
|
export { Payments as Payments, type AttachExistingCustomer as AttachExistingCustomer, type BillingAddress as BillingAddress, type CreateNewCustomer as CreateNewCustomer, type CustomerLimitedDetails as CustomerLimitedDetails, type CustomerRequest as CustomerRequest, type IntentStatus as IntentStatus, type OneTimeProductCartItem as OneTimeProductCartItem, type Payment as Payment, type PaymentCreateResponse as PaymentCreateResponse, type PaymentListResponse as PaymentListResponse, PaymentListResponsesDefaultPageNumberPagination as PaymentListResponsesDefaultPageNumberPagination, type PaymentCreateParams as PaymentCreateParams, type PaymentListParams as PaymentListParams, };
|
|
150
|
-
export { Subscriptions as Subscriptions, type Subscription as Subscription, type SubscriptionStatus as SubscriptionStatus, type TimeInterval as TimeInterval, type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionChargeResponse as SubscriptionChargeResponse,
|
|
152
|
+
export { Subscriptions as Subscriptions, type AddonCartResponseItem as AddonCartResponseItem, type Subscription as Subscription, type SubscriptionStatus as SubscriptionStatus, type TimeInterval as TimeInterval, type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionChargeResponse as SubscriptionChargeResponse, SubscriptionListResponsesDefaultPageNumberPagination as SubscriptionListResponsesDefaultPageNumberPagination, type SubscriptionCreateParams as SubscriptionCreateParams, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionChangePlanParams as SubscriptionChangePlanParams, type SubscriptionChargeParams as SubscriptionChargeParams, };
|
|
151
153
|
export { Invoices as Invoices };
|
|
152
154
|
export { Licenses as Licenses, type LicenseValidateResponse as LicenseValidateResponse, type LicenseActivateParams as LicenseActivateParams, type LicenseDeactivateParams as LicenseDeactivateParams, type LicenseValidateParams as LicenseValidateParams, };
|
|
153
155
|
export { LicenseKeys as LicenseKeys, type LicenseKey as LicenseKey, type LicenseKeyStatus as LicenseKeyStatus, LicenseKeysDefaultPageNumberPagination as LicenseKeysDefaultPageNumberPagination, type LicenseKeyUpdateParams as LicenseKeyUpdateParams, type LicenseKeyListParams as LicenseKeyListParams, };
|
|
@@ -158,8 +160,9 @@ export declare namespace DodoPayments {
|
|
|
158
160
|
export { Payouts as Payouts, type PayoutListResponse as PayoutListResponse, PayoutListResponsesDefaultPageNumberPagination as PayoutListResponsesDefaultPageNumberPagination, type PayoutListParams as PayoutListParams, };
|
|
159
161
|
export { WebhookEvents as WebhookEvents, type WebhookEvent as WebhookEvent, WebhookEventsDefaultPageNumberPagination as WebhookEventsDefaultPageNumberPagination, type WebhookEventListParams as WebhookEventListParams, };
|
|
160
162
|
export { Products as Products, type LicenseKeyDuration as LicenseKeyDuration, type Price as Price, type Product as Product, type ProductListResponse as ProductListResponse, ProductListResponsesDefaultPageNumberPagination as ProductListResponsesDefaultPageNumberPagination, type ProductCreateParams as ProductCreateParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, };
|
|
161
|
-
export { Misc as Misc, type CountryCode as CountryCode, type MiscListSupportedCountriesResponse as MiscListSupportedCountriesResponse, };
|
|
163
|
+
export { Misc as Misc, type CountryCode as CountryCode, type Currency as Currency, type TaxCategory as TaxCategory, type MiscListSupportedCountriesResponse as MiscListSupportedCountriesResponse, };
|
|
162
164
|
export { Discounts as Discounts, type Discount as Discount, type DiscountType as DiscountType, DiscountsDefaultPageNumberPagination as DiscountsDefaultPageNumberPagination, type DiscountCreateParams as DiscountCreateParams, type DiscountUpdateParams as DiscountUpdateParams, type DiscountListParams as DiscountListParams, };
|
|
165
|
+
export { Addons as Addons, type AddonResponse as AddonResponse, type AddonUpdateImagesResponse as AddonUpdateImagesResponse, AddonResponsesDefaultPageNumberPagination as AddonResponsesDefaultPageNumberPagination, type AddonCreateParams as AddonCreateParams, type AddonUpdateParams as AddonUpdateParams, type AddonListParams as AddonListParams, };
|
|
163
166
|
}
|
|
164
167
|
export { toFile, fileFromPath } from "./uploads.js";
|
|
165
168
|
export { DodoPaymentsError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,iCAAiC,EAAE,mCAAmC,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,oCAAoC,EACrC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,mCAAmC,EACpC,MAA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AAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,yCAAyC,IAAI,yCAAyC,EACtF,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,eAAe,YAAY,CAAC"}
|
package/index.js
CHANGED
|
@@ -31,6 +31,7 @@ const Errors = __importStar(require("./error.js"));
|
|
|
31
31
|
const Pagination = __importStar(require("./pagination.js"));
|
|
32
32
|
const Uploads = __importStar(require("./uploads.js"));
|
|
33
33
|
const API = __importStar(require("./resources/index.js"));
|
|
34
|
+
const addons_1 = require("./resources/addons.js");
|
|
34
35
|
const discounts_1 = require("./resources/discounts.js");
|
|
35
36
|
const disputes_1 = require("./resources/disputes.js");
|
|
36
37
|
const license_key_instances_1 = require("./resources/license-key-instances.js");
|
|
@@ -56,7 +57,7 @@ class DodoPayments extends Core.APIClient {
|
|
|
56
57
|
/**
|
|
57
58
|
* API Client for interfacing with the Dodo Payments API.
|
|
58
59
|
*
|
|
59
|
-
* @param {string | undefined} [opts.
|
|
60
|
+
* @param {string | undefined} [opts.apiKey=process.env['DODO_PAYMENTS_API_KEY'] ?? undefined]
|
|
60
61
|
* @param {Environment} [opts.environment=live_mode] - Specifies the environment URL to use for the API.
|
|
61
62
|
* @param {string} [opts.baseURL=process.env['DODO_PAYMENTS_BASE_URL'] ?? https://live.dodopayments.com] - Override the default base URL for the API.
|
|
62
63
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
@@ -66,12 +67,12 @@ class DodoPayments extends Core.APIClient {
|
|
|
66
67
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
67
68
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
68
69
|
*/
|
|
69
|
-
constructor({ baseURL = Core.readEnv('DODO_PAYMENTS_BASE_URL'),
|
|
70
|
-
if (
|
|
71
|
-
throw new Errors.DodoPaymentsError("The DODO_PAYMENTS_API_KEY environment variable is missing or empty; either provide it, or instantiate the DodoPayments client with an
|
|
70
|
+
constructor({ baseURL = Core.readEnv('DODO_PAYMENTS_BASE_URL'), apiKey = Core.readEnv('DODO_PAYMENTS_API_KEY'), ...opts } = {}) {
|
|
71
|
+
if (apiKey === undefined) {
|
|
72
|
+
throw new Errors.DodoPaymentsError("The DODO_PAYMENTS_API_KEY environment variable is missing or empty; either provide it, or instantiate the DodoPayments client with an apiKey option, like new DodoPayments({ apiKey: 'My API Key' }).");
|
|
72
73
|
}
|
|
73
74
|
const options = {
|
|
74
|
-
|
|
75
|
+
apiKey,
|
|
75
76
|
...opts,
|
|
76
77
|
baseURL,
|
|
77
78
|
environment: opts.environment ?? 'live_mode',
|
|
@@ -100,8 +101,9 @@ class DodoPayments extends Core.APIClient {
|
|
|
100
101
|
this.products = new API.Products(this);
|
|
101
102
|
this.misc = new API.Misc(this);
|
|
102
103
|
this.discounts = new API.Discounts(this);
|
|
104
|
+
this.addons = new API.Addons(this);
|
|
103
105
|
this._options = options;
|
|
104
|
-
this.
|
|
106
|
+
this.apiKey = apiKey;
|
|
105
107
|
}
|
|
106
108
|
defaultQuery() {
|
|
107
109
|
return this._options.defaultQuery;
|
|
@@ -113,7 +115,7 @@ class DodoPayments extends Core.APIClient {
|
|
|
113
115
|
};
|
|
114
116
|
}
|
|
115
117
|
authHeaders(opts) {
|
|
116
|
-
return { Authorization: `Bearer ${this.
|
|
118
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
exports.DodoPayments = DodoPayments;
|
|
@@ -139,7 +141,8 @@ DodoPayments.Payments = payments_1.Payments;
|
|
|
139
141
|
DodoPayments.PaymentListResponsesDefaultPageNumberPagination =
|
|
140
142
|
payments_1.PaymentListResponsesDefaultPageNumberPagination;
|
|
141
143
|
DodoPayments.Subscriptions = subscriptions_1.Subscriptions;
|
|
142
|
-
DodoPayments.
|
|
144
|
+
DodoPayments.SubscriptionListResponsesDefaultPageNumberPagination =
|
|
145
|
+
subscriptions_1.SubscriptionListResponsesDefaultPageNumberPagination;
|
|
143
146
|
DodoPayments.Invoices = invoices_1.Invoices;
|
|
144
147
|
DodoPayments.Licenses = licenses_1.Licenses;
|
|
145
148
|
DodoPayments.LicenseKeys = license_keys_1.LicenseKeys;
|
|
@@ -162,6 +165,8 @@ DodoPayments.ProductListResponsesDefaultPageNumberPagination =
|
|
|
162
165
|
DodoPayments.Misc = misc_1.Misc;
|
|
163
166
|
DodoPayments.Discounts = discounts_1.Discounts;
|
|
164
167
|
DodoPayments.DiscountsDefaultPageNumberPagination = discounts_1.DiscountsDefaultPageNumberPagination;
|
|
168
|
+
DodoPayments.Addons = addons_1.Addons;
|
|
169
|
+
DodoPayments.AddonResponsesDefaultPageNumberPagination = addons_1.AddonResponsesDefaultPageNumberPagination;
|
|
165
170
|
var uploads_1 = require("./uploads.js");
|
|
166
171
|
Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return uploads_1.toFile; } });
|
|
167
172
|
Object.defineProperty(exports, "fileFromPath", { enumerable: true, get: function () { return uploads_1.fileFromPath; } });
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/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,WAAI,CAAC;AACzB,YAAY,CAAC,SAAS,GAAG,qBAAS,CAAC;AACnC,YAAY,CAAC,oCAAoC,GAAG,gDAAoC,CAAC;AACzF,YAAY,CAAC,MAAM,GAAG,eAAM,CAAC;AAC7B,YAAY,CAAC,yCAAyC,GAAG,kDAAyC,CAAC;AA0JnG,wCAAiD;AAAxC,iGAAA,MAAM,OAAA;AAAE,uGAAA,YAAY,OAAA;AAC7B,oCAciB;AAbf,0GAAA,iBAAiB,OAAA;AACjB,iGAAA,QAAQ,OAAA;AACR,2GAAA,kBAAkB,OAAA;AAClB,kHAAA,yBAAyB,OAAA;AACzB,0GAAA,iBAAiB,OAAA;AACjB,sGAAA,aAAa,OAAA;AACb,sGAAA,aAAa,OAAA;AACb,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,8GAAA,qBAAqB,OAAA;AACrB,iHAAA,wBAAwB,OAAA;AAG1B,kBAAe,YAAY,CAAC"}
|
package/index.mjs
CHANGED
|
@@ -5,16 +5,17 @@ import * as Errors from "./error.mjs";
|
|
|
5
5
|
import * as Pagination from "./pagination.mjs";
|
|
6
6
|
import * as Uploads from "./uploads.mjs";
|
|
7
7
|
import * as API from "./resources/index.mjs";
|
|
8
|
+
import { AddonResponsesDefaultPageNumberPagination, Addons, } from "./resources/addons.mjs";
|
|
8
9
|
import { Discounts, DiscountsDefaultPageNumberPagination, } from "./resources/discounts.mjs";
|
|
9
10
|
import { Disputes, DisputesDefaultPageNumberPagination, } from "./resources/disputes.mjs";
|
|
10
11
|
import { LicenseKeyInstances, LicenseKeyInstancesDefaultPageNumberPagination, } from "./resources/license-key-instances.mjs";
|
|
11
12
|
import { LicenseKeys, LicenseKeysDefaultPageNumberPagination, } from "./resources/license-keys.mjs";
|
|
12
13
|
import { Licenses, } from "./resources/licenses.mjs";
|
|
13
|
-
import { Misc } from "./resources/misc.mjs";
|
|
14
|
+
import { Misc, } from "./resources/misc.mjs";
|
|
14
15
|
import { PaymentListResponsesDefaultPageNumberPagination, Payments, } from "./resources/payments.mjs";
|
|
15
16
|
import { PayoutListResponsesDefaultPageNumberPagination, Payouts, } from "./resources/payouts.mjs";
|
|
16
17
|
import { Refunds, RefundsDefaultPageNumberPagination, } from "./resources/refunds.mjs";
|
|
17
|
-
import {
|
|
18
|
+
import { SubscriptionListResponsesDefaultPageNumberPagination, Subscriptions, } from "./resources/subscriptions.mjs";
|
|
18
19
|
import { WebhookEvents, WebhookEventsDefaultPageNumberPagination, } from "./resources/webhook-events.mjs";
|
|
19
20
|
import { Customers, CustomersDefaultPageNumberPagination, } from "./resources/customers/customers.mjs";
|
|
20
21
|
import { Invoices } from "./resources/invoices/invoices.mjs";
|
|
@@ -30,7 +31,7 @@ export class DodoPayments extends Core.APIClient {
|
|
|
30
31
|
/**
|
|
31
32
|
* API Client for interfacing with the Dodo Payments API.
|
|
32
33
|
*
|
|
33
|
-
* @param {string | undefined} [opts.
|
|
34
|
+
* @param {string | undefined} [opts.apiKey=process.env['DODO_PAYMENTS_API_KEY'] ?? undefined]
|
|
34
35
|
* @param {Environment} [opts.environment=live_mode] - Specifies the environment URL to use for the API.
|
|
35
36
|
* @param {string} [opts.baseURL=process.env['DODO_PAYMENTS_BASE_URL'] ?? https://live.dodopayments.com] - Override the default base URL for the API.
|
|
36
37
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
@@ -40,12 +41,12 @@ export class DodoPayments extends Core.APIClient {
|
|
|
40
41
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
41
42
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
42
43
|
*/
|
|
43
|
-
constructor({ baseURL = Core.readEnv('DODO_PAYMENTS_BASE_URL'),
|
|
44
|
-
if (
|
|
45
|
-
throw new Errors.DodoPaymentsError("The DODO_PAYMENTS_API_KEY environment variable is missing or empty; either provide it, or instantiate the DodoPayments client with an
|
|
44
|
+
constructor({ baseURL = Core.readEnv('DODO_PAYMENTS_BASE_URL'), apiKey = Core.readEnv('DODO_PAYMENTS_API_KEY'), ...opts } = {}) {
|
|
45
|
+
if (apiKey === undefined) {
|
|
46
|
+
throw new Errors.DodoPaymentsError("The DODO_PAYMENTS_API_KEY environment variable is missing or empty; either provide it, or instantiate the DodoPayments client with an apiKey option, like new DodoPayments({ apiKey: 'My API Key' }).");
|
|
46
47
|
}
|
|
47
48
|
const options = {
|
|
48
|
-
|
|
49
|
+
apiKey,
|
|
49
50
|
...opts,
|
|
50
51
|
baseURL,
|
|
51
52
|
environment: opts.environment ?? 'live_mode',
|
|
@@ -74,8 +75,9 @@ export class DodoPayments extends Core.APIClient {
|
|
|
74
75
|
this.products = new API.Products(this);
|
|
75
76
|
this.misc = new API.Misc(this);
|
|
76
77
|
this.discounts = new API.Discounts(this);
|
|
78
|
+
this.addons = new API.Addons(this);
|
|
77
79
|
this._options = options;
|
|
78
|
-
this.
|
|
80
|
+
this.apiKey = apiKey;
|
|
79
81
|
}
|
|
80
82
|
defaultQuery() {
|
|
81
83
|
return this._options.defaultQuery;
|
|
@@ -87,7 +89,7 @@ export class DodoPayments extends Core.APIClient {
|
|
|
87
89
|
};
|
|
88
90
|
}
|
|
89
91
|
authHeaders(opts) {
|
|
90
|
-
return { Authorization: `Bearer ${this.
|
|
92
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
_a = DodoPayments;
|
|
@@ -112,7 +114,8 @@ DodoPayments.Payments = Payments;
|
|
|
112
114
|
DodoPayments.PaymentListResponsesDefaultPageNumberPagination =
|
|
113
115
|
PaymentListResponsesDefaultPageNumberPagination;
|
|
114
116
|
DodoPayments.Subscriptions = Subscriptions;
|
|
115
|
-
DodoPayments.
|
|
117
|
+
DodoPayments.SubscriptionListResponsesDefaultPageNumberPagination =
|
|
118
|
+
SubscriptionListResponsesDefaultPageNumberPagination;
|
|
116
119
|
DodoPayments.Invoices = Invoices;
|
|
117
120
|
DodoPayments.Licenses = Licenses;
|
|
118
121
|
DodoPayments.LicenseKeys = LicenseKeys;
|
|
@@ -135,6 +138,8 @@ DodoPayments.ProductListResponsesDefaultPageNumberPagination =
|
|
|
135
138
|
DodoPayments.Misc = Misc;
|
|
136
139
|
DodoPayments.Discounts = Discounts;
|
|
137
140
|
DodoPayments.DiscountsDefaultPageNumberPagination = DiscountsDefaultPageNumberPagination;
|
|
141
|
+
DodoPayments.Addons = Addons;
|
|
142
|
+
DodoPayments.AddonResponsesDefaultPageNumberPagination = AddonResponsesDefaultPageNumberPagination;
|
|
138
143
|
export { toFile, fileFromPath } from "./uploads.mjs";
|
|
139
144
|
export { DodoPaymentsError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.mjs";
|
|
140
145
|
export default DodoPayments;
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,KAAK,IAAI;OACT,KAAK,MAAM;OACX,KAAK,UAAU;OAEf,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAML,SAAS,EACT,oCAAoC,GACrC;OACM,EAKL,QAAQ,EACR,mCAAmC,GACpC;OACM,EAIL,mBAAmB,EACnB,8CAA8C,GAC/C;OACM,EAKL,WAAW,EACX,sCAAsC,GACvC;OACM,EAKL,QAAQ,GACT;OACM,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,KAAK,IAAI;OACT,KAAK,MAAM;OACX,KAAK,UAAU;OAEf,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAIL,yCAAyC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GAAG,yCAAyC,CAAC;OA0J5F,EAAE,MAAM,EAAE,YAAY,EAAE;OACxB,EACL,iBAAiB,EACjB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB;AAED,eAAe,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { APIResource } from "../resource.js";
|
|
2
|
+
import * as Core from "../core.js";
|
|
3
|
+
import * as MiscAPI from "./misc.js";
|
|
4
|
+
import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams } from "../pagination.js";
|
|
5
|
+
export declare class Addons extends APIResource {
|
|
6
|
+
create(body: AddonCreateParams, options?: Core.RequestOptions): Core.APIPromise<AddonResponse>;
|
|
7
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<AddonResponse>;
|
|
8
|
+
update(id: string, body: AddonUpdateParams, options?: Core.RequestOptions): Core.APIPromise<AddonResponse>;
|
|
9
|
+
list(query?: AddonListParams, options?: Core.RequestOptions): Core.PagePromise<AddonResponsesDefaultPageNumberPagination, AddonResponse>;
|
|
10
|
+
list(options?: Core.RequestOptions): Core.PagePromise<AddonResponsesDefaultPageNumberPagination, AddonResponse>;
|
|
11
|
+
updateImages(id: string, options?: Core.RequestOptions): Core.APIPromise<AddonUpdateImagesResponse>;
|
|
12
|
+
}
|
|
13
|
+
export declare class AddonResponsesDefaultPageNumberPagination extends DefaultPageNumberPagination<AddonResponse> {
|
|
14
|
+
}
|
|
15
|
+
export interface AddonResponse {
|
|
16
|
+
/**
|
|
17
|
+
* id of the Addon
|
|
18
|
+
*/
|
|
19
|
+
id: string;
|
|
20
|
+
/**
|
|
21
|
+
* Unique identifier for the business to which the addon belongs.
|
|
22
|
+
*/
|
|
23
|
+
business_id: string;
|
|
24
|
+
/**
|
|
25
|
+
* Created time
|
|
26
|
+
*/
|
|
27
|
+
created_at: string;
|
|
28
|
+
currency: MiscAPI.Currency;
|
|
29
|
+
/**
|
|
30
|
+
* Name of the Addon
|
|
31
|
+
*/
|
|
32
|
+
name: string;
|
|
33
|
+
/**
|
|
34
|
+
* Amount of the addon
|
|
35
|
+
*/
|
|
36
|
+
price: number;
|
|
37
|
+
/**
|
|
38
|
+
* Represents the different categories of taxation applicable to various products
|
|
39
|
+
* and services.
|
|
40
|
+
*/
|
|
41
|
+
tax_category: MiscAPI.TaxCategory;
|
|
42
|
+
/**
|
|
43
|
+
* Updated time
|
|
44
|
+
*/
|
|
45
|
+
updated_at: string;
|
|
46
|
+
/**
|
|
47
|
+
* Optional description of the Addon
|
|
48
|
+
*/
|
|
49
|
+
description?: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Image of the Addon
|
|
52
|
+
*/
|
|
53
|
+
image?: string | null;
|
|
54
|
+
}
|
|
55
|
+
export interface AddonUpdateImagesResponse {
|
|
56
|
+
image_id: string;
|
|
57
|
+
url: string;
|
|
58
|
+
}
|
|
59
|
+
export interface AddonCreateParams {
|
|
60
|
+
currency: MiscAPI.Currency;
|
|
61
|
+
/**
|
|
62
|
+
* Name of the Addon
|
|
63
|
+
*/
|
|
64
|
+
name: string;
|
|
65
|
+
/**
|
|
66
|
+
* Amount of the addon
|
|
67
|
+
*/
|
|
68
|
+
price: number;
|
|
69
|
+
/**
|
|
70
|
+
* Represents the different categories of taxation applicable to various products
|
|
71
|
+
* and services.
|
|
72
|
+
*/
|
|
73
|
+
tax_category: MiscAPI.TaxCategory;
|
|
74
|
+
/**
|
|
75
|
+
* Optional description of the Addon
|
|
76
|
+
*/
|
|
77
|
+
description?: string | null;
|
|
78
|
+
}
|
|
79
|
+
export interface AddonUpdateParams {
|
|
80
|
+
currency?: MiscAPI.Currency | null;
|
|
81
|
+
/**
|
|
82
|
+
* Description of the Addon, optional and must be at most 1000 characters.
|
|
83
|
+
*/
|
|
84
|
+
description?: string | null;
|
|
85
|
+
/**
|
|
86
|
+
* Addon image id after its uploaded to S3
|
|
87
|
+
*/
|
|
88
|
+
image_id?: string | null;
|
|
89
|
+
/**
|
|
90
|
+
* Name of the Addon, optional and must be at most 100 characters.
|
|
91
|
+
*/
|
|
92
|
+
name?: string | null;
|
|
93
|
+
/**
|
|
94
|
+
* Amount of the addon
|
|
95
|
+
*/
|
|
96
|
+
price?: number | null;
|
|
97
|
+
/**
|
|
98
|
+
* Represents the different categories of taxation applicable to various products
|
|
99
|
+
* and services.
|
|
100
|
+
*/
|
|
101
|
+
tax_category?: MiscAPI.TaxCategory | null;
|
|
102
|
+
}
|
|
103
|
+
export interface AddonListParams extends DefaultPageNumberPaginationParams {
|
|
104
|
+
}
|
|
105
|
+
export declare namespace Addons {
|
|
106
|
+
export { type AddonResponse as AddonResponse, type AddonUpdateImagesResponse as AddonUpdateImagesResponse, AddonResponsesDefaultPageNumberPagination as AddonResponsesDefaultPageNumberPagination, type AddonCreateParams as AddonCreateParams, type AddonUpdateParams as AddonUpdateParams, type AddonListParams as AddonListParams, };
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=addons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addons.d.ts","sourceRoot":"","sources":["../src/resources/addons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,OAAO,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,2BAA2B,EAAE,KAAK,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAEpG,qBAAa,MAAO,SAAQ,WAAW;IACrC,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;IAI9F,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,C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