@commercelayer/sdk 5.27.3 → 5.29.0-alfa.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/api.d.ts +3 -2
- package/lib/cjs/api.js +5 -2
- package/lib/cjs/client.js +5 -5
- package/lib/cjs/commercelayer.d.ts +3 -2
- package/lib/cjs/commercelayer.js +5 -4
- package/lib/cjs/common.js +1 -1
- package/lib/cjs/error.js +1 -2
- package/lib/cjs/model.d.ts +1 -0
- package/lib/cjs/query.d.ts +1 -1
- package/lib/cjs/query.js +1 -1
- package/lib/cjs/resource.js +22 -25
- package/lib/cjs/resources/adjustments.d.ts +3 -0
- package/lib/cjs/resources/adyen_gateways.d.ts +2 -2
- package/lib/cjs/resources/avalara_accounts.d.ts +6 -6
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +11 -13
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +6 -2
- package/lib/cjs/resources/external_gateways.d.ts +5 -1
- package/lib/cjs/resources/external_gateways.js +3 -0
- package/lib/cjs/resources/external_promotions.d.ts +15 -13
- package/lib/cjs/resources/external_promotions.js +9 -2
- package/lib/cjs/resources/external_tax_calculators.d.ts +4 -0
- package/lib/cjs/resources/external_tax_calculators.js +3 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +11 -13
- package/lib/cjs/resources/fixed_amount_promotions.js +6 -2
- package/lib/cjs/resources/fixed_price_promotions.d.ts +11 -13
- package/lib/cjs/resources/fixed_price_promotions.js +6 -2
- package/lib/cjs/resources/free_gift_promotions.d.ts +11 -13
- package/lib/cjs/resources/free_gift_promotions.js +6 -2
- package/lib/cjs/resources/free_shipping_promotions.d.ts +17 -14
- package/lib/cjs/resources/free_shipping_promotions.js +6 -2
- package/lib/cjs/resources/gift_cards.d.ts +3 -0
- package/lib/cjs/resources/inventory_models.d.ts +3 -0
- package/lib/cjs/resources/line_items.d.ts +15 -4
- package/lib/cjs/resources/line_items.js +7 -0
- package/lib/cjs/resources/markets.d.ts +1 -1
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -4
- package/lib/cjs/resources/orders.d.ts +16 -1
- package/lib/cjs/resources/orders.js +14 -0
- package/lib/cjs/resources/parcel_line_items.d.ts +0 -8
- package/lib/cjs/resources/payment_methods.d.ts +8 -5
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +11 -13
- package/lib/cjs/resources/percentage_discount_promotions.js +6 -2
- package/lib/cjs/resources/promotions.d.ts +6 -3
- package/lib/cjs/resources/promotions.js +6 -2
- package/lib/cjs/resources/resource_errors.d.ts +22 -0
- package/lib/cjs/resources/resource_errors.js +16 -0
- package/lib/cjs/resources/shipments.d.ts +0 -4
- package/lib/cjs/resources/shipping_methods.d.ts +9 -5
- package/lib/cjs/resources/shipping_methods.js +3 -0
- package/lib/cjs/resources/stock_line_items.d.ts +6 -0
- package/lib/cjs/resources/stock_line_items.js +9 -0
- package/lib/cjs/resources/stock_reservations.d.ts +0 -1
- package/lib/cjs/resources/stock_transfers.d.ts +1 -1
- package/lib/cjs/resources/stripe_payments.d.ts +4 -1
- package/lib/cjs/resources/webhooks.d.ts +3 -3
- package/lib/cjs/resources/webhooks.js +3 -3
- package/lib/esm/api.d.ts +3 -2
- package/lib/esm/api.js +2 -0
- package/lib/esm/client.js +19 -30
- package/lib/esm/commercelayer.d.ts +3 -2
- package/lib/esm/commercelayer.js +261 -149
- package/lib/esm/common.js +1 -1
- package/lib/esm/error.js +10 -5
- package/lib/esm/model.d.ts +1 -0
- package/lib/esm/query.d.ts +1 -1
- package/lib/esm/query.js +1 -1
- package/lib/esm/resource.js +37 -50
- package/lib/esm/resources/addresses.js +1 -1
- package/lib/esm/resources/adjustments.d.ts +3 -0
- package/lib/esm/resources/adjustments.js +1 -1
- package/lib/esm/resources/adyen_gateways.d.ts +2 -2
- package/lib/esm/resources/adyen_gateways.js +1 -1
- package/lib/esm/resources/adyen_payments.js +1 -1
- package/lib/esm/resources/application.js +1 -1
- package/lib/esm/resources/attachments.js +1 -1
- package/lib/esm/resources/authorizations.js +1 -1
- package/lib/esm/resources/avalara_accounts.d.ts +6 -6
- package/lib/esm/resources/avalara_accounts.js +1 -1
- package/lib/esm/resources/axerve_gateways.js +1 -1
- package/lib/esm/resources/axerve_payments.js +1 -1
- package/lib/esm/resources/billing_info_validation_rules.js +1 -1
- package/lib/esm/resources/bing_geocoders.js +1 -1
- package/lib/esm/resources/braintree_gateways.js +1 -1
- package/lib/esm/resources/braintree_payments.js +1 -1
- package/lib/esm/resources/bundles.js +1 -1
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +11 -13
- package/lib/esm/resources/buy_x_pay_y_promotions.js +7 -3
- package/lib/esm/resources/captures.js +1 -1
- package/lib/esm/resources/carrier_accounts.js +1 -1
- package/lib/esm/resources/checkout_com_gateways.js +1 -1
- package/lib/esm/resources/checkout_com_payments.js +1 -1
- package/lib/esm/resources/cleanups.js +1 -1
- package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
- package/lib/esm/resources/coupon_recipients.js +1 -1
- package/lib/esm/resources/coupons.js +1 -1
- package/lib/esm/resources/custom_promotion_rules.js +1 -1
- package/lib/esm/resources/customer_addresses.js +1 -1
- package/lib/esm/resources/customer_groups.js +1 -1
- package/lib/esm/resources/customer_password_resets.js +1 -1
- package/lib/esm/resources/customer_payment_sources.js +1 -1
- package/lib/esm/resources/customer_subscriptions.js +1 -1
- package/lib/esm/resources/customers.js +1 -1
- package/lib/esm/resources/delivery_lead_times.js +1 -1
- package/lib/esm/resources/event_callbacks.js +1 -1
- package/lib/esm/resources/events.js +1 -1
- package/lib/esm/resources/exports.js +1 -1
- package/lib/esm/resources/external_gateways.d.ts +5 -1
- package/lib/esm/resources/external_gateways.js +4 -1
- package/lib/esm/resources/external_payments.js +1 -1
- package/lib/esm/resources/external_promotions.d.ts +15 -13
- package/lib/esm/resources/external_promotions.js +10 -3
- package/lib/esm/resources/external_tax_calculators.d.ts +4 -0
- package/lib/esm/resources/external_tax_calculators.js +4 -1
- package/lib/esm/resources/fixed_amount_promotions.d.ts +11 -13
- package/lib/esm/resources/fixed_amount_promotions.js +7 -3
- package/lib/esm/resources/fixed_price_promotions.d.ts +11 -13
- package/lib/esm/resources/fixed_price_promotions.js +7 -3
- package/lib/esm/resources/free_gift_promotions.d.ts +11 -13
- package/lib/esm/resources/free_gift_promotions.js +7 -3
- package/lib/esm/resources/free_shipping_promotions.d.ts +17 -14
- package/lib/esm/resources/free_shipping_promotions.js +7 -3
- package/lib/esm/resources/geocoders.js +1 -1
- package/lib/esm/resources/gift_card_recipients.js +1 -1
- package/lib/esm/resources/gift_cards.d.ts +3 -0
- package/lib/esm/resources/gift_cards.js +1 -1
- package/lib/esm/resources/google_geocoders.js +1 -1
- package/lib/esm/resources/imports.js +1 -1
- package/lib/esm/resources/in_stock_subscriptions.js +1 -1
- package/lib/esm/resources/inventory_models.d.ts +3 -0
- package/lib/esm/resources/inventory_models.js +1 -1
- package/lib/esm/resources/inventory_return_locations.js +1 -1
- package/lib/esm/resources/inventory_stock_locations.js +1 -1
- package/lib/esm/resources/klarna_gateways.js +1 -1
- package/lib/esm/resources/klarna_payments.js +1 -1
- package/lib/esm/resources/line_item_options.js +1 -1
- package/lib/esm/resources/line_items.d.ts +15 -4
- package/lib/esm/resources/line_items.js +8 -1
- package/lib/esm/resources/manual_gateways.js +1 -1
- package/lib/esm/resources/manual_tax_calculators.js +1 -1
- package/lib/esm/resources/markets.d.ts +1 -1
- package/lib/esm/resources/markets.js +1 -1
- package/lib/esm/resources/merchants.js +1 -1
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
- package/lib/esm/resources/order_copies.js +1 -1
- package/lib/esm/resources/order_factories.js +1 -1
- package/lib/esm/resources/order_subscription_items.js +1 -1
- package/lib/esm/resources/order_subscriptions.d.ts +1 -4
- package/lib/esm/resources/order_subscriptions.js +1 -1
- package/lib/esm/resources/order_validation_rules.js +1 -1
- package/lib/esm/resources/orders.d.ts +16 -1
- package/lib/esm/resources/orders.js +15 -1
- package/lib/esm/resources/organization.js +1 -1
- package/lib/esm/resources/packages.js +1 -1
- package/lib/esm/resources/parcel_line_items.d.ts +0 -8
- package/lib/esm/resources/parcel_line_items.js +1 -1
- package/lib/esm/resources/parcels.js +1 -1
- package/lib/esm/resources/payment_gateways.js +1 -1
- package/lib/esm/resources/payment_methods.d.ts +8 -5
- package/lib/esm/resources/payment_methods.js +1 -1
- package/lib/esm/resources/payment_options.js +1 -1
- package/lib/esm/resources/paypal_gateways.js +1 -1
- package/lib/esm/resources/paypal_payments.js +1 -1
- package/lib/esm/resources/percentage_discount_promotions.d.ts +11 -13
- package/lib/esm/resources/percentage_discount_promotions.js +7 -3
- package/lib/esm/resources/price_frequency_tiers.js +1 -1
- package/lib/esm/resources/price_lists.js +1 -1
- package/lib/esm/resources/price_tiers.js +1 -1
- package/lib/esm/resources/price_volume_tiers.js +1 -1
- package/lib/esm/resources/prices.js +1 -1
- package/lib/esm/resources/promotion_rules.js +1 -1
- package/lib/esm/resources/promotions.d.ts +6 -3
- package/lib/esm/resources/promotions.js +7 -3
- package/lib/esm/resources/recurring_order_copies.js +1 -1
- package/lib/esm/resources/refunds.js +1 -1
- package/lib/esm/resources/reserved_stocks.js +1 -1
- package/lib/esm/resources/resource_errors.d.ts +22 -0
- package/lib/esm/resources/resource_errors.js +14 -0
- package/lib/esm/resources/return_line_items.js +1 -1
- package/lib/esm/resources/returns.js +1 -1
- package/lib/esm/resources/satispay_gateways.js +1 -1
- package/lib/esm/resources/satispay_payments.js +1 -1
- package/lib/esm/resources/shipments.d.ts +0 -4
- package/lib/esm/resources/shipments.js +1 -1
- package/lib/esm/resources/shipping_categories.js +1 -1
- package/lib/esm/resources/shipping_method_tiers.js +1 -1
- package/lib/esm/resources/shipping_methods.d.ts +9 -5
- package/lib/esm/resources/shipping_methods.js +4 -1
- package/lib/esm/resources/shipping_weight_tiers.js +1 -1
- package/lib/esm/resources/shipping_zones.js +1 -1
- package/lib/esm/resources/sku_list_items.js +1 -1
- package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
- package/lib/esm/resources/sku_lists.js +1 -1
- package/lib/esm/resources/sku_options.js +1 -1
- package/lib/esm/resources/skus.js +1 -1
- package/lib/esm/resources/stock_items.js +1 -1
- package/lib/esm/resources/stock_line_items.d.ts +6 -0
- package/lib/esm/resources/stock_line_items.js +10 -1
- package/lib/esm/resources/stock_locations.js +1 -1
- package/lib/esm/resources/stock_reservations.d.ts +0 -1
- package/lib/esm/resources/stock_reservations.js +1 -1
- package/lib/esm/resources/stock_transfers.d.ts +1 -1
- package/lib/esm/resources/stock_transfers.js +1 -1
- package/lib/esm/resources/stripe_gateways.js +1 -1
- package/lib/esm/resources/stripe_payments.d.ts +4 -1
- package/lib/esm/resources/stripe_payments.js +1 -1
- package/lib/esm/resources/subscription_models.js +1 -1
- package/lib/esm/resources/tags.js +1 -1
- package/lib/esm/resources/tax_calculators.js +1 -1
- package/lib/esm/resources/tax_categories.js +1 -1
- package/lib/esm/resources/tax_rules.js +1 -1
- package/lib/esm/resources/taxjar_accounts.js +1 -1
- package/lib/esm/resources/transactions.js +1 -1
- package/lib/esm/resources/versions.js +1 -1
- package/lib/esm/resources/voids.js +1 -1
- package/lib/esm/resources/webhooks.d.ts +3 -3
- package/lib/esm/resources/webhooks.js +4 -4
- package/lib/esm/resources/wire_transfers.js +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -16
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class StockReservations extends ApiResource {
|
3
|
+
static TYPE = 'stock_reservations';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: StockReservations.TYPE }, params, options);
|
5
6
|
}
|
@@ -42,5 +43,4 @@ class StockReservations extends ApiResource {
|
|
42
43
|
return StockReservations.TYPE;
|
43
44
|
}
|
44
45
|
}
|
45
|
-
StockReservations.TYPE = 'stock_reservations';
|
46
46
|
export default StockReservations;
|
@@ -25,7 +25,7 @@ type LineItemRel = ResourceRel & {
|
|
25
25
|
};
|
26
26
|
interface StockTransfer extends Resource {
|
27
27
|
readonly type: StockTransferType;
|
28
|
-
number?:
|
28
|
+
number?: string | null;
|
29
29
|
sku_code?: string | null;
|
30
30
|
status: 'draft' | 'upcoming' | 'on_hold' | 'picking' | 'in_transit' | 'completed' | 'cancelled';
|
31
31
|
quantity: number;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class StockTransfers extends ApiResource {
|
3
|
+
static TYPE = 'stock_transfers';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: StockTransfers.TYPE }, params, options);
|
5
6
|
}
|
@@ -65,5 +66,4 @@ class StockTransfers extends ApiResource {
|
|
65
66
|
return StockTransfers.TYPE;
|
66
67
|
}
|
67
68
|
}
|
68
|
-
StockTransfers.TYPE = 'stock_transfers';
|
69
69
|
export default StockTransfers;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class StripeGateways extends ApiResource {
|
3
|
+
static TYPE = 'stripe_gateways';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: StripeGateways.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class StripeGateways extends ApiResource {
|
|
31
32
|
return StripeGateways.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
StripeGateways.TYPE = 'stripe_gateways';
|
35
35
|
export default StripeGateways;
|
@@ -13,7 +13,8 @@ type OrderRel = ResourceRel & {
|
|
13
13
|
};
|
14
14
|
interface StripePayment extends Resource {
|
15
15
|
readonly type: StripePaymentType;
|
16
|
-
|
16
|
+
stripe_id?: string | null;
|
17
|
+
client_secret?: string | null;
|
17
18
|
publishable_key?: string | null;
|
18
19
|
options?: Record<string, any> | null;
|
19
20
|
payment_method?: Record<string, any> | null;
|
@@ -29,6 +30,8 @@ interface StripePayment extends Resource {
|
|
29
30
|
versions?: Version[] | null;
|
30
31
|
}
|
31
32
|
interface StripePaymentCreate extends ResourceCreate {
|
33
|
+
stripe_id?: string | null;
|
34
|
+
client_secret?: string | null;
|
32
35
|
options?: Record<string, any> | null;
|
33
36
|
return_url?: string | null;
|
34
37
|
receipt_email?: string | null;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class StripePayments extends ApiResource {
|
3
|
+
static TYPE = 'stripe_payments';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: StripePayments.TYPE }, params, options);
|
5
6
|
}
|
@@ -37,5 +38,4 @@ class StripePayments extends ApiResource {
|
|
37
38
|
return StripePayments.TYPE;
|
38
39
|
}
|
39
40
|
}
|
40
|
-
StripePayments.TYPE = 'stripe_payments';
|
41
41
|
export default StripePayments;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class SubscriptionModels extends ApiResource {
|
3
|
+
static TYPE = 'subscription_models';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: SubscriptionModels.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class SubscriptionModels extends ApiResource {
|
|
31
32
|
return SubscriptionModels.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
SubscriptionModels.TYPE = 'subscription_models';
|
35
35
|
export default SubscriptionModels;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Tags extends ApiResource {
|
3
|
+
static TYPE = 'tags';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Tags.TYPE }, params, options);
|
5
6
|
}
|
@@ -19,5 +20,4 @@ class Tags extends ApiResource {
|
|
19
20
|
return Tags.TYPE;
|
20
21
|
}
|
21
22
|
}
|
22
|
-
Tags.TYPE = 'tags';
|
23
23
|
export default Tags;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class TaxCalculators extends ApiResource {
|
3
|
+
static TYPE = 'tax_calculators';
|
3
4
|
async markets(taxCalculatorId, params, options) {
|
4
5
|
const _taxCalculatorId = taxCalculatorId.id || taxCalculatorId;
|
5
6
|
return this.resources.fetch({ type: 'markets' }, `tax_calculators/${_taxCalculatorId}/markets`, params, options);
|
@@ -22,5 +23,4 @@ class TaxCalculators extends ApiResource {
|
|
22
23
|
return TaxCalculators.TYPE;
|
23
24
|
}
|
24
25
|
}
|
25
|
-
TaxCalculators.TYPE = 'tax_calculators';
|
26
26
|
export default TaxCalculators;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class TaxCategories extends ApiResource {
|
3
|
+
static TYPE = 'tax_categories';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: TaxCategories.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class TaxCategories extends ApiResource {
|
|
31
32
|
return TaxCategories.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
TaxCategories.TYPE = 'tax_categories';
|
35
35
|
export default TaxCategories;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class TaxRules extends ApiResource {
|
3
|
+
static TYPE = 'tax_rules';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: TaxRules.TYPE }, params, options);
|
5
6
|
}
|
@@ -27,5 +28,4 @@ class TaxRules extends ApiResource {
|
|
27
28
|
return TaxRules.TYPE;
|
28
29
|
}
|
29
30
|
}
|
30
|
-
TaxRules.TYPE = 'tax_rules';
|
31
31
|
export default TaxRules;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class TaxjarAccounts extends ApiResource {
|
3
|
+
static TYPE = 'taxjar_accounts';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: TaxjarAccounts.TYPE }, params, options);
|
5
6
|
}
|
@@ -35,5 +36,4 @@ class TaxjarAccounts extends ApiResource {
|
|
35
36
|
return TaxjarAccounts.TYPE;
|
36
37
|
}
|
37
38
|
}
|
38
|
-
TaxjarAccounts.TYPE = 'taxjar_accounts';
|
39
39
|
export default TaxjarAccounts;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Transactions extends ApiResource {
|
3
|
+
static TYPE = 'transactions';
|
3
4
|
async order(transactionId, params, options) {
|
4
5
|
const _transactionId = transactionId.id || transactionId;
|
5
6
|
return this.resources.fetch({ type: 'orders' }, `transactions/${_transactionId}/order`, params, options);
|
@@ -26,5 +27,4 @@ class Transactions extends ApiResource {
|
|
26
27
|
return Transactions.TYPE;
|
27
28
|
}
|
28
29
|
}
|
29
|
-
Transactions.TYPE = 'transactions';
|
30
30
|
export default Transactions;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Versions extends ApiResource {
|
3
|
+
static TYPE = 'versions';
|
3
4
|
isVersion(resource) {
|
4
5
|
return resource.type && (resource.type === Versions.TYPE);
|
5
6
|
}
|
@@ -10,5 +11,4 @@ class Versions extends ApiResource {
|
|
10
11
|
return Versions.TYPE;
|
11
12
|
}
|
12
13
|
}
|
13
|
-
Versions.TYPE = 'versions';
|
14
14
|
export default Versions;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Voids extends ApiResource {
|
3
|
+
static TYPE = 'voids';
|
3
4
|
async order(voidId, params, options) {
|
4
5
|
const _voidId = voidId.id || voidId;
|
5
6
|
return this.resources.fetch({ type: 'orders' }, `voids/${_voidId}/order`, params, options);
|
@@ -30,5 +31,4 @@ class Voids extends ApiResource {
|
|
30
31
|
return Voids.TYPE;
|
31
32
|
}
|
32
33
|
}
|
33
|
-
Voids.TYPE = 'voids';
|
34
34
|
export default Voids;
|
@@ -13,10 +13,10 @@ interface Webhook extends Resource {
|
|
13
13
|
topic: string;
|
14
14
|
callback_url: string;
|
15
15
|
include_resources?: string[] | null;
|
16
|
+
disabled_at?: string | null;
|
16
17
|
circuit_state?: string | null;
|
17
18
|
circuit_failure_count?: number | null;
|
18
19
|
shared_secret: string;
|
19
|
-
disabled_at?: string | null;
|
20
20
|
last_event_callbacks?: EventCallback[] | null;
|
21
21
|
versions?: Version[] | null;
|
22
22
|
}
|
@@ -33,9 +33,9 @@ interface WebhookUpdate extends ResourceUpdate {
|
|
33
33
|
topic?: string | null;
|
34
34
|
callback_url?: string | null;
|
35
35
|
include_resources?: string[] | null;
|
36
|
-
_reset_circuit?: boolean | null;
|
37
36
|
_disable?: boolean | null;
|
38
37
|
_enable?: boolean | null;
|
38
|
+
_reset_circuit?: boolean | null;
|
39
39
|
}
|
40
40
|
declare class Webhooks extends ApiResource<Webhook> {
|
41
41
|
static readonly TYPE: WebhookType;
|
@@ -44,9 +44,9 @@ declare class Webhooks extends ApiResource<Webhook> {
|
|
44
44
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
45
45
|
last_event_callbacks(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
|
46
46
|
versions(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
47
|
-
_reset_circuit(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
48
47
|
_disable(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
49
48
|
_enable(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
49
|
+
_reset_circuit(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
50
50
|
isWebhook(resource: any): resource is Webhook;
|
51
51
|
relationship(id: string | ResourceId | null): WebhookRel;
|
52
52
|
type(): WebhookType;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Webhooks extends ApiResource {
|
3
|
+
static TYPE = 'webhooks';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Webhooks.TYPE }, params, options);
|
5
6
|
}
|
@@ -17,15 +18,15 @@ class Webhooks extends ApiResource {
|
|
17
18
|
const _webhookId = webhookId.id || webhookId;
|
18
19
|
return this.resources.fetch({ type: 'versions' }, `webhooks/${_webhookId}/versions`, params, options);
|
19
20
|
}
|
20
|
-
async _reset_circuit(id, params, options) {
|
21
|
-
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _reset_circuit: true }, params, options);
|
22
|
-
}
|
23
21
|
async _disable(id, params, options) {
|
24
22
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _disable: true }, params, options);
|
25
23
|
}
|
26
24
|
async _enable(id, params, options) {
|
27
25
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _enable: true }, params, options);
|
28
26
|
}
|
27
|
+
async _reset_circuit(id, params, options) {
|
28
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _reset_circuit: true }, params, options);
|
29
|
+
}
|
29
30
|
isWebhook(resource) {
|
30
31
|
return resource.type && (resource.type === Webhooks.TYPE);
|
31
32
|
}
|
@@ -36,5 +37,4 @@ class Webhooks extends ApiResource {
|
|
36
37
|
return Webhooks.TYPE;
|
37
38
|
}
|
38
39
|
}
|
39
|
-
Webhooks.TYPE = 'webhooks';
|
40
40
|
export default Webhooks;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class WireTransfers extends ApiResource {
|
3
|
+
static TYPE = 'wire_transfers';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: WireTransfers.TYPE }, params, options);
|
5
6
|
}
|
@@ -27,5 +28,4 @@ class WireTransfers extends ApiResource {
|
|
27
28
|
return WireTransfers.TYPE;
|
28
29
|
}
|
29
30
|
}
|
30
|
-
WireTransfers.TYPE = 'wire_transfers';
|
31
31
|
export default WireTransfers;
|