@commercelayer/sdk 5.0.0-beta.9 → 5.1.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/LICENSE +2 -2
- package/README.md +18 -0
- package/lib/cjs/api.d.ts +23 -12
- package/lib/cjs/api.js +20 -2
- package/lib/cjs/client.d.ts +3 -5
- package/lib/cjs/commercelayer.d.ts +10 -4
- package/lib/cjs/commercelayer.js +9 -3
- package/lib/cjs/common.d.ts +1 -0
- package/lib/cjs/common.js +11 -0
- package/lib/cjs/index.d.ts +1 -2
- package/lib/cjs/index.js +0 -16
- package/lib/cjs/interceptor.d.ts +1 -1
- package/lib/cjs/model.d.ts +7 -1
- package/lib/cjs/query.d.ts +5 -13
- package/lib/cjs/resource.d.ts +8 -10
- package/lib/cjs/resources/addresses.d.ts +63 -51
- package/lib/cjs/resources/addresses.js +8 -0
- package/lib/cjs/resources/adjustments.d.ts +5 -4
- package/lib/cjs/resources/adyen_gateways.d.ts +21 -20
- package/lib/cjs/resources/adyen_payments.d.ts +16 -15
- package/lib/cjs/resources/application.d.ts +7 -6
- package/lib/cjs/resources/attachments.d.ts +11 -10
- package/lib/cjs/resources/authorizations.d.ts +28 -27
- package/lib/cjs/resources/avalara_accounts.d.ts +17 -16
- package/lib/cjs/resources/axerve_gateways.d.ts +9 -8
- package/lib/cjs/resources/axerve_payments.d.ts +12 -11
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +5 -4
- package/lib/cjs/resources/bing_geocoders.d.ts +6 -5
- package/lib/cjs/resources/braintree_gateways.d.ts +21 -20
- package/lib/cjs/resources/braintree_payments.d.ts +17 -16
- package/lib/cjs/resources/bundles.d.ts +38 -26
- package/lib/cjs/resources/bundles.js +8 -0
- package/lib/cjs/resources/captures.d.ts +19 -18
- package/lib/cjs/resources/carrier_accounts.d.ts +7 -6
- package/lib/cjs/resources/checkout_com_gateways.d.ts +12 -11
- package/lib/cjs/resources/checkout_com_payments.d.ts +25 -24
- package/lib/cjs/resources/cleanups.d.ts +13 -12
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +7 -6
- package/lib/cjs/resources/coupon_recipients.d.ts +13 -12
- package/lib/cjs/resources/coupons.d.ts +27 -15
- package/lib/cjs/resources/coupons.js +8 -0
- package/lib/cjs/resources/customer_addresses.d.ts +8 -7
- package/lib/cjs/resources/customer_groups.d.ts +6 -5
- package/lib/cjs/resources/customer_password_resets.d.ts +8 -7
- package/lib/cjs/resources/customer_payment_sources.d.ts +9 -8
- package/lib/cjs/resources/customer_subscriptions.d.ts +4 -3
- package/lib/cjs/resources/customers.d.ts +27 -18
- package/lib/cjs/resources/customers.js +4 -0
- package/lib/cjs/resources/delivery_lead_times.d.ts +11 -10
- package/lib/cjs/resources/event_callbacks.d.ts +6 -5
- package/lib/cjs/resources/events.d.ts +4 -3
- package/lib/cjs/resources/exports.d.ts +17 -16
- package/lib/cjs/resources/external_gateways.d.ts +20 -19
- package/lib/cjs/resources/external_payments.d.ts +10 -9
- package/lib/cjs/resources/external_promotions.d.ts +37 -28
- package/lib/cjs/resources/external_promotions.js +4 -0
- package/lib/cjs/resources/external_tax_calculators.d.ts +6 -5
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +39 -30
- package/lib/cjs/resources/fixed_amount_promotions.js +4 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +44 -35
- package/lib/cjs/resources/fixed_price_promotions.js +8 -4
- package/lib/cjs/resources/free_gift_promotions.d.ts +44 -35
- package/lib/cjs/resources/free_gift_promotions.js +8 -4
- package/lib/cjs/resources/free_shipping_promotions.d.ts +38 -26
- package/lib/cjs/resources/free_shipping_promotions.js +8 -0
- package/lib/cjs/resources/geocoders.d.ts +4 -3
- package/lib/cjs/resources/gift_card_recipients.d.ts +13 -12
- package/lib/cjs/resources/gift_cards.d.ts +50 -41
- package/lib/cjs/resources/gift_cards.js +4 -0
- package/lib/cjs/resources/google_geocoders.d.ts +6 -5
- package/lib/cjs/resources/imports.d.ts +22 -21
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +20 -19
- package/lib/cjs/resources/inventory_models.d.ts +12 -11
- package/lib/cjs/resources/inventory_return_locations.d.ts +7 -6
- package/lib/cjs/resources/inventory_stock_locations.d.ts +10 -9
- package/lib/cjs/resources/klarna_gateways.d.ts +10 -9
- package/lib/cjs/resources/klarna_payments.d.ts +15 -14
- package/lib/cjs/resources/line_item_options.d.ts +32 -20
- package/lib/cjs/resources/line_item_options.js +8 -0
- package/lib/cjs/resources/line_items.d.ts +58 -43
- package/lib/cjs/resources/line_items.js +8 -0
- package/lib/cjs/resources/manual_gateways.d.ts +4 -3
- package/lib/cjs/resources/manual_tax_calculators.d.ts +8 -7
- package/lib/cjs/resources/markets.d.ts +41 -32
- package/lib/cjs/resources/markets.js +4 -0
- package/lib/cjs/resources/merchants.d.ts +6 -5
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +9 -8
- package/lib/cjs/resources/order_copies.d.ts +23 -20
- package/lib/cjs/resources/order_copies.js +7 -4
- package/lib/cjs/resources/order_factories.d.ts +34 -0
- package/lib/cjs/resources/order_factories.js +28 -0
- package/lib/cjs/resources/order_subscription_items.d.ts +61 -0
- package/lib/cjs/resources/order_subscription_items.js +29 -0
- package/lib/cjs/resources/order_subscriptions.d.ts +52 -29
- package/lib/cjs/resources/order_subscriptions.js +18 -2
- package/lib/cjs/resources/order_validation_rules.d.ts +4 -3
- package/lib/cjs/resources/orders.d.ts +200 -183
- package/lib/cjs/resources/orders.js +12 -0
- package/lib/cjs/resources/organization.d.ts +18 -17
- package/lib/cjs/resources/packages.d.ts +14 -13
- package/lib/cjs/resources/parcel_line_items.d.ts +7 -6
- package/lib/cjs/resources/parcels.d.ts +78 -74
- package/lib/cjs/resources/payment_gateways.d.ts +3 -2
- package/lib/cjs/resources/payment_methods.d.ts +33 -32
- package/lib/cjs/resources/paypal_gateways.d.ts +7 -6
- package/lib/cjs/resources/paypal_payments.d.ts +17 -16
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +43 -34
- package/lib/cjs/resources/percentage_discount_promotions.js +8 -4
- package/lib/cjs/resources/price_frequency_tiers.d.ts +50 -0
- package/lib/cjs/resources/price_frequency_tiers.js +37 -0
- package/lib/cjs/resources/price_lists.d.ts +9 -8
- package/lib/cjs/resources/price_tiers.d.ts +7 -6
- package/lib/cjs/resources/price_volume_tiers.d.ts +15 -11
- package/lib/cjs/resources/price_volume_tiers.js +4 -0
- package/lib/cjs/resources/prices.d.ts +20 -16
- package/lib/cjs/resources/prices.js +4 -0
- package/lib/cjs/resources/promotion_rules.d.ts +3 -2
- package/lib/cjs/resources/promotions.d.ts +17 -10
- package/lib/cjs/resources/promotions.js +8 -0
- package/lib/cjs/resources/recurring_order_copies.d.ts +53 -0
- package/lib/cjs/resources/recurring_order_copies.js +41 -0
- package/lib/cjs/resources/refunds.d.ts +10 -9
- package/lib/cjs/resources/return_line_items.d.ts +13 -12
- package/lib/cjs/resources/returns.d.ts +39 -30
- package/lib/cjs/resources/returns.js +4 -0
- package/lib/cjs/resources/satispay_gateways.d.ts +11 -7
- package/lib/cjs/resources/satispay_payments.d.ts +10 -12
- package/lib/cjs/resources/shipments.d.ts +42 -41
- package/lib/cjs/resources/shipping_categories.d.ts +5 -4
- package/lib/cjs/resources/shipping_method_tiers.d.ts +7 -6
- package/lib/cjs/resources/shipping_methods.d.ts +50 -49
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +12 -11
- package/lib/cjs/resources/shipping_zones.d.ts +22 -21
- package/lib/cjs/resources/sku_list_items.d.ts +13 -12
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +14 -13
- package/lib/cjs/resources/sku_lists.d.ts +22 -21
- package/lib/cjs/resources/sku_options.d.ts +36 -24
- package/lib/cjs/resources/sku_options.js +8 -0
- package/lib/cjs/resources/skus.d.ts +47 -35
- package/lib/cjs/resources/skus.js +8 -0
- package/lib/cjs/resources/stock_items.d.ts +12 -11
- package/lib/cjs/resources/stock_line_items.d.ts +7 -6
- package/lib/cjs/resources/stock_locations.d.ts +17 -16
- package/lib/cjs/resources/stock_transfers.d.ts +24 -23
- package/lib/cjs/resources/stripe_gateways.d.ts +12 -11
- package/lib/cjs/resources/stripe_payments.d.ts +15 -14
- package/lib/cjs/resources/subscription_models.d.ts +49 -0
- package/lib/cjs/resources/subscription_models.js +37 -0
- package/lib/cjs/resources/tags.d.ts +28 -0
- package/lib/cjs/resources/tags.js +25 -0
- package/lib/cjs/resources/tax_calculators.d.ts +4 -3
- package/lib/cjs/resources/tax_categories.d.ts +10 -9
- package/lib/cjs/resources/tax_rules.d.ts +39 -38
- package/lib/cjs/resources/taxjar_accounts.d.ts +9 -8
- package/lib/cjs/resources/transactions.d.ts +8 -7
- package/lib/cjs/resources/voids.d.ts +10 -9
- package/lib/cjs/resources/webhooks.d.ts +14 -13
- package/lib/cjs/resources/wire_transfers.d.ts +5 -4
- package/lib/cjs/util.d.ts +1 -3
- package/lib/esm/api.d.ts +23 -12
- package/lib/esm/api.js +12 -0
- package/lib/esm/client.d.ts +3 -5
- package/lib/esm/commercelayer.d.ts +10 -4
- package/lib/esm/commercelayer.js +9 -3
- package/lib/esm/common.d.ts +1 -0
- package/lib/esm/common.js +11 -0
- package/lib/esm/index.d.ts +1 -2
- package/lib/esm/index.js +0 -2
- package/lib/esm/interceptor.d.ts +1 -1
- package/lib/esm/model.d.ts +7 -1
- package/lib/esm/query.d.ts +5 -13
- package/lib/esm/resource.d.ts +8 -10
- package/lib/esm/resources/addresses.d.ts +63 -51
- package/lib/esm/resources/addresses.js +8 -0
- package/lib/esm/resources/adjustments.d.ts +5 -4
- package/lib/esm/resources/adyen_gateways.d.ts +21 -20
- package/lib/esm/resources/adyen_payments.d.ts +16 -15
- package/lib/esm/resources/application.d.ts +7 -6
- package/lib/esm/resources/attachments.d.ts +11 -10
- package/lib/esm/resources/authorizations.d.ts +28 -27
- package/lib/esm/resources/avalara_accounts.d.ts +17 -16
- package/lib/esm/resources/axerve_gateways.d.ts +9 -8
- package/lib/esm/resources/axerve_payments.d.ts +12 -11
- package/lib/esm/resources/billing_info_validation_rules.d.ts +5 -4
- package/lib/esm/resources/bing_geocoders.d.ts +6 -5
- package/lib/esm/resources/braintree_gateways.d.ts +21 -20
- package/lib/esm/resources/braintree_payments.d.ts +17 -16
- package/lib/esm/resources/bundles.d.ts +38 -26
- package/lib/esm/resources/bundles.js +8 -0
- package/lib/esm/resources/captures.d.ts +19 -18
- package/lib/esm/resources/carrier_accounts.d.ts +7 -6
- package/lib/esm/resources/checkout_com_gateways.d.ts +12 -11
- package/lib/esm/resources/checkout_com_payments.d.ts +25 -24
- package/lib/esm/resources/cleanups.d.ts +13 -12
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +7 -6
- package/lib/esm/resources/coupon_recipients.d.ts +13 -12
- package/lib/esm/resources/coupons.d.ts +27 -15
- package/lib/esm/resources/coupons.js +8 -0
- package/lib/esm/resources/customer_addresses.d.ts +8 -7
- package/lib/esm/resources/customer_groups.d.ts +6 -5
- package/lib/esm/resources/customer_password_resets.d.ts +8 -7
- package/lib/esm/resources/customer_payment_sources.d.ts +9 -8
- package/lib/esm/resources/customer_subscriptions.d.ts +4 -3
- package/lib/esm/resources/customers.d.ts +27 -18
- package/lib/esm/resources/customers.js +4 -0
- package/lib/esm/resources/delivery_lead_times.d.ts +11 -10
- package/lib/esm/resources/event_callbacks.d.ts +6 -5
- package/lib/esm/resources/events.d.ts +4 -3
- package/lib/esm/resources/exports.d.ts +17 -16
- package/lib/esm/resources/external_gateways.d.ts +20 -19
- package/lib/esm/resources/external_payments.d.ts +10 -9
- package/lib/esm/resources/external_promotions.d.ts +37 -28
- package/lib/esm/resources/external_promotions.js +4 -0
- package/lib/esm/resources/external_tax_calculators.d.ts +6 -5
- package/lib/esm/resources/fixed_amount_promotions.d.ts +39 -30
- package/lib/esm/resources/fixed_amount_promotions.js +4 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +44 -35
- package/lib/esm/resources/fixed_price_promotions.js +8 -4
- package/lib/esm/resources/free_gift_promotions.d.ts +44 -35
- package/lib/esm/resources/free_gift_promotions.js +8 -4
- package/lib/esm/resources/free_shipping_promotions.d.ts +38 -26
- package/lib/esm/resources/free_shipping_promotions.js +8 -0
- package/lib/esm/resources/geocoders.d.ts +4 -3
- package/lib/esm/resources/gift_card_recipients.d.ts +13 -12
- package/lib/esm/resources/gift_cards.d.ts +50 -41
- package/lib/esm/resources/gift_cards.js +4 -0
- package/lib/esm/resources/google_geocoders.d.ts +6 -5
- package/lib/esm/resources/imports.d.ts +22 -21
- package/lib/esm/resources/in_stock_subscriptions.d.ts +20 -19
- package/lib/esm/resources/inventory_models.d.ts +12 -11
- package/lib/esm/resources/inventory_return_locations.d.ts +7 -6
- package/lib/esm/resources/inventory_stock_locations.d.ts +10 -9
- package/lib/esm/resources/klarna_gateways.d.ts +10 -9
- package/lib/esm/resources/klarna_payments.d.ts +15 -14
- package/lib/esm/resources/line_item_options.d.ts +32 -20
- package/lib/esm/resources/line_item_options.js +8 -0
- package/lib/esm/resources/line_items.d.ts +58 -43
- package/lib/esm/resources/line_items.js +8 -0
- package/lib/esm/resources/manual_gateways.d.ts +4 -3
- package/lib/esm/resources/manual_tax_calculators.d.ts +8 -7
- package/lib/esm/resources/markets.d.ts +41 -32
- package/lib/esm/resources/markets.js +4 -0
- package/lib/esm/resources/merchants.d.ts +6 -5
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +9 -8
- package/lib/esm/resources/order_copies.d.ts +23 -20
- package/lib/esm/resources/order_copies.js +7 -4
- package/lib/esm/resources/order_factories.d.ts +34 -0
- package/lib/esm/resources/order_factories.js +26 -0
- package/lib/esm/resources/order_subscription_items.d.ts +61 -0
- package/lib/esm/resources/order_subscription_items.js +27 -0
- package/lib/esm/resources/order_subscriptions.d.ts +52 -29
- package/lib/esm/resources/order_subscriptions.js +18 -2
- package/lib/esm/resources/order_validation_rules.d.ts +4 -3
- package/lib/esm/resources/orders.d.ts +200 -183
- package/lib/esm/resources/orders.js +12 -0
- package/lib/esm/resources/organization.d.ts +18 -17
- package/lib/esm/resources/packages.d.ts +14 -13
- package/lib/esm/resources/parcel_line_items.d.ts +7 -6
- package/lib/esm/resources/parcels.d.ts +78 -74
- package/lib/esm/resources/payment_gateways.d.ts +3 -2
- package/lib/esm/resources/payment_methods.d.ts +33 -32
- package/lib/esm/resources/paypal_gateways.d.ts +7 -6
- package/lib/esm/resources/paypal_payments.d.ts +17 -16
- package/lib/esm/resources/percentage_discount_promotions.d.ts +43 -34
- package/lib/esm/resources/percentage_discount_promotions.js +8 -4
- package/lib/esm/resources/price_frequency_tiers.d.ts +50 -0
- package/lib/esm/resources/price_frequency_tiers.js +35 -0
- package/lib/esm/resources/price_lists.d.ts +9 -8
- package/lib/esm/resources/price_tiers.d.ts +7 -6
- package/lib/esm/resources/price_volume_tiers.d.ts +15 -11
- package/lib/esm/resources/price_volume_tiers.js +4 -0
- package/lib/esm/resources/prices.d.ts +20 -16
- package/lib/esm/resources/prices.js +4 -0
- package/lib/esm/resources/promotion_rules.d.ts +3 -2
- package/lib/esm/resources/promotions.d.ts +17 -10
- package/lib/esm/resources/promotions.js +8 -0
- package/lib/esm/resources/recurring_order_copies.d.ts +53 -0
- package/lib/esm/resources/recurring_order_copies.js +39 -0
- package/lib/esm/resources/refunds.d.ts +10 -9
- package/lib/esm/resources/return_line_items.d.ts +13 -12
- package/lib/esm/resources/returns.d.ts +39 -30
- package/lib/esm/resources/returns.js +4 -0
- package/lib/esm/resources/satispay_gateways.d.ts +11 -7
- package/lib/esm/resources/satispay_payments.d.ts +10 -12
- package/lib/esm/resources/shipments.d.ts +42 -41
- package/lib/esm/resources/shipping_categories.d.ts +5 -4
- package/lib/esm/resources/shipping_method_tiers.d.ts +7 -6
- package/lib/esm/resources/shipping_methods.d.ts +50 -49
- package/lib/esm/resources/shipping_weight_tiers.d.ts +12 -11
- package/lib/esm/resources/shipping_zones.d.ts +22 -21
- package/lib/esm/resources/sku_list_items.d.ts +13 -12
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +14 -13
- package/lib/esm/resources/sku_lists.d.ts +22 -21
- package/lib/esm/resources/sku_options.d.ts +36 -24
- package/lib/esm/resources/sku_options.js +8 -0
- package/lib/esm/resources/skus.d.ts +47 -35
- package/lib/esm/resources/skus.js +8 -0
- package/lib/esm/resources/stock_items.d.ts +12 -11
- package/lib/esm/resources/stock_line_items.d.ts +7 -6
- package/lib/esm/resources/stock_locations.d.ts +17 -16
- package/lib/esm/resources/stock_transfers.d.ts +24 -23
- package/lib/esm/resources/stripe_gateways.d.ts +12 -11
- package/lib/esm/resources/stripe_payments.d.ts +15 -14
- package/lib/esm/resources/subscription_models.d.ts +49 -0
- package/lib/esm/resources/subscription_models.js +35 -0
- package/lib/esm/resources/tags.d.ts +28 -0
- package/lib/esm/resources/tags.js +23 -0
- package/lib/esm/resources/tax_calculators.d.ts +4 -3
- package/lib/esm/resources/tax_categories.d.ts +10 -9
- package/lib/esm/resources/tax_rules.d.ts +39 -38
- package/lib/esm/resources/taxjar_accounts.d.ts +9 -8
- package/lib/esm/resources/transactions.d.ts +8 -7
- package/lib/esm/resources/voids.d.ts +10 -9
- package/lib/esm/resources/webhooks.d.ts +14 -13
- package/lib/esm/resources/wire_transfers.d.ts +5 -4
- package/lib/esm/util.d.ts +1 -3
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { Customer } from './customers';
|
4
5
|
import type { Market } from './markets';
|
@@ -10,15 +11,15 @@ type CustomerGroupRel = ResourceRel & {
|
|
10
11
|
interface CustomerGroup extends Resource {
|
11
12
|
readonly type: CustomerGroupType;
|
12
13
|
name: string;
|
13
|
-
customers?: Customer[];
|
14
|
-
markets?: Market[];
|
15
|
-
attachments?: Attachment[];
|
14
|
+
customers?: Customer[] | null;
|
15
|
+
markets?: Market[] | null;
|
16
|
+
attachments?: Attachment[] | null;
|
16
17
|
}
|
17
18
|
interface CustomerGroupCreate extends ResourceCreate {
|
18
19
|
name: string;
|
19
20
|
}
|
20
21
|
interface CustomerGroupUpdate extends ResourceUpdate {
|
21
|
-
name
|
22
|
+
name?: string | null;
|
22
23
|
}
|
23
24
|
declare class CustomerGroups extends ApiResource<CustomerGroup> {
|
24
25
|
static readonly TYPE: CustomerGroupType;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { Customer } from './customers';
|
4
5
|
import type { Event } from './events';
|
@@ -9,17 +10,17 @@ type CustomerPasswordResetRel = ResourceRel & {
|
|
9
10
|
interface CustomerPasswordReset extends Resource {
|
10
11
|
readonly type: CustomerPasswordResetType;
|
11
12
|
customer_email: string;
|
12
|
-
reset_password_token?: string;
|
13
|
-
reset_password_at?: string;
|
14
|
-
customer?: Customer;
|
15
|
-
events?: Event[];
|
13
|
+
reset_password_token?: string | null;
|
14
|
+
reset_password_at?: string | null;
|
15
|
+
customer?: Customer | null;
|
16
|
+
events?: Event[] | null;
|
16
17
|
}
|
17
18
|
interface CustomerPasswordResetCreate extends ResourceCreate {
|
18
19
|
customer_email: string;
|
19
20
|
}
|
20
21
|
interface CustomerPasswordResetUpdate extends ResourceUpdate {
|
21
|
-
customer_password?: string;
|
22
|
-
_reset_password_token?: string;
|
22
|
+
customer_password?: string | null;
|
23
|
+
_reset_password_token?: string | null;
|
23
24
|
}
|
24
25
|
declare class CustomerPasswordResets extends ApiResource<CustomerPasswordReset> {
|
25
26
|
static readonly TYPE: CustomerPasswordResetType;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve } from '../query';
|
3
4
|
import type { Customer, CustomerType } from './customers';
|
4
5
|
import type { AdyenPayment, AdyenPaymentType } from './adyen_payments';
|
@@ -50,19 +51,19 @@ type WireTransferRel = ResourceRel & {
|
|
50
51
|
};
|
51
52
|
interface CustomerPaymentSource extends Resource {
|
52
53
|
readonly type: CustomerPaymentSourceType;
|
53
|
-
name?: string;
|
54
|
-
customer_token?: string;
|
55
|
-
payment_source_token?: string;
|
56
|
-
customer?: Customer;
|
57
|
-
payment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | SatispayPayment | StripePayment | WireTransfer;
|
54
|
+
name?: string | null;
|
55
|
+
customer_token?: string | null;
|
56
|
+
payment_source_token?: string | null;
|
57
|
+
customer?: Customer | null;
|
58
|
+
payment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | SatispayPayment | StripePayment | WireTransfer | null;
|
58
59
|
}
|
59
60
|
interface CustomerPaymentSourceCreate extends ResourceCreate {
|
60
61
|
customer: CustomerRel;
|
61
62
|
payment_source: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | SatispayPaymentRel | StripePaymentRel | WireTransferRel;
|
62
63
|
}
|
63
64
|
interface CustomerPaymentSourceUpdate extends ResourceUpdate {
|
64
|
-
customer?: CustomerRel;
|
65
|
-
payment_source?: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | SatispayPaymentRel | StripePaymentRel | WireTransferRel;
|
65
|
+
customer?: CustomerRel | null;
|
66
|
+
payment_source?: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | SatispayPaymentRel | StripePaymentRel | WireTransferRel | null;
|
66
67
|
}
|
67
68
|
declare class CustomerPaymentSources extends ApiResource<CustomerPaymentSource> {
|
68
69
|
static readonly TYPE: CustomerPaymentSourceType;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { Customer } from './customers';
|
4
5
|
import type { Event } from './events';
|
@@ -9,8 +10,8 @@ type CustomerSubscriptionRel = ResourceRel & {
|
|
9
10
|
interface CustomerSubscription extends Resource {
|
10
11
|
readonly type: CustomerSubscriptionType;
|
11
12
|
customer_email: string;
|
12
|
-
customer?: Customer;
|
13
|
-
events?: Event[];
|
13
|
+
customer?: Customer | null;
|
14
|
+
events?: Event[] | null;
|
14
15
|
}
|
15
16
|
interface CustomerSubscriptionCreate extends ResourceCreate {
|
16
17
|
customer_email: string;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { CustomerGroup, CustomerGroupType } from './customer_groups';
|
4
5
|
import type { CustomerAddress } from './customer_addresses';
|
@@ -10,6 +11,7 @@ import type { Return } from './returns';
|
|
10
11
|
import type { SkuList } from './sku_lists';
|
11
12
|
import type { Attachment } from './attachments';
|
12
13
|
import type { Event } from './events';
|
14
|
+
import type { Tag, TagType } from './tags';
|
13
15
|
type CustomerType = 'customers';
|
14
16
|
type CustomerRel = ResourceRel & {
|
15
17
|
type: CustomerType;
|
@@ -17,31 +19,37 @@ type CustomerRel = ResourceRel & {
|
|
17
19
|
type CustomerGroupRel = ResourceRel & {
|
18
20
|
type: CustomerGroupType;
|
19
21
|
};
|
22
|
+
type TagRel = ResourceRel & {
|
23
|
+
type: TagType;
|
24
|
+
};
|
20
25
|
interface Customer extends Resource {
|
21
26
|
readonly type: CustomerType;
|
22
27
|
email: string;
|
23
|
-
status
|
24
|
-
has_password?: boolean;
|
25
|
-
customer_group?: CustomerGroup;
|
26
|
-
customer_addresses?: CustomerAddress[];
|
27
|
-
customer_payment_sources?: CustomerPaymentSource[];
|
28
|
-
customer_subscriptions?: CustomerSubscription[];
|
29
|
-
orders?: Order[];
|
30
|
-
order_subscriptions?: OrderSubscription[];
|
31
|
-
returns?: Return[];
|
32
|
-
sku_lists?: SkuList[];
|
33
|
-
attachments?: Attachment[];
|
34
|
-
events?: Event[];
|
28
|
+
status: 'prospect' | 'acquired' | 'repeat';
|
29
|
+
has_password?: boolean | null;
|
30
|
+
customer_group?: CustomerGroup | null;
|
31
|
+
customer_addresses?: CustomerAddress[] | null;
|
32
|
+
customer_payment_sources?: CustomerPaymentSource[] | null;
|
33
|
+
customer_subscriptions?: CustomerSubscription[] | null;
|
34
|
+
orders?: Order[] | null;
|
35
|
+
order_subscriptions?: OrderSubscription[] | null;
|
36
|
+
returns?: Return[] | null;
|
37
|
+
sku_lists?: SkuList[] | null;
|
38
|
+
attachments?: Attachment[] | null;
|
39
|
+
events?: Event[] | null;
|
40
|
+
tags?: Tag[] | null;
|
35
41
|
}
|
36
42
|
interface CustomerCreate extends ResourceCreate {
|
37
43
|
email: string;
|
38
|
-
password?: string;
|
39
|
-
customer_group?: CustomerGroupRel;
|
44
|
+
password?: string | null;
|
45
|
+
customer_group?: CustomerGroupRel | null;
|
46
|
+
tags?: TagRel[] | null;
|
40
47
|
}
|
41
48
|
interface CustomerUpdate extends ResourceUpdate {
|
42
|
-
email
|
43
|
-
password?: string;
|
44
|
-
customer_group?: CustomerGroupRel;
|
49
|
+
email?: string | null;
|
50
|
+
password?: string | null;
|
51
|
+
customer_group?: CustomerGroupRel | null;
|
52
|
+
tags?: TagRel[] | null;
|
45
53
|
}
|
46
54
|
declare class Customers extends ApiResource<Customer> {
|
47
55
|
static readonly TYPE: CustomerType;
|
@@ -58,6 +66,7 @@ declare class Customers extends ApiResource<Customer> {
|
|
58
66
|
sku_lists(customerId: string | Customer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuList>>;
|
59
67
|
attachments(customerId: string | Customer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
60
68
|
events(customerId: string | Customer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
69
|
+
tags(customerId: string | Customer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
61
70
|
isCustomer(resource: any): resource is Customer;
|
62
71
|
relationship(id: string | ResourceId | null): CustomerRel;
|
63
72
|
type(): CustomerType;
|
@@ -51,6 +51,10 @@ class Customers extends resource_1.ApiResource {
|
|
51
51
|
const _customerId = customerId.id || customerId;
|
52
52
|
return this.resources.fetch({ type: 'events' }, `customers/${_customerId}/events`, params, options);
|
53
53
|
}
|
54
|
+
async tags(customerId, params, options) {
|
55
|
+
const _customerId = customerId.id || customerId;
|
56
|
+
return this.resources.fetch({ type: 'tags' }, `customers/${_customerId}/tags`, params, options);
|
57
|
+
}
|
54
58
|
isCustomer(resource) {
|
55
59
|
return resource.type && (resource.type === Customers.TYPE);
|
56
60
|
}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { StockLocation, StockLocationType } from './stock_locations';
|
4
5
|
import type { ShippingMethod, ShippingMethodType } from './shipping_methods';
|
@@ -17,11 +18,11 @@ interface DeliveryLeadTime extends Resource {
|
|
17
18
|
readonly type: DeliveryLeadTimeType;
|
18
19
|
min_hours: number;
|
19
20
|
max_hours: number;
|
20
|
-
min_days?: number;
|
21
|
-
max_days?: number;
|
22
|
-
stock_location?: StockLocation;
|
23
|
-
shipping_method?: ShippingMethod;
|
24
|
-
attachments?: Attachment[];
|
21
|
+
min_days?: number | null;
|
22
|
+
max_days?: number | null;
|
23
|
+
stock_location?: StockLocation | null;
|
24
|
+
shipping_method?: ShippingMethod | null;
|
25
|
+
attachments?: Attachment[] | null;
|
25
26
|
}
|
26
27
|
interface DeliveryLeadTimeCreate extends ResourceCreate {
|
27
28
|
min_hours: number;
|
@@ -30,10 +31,10 @@ interface DeliveryLeadTimeCreate extends ResourceCreate {
|
|
30
31
|
shipping_method: ShippingMethodRel;
|
31
32
|
}
|
32
33
|
interface DeliveryLeadTimeUpdate extends ResourceUpdate {
|
33
|
-
min_hours
|
34
|
-
max_hours
|
35
|
-
stock_location?: StockLocationRel;
|
36
|
-
shipping_method?: ShippingMethodRel;
|
34
|
+
min_hours?: number | null;
|
35
|
+
max_hours?: number | null;
|
36
|
+
stock_location?: StockLocationRel | null;
|
37
|
+
shipping_method?: ShippingMethodRel | null;
|
37
38
|
}
|
38
39
|
declare class DeliveryLeadTimes extends ApiResource<DeliveryLeadTime> {
|
39
40
|
static readonly TYPE: DeliveryLeadTimeType;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve } from '../query';
|
3
4
|
import type { Webhook } from './webhooks';
|
4
5
|
type EventCallbackType = 'event_callbacks';
|
@@ -8,10 +9,10 @@ type EventCallbackRel = ResourceRel & {
|
|
8
9
|
interface EventCallback extends Resource {
|
9
10
|
readonly type: EventCallbackType;
|
10
11
|
callback_url: string;
|
11
|
-
payload?:
|
12
|
-
response_code?: string;
|
13
|
-
response_message?: string;
|
14
|
-
webhook?: Webhook;
|
12
|
+
payload?: Record<string, any> | null;
|
13
|
+
response_code?: string | null;
|
14
|
+
response_message?: string | null;
|
15
|
+
webhook?: Webhook | null;
|
15
16
|
}
|
16
17
|
declare class EventCallbacks extends ApiResource<EventCallback> {
|
17
18
|
static readonly TYPE: EventCallbackType;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
3
|
import type { QueryParamsList } from '../query';
|
3
4
|
import type { EventCallback } from './event_callbacks';
|
4
5
|
import type { Webhook } from './webhooks';
|
@@ -9,8 +10,8 @@ type EventRel = ResourceRel & {
|
|
9
10
|
interface Event extends Resource {
|
10
11
|
readonly type: EventType;
|
11
12
|
name: string;
|
12
|
-
last_event_callbacks?: EventCallback[];
|
13
|
-
webhooks?: Webhook[];
|
13
|
+
last_event_callbacks?: EventCallback[] | null;
|
14
|
+
webhooks?: Webhook[] | null;
|
14
15
|
}
|
15
16
|
declare class Events extends ApiResource<Event> {
|
16
17
|
static readonly TYPE: EventType;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { Event } from './events';
|
4
5
|
type ExportType = 'exports';
|
@@ -8,24 +9,24 @@ type ExportRel = ResourceRel & {
|
|
8
9
|
interface Export extends Resource {
|
9
10
|
readonly type: ExportType;
|
10
11
|
resource_type: string;
|
11
|
-
format?: string;
|
12
|
-
status
|
13
|
-
includes?: string[];
|
14
|
-
filters?:
|
15
|
-
dry_data?: boolean;
|
16
|
-
started_at?: string;
|
17
|
-
completed_at?: string;
|
18
|
-
interrupted_at?: string;
|
19
|
-
records_count?: number;
|
20
|
-
attachment_url?: string;
|
21
|
-
events?: Event[];
|
12
|
+
format?: string | null;
|
13
|
+
status: 'pending' | 'in_progress' | 'completed';
|
14
|
+
includes?: string[] | null;
|
15
|
+
filters?: Record<string, any> | null;
|
16
|
+
dry_data?: boolean | null;
|
17
|
+
started_at?: string | null;
|
18
|
+
completed_at?: string | null;
|
19
|
+
interrupted_at?: string | null;
|
20
|
+
records_count?: number | null;
|
21
|
+
attachment_url?: string | null;
|
22
|
+
events?: Event[] | null;
|
22
23
|
}
|
23
24
|
interface ExportCreate extends ResourceCreate {
|
24
25
|
resource_type: string;
|
25
|
-
format?: string;
|
26
|
-
includes?: string[];
|
27
|
-
filters?:
|
28
|
-
dry_data?: boolean;
|
26
|
+
format?: string | null;
|
27
|
+
includes?: string[] | null;
|
28
|
+
filters?: Record<string, any> | null;
|
29
|
+
dry_data?: boolean | null;
|
29
30
|
}
|
30
31
|
declare class Exports extends ApiResource<Export> {
|
31
32
|
static readonly TYPE: ExportType;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { PaymentMethod } from './payment_methods';
|
4
5
|
import type { ExternalPayment } from './external_payments';
|
@@ -10,29 +11,29 @@ interface ExternalGateway extends Resource {
|
|
10
11
|
readonly type: ExternalGatewayType;
|
11
12
|
name: string;
|
12
13
|
shared_secret: string;
|
13
|
-
authorize_url?: string;
|
14
|
-
capture_url?: string;
|
15
|
-
void_url?: string;
|
16
|
-
refund_url?: string;
|
17
|
-
token_url?: string;
|
18
|
-
payment_methods?: PaymentMethod[];
|
19
|
-
external_payments?: ExternalPayment[];
|
14
|
+
authorize_url?: string | null;
|
15
|
+
capture_url?: string | null;
|
16
|
+
void_url?: string | null;
|
17
|
+
refund_url?: string | null;
|
18
|
+
token_url?: string | null;
|
19
|
+
payment_methods?: PaymentMethod[] | null;
|
20
|
+
external_payments?: ExternalPayment[] | null;
|
20
21
|
}
|
21
22
|
interface ExternalGatewayCreate extends ResourceCreate {
|
22
23
|
name: string;
|
23
|
-
authorize_url?: string;
|
24
|
-
capture_url?: string;
|
25
|
-
void_url?: string;
|
26
|
-
refund_url?: string;
|
27
|
-
token_url?: string;
|
24
|
+
authorize_url?: string | null;
|
25
|
+
capture_url?: string | null;
|
26
|
+
void_url?: string | null;
|
27
|
+
refund_url?: string | null;
|
28
|
+
token_url?: string | null;
|
28
29
|
}
|
29
30
|
interface ExternalGatewayUpdate extends ResourceUpdate {
|
30
|
-
name
|
31
|
-
authorize_url?: string;
|
32
|
-
capture_url?: string;
|
33
|
-
void_url?: string;
|
34
|
-
refund_url?: string;
|
35
|
-
token_url?: string;
|
31
|
+
name?: string | null;
|
32
|
+
authorize_url?: string | null;
|
33
|
+
capture_url?: string | null;
|
34
|
+
void_url?: string | null;
|
35
|
+
refund_url?: string | null;
|
36
|
+
token_url?: string | null;
|
36
37
|
}
|
37
38
|
declare class ExternalGateways extends ApiResource<ExternalGateway> {
|
38
39
|
static readonly TYPE: ExternalGatewayType;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve } from '../query';
|
3
4
|
import type { Order, OrderType } from './orders';
|
4
5
|
import type { PaymentGateway } from './payment_gateways';
|
@@ -13,20 +14,20 @@ type OrderRel = ResourceRel & {
|
|
13
14
|
interface ExternalPayment extends Resource {
|
14
15
|
readonly type: ExternalPaymentType;
|
15
16
|
payment_source_token: string;
|
16
|
-
options?:
|
17
|
-
payment_instrument?:
|
18
|
-
order?: Order;
|
19
|
-
payment_gateway?: PaymentGateway;
|
20
|
-
wallet?: CustomerPaymentSource;
|
17
|
+
options?: Record<string, any> | null;
|
18
|
+
payment_instrument?: Record<string, any> | null;
|
19
|
+
order?: Order | null;
|
20
|
+
payment_gateway?: PaymentGateway | null;
|
21
|
+
wallet?: CustomerPaymentSource | null;
|
21
22
|
}
|
22
23
|
interface ExternalPaymentCreate extends ResourceCreate {
|
23
24
|
payment_source_token: string;
|
24
|
-
options?:
|
25
|
+
options?: Record<string, any> | null;
|
25
26
|
order: OrderRel;
|
26
27
|
}
|
27
28
|
interface ExternalPaymentUpdate extends ResourceUpdate {
|
28
|
-
options?:
|
29
|
-
order?: OrderRel;
|
29
|
+
options?: Record<string, any> | null;
|
30
|
+
order?: OrderRel | null;
|
30
31
|
}
|
31
32
|
declare class ExternalPayments extends ApiResource<ExternalPayment> {
|
32
33
|
static readonly TYPE: ExternalPaymentType;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { Market, MarketType } from './markets';
|
4
5
|
import type { PromotionRule, PromotionRuleType } from './promotion_rules';
|
@@ -7,6 +8,7 @@ import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_
|
|
7
8
|
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
8
9
|
import type { Attachment } from './attachments';
|
9
10
|
import type { Event } from './events';
|
11
|
+
import type { Tag, TagType } from './tags';
|
10
12
|
type ExternalPromotionType = 'external_promotions';
|
11
13
|
type ExternalPromotionRel = ResourceRel & {
|
12
14
|
type: ExternalPromotionType;
|
@@ -26,50 +28,56 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
26
28
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
27
29
|
type: CouponCodesPromotionRuleType;
|
28
30
|
};
|
31
|
+
type TagRel = ResourceRel & {
|
32
|
+
type: TagType;
|
33
|
+
};
|
29
34
|
interface ExternalPromotion extends Resource {
|
30
35
|
readonly type: ExternalPromotionType;
|
31
36
|
name: string;
|
32
|
-
currency_code?: string;
|
37
|
+
currency_code?: string | null;
|
33
38
|
starts_at: string;
|
34
39
|
expires_at: string;
|
35
40
|
total_usage_limit: number;
|
36
|
-
total_usage_count?: number;
|
37
|
-
active?: boolean;
|
41
|
+
total_usage_count?: number | null;
|
42
|
+
active?: boolean | null;
|
38
43
|
promotion_url: string;
|
39
44
|
shared_secret: string;
|
40
|
-
market?: Market;
|
41
|
-
promotion_rules?: PromotionRule[];
|
42
|
-
order_amount_promotion_rule?: OrderAmountPromotionRule;
|
43
|
-
sku_list_promotion_rule?: SkuListPromotionRule;
|
44
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRule;
|
45
|
-
attachments?: Attachment[];
|
46
|
-
events?: Event[];
|
45
|
+
market?: Market | null;
|
46
|
+
promotion_rules?: PromotionRule[] | null;
|
47
|
+
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
48
|
+
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
49
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
50
|
+
attachments?: Attachment[] | null;
|
51
|
+
events?: Event[] | null;
|
52
|
+
tags?: Tag[] | null;
|
47
53
|
}
|
48
54
|
interface ExternalPromotionCreate extends ResourceCreate {
|
49
55
|
name: string;
|
50
|
-
currency_code?: string;
|
56
|
+
currency_code?: string | null;
|
51
57
|
starts_at: string;
|
52
58
|
expires_at: string;
|
53
59
|
total_usage_limit: number;
|
54
60
|
promotion_url: string;
|
55
|
-
market?: MarketRel;
|
56
|
-
promotion_rules?: PromotionRuleRel[];
|
57
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
58
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
59
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
61
|
+
market?: MarketRel | null;
|
62
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
63
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
64
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
65
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
66
|
+
tags?: TagRel[] | null;
|
60
67
|
}
|
61
68
|
interface ExternalPromotionUpdate extends ResourceUpdate {
|
62
|
-
name
|
63
|
-
currency_code?: string;
|
64
|
-
starts_at
|
65
|
-
expires_at
|
66
|
-
total_usage_limit
|
67
|
-
promotion_url
|
68
|
-
market?: MarketRel;
|
69
|
-
promotion_rules?: PromotionRuleRel[];
|
70
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
71
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
72
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
69
|
+
name?: string | null;
|
70
|
+
currency_code?: string | null;
|
71
|
+
starts_at?: string | null;
|
72
|
+
expires_at?: string | null;
|
73
|
+
total_usage_limit?: number | null;
|
74
|
+
promotion_url?: string | null;
|
75
|
+
market?: MarketRel | null;
|
76
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
77
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
78
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
79
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
80
|
+
tags?: TagRel[] | null;
|
73
81
|
}
|
74
82
|
declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
|
75
83
|
static readonly TYPE: ExternalPromotionType;
|
@@ -82,6 +90,7 @@ declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
|
|
82
90
|
coupon_codes_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
83
91
|
attachments(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
84
92
|
events(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
93
|
+
tags(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
85
94
|
isExternalPromotion(resource: any): resource is ExternalPromotion;
|
86
95
|
relationship(id: string | ResourceId | null): ExternalPromotionRel;
|
87
96
|
type(): ExternalPromotionType;
|
@@ -35,6 +35,10 @@ class ExternalPromotions extends resource_1.ApiResource {
|
|
35
35
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
36
36
|
return this.resources.fetch({ type: 'events' }, `external_promotions/${_externalPromotionId}/events`, params, options);
|
37
37
|
}
|
38
|
+
async tags(externalPromotionId, params, options) {
|
39
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
40
|
+
return this.resources.fetch({ type: 'tags' }, `external_promotions/${_externalPromotionId}/tags`, params, options);
|
41
|
+
}
|
38
42
|
isExternalPromotion(resource) {
|
39
43
|
return resource.type && (resource.type === ExternalPromotions.TYPE);
|
40
44
|
}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { ApiResource
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
4
|
import type { Market } from './markets';
|
4
5
|
import type { Attachment } from './attachments';
|
@@ -11,16 +12,16 @@ interface ExternalTaxCalculator extends Resource {
|
|
11
12
|
name: string;
|
12
13
|
tax_calculator_url: string;
|
13
14
|
shared_secret: string;
|
14
|
-
markets?: Market[];
|
15
|
-
attachments?: Attachment[];
|
15
|
+
markets?: Market[] | null;
|
16
|
+
attachments?: Attachment[] | null;
|
16
17
|
}
|
17
18
|
interface ExternalTaxCalculatorCreate extends ResourceCreate {
|
18
19
|
name: string;
|
19
20
|
tax_calculator_url: string;
|
20
21
|
}
|
21
22
|
interface ExternalTaxCalculatorUpdate extends ResourceUpdate {
|
22
|
-
name
|
23
|
-
tax_calculator_url
|
23
|
+
name?: string | null;
|
24
|
+
tax_calculator_url?: string | null;
|
24
25
|
}
|
25
26
|
declare class ExternalTaxCalculators extends ApiResource<ExternalTaxCalculator> {
|
26
27
|
static readonly TYPE: ExternalTaxCalculatorType;
|