@commercelayer/sdk 2.3.3-beta.1 → 2.3.3-beta.2
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/{api.d.ts → cjs/api.d.ts} +101 -101
- package/lib/cjs/api.js +406 -0
- package/lib/{client.d.ts → cjs/client.d.ts} +30 -30
- package/lib/cjs/client.js +101 -0
- package/lib/{commercelayer.d.ts → cjs/commercelayer.d.ts} +118 -118
- package/lib/cjs/commercelayer.js +201 -0
- package/lib/{common.d.ts → cjs/common.d.ts} +4 -4
- package/lib/cjs/common.js +13 -0
- package/lib/{config.d.ts → cjs/config.d.ts} +7 -7
- package/lib/cjs/config.js +9 -0
- package/lib/{error.d.ts → cjs/error.d.ts} +26 -26
- package/lib/cjs/error.js +40 -0
- package/lib/{index.d.ts → cjs/index.d.ts} +6 -6
- package/lib/cjs/index.js +24 -0
- package/lib/{interceptor.d.ts → cjs/interceptor.d.ts} +19 -19
- package/lib/cjs/interceptor.js +2 -0
- package/lib/{jsonapi.d.ts → cjs/jsonapi.d.ts} +7 -7
- package/lib/cjs/jsonapi.js +63 -0
- package/lib/{model.d.ts → cjs/model.d.ts} +99 -99
- package/lib/cjs/model.js +3 -0
- package/lib/{query.d.ts → cjs/query.d.ts} +57 -57
- package/lib/cjs/query.js +172 -0
- package/lib/{resource.d.ts → cjs/resource.d.ts} +69 -69
- package/lib/cjs/resource.js +114 -0
- package/lib/{resources → cjs/resources}/addresses.d.ts +91 -91
- package/lib/cjs/resources/addresses.js +47 -0
- package/lib/{resources → cjs/resources}/adjustments.d.ts +39 -39
- package/lib/cjs/resources/adjustments.js +47 -0
- package/lib/{resources → cjs/resources}/adyen_gateways.d.ts +49 -49
- package/lib/cjs/resources/adyen_gateways.js +47 -0
- package/lib/{resources → cjs/resources}/adyen_payments.d.ts +47 -47
- package/lib/cjs/resources/adyen_payments.js +47 -0
- package/lib/{resources → cjs/resources}/application.d.ts +25 -25
- package/lib/cjs/resources/application.js +35 -0
- package/lib/{resources → cjs/resources}/attachments.d.ts +160 -160
- package/lib/cjs/resources/attachments.js +47 -0
- package/lib/{resources → cjs/resources}/authorizations.d.ts +58 -58
- package/lib/cjs/resources/authorizations.js +41 -0
- package/lib/{resources → cjs/resources}/avalara_accounts.d.ts +53 -53
- package/lib/cjs/resources/avalara_accounts.js +47 -0
- package/lib/{resources → cjs/resources}/billing_info_validation_rules.d.ts +35 -35
- package/lib/cjs/resources/billing_info_validation_rules.js +47 -0
- package/lib/{resources → cjs/resources}/bing_geocoders.d.ts +37 -37
- package/lib/cjs/resources/bing_geocoders.js +47 -0
- package/lib/{resources → cjs/resources}/braintree_gateways.d.ts +58 -58
- package/lib/cjs/resources/braintree_gateways.js +47 -0
- package/lib/{resources → cjs/resources}/braintree_payments.d.ts +49 -49
- package/lib/cjs/resources/braintree_payments.js +47 -0
- package/lib/{resources → cjs/resources}/bundles.d.ts +69 -69
- package/lib/cjs/resources/bundles.js +47 -0
- package/lib/{resources → cjs/resources}/captures.d.ts +49 -49
- package/lib/cjs/resources/captures.js +41 -0
- package/lib/{resources → cjs/resources}/carrier_accounts.d.ts +28 -28
- package/lib/cjs/resources/carrier_accounts.js +38 -0
- package/lib/{resources → cjs/resources}/checkout_com_gateways.d.ts +47 -47
- package/lib/cjs/resources/checkout_com_gateways.js +47 -0
- package/lib/{resources → cjs/resources}/checkout_com_payments.d.ts +53 -53
- package/lib/cjs/resources/checkout_com_payments.js +47 -0
- package/lib/{resources → cjs/resources}/coupon_codes_promotion_rules.d.ts +62 -62
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +47 -0
- package/lib/{resources → cjs/resources}/coupon_recipients.d.ts +46 -46
- package/lib/cjs/resources/coupon_recipients.js +47 -0
- package/lib/{resources → cjs/resources}/coupons.d.ts +45 -45
- package/lib/cjs/resources/coupons.js +47 -0
- package/lib/{resources → cjs/resources}/customer_addresses.d.ts +43 -43
- package/lib/cjs/resources/customer_addresses.js +47 -0
- package/lib/{resources → cjs/resources}/customer_groups.d.ts +37 -37
- package/lib/cjs/resources/customer_groups.js +47 -0
- package/lib/{resources → cjs/resources}/customer_password_resets.d.ts +36 -36
- package/lib/cjs/resources/customer_password_resets.js +47 -0
- package/lib/{resources → cjs/resources}/customer_payment_sources.d.ts +69 -69
- package/lib/cjs/resources/customer_payment_sources.js +47 -0
- package/lib/{resources → cjs/resources}/customer_subscriptions.d.ts +31 -31
- package/lib/cjs/resources/customer_subscriptions.js +47 -0
- package/lib/{resources → cjs/resources}/customers.d.ts +56 -56
- package/lib/cjs/resources/customers.js +47 -0
- package/lib/{resources → cjs/resources}/delivery_lead_times.d.ts +52 -52
- package/lib/cjs/resources/delivery_lead_times.js +47 -0
- package/lib/{resources → cjs/resources}/event_callbacks.d.ts +27 -27
- package/lib/cjs/resources/event_callbacks.js +38 -0
- package/lib/{resources → cjs/resources}/external_gateways.d.ts +48 -48
- package/lib/cjs/resources/external_gateways.js +47 -0
- package/lib/{resources → cjs/resources}/external_payments.d.ts +42 -42
- package/lib/cjs/resources/external_payments.js +47 -0
- package/lib/{resources → cjs/resources}/external_promotions.d.ts +82 -82
- package/lib/cjs/resources/external_promotions.js +47 -0
- package/lib/{resources → cjs/resources}/external_tax_calculators.d.ts +45 -45
- package/lib/cjs/resources/external_tax_calculators.js +47 -0
- package/lib/{resources → cjs/resources}/fixed_amount_promotions.d.ts +84 -84
- package/lib/cjs/resources/fixed_amount_promotions.js +47 -0
- package/lib/{resources → cjs/resources}/fixed_price_promotions.d.ts +93 -93
- package/lib/cjs/resources/fixed_price_promotions.js +47 -0
- package/lib/{resources → cjs/resources}/free_gift_promotions.d.ts +91 -91
- package/lib/cjs/resources/free_gift_promotions.js +47 -0
- package/lib/{resources → cjs/resources}/free_shipping_promotions.d.ts +79 -79
- package/lib/cjs/resources/free_shipping_promotions.js +47 -0
- package/lib/{resources → cjs/resources}/geocoders.d.ts +25 -25
- package/lib/cjs/resources/geocoders.js +35 -0
- package/lib/{resources → cjs/resources}/gift_card_recipients.d.ts +46 -46
- package/lib/cjs/resources/gift_card_recipients.js +47 -0
- package/lib/{resources → cjs/resources}/gift_cards.d.ts +84 -84
- package/lib/cjs/resources/gift_cards.js +47 -0
- package/lib/{resources → cjs/resources}/google_geocoders.d.ts +37 -37
- package/lib/cjs/resources/google_geocoders.js +47 -0
- package/lib/{resources → cjs/resources}/imports.d.ts +44 -44
- package/lib/cjs/resources/imports.js +44 -0
- package/lib/{resources → cjs/resources}/in_stock_subscriptions.d.ts +60 -60
- package/lib/cjs/resources/in_stock_subscriptions.js +47 -0
- package/lib/{resources → cjs/resources}/inventory_models.d.ts +43 -43
- package/lib/cjs/resources/inventory_models.js +47 -0
- package/lib/{resources → cjs/resources}/inventory_return_locations.d.ts +45 -45
- package/lib/cjs/resources/inventory_return_locations.js +47 -0
- package/lib/{resources → cjs/resources}/inventory_stock_locations.d.ts +48 -48
- package/lib/cjs/resources/inventory_stock_locations.js +47 -0
- package/lib/{resources → cjs/resources}/line_item_options.d.ts +59 -59
- package/lib/cjs/resources/line_item_options.js +47 -0
- package/lib/{resources → cjs/resources}/line_items.d.ts +125 -125
- package/lib/cjs/resources/line_items.js +47 -0
- package/lib/{resources → cjs/resources}/manual_gateways.d.ts +36 -36
- package/lib/cjs/resources/manual_gateways.js +47 -0
- package/lib/{resources → cjs/resources}/manual_tax_calculators.d.ts +49 -49
- package/lib/cjs/resources/manual_tax_calculators.js +47 -0
- package/lib/{resources → cjs/resources}/markets.d.ts +79 -79
- package/lib/cjs/resources/markets.js +47 -0
- package/lib/{resources → cjs/resources}/merchants.d.ts +40 -40
- package/lib/cjs/resources/merchants.js +47 -0
- package/lib/{resources → cjs/resources}/order_amount_promotion_rules.d.ts +60 -60
- package/lib/cjs/resources/order_amount_promotion_rules.js +47 -0
- package/lib/{resources → cjs/resources}/order_copies.d.ts +46 -46
- package/lib/cjs/resources/order_copies.js +44 -0
- package/lib/{resources → cjs/resources}/order_subscriptions.d.ts +66 -66
- package/lib/cjs/resources/order_subscriptions.js +47 -0
- package/lib/{resources → cjs/resources}/order_validation_rules.d.ts +22 -22
- package/lib/cjs/resources/order_validation_rules.js +35 -0
- package/lib/{resources → cjs/resources}/orders.d.ts +255 -255
- package/lib/cjs/resources/orders.js +47 -0
- package/lib/{resources → cjs/resources}/organization.d.ts +34 -34
- package/lib/cjs/resources/organization.js +35 -0
- package/lib/{resources → cjs/resources}/packages.d.ts +57 -57
- package/lib/cjs/resources/packages.js +47 -0
- package/lib/{resources → cjs/resources}/parcel_line_items.d.ts +51 -51
- package/lib/cjs/resources/parcel_line_items.js +47 -0
- package/lib/{resources → cjs/resources}/parcels.d.ts +108 -108
- package/lib/cjs/resources/parcels.js +47 -0
- package/lib/{resources → cjs/resources}/payment_gateways.d.ts +33 -33
- package/lib/cjs/resources/payment_gateways.js +47 -0
- package/lib/{resources → cjs/resources}/payment_methods.d.ts +54 -54
- package/lib/cjs/resources/payment_methods.js +47 -0
- package/lib/{resources → cjs/resources}/paypal_gateways.d.ts +41 -41
- package/lib/cjs/resources/paypal_gateways.js +47 -0
- package/lib/{resources → cjs/resources}/paypal_payments.d.ts +49 -49
- package/lib/cjs/resources/paypal_payments.js +47 -0
- package/lib/{resources → cjs/resources}/percentage_discount_promotions.d.ts +91 -91
- package/lib/cjs/resources/percentage_discount_promotions.js +47 -0
- package/lib/{resources → cjs/resources}/price_lists.d.ts +41 -41
- package/lib/cjs/resources/price_lists.js +47 -0
- package/lib/{resources → cjs/resources}/prices.d.ts +58 -58
- package/lib/cjs/resources/prices.js +47 -0
- package/lib/{resources → cjs/resources}/promotion_rules.d.ts +27 -27
- package/lib/cjs/resources/promotion_rules.js +35 -0
- package/lib/{resources → cjs/resources}/promotions.d.ts +38 -38
- package/lib/cjs/resources/promotions.js +35 -0
- package/lib/{resources → cjs/resources}/refunds.d.ts +36 -36
- package/lib/cjs/resources/refunds.js +38 -0
- package/lib/{resources → cjs/resources}/return_line_items.d.ts +51 -51
- package/lib/cjs/resources/return_line_items.js +47 -0
- package/lib/{resources → cjs/resources}/returns.d.ts +69 -69
- package/lib/cjs/resources/returns.js +47 -0
- package/lib/{resources → cjs/resources}/shipments.d.ts +80 -80
- package/lib/cjs/resources/shipments.js +41 -0
- package/lib/{resources → cjs/resources}/shipping_categories.d.ts +35 -35
- package/lib/cjs/resources/shipping_categories.js +47 -0
- package/lib/{resources → cjs/resources}/shipping_methods.d.ts +71 -71
- package/lib/cjs/resources/shipping_methods.js +47 -0
- package/lib/{resources → cjs/resources}/shipping_zones.d.ts +51 -51
- package/lib/cjs/resources/shipping_zones.js +47 -0
- package/lib/{resources → cjs/resources}/sku_list_items.d.ts +46 -46
- package/lib/cjs/resources/sku_list_items.js +47 -0
- package/lib/{resources → cjs/resources}/sku_list_promotion_rules.d.ts +70 -70
- package/lib/cjs/resources/sku_list_promotion_rules.js +47 -0
- package/lib/{resources → cjs/resources}/sku_lists.d.ts +50 -50
- package/lib/cjs/resources/sku_lists.js +47 -0
- package/lib/{resources → cjs/resources}/sku_options.d.ts +55 -55
- package/lib/cjs/resources/sku_options.js +47 -0
- package/lib/{resources → cjs/resources}/skus.d.ts +76 -76
- package/lib/cjs/resources/skus.js +47 -0
- package/lib/{resources → cjs/resources}/stock_items.d.ts +50 -50
- package/lib/cjs/resources/stock_items.js +47 -0
- package/lib/{resources → cjs/resources}/stock_line_items.d.ts +30 -30
- package/lib/cjs/resources/stock_line_items.js +38 -0
- package/lib/{resources → cjs/resources}/stock_locations.d.ts +55 -55
- package/lib/cjs/resources/stock_locations.js +47 -0
- package/lib/{resources → cjs/resources}/stock_transfers.d.ts +70 -70
- package/lib/cjs/resources/stock_transfers.js +47 -0
- package/lib/{resources → cjs/resources}/stripe_gateways.d.ts +40 -40
- package/lib/cjs/resources/stripe_gateways.js +47 -0
- package/lib/{resources → cjs/resources}/stripe_payments.d.ts +44 -44
- package/lib/cjs/resources/stripe_payments.js +47 -0
- package/lib/{resources → cjs/resources}/tax_calculators.d.ts +27 -27
- package/lib/cjs/resources/tax_calculators.js +35 -0
- package/lib/{resources → cjs/resources}/tax_categories.d.ts +61 -61
- package/lib/cjs/resources/tax_categories.js +47 -0
- package/lib/{resources → cjs/resources}/tax_rules.d.ts +72 -72
- package/lib/cjs/resources/tax_rules.js +47 -0
- package/lib/{resources → cjs/resources}/taxjar_accounts.d.ts +44 -44
- package/lib/cjs/resources/taxjar_accounts.js +47 -0
- package/lib/{resources → cjs/resources}/transactions.d.ts +33 -33
- package/lib/cjs/resources/transactions.js +35 -0
- package/lib/{resources → cjs/resources}/voids.d.ts +36 -36
- package/lib/cjs/resources/voids.js +38 -0
- package/lib/{resources → cjs/resources}/webhooks.d.ts +45 -45
- package/lib/cjs/resources/webhooks.js +47 -0
- package/lib/{resources → cjs/resources}/wire_transfers.d.ts +35 -35
- package/lib/cjs/resources/wire_transfers.js +47 -0
- package/lib/{static.d.ts → cjs/static.d.ts} +6 -6
- package/lib/cjs/static.js +36 -0
- package/lib/{util.d.ts → cjs/util.d.ts} +3 -3
- package/lib/cjs/util.js +7 -0
- package/lib/esm/api.d.ts +101 -0
- package/lib/esm/api.js +304 -0
- package/lib/esm/client.d.ts +30 -0
- package/lib/esm/client.js +96 -0
- package/lib/esm/commercelayer.d.ts +118 -0
- package/lib/esm/commercelayer.js +177 -0
- package/lib/esm/common.d.ts +4 -0
- package/lib/esm/common.js +9 -0
- package/lib/esm/config.d.ts +7 -0
- package/lib/esm/config.js +7 -0
- package/lib/esm/error.d.ts +26 -0
- package/lib/esm/error.js +35 -0
- package/lib/esm/index.d.ts +6 -0
- package/lib/esm/index.js +6 -0
- package/lib/esm/interceptor.d.ts +19 -0
- package/lib/esm/interceptor.js +1 -0
- package/lib/esm/jsonapi.d.ts +7 -0
- package/lib/esm/jsonapi.js +59 -0
- package/lib/esm/model.d.ts +99 -0
- package/lib/esm/model.js +2 -0
- package/lib/esm/query.d.ts +57 -0
- package/lib/esm/query.js +168 -0
- package/lib/esm/resource.d.ts +69 -0
- package/lib/esm/resource.js +108 -0
- package/lib/esm/resources/addresses.d.ts +91 -0
- package/lib/esm/resources/addresses.js +45 -0
- package/lib/esm/resources/adjustments.d.ts +39 -0
- package/lib/esm/resources/adjustments.js +45 -0
- package/lib/esm/resources/adyen_gateways.d.ts +49 -0
- package/lib/esm/resources/adyen_gateways.js +45 -0
- package/lib/esm/resources/adyen_payments.d.ts +47 -0
- package/lib/esm/resources/adyen_payments.js +45 -0
- package/lib/esm/resources/application.d.ts +25 -0
- package/lib/esm/resources/application.js +33 -0
- package/lib/esm/resources/attachments.d.ts +160 -0
- package/lib/esm/resources/attachments.js +45 -0
- package/lib/esm/resources/authorizations.d.ts +58 -0
- package/lib/esm/resources/authorizations.js +39 -0
- package/lib/esm/resources/avalara_accounts.d.ts +53 -0
- package/lib/esm/resources/avalara_accounts.js +45 -0
- package/lib/esm/resources/billing_info_validation_rules.d.ts +35 -0
- package/lib/esm/resources/billing_info_validation_rules.js +45 -0
- package/lib/esm/resources/bing_geocoders.d.ts +37 -0
- package/lib/esm/resources/bing_geocoders.js +45 -0
- package/lib/esm/resources/braintree_gateways.d.ts +58 -0
- package/lib/esm/resources/braintree_gateways.js +45 -0
- package/lib/esm/resources/braintree_payments.d.ts +49 -0
- package/lib/esm/resources/braintree_payments.js +45 -0
- package/lib/esm/resources/bundles.d.ts +69 -0
- package/lib/esm/resources/bundles.js +45 -0
- package/lib/esm/resources/captures.d.ts +49 -0
- package/lib/esm/resources/captures.js +39 -0
- package/lib/esm/resources/carrier_accounts.d.ts +28 -0
- package/lib/esm/resources/carrier_accounts.js +36 -0
- package/lib/esm/resources/checkout_com_gateways.d.ts +47 -0
- package/lib/esm/resources/checkout_com_gateways.js +45 -0
- package/lib/esm/resources/checkout_com_payments.d.ts +53 -0
- package/lib/esm/resources/checkout_com_payments.js +45 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +62 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.js +45 -0
- package/lib/esm/resources/coupon_recipients.d.ts +46 -0
- package/lib/esm/resources/coupon_recipients.js +45 -0
- package/lib/esm/resources/coupons.d.ts +45 -0
- package/lib/esm/resources/coupons.js +45 -0
- package/lib/esm/resources/customer_addresses.d.ts +43 -0
- package/lib/esm/resources/customer_addresses.js +45 -0
- package/lib/esm/resources/customer_groups.d.ts +37 -0
- package/lib/esm/resources/customer_groups.js +45 -0
- package/lib/esm/resources/customer_password_resets.d.ts +36 -0
- package/lib/esm/resources/customer_password_resets.js +45 -0
- package/lib/esm/resources/customer_payment_sources.d.ts +69 -0
- package/lib/esm/resources/customer_payment_sources.js +45 -0
- package/lib/esm/resources/customer_subscriptions.d.ts +31 -0
- package/lib/esm/resources/customer_subscriptions.js +45 -0
- package/lib/esm/resources/customers.d.ts +56 -0
- package/lib/esm/resources/customers.js +45 -0
- package/lib/esm/resources/delivery_lead_times.d.ts +52 -0
- package/lib/esm/resources/delivery_lead_times.js +45 -0
- package/lib/esm/resources/event_callbacks.d.ts +27 -0
- package/lib/esm/resources/event_callbacks.js +36 -0
- package/lib/esm/resources/external_gateways.d.ts +48 -0
- package/lib/esm/resources/external_gateways.js +45 -0
- package/lib/esm/resources/external_payments.d.ts +42 -0
- package/lib/esm/resources/external_payments.js +45 -0
- package/lib/esm/resources/external_promotions.d.ts +82 -0
- package/lib/esm/resources/external_promotions.js +45 -0
- package/lib/esm/resources/external_tax_calculators.d.ts +45 -0
- package/lib/esm/resources/external_tax_calculators.js +45 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +84 -0
- package/lib/esm/resources/fixed_amount_promotions.js +45 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +93 -0
- package/lib/esm/resources/fixed_price_promotions.js +45 -0
- package/lib/esm/resources/free_gift_promotions.d.ts +91 -0
- package/lib/esm/resources/free_gift_promotions.js +45 -0
- package/lib/esm/resources/free_shipping_promotions.d.ts +79 -0
- package/lib/esm/resources/free_shipping_promotions.js +45 -0
- package/lib/esm/resources/geocoders.d.ts +25 -0
- package/lib/esm/resources/geocoders.js +33 -0
- package/lib/esm/resources/gift_card_recipients.d.ts +46 -0
- package/lib/esm/resources/gift_card_recipients.js +45 -0
- package/lib/esm/resources/gift_cards.d.ts +84 -0
- package/lib/esm/resources/gift_cards.js +45 -0
- package/lib/esm/resources/google_geocoders.d.ts +37 -0
- package/lib/esm/resources/google_geocoders.js +45 -0
- package/lib/esm/resources/imports.d.ts +44 -0
- package/lib/esm/resources/imports.js +42 -0
- package/lib/esm/resources/in_stock_subscriptions.d.ts +60 -0
- package/lib/esm/resources/in_stock_subscriptions.js +45 -0
- package/lib/esm/resources/inventory_models.d.ts +43 -0
- package/lib/esm/resources/inventory_models.js +45 -0
- package/lib/esm/resources/inventory_return_locations.d.ts +45 -0
- package/lib/esm/resources/inventory_return_locations.js +45 -0
- package/lib/esm/resources/inventory_stock_locations.d.ts +48 -0
- package/lib/esm/resources/inventory_stock_locations.js +45 -0
- package/lib/esm/resources/line_item_options.d.ts +59 -0
- package/lib/esm/resources/line_item_options.js +45 -0
- package/lib/esm/resources/line_items.d.ts +125 -0
- package/lib/esm/resources/line_items.js +45 -0
- package/lib/esm/resources/manual_gateways.d.ts +36 -0
- package/lib/esm/resources/manual_gateways.js +45 -0
- package/lib/esm/resources/manual_tax_calculators.d.ts +49 -0
- package/lib/esm/resources/manual_tax_calculators.js +45 -0
- package/lib/esm/resources/markets.d.ts +79 -0
- package/lib/esm/resources/markets.js +45 -0
- package/lib/esm/resources/merchants.d.ts +40 -0
- package/lib/esm/resources/merchants.js +45 -0
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +60 -0
- package/lib/esm/resources/order_amount_promotion_rules.js +45 -0
- package/lib/esm/resources/order_copies.d.ts +46 -0
- package/lib/esm/resources/order_copies.js +42 -0
- package/lib/esm/resources/order_subscriptions.d.ts +66 -0
- package/lib/esm/resources/order_subscriptions.js +45 -0
- package/lib/esm/resources/order_validation_rules.d.ts +22 -0
- package/lib/esm/resources/order_validation_rules.js +33 -0
- package/lib/esm/resources/orders.d.ts +255 -0
- package/lib/esm/resources/orders.js +45 -0
- package/lib/esm/resources/organization.d.ts +34 -0
- package/lib/esm/resources/organization.js +33 -0
- package/lib/esm/resources/packages.d.ts +57 -0
- package/lib/esm/resources/packages.js +45 -0
- package/lib/esm/resources/parcel_line_items.d.ts +51 -0
- package/lib/esm/resources/parcel_line_items.js +45 -0
- package/lib/esm/resources/parcels.d.ts +108 -0
- package/lib/esm/resources/parcels.js +45 -0
- package/lib/esm/resources/payment_gateways.d.ts +33 -0
- package/lib/esm/resources/payment_gateways.js +45 -0
- package/lib/esm/resources/payment_methods.d.ts +54 -0
- package/lib/esm/resources/payment_methods.js +45 -0
- package/lib/esm/resources/paypal_gateways.d.ts +41 -0
- package/lib/esm/resources/paypal_gateways.js +45 -0
- package/lib/esm/resources/paypal_payments.d.ts +49 -0
- package/lib/esm/resources/paypal_payments.js +45 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +91 -0
- package/lib/esm/resources/percentage_discount_promotions.js +45 -0
- package/lib/esm/resources/price_lists.d.ts +41 -0
- package/lib/esm/resources/price_lists.js +45 -0
- package/lib/esm/resources/prices.d.ts +58 -0
- package/lib/esm/resources/prices.js +45 -0
- package/lib/esm/resources/promotion_rules.d.ts +27 -0
- package/lib/esm/resources/promotion_rules.js +33 -0
- package/lib/esm/resources/promotions.d.ts +38 -0
- package/lib/esm/resources/promotions.js +33 -0
- package/lib/esm/resources/refunds.d.ts +36 -0
- package/lib/esm/resources/refunds.js +36 -0
- package/lib/esm/resources/return_line_items.d.ts +51 -0
- package/lib/esm/resources/return_line_items.js +45 -0
- package/lib/esm/resources/returns.d.ts +69 -0
- package/lib/esm/resources/returns.js +45 -0
- package/lib/esm/resources/shipments.d.ts +80 -0
- package/lib/esm/resources/shipments.js +39 -0
- package/lib/esm/resources/shipping_categories.d.ts +35 -0
- package/lib/esm/resources/shipping_categories.js +45 -0
- package/lib/esm/resources/shipping_methods.d.ts +71 -0
- package/lib/esm/resources/shipping_methods.js +45 -0
- package/lib/esm/resources/shipping_zones.d.ts +51 -0
- package/lib/esm/resources/shipping_zones.js +45 -0
- package/lib/esm/resources/sku_list_items.d.ts +46 -0
- package/lib/esm/resources/sku_list_items.js +45 -0
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +70 -0
- package/lib/esm/resources/sku_list_promotion_rules.js +45 -0
- package/lib/esm/resources/sku_lists.d.ts +50 -0
- package/lib/esm/resources/sku_lists.js +45 -0
- package/lib/esm/resources/sku_options.d.ts +55 -0
- package/lib/esm/resources/sku_options.js +45 -0
- package/lib/esm/resources/skus.d.ts +76 -0
- package/lib/esm/resources/skus.js +45 -0
- package/lib/esm/resources/stock_items.d.ts +50 -0
- package/lib/esm/resources/stock_items.js +45 -0
- package/lib/esm/resources/stock_line_items.d.ts +30 -0
- package/lib/esm/resources/stock_line_items.js +36 -0
- package/lib/esm/resources/stock_locations.d.ts +55 -0
- package/lib/esm/resources/stock_locations.js +45 -0
- package/lib/esm/resources/stock_transfers.d.ts +70 -0
- package/lib/esm/resources/stock_transfers.js +45 -0
- package/lib/esm/resources/stripe_gateways.d.ts +40 -0
- package/lib/esm/resources/stripe_gateways.js +45 -0
- package/lib/esm/resources/stripe_payments.d.ts +44 -0
- package/lib/esm/resources/stripe_payments.js +45 -0
- package/lib/esm/resources/tax_calculators.d.ts +27 -0
- package/lib/esm/resources/tax_calculators.js +33 -0
- package/lib/esm/resources/tax_categories.d.ts +61 -0
- package/lib/esm/resources/tax_categories.js +45 -0
- package/lib/esm/resources/tax_rules.d.ts +72 -0
- package/lib/esm/resources/tax_rules.js +45 -0
- package/lib/esm/resources/taxjar_accounts.d.ts +44 -0
- package/lib/esm/resources/taxjar_accounts.js +45 -0
- package/lib/esm/resources/transactions.d.ts +33 -0
- package/lib/esm/resources/transactions.js +33 -0
- package/lib/esm/resources/voids.d.ts +36 -0
- package/lib/esm/resources/voids.js +36 -0
- package/lib/esm/resources/webhooks.d.ts +45 -0
- package/lib/esm/resources/webhooks.js +45 -0
- package/lib/esm/resources/wire_transfers.d.ts +35 -0
- package/lib/esm/resources/wire_transfers.js +45 -0
- package/lib/esm/static.d.ts +6 -0
- package/lib/esm/static.js +14 -0
- package/lib/esm/util.d.ts +3 -0
- package/lib/esm/util.js +4 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +70 -57
- package/lib/index.js +0 -8
- package/lib/sdk.cjs.development.js +0 -17158
- package/lib/sdk.cjs.development.js.map +0 -1
- package/lib/sdk.cjs.production.min.js +0 -2
- package/lib/sdk.cjs.production.min.js.map +0 -1
- package/lib/sdk.esm.js +0 -17152
- package/lib/sdk.esm.js.map +0 -1
package/lib/cjs/api.js
ADDED
@@ -0,0 +1,406 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.Markets = exports.ManualTaxCalculators = exports.ManualGateways = exports.LineItems = exports.LineItemOptions = exports.InventoryStockLocations = exports.InventoryReturnLocations = 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.EventCallbacks = exports.DeliveryLeadTimes = exports.Customers = exports.CustomerSubscriptions = exports.CustomerPaymentSources = exports.CustomerPasswordResets = exports.CustomerGroups = exports.CustomerAddresses = exports.Coupons = exports.CouponRecipients = exports.CouponCodesPromotionRules = exports.CheckoutComPayments = exports.CheckoutComGateways = exports.CarrierAccounts = exports.Captures = exports.Bundles = exports.BraintreePayments = exports.BraintreeGateways = exports.BingGeocoders = exports.BillingInfoValidationRules = exports.AvalaraAccounts = exports.Authorizations = exports.Attachments = exports.Applications = exports.AdyenPayments = exports.AdyenGateways = exports.Adjustments = exports.Addresses = void 0;
|
7
|
+
exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockLocations = exports.StockLineItems = exports.StockItems = exports.Skus = exports.SkuOptions = exports.SkuLists = exports.SkuListPromotionRules = exports.SkuListItems = exports.ShippingZones = exports.ShippingMethods = exports.ShippingCategories = exports.Shipments = exports.Returns = exports.ReturnLineItems = exports.Refunds = exports.Promotions = exports.PromotionRules = exports.Prices = exports.PriceLists = 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.OrderCopies = exports.OrderAmountPromotionRules = exports.Merchants = void 0;
|
8
|
+
// ##__API_RESOURCES_START__##
|
9
|
+
// ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
|
10
|
+
/**
|
11
|
+
* ©2021 Commerce Layer Inc.
|
12
|
+
* Source code generated automatically by SDK codegen from OpenAPI schema 2.7.3
|
13
|
+
**/
|
14
|
+
var addresses_1 = require("./resources/addresses");
|
15
|
+
Object.defineProperty(exports, "Addresses", { enumerable: true, get: function () { return __importDefault(addresses_1).default; } });
|
16
|
+
var adjustments_1 = require("./resources/adjustments");
|
17
|
+
Object.defineProperty(exports, "Adjustments", { enumerable: true, get: function () { return __importDefault(adjustments_1).default; } });
|
18
|
+
var adyen_gateways_1 = require("./resources/adyen_gateways");
|
19
|
+
Object.defineProperty(exports, "AdyenGateways", { enumerable: true, get: function () { return __importDefault(adyen_gateways_1).default; } });
|
20
|
+
var adyen_payments_1 = require("./resources/adyen_payments");
|
21
|
+
Object.defineProperty(exports, "AdyenPayments", { enumerable: true, get: function () { return __importDefault(adyen_payments_1).default; } });
|
22
|
+
var application_1 = require("./resources/application");
|
23
|
+
Object.defineProperty(exports, "Applications", { enumerable: true, get: function () { return __importDefault(application_1).default; } });
|
24
|
+
var attachments_1 = require("./resources/attachments");
|
25
|
+
Object.defineProperty(exports, "Attachments", { enumerable: true, get: function () { return __importDefault(attachments_1).default; } });
|
26
|
+
var authorizations_1 = require("./resources/authorizations");
|
27
|
+
Object.defineProperty(exports, "Authorizations", { enumerable: true, get: function () { return __importDefault(authorizations_1).default; } });
|
28
|
+
var avalara_accounts_1 = require("./resources/avalara_accounts");
|
29
|
+
Object.defineProperty(exports, "AvalaraAccounts", { enumerable: true, get: function () { return __importDefault(avalara_accounts_1).default; } });
|
30
|
+
var billing_info_validation_rules_1 = require("./resources/billing_info_validation_rules");
|
31
|
+
Object.defineProperty(exports, "BillingInfoValidationRules", { enumerable: true, get: function () { return __importDefault(billing_info_validation_rules_1).default; } });
|
32
|
+
var bing_geocoders_1 = require("./resources/bing_geocoders");
|
33
|
+
Object.defineProperty(exports, "BingGeocoders", { enumerable: true, get: function () { return __importDefault(bing_geocoders_1).default; } });
|
34
|
+
var braintree_gateways_1 = require("./resources/braintree_gateways");
|
35
|
+
Object.defineProperty(exports, "BraintreeGateways", { enumerable: true, get: function () { return __importDefault(braintree_gateways_1).default; } });
|
36
|
+
var braintree_payments_1 = require("./resources/braintree_payments");
|
37
|
+
Object.defineProperty(exports, "BraintreePayments", { enumerable: true, get: function () { return __importDefault(braintree_payments_1).default; } });
|
38
|
+
var bundles_1 = require("./resources/bundles");
|
39
|
+
Object.defineProperty(exports, "Bundles", { enumerable: true, get: function () { return __importDefault(bundles_1).default; } });
|
40
|
+
var captures_1 = require("./resources/captures");
|
41
|
+
Object.defineProperty(exports, "Captures", { enumerable: true, get: function () { return __importDefault(captures_1).default; } });
|
42
|
+
var carrier_accounts_1 = require("./resources/carrier_accounts");
|
43
|
+
Object.defineProperty(exports, "CarrierAccounts", { enumerable: true, get: function () { return __importDefault(carrier_accounts_1).default; } });
|
44
|
+
var checkout_com_gateways_1 = require("./resources/checkout_com_gateways");
|
45
|
+
Object.defineProperty(exports, "CheckoutComGateways", { enumerable: true, get: function () { return __importDefault(checkout_com_gateways_1).default; } });
|
46
|
+
var checkout_com_payments_1 = require("./resources/checkout_com_payments");
|
47
|
+
Object.defineProperty(exports, "CheckoutComPayments", { enumerable: true, get: function () { return __importDefault(checkout_com_payments_1).default; } });
|
48
|
+
var coupon_codes_promotion_rules_1 = require("./resources/coupon_codes_promotion_rules");
|
49
|
+
Object.defineProperty(exports, "CouponCodesPromotionRules", { enumerable: true, get: function () { return __importDefault(coupon_codes_promotion_rules_1).default; } });
|
50
|
+
var coupon_recipients_1 = require("./resources/coupon_recipients");
|
51
|
+
Object.defineProperty(exports, "CouponRecipients", { enumerable: true, get: function () { return __importDefault(coupon_recipients_1).default; } });
|
52
|
+
var coupons_1 = require("./resources/coupons");
|
53
|
+
Object.defineProperty(exports, "Coupons", { enumerable: true, get: function () { return __importDefault(coupons_1).default; } });
|
54
|
+
var customer_addresses_1 = require("./resources/customer_addresses");
|
55
|
+
Object.defineProperty(exports, "CustomerAddresses", { enumerable: true, get: function () { return __importDefault(customer_addresses_1).default; } });
|
56
|
+
var customer_groups_1 = require("./resources/customer_groups");
|
57
|
+
Object.defineProperty(exports, "CustomerGroups", { enumerable: true, get: function () { return __importDefault(customer_groups_1).default; } });
|
58
|
+
var customer_password_resets_1 = require("./resources/customer_password_resets");
|
59
|
+
Object.defineProperty(exports, "CustomerPasswordResets", { enumerable: true, get: function () { return __importDefault(customer_password_resets_1).default; } });
|
60
|
+
var customer_payment_sources_1 = require("./resources/customer_payment_sources");
|
61
|
+
Object.defineProperty(exports, "CustomerPaymentSources", { enumerable: true, get: function () { return __importDefault(customer_payment_sources_1).default; } });
|
62
|
+
var customer_subscriptions_1 = require("./resources/customer_subscriptions");
|
63
|
+
Object.defineProperty(exports, "CustomerSubscriptions", { enumerable: true, get: function () { return __importDefault(customer_subscriptions_1).default; } });
|
64
|
+
var customers_1 = require("./resources/customers");
|
65
|
+
Object.defineProperty(exports, "Customers", { enumerable: true, get: function () { return __importDefault(customers_1).default; } });
|
66
|
+
var delivery_lead_times_1 = require("./resources/delivery_lead_times");
|
67
|
+
Object.defineProperty(exports, "DeliveryLeadTimes", { enumerable: true, get: function () { return __importDefault(delivery_lead_times_1).default; } });
|
68
|
+
var event_callbacks_1 = require("./resources/event_callbacks");
|
69
|
+
Object.defineProperty(exports, "EventCallbacks", { enumerable: true, get: function () { return __importDefault(event_callbacks_1).default; } });
|
70
|
+
var external_gateways_1 = require("./resources/external_gateways");
|
71
|
+
Object.defineProperty(exports, "ExternalGateways", { enumerable: true, get: function () { return __importDefault(external_gateways_1).default; } });
|
72
|
+
var external_payments_1 = require("./resources/external_payments");
|
73
|
+
Object.defineProperty(exports, "ExternalPayments", { enumerable: true, get: function () { return __importDefault(external_payments_1).default; } });
|
74
|
+
var external_promotions_1 = require("./resources/external_promotions");
|
75
|
+
Object.defineProperty(exports, "ExternalPromotions", { enumerable: true, get: function () { return __importDefault(external_promotions_1).default; } });
|
76
|
+
var external_tax_calculators_1 = require("./resources/external_tax_calculators");
|
77
|
+
Object.defineProperty(exports, "ExternalTaxCalculators", { enumerable: true, get: function () { return __importDefault(external_tax_calculators_1).default; } });
|
78
|
+
var fixed_amount_promotions_1 = require("./resources/fixed_amount_promotions");
|
79
|
+
Object.defineProperty(exports, "FixedAmountPromotions", { enumerable: true, get: function () { return __importDefault(fixed_amount_promotions_1).default; } });
|
80
|
+
var fixed_price_promotions_1 = require("./resources/fixed_price_promotions");
|
81
|
+
Object.defineProperty(exports, "FixedPricePromotions", { enumerable: true, get: function () { return __importDefault(fixed_price_promotions_1).default; } });
|
82
|
+
var free_gift_promotions_1 = require("./resources/free_gift_promotions");
|
83
|
+
Object.defineProperty(exports, "FreeGiftPromotions", { enumerable: true, get: function () { return __importDefault(free_gift_promotions_1).default; } });
|
84
|
+
var free_shipping_promotions_1 = require("./resources/free_shipping_promotions");
|
85
|
+
Object.defineProperty(exports, "FreeShippingPromotions", { enumerable: true, get: function () { return __importDefault(free_shipping_promotions_1).default; } });
|
86
|
+
var geocoders_1 = require("./resources/geocoders");
|
87
|
+
Object.defineProperty(exports, "Geocoders", { enumerable: true, get: function () { return __importDefault(geocoders_1).default; } });
|
88
|
+
var gift_card_recipients_1 = require("./resources/gift_card_recipients");
|
89
|
+
Object.defineProperty(exports, "GiftCardRecipients", { enumerable: true, get: function () { return __importDefault(gift_card_recipients_1).default; } });
|
90
|
+
var gift_cards_1 = require("./resources/gift_cards");
|
91
|
+
Object.defineProperty(exports, "GiftCards", { enumerable: true, get: function () { return __importDefault(gift_cards_1).default; } });
|
92
|
+
var google_geocoders_1 = require("./resources/google_geocoders");
|
93
|
+
Object.defineProperty(exports, "GoogleGeocoders", { enumerable: true, get: function () { return __importDefault(google_geocoders_1).default; } });
|
94
|
+
var imports_1 = require("./resources/imports");
|
95
|
+
Object.defineProperty(exports, "Imports", { enumerable: true, get: function () { return __importDefault(imports_1).default; } });
|
96
|
+
var in_stock_subscriptions_1 = require("./resources/in_stock_subscriptions");
|
97
|
+
Object.defineProperty(exports, "InStockSubscriptions", { enumerable: true, get: function () { return __importDefault(in_stock_subscriptions_1).default; } });
|
98
|
+
var inventory_models_1 = require("./resources/inventory_models");
|
99
|
+
Object.defineProperty(exports, "InventoryModels", { enumerable: true, get: function () { return __importDefault(inventory_models_1).default; } });
|
100
|
+
var inventory_return_locations_1 = require("./resources/inventory_return_locations");
|
101
|
+
Object.defineProperty(exports, "InventoryReturnLocations", { enumerable: true, get: function () { return __importDefault(inventory_return_locations_1).default; } });
|
102
|
+
var inventory_stock_locations_1 = require("./resources/inventory_stock_locations");
|
103
|
+
Object.defineProperty(exports, "InventoryStockLocations", { enumerable: true, get: function () { return __importDefault(inventory_stock_locations_1).default; } });
|
104
|
+
var line_item_options_1 = require("./resources/line_item_options");
|
105
|
+
Object.defineProperty(exports, "LineItemOptions", { enumerable: true, get: function () { return __importDefault(line_item_options_1).default; } });
|
106
|
+
var line_items_1 = require("./resources/line_items");
|
107
|
+
Object.defineProperty(exports, "LineItems", { enumerable: true, get: function () { return __importDefault(line_items_1).default; } });
|
108
|
+
var manual_gateways_1 = require("./resources/manual_gateways");
|
109
|
+
Object.defineProperty(exports, "ManualGateways", { enumerable: true, get: function () { return __importDefault(manual_gateways_1).default; } });
|
110
|
+
var manual_tax_calculators_1 = require("./resources/manual_tax_calculators");
|
111
|
+
Object.defineProperty(exports, "ManualTaxCalculators", { enumerable: true, get: function () { return __importDefault(manual_tax_calculators_1).default; } });
|
112
|
+
var markets_1 = require("./resources/markets");
|
113
|
+
Object.defineProperty(exports, "Markets", { enumerable: true, get: function () { return __importDefault(markets_1).default; } });
|
114
|
+
var merchants_1 = require("./resources/merchants");
|
115
|
+
Object.defineProperty(exports, "Merchants", { enumerable: true, get: function () { return __importDefault(merchants_1).default; } });
|
116
|
+
var order_amount_promotion_rules_1 = require("./resources/order_amount_promotion_rules");
|
117
|
+
Object.defineProperty(exports, "OrderAmountPromotionRules", { enumerable: true, get: function () { return __importDefault(order_amount_promotion_rules_1).default; } });
|
118
|
+
var order_copies_1 = require("./resources/order_copies");
|
119
|
+
Object.defineProperty(exports, "OrderCopies", { enumerable: true, get: function () { return __importDefault(order_copies_1).default; } });
|
120
|
+
var order_subscriptions_1 = require("./resources/order_subscriptions");
|
121
|
+
Object.defineProperty(exports, "OrderSubscriptions", { enumerable: true, get: function () { return __importDefault(order_subscriptions_1).default; } });
|
122
|
+
var order_validation_rules_1 = require("./resources/order_validation_rules");
|
123
|
+
Object.defineProperty(exports, "OrderValidationRules", { enumerable: true, get: function () { return __importDefault(order_validation_rules_1).default; } });
|
124
|
+
var orders_1 = require("./resources/orders");
|
125
|
+
Object.defineProperty(exports, "Orders", { enumerable: true, get: function () { return __importDefault(orders_1).default; } });
|
126
|
+
var organization_1 = require("./resources/organization");
|
127
|
+
Object.defineProperty(exports, "Organizations", { enumerable: true, get: function () { return __importDefault(organization_1).default; } });
|
128
|
+
var packages_1 = require("./resources/packages");
|
129
|
+
Object.defineProperty(exports, "Packages", { enumerable: true, get: function () { return __importDefault(packages_1).default; } });
|
130
|
+
var parcel_line_items_1 = require("./resources/parcel_line_items");
|
131
|
+
Object.defineProperty(exports, "ParcelLineItems", { enumerable: true, get: function () { return __importDefault(parcel_line_items_1).default; } });
|
132
|
+
var parcels_1 = require("./resources/parcels");
|
133
|
+
Object.defineProperty(exports, "Parcels", { enumerable: true, get: function () { return __importDefault(parcels_1).default; } });
|
134
|
+
var payment_gateways_1 = require("./resources/payment_gateways");
|
135
|
+
Object.defineProperty(exports, "PaymentGateways", { enumerable: true, get: function () { return __importDefault(payment_gateways_1).default; } });
|
136
|
+
var payment_methods_1 = require("./resources/payment_methods");
|
137
|
+
Object.defineProperty(exports, "PaymentMethods", { enumerable: true, get: function () { return __importDefault(payment_methods_1).default; } });
|
138
|
+
var paypal_gateways_1 = require("./resources/paypal_gateways");
|
139
|
+
Object.defineProperty(exports, "PaypalGateways", { enumerable: true, get: function () { return __importDefault(paypal_gateways_1).default; } });
|
140
|
+
var paypal_payments_1 = require("./resources/paypal_payments");
|
141
|
+
Object.defineProperty(exports, "PaypalPayments", { enumerable: true, get: function () { return __importDefault(paypal_payments_1).default; } });
|
142
|
+
var percentage_discount_promotions_1 = require("./resources/percentage_discount_promotions");
|
143
|
+
Object.defineProperty(exports, "PercentageDiscountPromotions", { enumerable: true, get: function () { return __importDefault(percentage_discount_promotions_1).default; } });
|
144
|
+
var price_lists_1 = require("./resources/price_lists");
|
145
|
+
Object.defineProperty(exports, "PriceLists", { enumerable: true, get: function () { return __importDefault(price_lists_1).default; } });
|
146
|
+
var prices_1 = require("./resources/prices");
|
147
|
+
Object.defineProperty(exports, "Prices", { enumerable: true, get: function () { return __importDefault(prices_1).default; } });
|
148
|
+
var promotion_rules_1 = require("./resources/promotion_rules");
|
149
|
+
Object.defineProperty(exports, "PromotionRules", { enumerable: true, get: function () { return __importDefault(promotion_rules_1).default; } });
|
150
|
+
var promotions_1 = require("./resources/promotions");
|
151
|
+
Object.defineProperty(exports, "Promotions", { enumerable: true, get: function () { return __importDefault(promotions_1).default; } });
|
152
|
+
var refunds_1 = require("./resources/refunds");
|
153
|
+
Object.defineProperty(exports, "Refunds", { enumerable: true, get: function () { return __importDefault(refunds_1).default; } });
|
154
|
+
var return_line_items_1 = require("./resources/return_line_items");
|
155
|
+
Object.defineProperty(exports, "ReturnLineItems", { enumerable: true, get: function () { return __importDefault(return_line_items_1).default; } });
|
156
|
+
var returns_1 = require("./resources/returns");
|
157
|
+
Object.defineProperty(exports, "Returns", { enumerable: true, get: function () { return __importDefault(returns_1).default; } });
|
158
|
+
var shipments_1 = require("./resources/shipments");
|
159
|
+
Object.defineProperty(exports, "Shipments", { enumerable: true, get: function () { return __importDefault(shipments_1).default; } });
|
160
|
+
var shipping_categories_1 = require("./resources/shipping_categories");
|
161
|
+
Object.defineProperty(exports, "ShippingCategories", { enumerable: true, get: function () { return __importDefault(shipping_categories_1).default; } });
|
162
|
+
var shipping_methods_1 = require("./resources/shipping_methods");
|
163
|
+
Object.defineProperty(exports, "ShippingMethods", { enumerable: true, get: function () { return __importDefault(shipping_methods_1).default; } });
|
164
|
+
var shipping_zones_1 = require("./resources/shipping_zones");
|
165
|
+
Object.defineProperty(exports, "ShippingZones", { enumerable: true, get: function () { return __importDefault(shipping_zones_1).default; } });
|
166
|
+
var sku_list_items_1 = require("./resources/sku_list_items");
|
167
|
+
Object.defineProperty(exports, "SkuListItems", { enumerable: true, get: function () { return __importDefault(sku_list_items_1).default; } });
|
168
|
+
var sku_list_promotion_rules_1 = require("./resources/sku_list_promotion_rules");
|
169
|
+
Object.defineProperty(exports, "SkuListPromotionRules", { enumerable: true, get: function () { return __importDefault(sku_list_promotion_rules_1).default; } });
|
170
|
+
var sku_lists_1 = require("./resources/sku_lists");
|
171
|
+
Object.defineProperty(exports, "SkuLists", { enumerable: true, get: function () { return __importDefault(sku_lists_1).default; } });
|
172
|
+
var sku_options_1 = require("./resources/sku_options");
|
173
|
+
Object.defineProperty(exports, "SkuOptions", { enumerable: true, get: function () { return __importDefault(sku_options_1).default; } });
|
174
|
+
var skus_1 = require("./resources/skus");
|
175
|
+
Object.defineProperty(exports, "Skus", { enumerable: true, get: function () { return __importDefault(skus_1).default; } });
|
176
|
+
var stock_items_1 = require("./resources/stock_items");
|
177
|
+
Object.defineProperty(exports, "StockItems", { enumerable: true, get: function () { return __importDefault(stock_items_1).default; } });
|
178
|
+
var stock_line_items_1 = require("./resources/stock_line_items");
|
179
|
+
Object.defineProperty(exports, "StockLineItems", { enumerable: true, get: function () { return __importDefault(stock_line_items_1).default; } });
|
180
|
+
var stock_locations_1 = require("./resources/stock_locations");
|
181
|
+
Object.defineProperty(exports, "StockLocations", { enumerable: true, get: function () { return __importDefault(stock_locations_1).default; } });
|
182
|
+
var stock_transfers_1 = require("./resources/stock_transfers");
|
183
|
+
Object.defineProperty(exports, "StockTransfers", { enumerable: true, get: function () { return __importDefault(stock_transfers_1).default; } });
|
184
|
+
var stripe_gateways_1 = require("./resources/stripe_gateways");
|
185
|
+
Object.defineProperty(exports, "StripeGateways", { enumerable: true, get: function () { return __importDefault(stripe_gateways_1).default; } });
|
186
|
+
var stripe_payments_1 = require("./resources/stripe_payments");
|
187
|
+
Object.defineProperty(exports, "StripePayments", { enumerable: true, get: function () { return __importDefault(stripe_payments_1).default; } });
|
188
|
+
var tax_calculators_1 = require("./resources/tax_calculators");
|
189
|
+
Object.defineProperty(exports, "TaxCalculators", { enumerable: true, get: function () { return __importDefault(tax_calculators_1).default; } });
|
190
|
+
var tax_categories_1 = require("./resources/tax_categories");
|
191
|
+
Object.defineProperty(exports, "TaxCategories", { enumerable: true, get: function () { return __importDefault(tax_categories_1).default; } });
|
192
|
+
var tax_rules_1 = require("./resources/tax_rules");
|
193
|
+
Object.defineProperty(exports, "TaxRules", { enumerable: true, get: function () { return __importDefault(tax_rules_1).default; } });
|
194
|
+
var taxjar_accounts_1 = require("./resources/taxjar_accounts");
|
195
|
+
Object.defineProperty(exports, "TaxjarAccounts", { enumerable: true, get: function () { return __importDefault(taxjar_accounts_1).default; } });
|
196
|
+
var transactions_1 = require("./resources/transactions");
|
197
|
+
Object.defineProperty(exports, "Transactions", { enumerable: true, get: function () { return __importDefault(transactions_1).default; } });
|
198
|
+
var voids_1 = require("./resources/voids");
|
199
|
+
Object.defineProperty(exports, "Voids", { enumerable: true, get: function () { return __importDefault(voids_1).default; } });
|
200
|
+
var webhooks_1 = require("./resources/webhooks");
|
201
|
+
Object.defineProperty(exports, "Webhooks", { enumerable: true, get: function () { return __importDefault(webhooks_1).default; } });
|
202
|
+
var wire_transfers_1 = require("./resources/wire_transfers");
|
203
|
+
Object.defineProperty(exports, "WireTransfers", { enumerable: true, get: function () { return __importDefault(wire_transfers_1).default; } });
|
204
|
+
// ##__API_RESOURCE_TYPES_STOP__##
|
205
|
+
exports.resourceList = [
|
206
|
+
// ##__API_RESOURCE_LIST_START__##
|
207
|
+
'addresses',
|
208
|
+
'adjustments',
|
209
|
+
'adyen_gateways',
|
210
|
+
'adyen_payments',
|
211
|
+
'application',
|
212
|
+
'attachments',
|
213
|
+
'authorizations',
|
214
|
+
'avalara_accounts',
|
215
|
+
'billing_info_validation_rules',
|
216
|
+
'bing_geocoders',
|
217
|
+
'braintree_gateways',
|
218
|
+
'braintree_payments',
|
219
|
+
'bundles',
|
220
|
+
'captures',
|
221
|
+
'carrier_accounts',
|
222
|
+
'checkout_com_gateways',
|
223
|
+
'checkout_com_payments',
|
224
|
+
'coupon_codes_promotion_rules',
|
225
|
+
'coupon_recipients',
|
226
|
+
'coupons',
|
227
|
+
'customer_addresses',
|
228
|
+
'customer_groups',
|
229
|
+
'customer_password_resets',
|
230
|
+
'customer_payment_sources',
|
231
|
+
'customer_subscriptions',
|
232
|
+
'customers',
|
233
|
+
'delivery_lead_times',
|
234
|
+
'event_callbacks',
|
235
|
+
'external_gateways',
|
236
|
+
'external_payments',
|
237
|
+
'external_promotions',
|
238
|
+
'external_tax_calculators',
|
239
|
+
'fixed_amount_promotions',
|
240
|
+
'fixed_price_promotions',
|
241
|
+
'free_gift_promotions',
|
242
|
+
'free_shipping_promotions',
|
243
|
+
'geocoders',
|
244
|
+
'gift_card_recipients',
|
245
|
+
'gift_cards',
|
246
|
+
'google_geocoders',
|
247
|
+
'imports',
|
248
|
+
'in_stock_subscriptions',
|
249
|
+
'inventory_models',
|
250
|
+
'inventory_return_locations',
|
251
|
+
'inventory_stock_locations',
|
252
|
+
'line_item_options',
|
253
|
+
'line_items',
|
254
|
+
'manual_gateways',
|
255
|
+
'manual_tax_calculators',
|
256
|
+
'markets',
|
257
|
+
'merchants',
|
258
|
+
'order_amount_promotion_rules',
|
259
|
+
'order_copies',
|
260
|
+
'order_subscriptions',
|
261
|
+
'order_validation_rules',
|
262
|
+
'orders',
|
263
|
+
'organization',
|
264
|
+
'packages',
|
265
|
+
'parcel_line_items',
|
266
|
+
'parcels',
|
267
|
+
'payment_gateways',
|
268
|
+
'payment_methods',
|
269
|
+
'paypal_gateways',
|
270
|
+
'paypal_payments',
|
271
|
+
'percentage_discount_promotions',
|
272
|
+
'price_lists',
|
273
|
+
'prices',
|
274
|
+
'promotion_rules',
|
275
|
+
'promotions',
|
276
|
+
'refunds',
|
277
|
+
'return_line_items',
|
278
|
+
'returns',
|
279
|
+
'shipments',
|
280
|
+
'shipping_categories',
|
281
|
+
'shipping_methods',
|
282
|
+
'shipping_zones',
|
283
|
+
'sku_list_items',
|
284
|
+
'sku_list_promotion_rules',
|
285
|
+
'sku_lists',
|
286
|
+
'sku_options',
|
287
|
+
'skus',
|
288
|
+
'stock_items',
|
289
|
+
'stock_line_items',
|
290
|
+
'stock_locations',
|
291
|
+
'stock_transfers',
|
292
|
+
'stripe_gateways',
|
293
|
+
'stripe_payments',
|
294
|
+
'tax_calculators',
|
295
|
+
'tax_categories',
|
296
|
+
'tax_rules',
|
297
|
+
'taxjar_accounts',
|
298
|
+
'transactions',
|
299
|
+
'voids',
|
300
|
+
'webhooks',
|
301
|
+
'wire_transfers'
|
302
|
+
// ##__API_RESOURCE_LIST_STOP__##
|
303
|
+
];
|
304
|
+
/*
|
305
|
+
type ResourceInfo = {
|
306
|
+
name: string;
|
307
|
+
type: string;
|
308
|
+
api: string;
|
309
|
+
}
|
310
|
+
|
311
|
+
|
312
|
+
export const resourceMap: { [res: string]: ResourceInfo } = {
|
313
|
+
// ##__API_RESOURCE_MAP_START__##
|
314
|
+
addresses: { name: 'address', type: 'addresses', api: 'addresses' },
|
315
|
+
adjustments: { name: 'adjustment', type: 'adjustments', api: 'adjustments' },
|
316
|
+
adyen_gateways: { name: 'adyen_gateway', type: 'adyen_gateways', api: 'adyen_gateways' },
|
317
|
+
adyen_payments: { name: 'adyen_payment', type: 'adyen_payments', api: 'adyen_payments' },
|
318
|
+
application: { name: 'application', type: 'application', api: 'application' },
|
319
|
+
attachments: { name: 'attachment', type: 'attachments', api: 'attachments' },
|
320
|
+
authorizations: { name: 'authorization', type: 'authorizations', api: 'authorizations' },
|
321
|
+
avalara_accounts: { name: 'avalara_account', type: 'avalara_accounts', api: 'avalara_accounts' },
|
322
|
+
billing_info_validation_rules: { name: 'billing_info_validation_rule', type: 'billing_info_validation_rules', api: 'billing_info_validation_rules' },
|
323
|
+
bing_geocoders: { name: 'bing_geocoder', type: 'bing_geocoders', api: 'bing_geocoders' },
|
324
|
+
braintree_gateways: { name: 'braintree_gateway', type: 'braintree_gateways', api: 'braintree_gateways' },
|
325
|
+
braintree_payments: { name: 'braintree_payment', type: 'braintree_payments', api: 'braintree_payments' },
|
326
|
+
bundles: { name: 'bundle', type: 'bundles', api: 'bundles' },
|
327
|
+
captures: { name: 'capture', type: 'captures', api: 'captures' },
|
328
|
+
carrier_accounts: { name: 'carrier_account', type: 'carrier_accounts', api: 'carrier_accounts' },
|
329
|
+
checkout_com_gateways: { name: 'checkout_com_gateway', type: 'checkout_com_gateways', api: 'checkout_com_gateways' },
|
330
|
+
checkout_com_payments: { name: 'checkout_com_payment', type: 'checkout_com_payments', api: 'checkout_com_payments' },
|
331
|
+
coupon_codes_promotion_rules: { name: 'coupon_codes_promotion_rule', type: 'coupon_codes_promotion_rules', api: 'coupon_codes_promotion_rules' },
|
332
|
+
coupons: { name: 'coupon', type: 'coupons', api: 'coupons' },
|
333
|
+
customer_addresses: { name: 'customer_address', type: 'customer_addresses', api: 'customer_addresses' },
|
334
|
+
customer_groups: { name: 'customer_group', type: 'customer_groups', api: 'customer_groups' },
|
335
|
+
customer_password_resets: { name: 'customer_password_reset', type: 'customer_password_resets', api: 'customer_password_resets' },
|
336
|
+
customer_payment_sources: { name: 'customer_payment_source', type: 'customer_payment_sources', api: 'customer_payment_sources' },
|
337
|
+
customer_subscriptions: { name: 'customer_subscription', type: 'customer_subscriptions', api: 'customer_subscriptions' },
|
338
|
+
customers: { name: 'customer', type: 'customers', api: 'customers' },
|
339
|
+
delivery_lead_times: { name: 'delivery_lead_time', type: 'delivery_lead_times', api: 'delivery_lead_times' },
|
340
|
+
external_gateways: { name: 'external_gateway', type: 'external_gateways', api: 'external_gateways' },
|
341
|
+
external_payments: { name: 'external_payment', type: 'external_payments', api: 'external_payments' },
|
342
|
+
external_promotions: { name: 'external_promotion', type: 'external_promotions', api: 'external_promotions' },
|
343
|
+
external_tax_calculators: { name: 'external_tax_calculator', type: 'external_tax_calculators', api: 'external_tax_calculators' },
|
344
|
+
fixed_amount_promotions: { name: 'fixed_amount_promotion', type: 'fixed_amount_promotions', api: 'fixed_amount_promotions' },
|
345
|
+
free_shipping_promotions: { name: 'free_shipping_promotion', type: 'free_shipping_promotions', api: 'free_shipping_promotions' },
|
346
|
+
geocoders: { name: 'geocoder', type: 'geocoders', api: 'geocoders' },
|
347
|
+
gift_card_recipients: { name: 'gift_card_recipient', type: 'gift_card_recipients', api: 'gift_card_recipients' },
|
348
|
+
gift_cards: { name: 'gift_card', type: 'gift_cards', api: 'gift_cards' },
|
349
|
+
google_geocoders: { name: 'google_geocoder', type: 'google_geocoders', api: 'google_geocoders' },
|
350
|
+
imports: { name: 'import', type: 'imports', api: 'imports' },
|
351
|
+
in_stock_subscriptions: { name: 'in_stock_subscription', type: 'in_stock_subscriptions', api: 'in_stock_subscriptions' },
|
352
|
+
inventory_models: { name: 'inventory_model', type: 'inventory_models', api: 'inventory_models' },
|
353
|
+
inventory_return_locations: { name: 'inventory_return_location', type: 'inventory_return_locations', api: 'inventory_return_locations' },
|
354
|
+
inventory_stock_locations: { name: 'inventory_stock_location', type: 'inventory_stock_locations', api: 'inventory_stock_locations' },
|
355
|
+
line_item_options: { name: 'line_item_option', type: 'line_item_options', api: 'line_item_options' },
|
356
|
+
line_items: { name: 'line_item', type: 'line_items', api: 'line_items' },
|
357
|
+
manual_gateways: { name: 'manual_gateway', type: 'manual_gateways', api: 'manual_gateways' },
|
358
|
+
manual_tax_calculators: { name: 'manual_tax_calculator', type: 'manual_tax_calculators', api: 'manual_tax_calculators' },
|
359
|
+
markets: { name: 'market', type: 'markets', api: 'markets' },
|
360
|
+
merchants: { name: 'merchant', type: 'merchants', api: 'merchants' },
|
361
|
+
order_amount_promotion_rules: { name: 'order_amount_promotion_rule', type: 'order_amount_promotion_rules', api: 'order_amount_promotion_rules' },
|
362
|
+
order_copies: { name: 'order_copy', type: 'order_copies', api: 'order_copies' },
|
363
|
+
order_subscriptions: { name: 'order_subscription', type: 'order_subscriptions', api: 'order_subscriptions' },
|
364
|
+
orders: { name: 'order', type: 'orders', api: 'orders' },
|
365
|
+
organization: { name: 'organization', type: 'organization', api: 'organization' },
|
366
|
+
packages: { name: 'package', type: 'packages', api: 'packages' },
|
367
|
+
parcel_line_items: { name: 'parcel_line_item', type: 'parcel_line_items', api: 'parcel_line_items' },
|
368
|
+
parcels: { name: 'parcel', type: 'parcels', api: 'parcels' },
|
369
|
+
payment_gateways: { name: 'payment_gateway', type: 'payment_gateways', api: 'payment_gateways' },
|
370
|
+
payment_methods: { name: 'payment_method', type: 'payment_methods', api: 'payment_methods' },
|
371
|
+
paypal_gateways: { name: 'paypal_gateway', type: 'paypal_gateways', api: 'paypal_gateways' },
|
372
|
+
paypal_payments: { name: 'paypal_payment', type: 'paypal_payments', api: 'paypal_payments' },
|
373
|
+
percentage_discount_promotions: { name: 'percentage_discount_promotion', type: 'percentage_discount_promotions', api: 'percentage_discount_promotions' },
|
374
|
+
price_lists: { name: 'price_list', type: 'price_lists', api: 'price_lists' },
|
375
|
+
prices: { name: 'price', type: 'prices', api: 'prices' },
|
376
|
+
promotion_rules: { name: 'promotion_rule', type: 'promotion_rules', api: 'promotion_rules' },
|
377
|
+
promotions: { name: 'promotion', type: 'promotions', api: 'promotions' },
|
378
|
+
refunds: { name: 'refund', type: 'refunds', api: 'refunds' },
|
379
|
+
return_line_items: { name: 'return_line_item', type: 'return_line_items', api: 'return_line_items' },
|
380
|
+
returns: { name: 'return', type: 'returns', api: 'returns' },
|
381
|
+
shipments: { name: 'shipment', type: 'shipments', api: 'shipments' },
|
382
|
+
shipping_categories: { name: 'shipping_category', type: 'shipping_categories', api: 'shipping_categories' },
|
383
|
+
shipping_methods: { name: 'shipping_method', type: 'shipping_methods', api: 'shipping_methods' },
|
384
|
+
shipping_zones: { name: 'shipping_zone', type: 'shipping_zones', api: 'shipping_zones' },
|
385
|
+
sku_list_items: { name: 'sku_list_item', type: 'sku_list_items', api: 'sku_list_items' },
|
386
|
+
sku_list_promotion_rules: { name: 'sku_list_promotion_rule', type: 'sku_list_promotion_rules', api: 'sku_list_promotion_rules' },
|
387
|
+
sku_lists: { name: 'sku_list', type: 'sku_lists', api: 'sku_lists' },
|
388
|
+
sku_options: { name: 'sku_option', type: 'sku_options', api: 'sku_options' },
|
389
|
+
skus: { name: 'sku', type: 'skus', api: 'skus' },
|
390
|
+
stock_items: { name: 'stock_item', type: 'stock_items', api: 'stock_items' },
|
391
|
+
stock_line_items: { name: 'stock_line_item', type: 'stock_line_items', api: 'stock_line_items' },
|
392
|
+
stock_locations: { name: 'stock_location', type: 'stock_locations', api: 'stock_locations' },
|
393
|
+
stock_transfers: { name: 'stock_transfer', type: 'stock_transfers', api: 'stock_transfers' },
|
394
|
+
stripe_gateways: { name: 'stripe_gateway', type: 'stripe_gateways', api: 'stripe_gateways' },
|
395
|
+
stripe_payments: { name: 'stripe_payment', type: 'stripe_payments', api: 'stripe_payments' },
|
396
|
+
tax_calculators: { name: 'tax_calculator', type: 'tax_calculators', api: 'tax_calculators' },
|
397
|
+
tax_categories: { name: 'tax_category', type: 'tax_categories', api: 'tax_categories' },
|
398
|
+
tax_rules: { name: 'tax_rule', type: 'tax_rules', api: 'tax_rules' },
|
399
|
+
taxjar_accounts: { name: 'taxjar_account', type: 'taxjar_accounts', api: 'taxjar_accounts' },
|
400
|
+
transactions: { name: 'transaction', type: 'transactions', api: 'transactions' },
|
401
|
+
voids: { name: 'void', type: 'voids', api: 'voids' },
|
402
|
+
webhooks: { name: 'webhook', type: 'webhooks', api: 'webhooks' },
|
403
|
+
wire_transfers: { name: 'wire_transfer', type: 'wire_transfers', api: 'wire_transfers' }
|
404
|
+
// ##__API_RESOURCE_MAP_STOP__##
|
405
|
+
} as const
|
406
|
+
*/
|
@@ -1,30 +1,30 @@
|
|
1
|
-
import { Method } from 'axios';
|
2
|
-
import { DocWithData as JSONApiDocument, ResourceObject as JSONApiResource } from 'jsonapi-typescript';
|
3
|
-
import type { InterceptorManager } from './interceptor';
|
4
|
-
declare type RequestConfig = {
|
5
|
-
timeout?: number;
|
6
|
-
params?: {
|
7
|
-
[key: string]: string | number | boolean;
|
8
|
-
};
|
9
|
-
};
|
10
|
-
declare type ApiClientInitConfig = {
|
11
|
-
organization: string;
|
12
|
-
domain?: string;
|
13
|
-
accessToken: string;
|
14
|
-
} & RequestConfig;
|
15
|
-
declare type ApiClientConfig = {
|
16
|
-
organization?: string;
|
17
|
-
domain?: string;
|
18
|
-
accessToken?: string;
|
19
|
-
} & RequestConfig;
|
20
|
-
declare class ApiClient {
|
21
|
-
#private;
|
22
|
-
static create(options: ApiClientInitConfig): ApiClient;
|
23
|
-
baseUrl: string;
|
24
|
-
interceptors: InterceptorManager;
|
25
|
-
private constructor();
|
26
|
-
config(config: ApiClientConfig): void;
|
27
|
-
request(method: Method, path: string, body?: JSONApiResource, options?: ApiClientConfig): Promise<JSONApiDocument>;
|
28
|
-
}
|
29
|
-
export default ApiClient;
|
30
|
-
export { ApiClientInitConfig, ApiClientConfig, RequestConfig };
|
1
|
+
import { Method } from 'axios';
|
2
|
+
import { DocWithData as JSONApiDocument, ResourceObject as JSONApiResource } from 'jsonapi-typescript';
|
3
|
+
import type { InterceptorManager } from './interceptor';
|
4
|
+
declare type RequestConfig = {
|
5
|
+
timeout?: number;
|
6
|
+
params?: {
|
7
|
+
[key: string]: string | number | boolean;
|
8
|
+
};
|
9
|
+
};
|
10
|
+
declare type ApiClientInitConfig = {
|
11
|
+
organization: string;
|
12
|
+
domain?: string;
|
13
|
+
accessToken: string;
|
14
|
+
} & RequestConfig;
|
15
|
+
declare type ApiClientConfig = {
|
16
|
+
organization?: string;
|
17
|
+
domain?: string;
|
18
|
+
accessToken?: string;
|
19
|
+
} & RequestConfig;
|
20
|
+
declare class ApiClient {
|
21
|
+
#private;
|
22
|
+
static create(options: ApiClientInitConfig): ApiClient;
|
23
|
+
baseUrl: string;
|
24
|
+
interceptors: InterceptorManager;
|
25
|
+
private constructor();
|
26
|
+
config(config: ApiClientConfig): void;
|
27
|
+
request(method: Method, path: string, body?: JSONApiResource, options?: ApiClientConfig): Promise<JSONApiDocument>;
|
28
|
+
}
|
29
|
+
export default ApiClient;
|
30
|
+
export { ApiClientInitConfig, ApiClientConfig, RequestConfig };
|
@@ -0,0 +1,101 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
7
|
+
};
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
12
|
+
};
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
|
+
};
|
16
|
+
var _ApiClient_accessToken, _ApiClient_client;
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
19
|
+
const axios_1 = __importDefault(require("axios"));
|
20
|
+
const error_1 = require("./error");
|
21
|
+
const baseURL = (organization, domain) => {
|
22
|
+
return `https://${organization.toLowerCase()}.${domain ? domain : 'commercelayer.io'}/api`;
|
23
|
+
};
|
24
|
+
const handleError = (error) => {
|
25
|
+
let sdkError = new error_1.SdkError({ message: error.message, type: error_1.ErrorType.GENERIC });
|
26
|
+
if (axios_1.default.isAxiosError(error)) {
|
27
|
+
if (error.response) {
|
28
|
+
// The request was made and the server responded with a status code that falls out of the range of 2xx
|
29
|
+
const apiError = new error_1.ApiError(sdkError);
|
30
|
+
apiError.type = error_1.ErrorType.RESPONSE;
|
31
|
+
apiError.status = error.response.status;
|
32
|
+
apiError.code = String(apiError.status);
|
33
|
+
apiError.errors = error.response.data.errors;
|
34
|
+
sdkError = apiError;
|
35
|
+
}
|
36
|
+
else if (error.request) {
|
37
|
+
// The request was made but no response was received
|
38
|
+
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of http.ClientRequest in node.js
|
39
|
+
sdkError.type = error_1.ErrorType.REQUEST;
|
40
|
+
sdkError.request = error.request;
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
// Something happened in setting up the request that triggered an Error
|
44
|
+
sdkError.type = error_1.ErrorType.CLIENT;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
else if (axios_1.default.isCancel(error))
|
48
|
+
sdkError.type = error_1.ErrorType.CANCEL;
|
49
|
+
else
|
50
|
+
sdkError.source = error;
|
51
|
+
throw sdkError;
|
52
|
+
};
|
53
|
+
class ApiClient {
|
54
|
+
constructor(options) {
|
55
|
+
_ApiClient_accessToken.set(this, void 0);
|
56
|
+
_ApiClient_client.set(this, void 0);
|
57
|
+
this.baseUrl = baseURL(options.organization, options.domain);
|
58
|
+
__classPrivateFieldSet(this, _ApiClient_accessToken, options.accessToken, "f");
|
59
|
+
const axiosConfig = {
|
60
|
+
timeout: options.timeout || 3000
|
61
|
+
};
|
62
|
+
__classPrivateFieldSet(this, _ApiClient_client, axios_1.default.create(Object.assign({ baseURL: this.baseUrl, timeout: 3000, headers: {
|
63
|
+
'Accept': 'application/vnd.api+json',
|
64
|
+
'Content-Type': 'application/vnd.api+json',
|
65
|
+
'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f"),
|
66
|
+
} }, axiosConfig)), "f");
|
67
|
+
this.interceptors = __classPrivateFieldGet(this, _ApiClient_client, "f").interceptors;
|
68
|
+
}
|
69
|
+
static create(options) {
|
70
|
+
if (!(options === null || options === void 0 ? void 0 : options.organization))
|
71
|
+
throw new Error("Undefined 'organization' parameter");
|
72
|
+
if (!(options === null || options === void 0 ? void 0 : options.accessToken))
|
73
|
+
throw new Error("Undefined 'accessToken' parameter");
|
74
|
+
return new ApiClient(options);
|
75
|
+
}
|
76
|
+
config(config) {
|
77
|
+
const def = __classPrivateFieldGet(this, _ApiClient_client, "f").defaults;
|
78
|
+
// Axios config
|
79
|
+
if (config.timeout)
|
80
|
+
def.timeout = config.timeout;
|
81
|
+
// API Client config
|
82
|
+
if (config.organization)
|
83
|
+
this.baseUrl = baseURL(config.organization, config.domain);
|
84
|
+
if (config.accessToken)
|
85
|
+
__classPrivateFieldSet(this, _ApiClient_accessToken, config.accessToken, "f");
|
86
|
+
}
|
87
|
+
async request(method, path, body, options) {
|
88
|
+
const data = body ? { data: body } : undefined;
|
89
|
+
const url = path;
|
90
|
+
// Runtime request parameters
|
91
|
+
const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
|
92
|
+
const headers = (options === null || options === void 0 ? void 0 : options.accessToken) ? { 'Authorization': 'Bearer ' + options.accessToken } : undefined;
|
93
|
+
// const start = Date.now()
|
94
|
+
return __classPrivateFieldGet(this, _ApiClient_client, "f").request(Object.assign({ method, baseURL: baseUrl, url, data, headers }, options))
|
95
|
+
.then(response => response.data)
|
96
|
+
.catch(error => handleError(error));
|
97
|
+
// .finally(() => console.log(`<<-- ${method} ${path} ${Date.now() - start}`))
|
98
|
+
}
|
99
|
+
}
|
100
|
+
_ApiClient_accessToken = new WeakMap(), _ApiClient_client = new WeakMap();
|
101
|
+
exports.default = ApiClient;
|