@commercelayer/sdk 5.14.0 → 5.15.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/lib/cjs/api.d.ts +9 -7
- package/lib/cjs/api.js +9 -3
- package/lib/cjs/commercelayer.d.ts +4 -2
- package/lib/cjs/commercelayer.js +3 -1
- package/lib/cjs/model.d.ts +2 -0
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +137 -0
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +75 -0
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +7 -3
- package/lib/cjs/resources/coupons.d.ts +3 -0
- package/lib/cjs/resources/custom_promotion_rules.d.ts +62 -0
- package/lib/cjs/resources/custom_promotion_rules.js +29 -0
- package/lib/cjs/resources/external_promotions.d.ts +20 -1
- package/lib/cjs/resources/external_promotions.js +10 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +20 -1
- package/lib/cjs/resources/fixed_amount_promotions.js +10 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +11 -0
- package/lib/cjs/resources/fixed_price_promotions.js +6 -0
- package/lib/cjs/resources/free_gift_promotions.d.ts +11 -0
- package/lib/cjs/resources/free_gift_promotions.js +6 -0
- package/lib/cjs/resources/free_shipping_promotions.d.ts +11 -0
- package/lib/cjs/resources/free_shipping_promotions.js +6 -0
- package/lib/cjs/resources/line_items.d.ts +1 -0
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +7 -3
- package/lib/cjs/resources/orders.d.ts +21 -0
- package/lib/cjs/resources/orders.js +16 -0
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +11 -0
- package/lib/cjs/resources/percentage_discount_promotions.js +6 -0
- package/lib/cjs/resources/promotion_rules.d.ts +2 -1
- package/lib/cjs/resources/promotions.d.ts +3 -0
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +7 -3
- package/lib/esm/api.d.ts +9 -7
- package/lib/esm/api.js +4 -0
- package/lib/esm/commercelayer.d.ts +4 -2
- package/lib/esm/commercelayer.js +3 -1
- package/lib/esm/model.d.ts +2 -0
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +137 -0
- package/lib/esm/resources/buy_x_pay_y_promotions.js +73 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +7 -3
- package/lib/esm/resources/coupons.d.ts +3 -0
- package/lib/esm/resources/custom_promotion_rules.d.ts +62 -0
- package/lib/esm/resources/custom_promotion_rules.js +27 -0
- package/lib/esm/resources/external_promotions.d.ts +20 -1
- package/lib/esm/resources/external_promotions.js +10 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +20 -1
- package/lib/esm/resources/fixed_amount_promotions.js +10 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +11 -0
- package/lib/esm/resources/fixed_price_promotions.js +6 -0
- package/lib/esm/resources/free_gift_promotions.d.ts +11 -0
- package/lib/esm/resources/free_gift_promotions.js +6 -0
- package/lib/esm/resources/free_shipping_promotions.d.ts +11 -0
- package/lib/esm/resources/free_shipping_promotions.js +6 -0
- package/lib/esm/resources/line_items.d.ts +1 -0
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +7 -3
- package/lib/esm/resources/orders.d.ts +21 -0
- package/lib/esm/resources/orders.js +16 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +11 -0
- package/lib/esm/resources/percentage_discount_promotions.js +6 -0
- package/lib/esm/resources/promotion_rules.d.ts +2 -1
- package/lib/esm/resources/promotions.d.ts +3 -0
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +7 -3
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
package/lib/cjs/api.d.ts
CHANGED
@@ -19,6 +19,7 @@ export { default as BingGeocoders } from './resources/bing_geocoders';
|
|
19
19
|
export { default as BraintreeGateways } from './resources/braintree_gateways';
|
20
20
|
export { default as BraintreePayments } from './resources/braintree_payments';
|
21
21
|
export { default as Bundles } from './resources/bundles';
|
22
|
+
export { default as BuyXPayYPromotions } from './resources/buy_x_pay_y_promotions';
|
22
23
|
export { default as Captures } from './resources/captures';
|
23
24
|
export { default as CarrierAccounts } from './resources/carrier_accounts';
|
24
25
|
export { default as CheckoutComGateways } from './resources/checkout_com_gateways';
|
@@ -27,6 +28,7 @@ export { default as Cleanups } from './resources/cleanups';
|
|
27
28
|
export { default as CouponCodesPromotionRules } from './resources/coupon_codes_promotion_rules';
|
28
29
|
export { default as CouponRecipients } from './resources/coupon_recipients';
|
29
30
|
export { default as Coupons } from './resources/coupons';
|
31
|
+
export { default as CustomPromotionRules } from './resources/custom_promotion_rules';
|
30
32
|
export { default as CustomerAddresses } from './resources/customer_addresses';
|
31
33
|
export { default as CustomerGroups } from './resources/customer_groups';
|
32
34
|
export { default as CustomerPasswordResets } from './resources/customer_password_resets';
|
@@ -121,8 +123,8 @@ export { default as Versions } from './resources/versions';
|
|
121
123
|
export { default as Voids } from './resources/voids';
|
122
124
|
export { default as Webhooks } from './resources/webhooks';
|
123
125
|
export { default as WireTransfers } from './resources/wire_transfers';
|
124
|
-
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
|
125
|
-
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
|
126
|
+
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
|
127
|
+
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "buy_x_pay_y_promotions", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "custom_promotion_rules", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
|
126
128
|
export type RetrievableResourceType = ResourceTypeLock;
|
127
129
|
export type RetrievableResource = Resource & {
|
128
130
|
type: RetrievableResourceType;
|
@@ -131,26 +133,26 @@ export type ListableResourceType = Exclude<ResourceTypeLock, 'application' | 'or
|
|
131
133
|
export type ListableResource = Resource & {
|
132
134
|
type: ListableResourceType;
|
133
135
|
};
|
134
|
-
export type CreatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
136
|
+
export type CreatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
135
137
|
export type CreatableResource = Resource & {
|
136
138
|
type: CreatableResourceType;
|
137
139
|
};
|
138
|
-
export type UpdatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
140
|
+
export type UpdatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
139
141
|
export type UpdatableResource = Resource & {
|
140
142
|
type: UpdatableResourceType;
|
141
143
|
};
|
142
|
-
export type DeletableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
144
|
+
export type DeletableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
143
145
|
export type DeletableResource = Resource & {
|
144
146
|
type: DeletableResourceType;
|
145
147
|
};
|
146
|
-
export type TaggableResourceType = 'addresses' | 'bundles' | 'coupons' | 'customers' | 'external_promotions' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_cards' | 'line_item_options' | 'line_items' | 'orders' | 'percentage_discount_promotions' | 'promotions' | 'returns' | 'sku_options' | 'skus';
|
148
|
+
export type TaggableResourceType = 'addresses' | 'bundles' | 'buy_x_pay_y_promotions' | 'coupons' | 'customers' | 'external_promotions' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_cards' | 'line_item_options' | 'line_items' | 'orders' | 'percentage_discount_promotions' | 'promotions' | 'returns' | 'sku_options' | 'skus';
|
147
149
|
export type TaggableResource = Resource & {
|
148
150
|
type: TaggableResourceType;
|
149
151
|
tags?: Array<ResourceRel & {
|
150
152
|
type: TagType;
|
151
153
|
}> | null;
|
152
154
|
};
|
153
|
-
export type VersionableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_payment_sources' | 'customer_subscriptions' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
155
|
+
export type VersionableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_payment_sources' | 'customer_subscriptions' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
154
156
|
export type VersionableResource = Resource & {
|
155
157
|
type: VersionableResourceType;
|
156
158
|
versions?: Array<ResourceRel & {
|
package/lib/cjs/api.js
CHANGED
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.
|
7
|
-
exports.
|
8
|
-
exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Versions = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockReservations = exports.StockLocations = exports.StockLineItems = void 0;
|
6
|
+
exports.InventoryModels = exports.InStockSubscriptions = exports.Imports = exports.GoogleGeocoders = exports.GiftCards = exports.GiftCardRecipients = exports.Geocoders = exports.FreeShippingPromotions = exports.FreeGiftPromotions = exports.FixedPricePromotions = exports.FixedAmountPromotions = exports.ExternalTaxCalculators = exports.ExternalPromotions = exports.ExternalPayments = exports.ExternalGateways = exports.Exports = exports.Events = exports.EventCallbacks = exports.DeliveryLeadTimes = exports.Customers = exports.CustomerSubscriptions = exports.CustomerPaymentSources = exports.CustomerPasswordResets = exports.CustomerGroups = exports.CustomerAddresses = exports.CustomPromotionRules = exports.Coupons = exports.CouponRecipients = exports.CouponCodesPromotionRules = exports.Cleanups = exports.CheckoutComPayments = exports.CheckoutComGateways = exports.CarrierAccounts = exports.Captures = exports.BuyXPayYPromotions = exports.Bundles = exports.BraintreePayments = exports.BraintreeGateways = exports.BingGeocoders = exports.BillingInfoValidationRules = exports.AxervePayments = exports.AxerveGateways = exports.AvalaraAccounts = exports.Authorizations = exports.Attachments = exports.Applications = exports.AdyenPayments = exports.AdyenGateways = exports.Adjustments = exports.Addresses = void 0;
|
7
|
+
exports.SkuOptions = exports.SkuLists = exports.SkuListPromotionRules = exports.SkuListItems = exports.ShippingZones = exports.ShippingWeightTiers = exports.ShippingMethods = exports.ShippingMethodTiers = exports.ShippingCategories = exports.Shipments = exports.SatispayPayments = exports.SatispayGateways = exports.Returns = exports.ReturnLineItems = exports.ReservedStocks = exports.Refunds = exports.RecurringOrderCopies = exports.Promotions = exports.PromotionRules = exports.Prices = exports.PriceVolumeTiers = exports.PriceTiers = exports.PriceLists = exports.PriceFrequencyTiers = exports.PercentageDiscountPromotions = exports.PaypalPayments = exports.PaypalGateways = exports.PaymentMethods = exports.PaymentGateways = exports.Parcels = exports.ParcelLineItems = exports.Packages = exports.Organizations = exports.Orders = exports.OrderValidationRules = exports.OrderSubscriptions = exports.OrderSubscriptionItems = exports.OrderFactories = exports.OrderCopies = exports.OrderAmountPromotionRules = exports.Merchants = exports.Markets = exports.ManualTaxCalculators = exports.ManualGateways = exports.LineItems = exports.LineItemOptions = exports.KlarnaPayments = exports.KlarnaGateways = exports.InventoryStockLocations = exports.InventoryReturnLocations = void 0;
|
8
|
+
exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Versions = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockReservations = exports.StockLocations = exports.StockLineItems = exports.StockItems = exports.Skus = void 0;
|
9
9
|
// ##__API_RESOURCES_START__##
|
10
10
|
// ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
|
11
11
|
/**
|
@@ -41,6 +41,8 @@ var braintree_payments_1 = require("./resources/braintree_payments");
|
|
41
41
|
Object.defineProperty(exports, "BraintreePayments", { enumerable: true, get: function () { return __importDefault(braintree_payments_1).default; } });
|
42
42
|
var bundles_1 = require("./resources/bundles");
|
43
43
|
Object.defineProperty(exports, "Bundles", { enumerable: true, get: function () { return __importDefault(bundles_1).default; } });
|
44
|
+
var buy_x_pay_y_promotions_1 = require("./resources/buy_x_pay_y_promotions");
|
45
|
+
Object.defineProperty(exports, "BuyXPayYPromotions", { enumerable: true, get: function () { return __importDefault(buy_x_pay_y_promotions_1).default; } });
|
44
46
|
var captures_1 = require("./resources/captures");
|
45
47
|
Object.defineProperty(exports, "Captures", { enumerable: true, get: function () { return __importDefault(captures_1).default; } });
|
46
48
|
var carrier_accounts_1 = require("./resources/carrier_accounts");
|
@@ -57,6 +59,8 @@ var coupon_recipients_1 = require("./resources/coupon_recipients");
|
|
57
59
|
Object.defineProperty(exports, "CouponRecipients", { enumerable: true, get: function () { return __importDefault(coupon_recipients_1).default; } });
|
58
60
|
var coupons_1 = require("./resources/coupons");
|
59
61
|
Object.defineProperty(exports, "Coupons", { enumerable: true, get: function () { return __importDefault(coupons_1).default; } });
|
62
|
+
var custom_promotion_rules_1 = require("./resources/custom_promotion_rules");
|
63
|
+
Object.defineProperty(exports, "CustomPromotionRules", { enumerable: true, get: function () { return __importDefault(custom_promotion_rules_1).default; } });
|
60
64
|
var customer_addresses_1 = require("./resources/customer_addresses");
|
61
65
|
Object.defineProperty(exports, "CustomerAddresses", { enumerable: true, get: function () { return __importDefault(customer_addresses_1).default; } });
|
62
66
|
var customer_groups_1 = require("./resources/customer_groups");
|
@@ -263,6 +267,7 @@ exports.resourceList = [
|
|
263
267
|
'braintree_gateways',
|
264
268
|
'braintree_payments',
|
265
269
|
'bundles',
|
270
|
+
'buy_x_pay_y_promotions',
|
266
271
|
'captures',
|
267
272
|
'carrier_accounts',
|
268
273
|
'checkout_com_gateways',
|
@@ -271,6 +276,7 @@ exports.resourceList = [
|
|
271
276
|
'coupon_codes_promotion_rules',
|
272
277
|
'coupon_recipients',
|
273
278
|
'coupons',
|
279
|
+
'custom_promotion_rules',
|
274
280
|
'customer_addresses',
|
275
281
|
'customer_groups',
|
276
282
|
'customer_password_resets',
|
@@ -2,14 +2,14 @@ import * as api from './api';
|
|
2
2
|
import type { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
4
|
import { type ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "4.
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "4.13.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
9
9
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
|
-
readonly openApiSchemaVersion = "4.
|
12
|
+
readonly openApiSchemaVersion = "4.13.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
adyen_gateways: api.AdyenGateways;
|
@@ -25,6 +25,7 @@ declare class CommerceLayerClient {
|
|
25
25
|
braintree_gateways: api.BraintreeGateways;
|
26
26
|
braintree_payments: api.BraintreePayments;
|
27
27
|
bundles: api.Bundles;
|
28
|
+
buy_x_pay_y_promotions: api.BuyXPayYPromotions;
|
28
29
|
captures: api.Captures;
|
29
30
|
carrier_accounts: api.CarrierAccounts;
|
30
31
|
checkout_com_gateways: api.CheckoutComGateways;
|
@@ -33,6 +34,7 @@ declare class CommerceLayerClient {
|
|
33
34
|
coupon_codes_promotion_rules: api.CouponCodesPromotionRules;
|
34
35
|
coupon_recipients: api.CouponRecipients;
|
35
36
|
coupons: api.Coupons;
|
37
|
+
custom_promotion_rules: api.CustomPromotionRules;
|
36
38
|
customer_addresses: api.CustomerAddresses;
|
37
39
|
customer_groups: api.CustomerGroups;
|
38
40
|
customer_password_resets: api.CustomerPasswordResets;
|
package/lib/cjs/commercelayer.js
CHANGED
@@ -45,7 +45,7 @@ const resource_1 = __importDefault(require("./resource"));
|
|
45
45
|
const debug_1 = __importDefault(require("./debug"));
|
46
46
|
const debug = (0, debug_1.default)('commercelayer');
|
47
47
|
// Autogenerated schema version number, do not remove this line
|
48
|
-
const OPEN_API_SCHEMA_VERSION = '4.
|
48
|
+
const OPEN_API_SCHEMA_VERSION = '4.13.0';
|
49
49
|
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
50
|
class CommerceLayerClient {
|
51
51
|
// ##__CL_RESOURCES_DEF_STOP__##
|
@@ -75,6 +75,7 @@ class CommerceLayerClient {
|
|
75
75
|
this.braintree_gateways = new api.BraintreeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
76
76
|
this.braintree_payments = new api.BraintreePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
77
77
|
this.bundles = new api.Bundles(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
78
|
+
this.buy_x_pay_y_promotions = new api.BuyXPayYPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
78
79
|
this.captures = new api.Captures(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
79
80
|
this.carrier_accounts = new api.CarrierAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
80
81
|
this.checkout_com_gateways = new api.CheckoutComGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -83,6 +84,7 @@ class CommerceLayerClient {
|
|
83
84
|
this.coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
84
85
|
this.coupon_recipients = new api.CouponRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
85
86
|
this.coupons = new api.Coupons(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
87
|
+
this.custom_promotion_rules = new api.CustomPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
86
88
|
this.customer_addresses = new api.CustomerAddresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
87
89
|
this.customer_groups = new api.CustomerGroups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
88
90
|
this.customer_password_resets = new api.CustomerPasswordResets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
package/lib/cjs/model.d.ts
CHANGED
@@ -16,6 +16,7 @@ export type { BingGeocoder, BingGeocoderCreate, BingGeocoderUpdate } from './res
|
|
16
16
|
export type { BraintreeGateway, BraintreeGatewayCreate, BraintreeGatewayUpdate } from './resources/braintree_gateways';
|
17
17
|
export type { BraintreePayment, BraintreePaymentCreate, BraintreePaymentUpdate } from './resources/braintree_payments';
|
18
18
|
export type { Bundle, BundleCreate, BundleUpdate } from './resources/bundles';
|
19
|
+
export type { BuyXPayYPromotion, BuyXPayYPromotionCreate, BuyXPayYPromotionUpdate } from './resources/buy_x_pay_y_promotions';
|
19
20
|
export type { Capture, CaptureUpdate } from './resources/captures';
|
20
21
|
export type { CarrierAccount } from './resources/carrier_accounts';
|
21
22
|
export type { CheckoutComGateway, CheckoutComGatewayCreate, CheckoutComGatewayUpdate } from './resources/checkout_com_gateways';
|
@@ -24,6 +25,7 @@ export type { Cleanup, CleanupCreate } from './resources/cleanups';
|
|
24
25
|
export type { CouponCodesPromotionRule, CouponCodesPromotionRuleCreate, CouponCodesPromotionRuleUpdate } from './resources/coupon_codes_promotion_rules';
|
25
26
|
export type { CouponRecipient, CouponRecipientCreate, CouponRecipientUpdate } from './resources/coupon_recipients';
|
26
27
|
export type { Coupon, CouponCreate, CouponUpdate } from './resources/coupons';
|
28
|
+
export type { CustomPromotionRule, CustomPromotionRuleCreate, CustomPromotionRuleUpdate } from './resources/custom_promotion_rules';
|
27
29
|
export type { CustomerAddress, CustomerAddressCreate, CustomerAddressUpdate } from './resources/customer_addresses';
|
28
30
|
export type { CustomerGroup, CustomerGroupCreate, CustomerGroupUpdate } from './resources/customer_groups';
|
29
31
|
export type { CustomerPasswordReset, CustomerPasswordResetCreate, CustomerPasswordResetUpdate } from './resources/customer_password_resets';
|
@@ -0,0 +1,137 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
+
import type { Market, MarketType } from './markets';
|
5
|
+
import type { PromotionRule, PromotionRuleType } from './promotion_rules';
|
6
|
+
import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
|
7
|
+
import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
|
8
|
+
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
9
|
+
import type { Coupon, CouponType } from './coupons';
|
10
|
+
import type { SkuList, SkuListType } from './sku_lists';
|
11
|
+
import type { Attachment } from './attachments';
|
12
|
+
import type { Event } from './events';
|
13
|
+
import type { Tag, TagType } from './tags';
|
14
|
+
import type { Version } from './versions';
|
15
|
+
import type { Sku } from './skus';
|
16
|
+
type BuyXPayYPromotionType = 'buy_x_pay_y_promotions';
|
17
|
+
type BuyXPayYPromotionRel = ResourceRel & {
|
18
|
+
type: BuyXPayYPromotionType;
|
19
|
+
};
|
20
|
+
type MarketRel = ResourceRel & {
|
21
|
+
type: MarketType;
|
22
|
+
};
|
23
|
+
type PromotionRuleRel = ResourceRel & {
|
24
|
+
type: PromotionRuleType;
|
25
|
+
};
|
26
|
+
type OrderAmountPromotionRuleRel = ResourceRel & {
|
27
|
+
type: OrderAmountPromotionRuleType;
|
28
|
+
};
|
29
|
+
type SkuListPromotionRuleRel = ResourceRel & {
|
30
|
+
type: SkuListPromotionRuleType;
|
31
|
+
};
|
32
|
+
type CouponCodesPromotionRuleRel = ResourceRel & {
|
33
|
+
type: CouponCodesPromotionRuleType;
|
34
|
+
};
|
35
|
+
type CouponRel = ResourceRel & {
|
36
|
+
type: CouponType;
|
37
|
+
};
|
38
|
+
type SkuListRel = ResourceRel & {
|
39
|
+
type: SkuListType;
|
40
|
+
};
|
41
|
+
type TagRel = ResourceRel & {
|
42
|
+
type: TagType;
|
43
|
+
};
|
44
|
+
interface BuyXPayYPromotion extends Resource {
|
45
|
+
readonly type: BuyXPayYPromotionType;
|
46
|
+
name: string;
|
47
|
+
currency_code?: string | null;
|
48
|
+
exclusive?: boolean | null;
|
49
|
+
priority?: number | null;
|
50
|
+
starts_at: string;
|
51
|
+
expires_at: string;
|
52
|
+
total_usage_limit: number;
|
53
|
+
total_usage_count?: number | null;
|
54
|
+
active?: boolean | null;
|
55
|
+
disabled_at?: string | null;
|
56
|
+
x: number;
|
57
|
+
y: number;
|
58
|
+
cheapest_free?: boolean | null;
|
59
|
+
market?: Market | null;
|
60
|
+
promotion_rules?: PromotionRule[] | null;
|
61
|
+
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
62
|
+
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
63
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
64
|
+
coupons?: Coupon[] | null;
|
65
|
+
sku_list?: SkuList | null;
|
66
|
+
attachments?: Attachment[] | null;
|
67
|
+
events?: Event[] | null;
|
68
|
+
tags?: Tag[] | null;
|
69
|
+
versions?: Version[] | null;
|
70
|
+
skus?: Sku[] | null;
|
71
|
+
}
|
72
|
+
interface BuyXPayYPromotionCreate extends ResourceCreate {
|
73
|
+
name: string;
|
74
|
+
currency_code?: string | null;
|
75
|
+
exclusive?: boolean | null;
|
76
|
+
priority?: number | null;
|
77
|
+
starts_at: string;
|
78
|
+
expires_at: string;
|
79
|
+
total_usage_limit: number;
|
80
|
+
x: number;
|
81
|
+
y: number;
|
82
|
+
cheapest_free?: boolean | null;
|
83
|
+
market?: MarketRel | null;
|
84
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
85
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
86
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
87
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
88
|
+
coupons?: CouponRel[] | null;
|
89
|
+
sku_list: SkuListRel;
|
90
|
+
tags?: TagRel[] | null;
|
91
|
+
}
|
92
|
+
interface BuyXPayYPromotionUpdate extends ResourceUpdate {
|
93
|
+
name?: string | null;
|
94
|
+
currency_code?: string | null;
|
95
|
+
exclusive?: boolean | null;
|
96
|
+
priority?: number | null;
|
97
|
+
starts_at?: string | null;
|
98
|
+
expires_at?: string | null;
|
99
|
+
total_usage_limit?: number | null;
|
100
|
+
_disable?: boolean | null;
|
101
|
+
_enable?: boolean | null;
|
102
|
+
x?: number | null;
|
103
|
+
y?: number | null;
|
104
|
+
cheapest_free?: boolean | null;
|
105
|
+
market?: MarketRel | null;
|
106
|
+
promotion_rules?: PromotionRuleRel[] | null;
|
107
|
+
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
108
|
+
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
109
|
+
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
110
|
+
coupons?: CouponRel[] | null;
|
111
|
+
sku_list?: SkuListRel | null;
|
112
|
+
tags?: TagRel[] | null;
|
113
|
+
}
|
114
|
+
declare class BuyXPayYPromotions extends ApiResource<BuyXPayYPromotion> {
|
115
|
+
static readonly TYPE: BuyXPayYPromotionType;
|
116
|
+
create(resource: BuyXPayYPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BuyXPayYPromotion>;
|
117
|
+
update(resource: BuyXPayYPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BuyXPayYPromotion>;
|
118
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
119
|
+
market(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
120
|
+
order_amount_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
121
|
+
sku_list_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
122
|
+
coupon_codes_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
123
|
+
coupons(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
124
|
+
sku_list(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
125
|
+
attachments(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
126
|
+
events(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
127
|
+
tags(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
128
|
+
versions(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
129
|
+
skus(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
130
|
+
_disable(id: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BuyXPayYPromotion>;
|
131
|
+
_enable(id: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BuyXPayYPromotion>;
|
132
|
+
isBuyXPayYPromotion(resource: any): resource is BuyXPayYPromotion;
|
133
|
+
relationship(id: string | ResourceId | null): BuyXPayYPromotionRel;
|
134
|
+
type(): BuyXPayYPromotionType;
|
135
|
+
}
|
136
|
+
export default BuyXPayYPromotions;
|
137
|
+
export type { BuyXPayYPromotion, BuyXPayYPromotionCreate, BuyXPayYPromotionUpdate, BuyXPayYPromotionType };
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class BuyXPayYPromotions extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: BuyXPayYPromotions.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: BuyXPayYPromotions.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: BuyXPayYPromotions.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async market(buyXPayYPromotionId, params, options) {
|
15
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
16
|
+
return this.resources.fetch({ type: 'markets' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/market`, params, options);
|
17
|
+
}
|
18
|
+
async order_amount_promotion_rule(buyXPayYPromotionId, params, options) {
|
19
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
20
|
+
return this.resources.fetch({ type: 'order_amount_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/order_amount_promotion_rule`, params, options);
|
21
|
+
}
|
22
|
+
async sku_list_promotion_rule(buyXPayYPromotionId, params, options) {
|
23
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
24
|
+
return this.resources.fetch({ type: 'sku_list_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/sku_list_promotion_rule`, params, options);
|
25
|
+
}
|
26
|
+
async coupon_codes_promotion_rule(buyXPayYPromotionId, params, options) {
|
27
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
28
|
+
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
|
+
}
|
30
|
+
async coupons(buyXPayYPromotionId, params, options) {
|
31
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
32
|
+
return this.resources.fetch({ type: 'coupons' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupons`, params, options);
|
33
|
+
}
|
34
|
+
async sku_list(buyXPayYPromotionId, params, options) {
|
35
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
36
|
+
return this.resources.fetch({ type: 'sku_lists' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/sku_list`, params, options);
|
37
|
+
}
|
38
|
+
async attachments(buyXPayYPromotionId, params, options) {
|
39
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
40
|
+
return this.resources.fetch({ type: 'attachments' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/attachments`, params, options);
|
41
|
+
}
|
42
|
+
async events(buyXPayYPromotionId, params, options) {
|
43
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
44
|
+
return this.resources.fetch({ type: 'events' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/events`, params, options);
|
45
|
+
}
|
46
|
+
async tags(buyXPayYPromotionId, params, options) {
|
47
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
48
|
+
return this.resources.fetch({ type: 'tags' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/tags`, params, options);
|
49
|
+
}
|
50
|
+
async versions(buyXPayYPromotionId, params, options) {
|
51
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
52
|
+
return this.resources.fetch({ type: 'versions' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/versions`, params, options);
|
53
|
+
}
|
54
|
+
async skus(buyXPayYPromotionId, params, options) {
|
55
|
+
const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
|
56
|
+
return this.resources.fetch({ type: 'skus' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/skus`, params, options);
|
57
|
+
}
|
58
|
+
async _disable(id, params, options) {
|
59
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: BuyXPayYPromotions.TYPE, _disable: true }, params, options);
|
60
|
+
}
|
61
|
+
async _enable(id, params, options) {
|
62
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: BuyXPayYPromotions.TYPE, _enable: true }, params, options);
|
63
|
+
}
|
64
|
+
isBuyXPayYPromotion(resource) {
|
65
|
+
return resource.type && (resource.type === BuyXPayYPromotions.TYPE);
|
66
|
+
}
|
67
|
+
relationship(id) {
|
68
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: BuyXPayYPromotions.TYPE } : { id: id.id, type: BuyXPayYPromotions.TYPE };
|
69
|
+
}
|
70
|
+
type() {
|
71
|
+
return BuyXPayYPromotions.TYPE;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
BuyXPayYPromotions.TYPE = 'buy_x_pay_y_promotions';
|
75
|
+
exports.default = BuyXPayYPromotions;
|
@@ -3,6 +3,7 @@ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesCon
|
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions';
|
5
5
|
import type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions';
|
6
|
+
import type { BuyXPayYPromotion, BuyXPayYPromotionType } from './buy_x_pay_y_promotions';
|
6
7
|
import type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions';
|
7
8
|
import type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions';
|
8
9
|
import type { ExternalPromotion, ExternalPromotionType } from './external_promotions';
|
@@ -19,6 +20,9 @@ type PercentageDiscountPromotionRel = ResourceRel & {
|
|
19
20
|
type FreeShippingPromotionRel = ResourceRel & {
|
20
21
|
type: FreeShippingPromotionType;
|
21
22
|
};
|
23
|
+
type BuyXPayYPromotionRel = ResourceRel & {
|
24
|
+
type: BuyXPayYPromotionType;
|
25
|
+
};
|
22
26
|
type FreeGiftPromotionRel = ResourceRel & {
|
23
27
|
type: FreeGiftPromotionType;
|
24
28
|
};
|
@@ -36,16 +40,16 @@ type CouponRel = ResourceRel & {
|
|
36
40
|
};
|
37
41
|
interface CouponCodesPromotionRule extends Resource {
|
38
42
|
readonly type: CouponCodesPromotionRuleType;
|
39
|
-
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
|
43
|
+
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
|
40
44
|
versions?: Version[] | null;
|
41
45
|
coupons?: Coupon[] | null;
|
42
46
|
}
|
43
47
|
interface CouponCodesPromotionRuleCreate extends ResourceCreate {
|
44
|
-
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
48
|
+
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
45
49
|
coupons?: CouponRel[] | null;
|
46
50
|
}
|
47
51
|
interface CouponCodesPromotionRuleUpdate extends ResourceUpdate {
|
48
|
-
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | null;
|
52
|
+
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | null;
|
49
53
|
coupons?: CouponRel[] | null;
|
50
54
|
}
|
51
55
|
declare class CouponCodesPromotionRules extends ApiResource<CouponCodesPromotionRule> {
|
@@ -26,6 +26,7 @@ interface Coupon extends Resource {
|
|
26
26
|
usage_limit?: number | null;
|
27
27
|
usage_count?: number | null;
|
28
28
|
recipient_email?: string | null;
|
29
|
+
expires_at?: string | null;
|
29
30
|
promotion_rule?: CouponCodesPromotionRule | null;
|
30
31
|
coupon_recipient?: CouponRecipient | null;
|
31
32
|
events?: Event[] | null;
|
@@ -37,6 +38,7 @@ interface CouponCreate extends ResourceCreate {
|
|
37
38
|
customer_single_use?: boolean | null;
|
38
39
|
usage_limit?: number | null;
|
39
40
|
recipient_email?: string | null;
|
41
|
+
expires_at?: string | null;
|
40
42
|
promotion_rule: CouponCodesPromotionRuleRel;
|
41
43
|
coupon_recipient?: CouponRecipientRel | null;
|
42
44
|
tags?: TagRel[] | null;
|
@@ -46,6 +48,7 @@ interface CouponUpdate extends ResourceUpdate {
|
|
46
48
|
customer_single_use?: boolean | null;
|
47
49
|
usage_limit?: number | null;
|
48
50
|
recipient_email?: string | null;
|
51
|
+
expires_at?: string | null;
|
49
52
|
promotion_rule?: CouponCodesPromotionRuleRel | null;
|
50
53
|
coupon_recipient?: CouponRecipientRel | null;
|
51
54
|
tags?: TagRel[] | null;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
|
+
import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions';
|
5
|
+
import type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions';
|
6
|
+
import type { BuyXPayYPromotion, BuyXPayYPromotionType } from './buy_x_pay_y_promotions';
|
7
|
+
import type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions';
|
8
|
+
import type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions';
|
9
|
+
import type { ExternalPromotion, ExternalPromotionType } from './external_promotions';
|
10
|
+
import type { FixedAmountPromotion, FixedAmountPromotionType } from './fixed_amount_promotions';
|
11
|
+
import type { Version } from './versions';
|
12
|
+
type CustomPromotionRuleType = 'custom_promotion_rules';
|
13
|
+
type CustomPromotionRuleRel = ResourceRel & {
|
14
|
+
type: CustomPromotionRuleType;
|
15
|
+
};
|
16
|
+
type PercentageDiscountPromotionRel = ResourceRel & {
|
17
|
+
type: PercentageDiscountPromotionType;
|
18
|
+
};
|
19
|
+
type FreeShippingPromotionRel = ResourceRel & {
|
20
|
+
type: FreeShippingPromotionType;
|
21
|
+
};
|
22
|
+
type BuyXPayYPromotionRel = ResourceRel & {
|
23
|
+
type: BuyXPayYPromotionType;
|
24
|
+
};
|
25
|
+
type FreeGiftPromotionRel = ResourceRel & {
|
26
|
+
type: FreeGiftPromotionType;
|
27
|
+
};
|
28
|
+
type FixedPricePromotionRel = ResourceRel & {
|
29
|
+
type: FixedPricePromotionType;
|
30
|
+
};
|
31
|
+
type ExternalPromotionRel = ResourceRel & {
|
32
|
+
type: ExternalPromotionType;
|
33
|
+
};
|
34
|
+
type FixedAmountPromotionRel = ResourceRel & {
|
35
|
+
type: FixedAmountPromotionType;
|
36
|
+
};
|
37
|
+
interface CustomPromotionRule extends Resource {
|
38
|
+
readonly type: CustomPromotionRuleType;
|
39
|
+
filters?: Record<string, any> | null;
|
40
|
+
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
|
41
|
+
versions?: Version[] | null;
|
42
|
+
}
|
43
|
+
interface CustomPromotionRuleCreate extends ResourceCreate {
|
44
|
+
filters?: Record<string, any> | null;
|
45
|
+
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
46
|
+
}
|
47
|
+
interface CustomPromotionRuleUpdate extends ResourceUpdate {
|
48
|
+
filters?: Record<string, any> | null;
|
49
|
+
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | null;
|
50
|
+
}
|
51
|
+
declare class CustomPromotionRules extends ApiResource<CustomPromotionRule> {
|
52
|
+
static readonly TYPE: CustomPromotionRuleType;
|
53
|
+
create(resource: CustomPromotionRuleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
54
|
+
update(resource: CustomPromotionRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
55
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
56
|
+
versions(customPromotionRuleId: string | CustomPromotionRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
57
|
+
isCustomPromotionRule(resource: any): resource is CustomPromotionRule;
|
58
|
+
relationship(id: string | ResourceId | null): CustomPromotionRuleRel;
|
59
|
+
type(): CustomPromotionRuleType;
|
60
|
+
}
|
61
|
+
export default CustomPromotionRules;
|
62
|
+
export type { CustomPromotionRule, CustomPromotionRuleCreate, CustomPromotionRuleUpdate, CustomPromotionRuleType };
|