@commercelayer/sdk 2.3.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 -23
- 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 -5
- 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 -17132
- 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 -17126
- package/lib/sdk.esm.js.map +0 -1
package/lib/esm/api.js
ADDED
@@ -0,0 +1,304 @@
|
|
1
|
+
// ##__API_RESOURCES_START__##
|
2
|
+
// ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
|
3
|
+
/**
|
4
|
+
* ©2021 Commerce Layer Inc.
|
5
|
+
* Source code generated automatically by SDK codegen from OpenAPI schema 2.7.3
|
6
|
+
**/
|
7
|
+
export { default as Addresses } from './resources/addresses';
|
8
|
+
export { default as Adjustments } from './resources/adjustments';
|
9
|
+
export { default as AdyenGateways } from './resources/adyen_gateways';
|
10
|
+
export { default as AdyenPayments } from './resources/adyen_payments';
|
11
|
+
export { default as Applications } from './resources/application';
|
12
|
+
export { default as Attachments } from './resources/attachments';
|
13
|
+
export { default as Authorizations } from './resources/authorizations';
|
14
|
+
export { default as AvalaraAccounts } from './resources/avalara_accounts';
|
15
|
+
export { default as BillingInfoValidationRules } from './resources/billing_info_validation_rules';
|
16
|
+
export { default as BingGeocoders } from './resources/bing_geocoders';
|
17
|
+
export { default as BraintreeGateways } from './resources/braintree_gateways';
|
18
|
+
export { default as BraintreePayments } from './resources/braintree_payments';
|
19
|
+
export { default as Bundles } from './resources/bundles';
|
20
|
+
export { default as Captures } from './resources/captures';
|
21
|
+
export { default as CarrierAccounts } from './resources/carrier_accounts';
|
22
|
+
export { default as CheckoutComGateways } from './resources/checkout_com_gateways';
|
23
|
+
export { default as CheckoutComPayments } from './resources/checkout_com_payments';
|
24
|
+
export { default as CouponCodesPromotionRules } from './resources/coupon_codes_promotion_rules';
|
25
|
+
export { default as CouponRecipients } from './resources/coupon_recipients';
|
26
|
+
export { default as Coupons } from './resources/coupons';
|
27
|
+
export { default as CustomerAddresses } from './resources/customer_addresses';
|
28
|
+
export { default as CustomerGroups } from './resources/customer_groups';
|
29
|
+
export { default as CustomerPasswordResets } from './resources/customer_password_resets';
|
30
|
+
export { default as CustomerPaymentSources } from './resources/customer_payment_sources';
|
31
|
+
export { default as CustomerSubscriptions } from './resources/customer_subscriptions';
|
32
|
+
export { default as Customers } from './resources/customers';
|
33
|
+
export { default as DeliveryLeadTimes } from './resources/delivery_lead_times';
|
34
|
+
export { default as EventCallbacks } from './resources/event_callbacks';
|
35
|
+
export { default as ExternalGateways } from './resources/external_gateways';
|
36
|
+
export { default as ExternalPayments } from './resources/external_payments';
|
37
|
+
export { default as ExternalPromotions } from './resources/external_promotions';
|
38
|
+
export { default as ExternalTaxCalculators } from './resources/external_tax_calculators';
|
39
|
+
export { default as FixedAmountPromotions } from './resources/fixed_amount_promotions';
|
40
|
+
export { default as FixedPricePromotions } from './resources/fixed_price_promotions';
|
41
|
+
export { default as FreeGiftPromotions } from './resources/free_gift_promotions';
|
42
|
+
export { default as FreeShippingPromotions } from './resources/free_shipping_promotions';
|
43
|
+
export { default as Geocoders } from './resources/geocoders';
|
44
|
+
export { default as GiftCardRecipients } from './resources/gift_card_recipients';
|
45
|
+
export { default as GiftCards } from './resources/gift_cards';
|
46
|
+
export { default as GoogleGeocoders } from './resources/google_geocoders';
|
47
|
+
export { default as Imports } from './resources/imports';
|
48
|
+
export { default as InStockSubscriptions } from './resources/in_stock_subscriptions';
|
49
|
+
export { default as InventoryModels } from './resources/inventory_models';
|
50
|
+
export { default as InventoryReturnLocations } from './resources/inventory_return_locations';
|
51
|
+
export { default as InventoryStockLocations } from './resources/inventory_stock_locations';
|
52
|
+
export { default as LineItemOptions } from './resources/line_item_options';
|
53
|
+
export { default as LineItems } from './resources/line_items';
|
54
|
+
export { default as ManualGateways } from './resources/manual_gateways';
|
55
|
+
export { default as ManualTaxCalculators } from './resources/manual_tax_calculators';
|
56
|
+
export { default as Markets } from './resources/markets';
|
57
|
+
export { default as Merchants } from './resources/merchants';
|
58
|
+
export { default as OrderAmountPromotionRules } from './resources/order_amount_promotion_rules';
|
59
|
+
export { default as OrderCopies } from './resources/order_copies';
|
60
|
+
export { default as OrderSubscriptions } from './resources/order_subscriptions';
|
61
|
+
export { default as OrderValidationRules } from './resources/order_validation_rules';
|
62
|
+
export { default as Orders } from './resources/orders';
|
63
|
+
export { default as Organizations } from './resources/organization';
|
64
|
+
export { default as Packages } from './resources/packages';
|
65
|
+
export { default as ParcelLineItems } from './resources/parcel_line_items';
|
66
|
+
export { default as Parcels } from './resources/parcels';
|
67
|
+
export { default as PaymentGateways } from './resources/payment_gateways';
|
68
|
+
export { default as PaymentMethods } from './resources/payment_methods';
|
69
|
+
export { default as PaypalGateways } from './resources/paypal_gateways';
|
70
|
+
export { default as PaypalPayments } from './resources/paypal_payments';
|
71
|
+
export { default as PercentageDiscountPromotions } from './resources/percentage_discount_promotions';
|
72
|
+
export { default as PriceLists } from './resources/price_lists';
|
73
|
+
export { default as Prices } from './resources/prices';
|
74
|
+
export { default as PromotionRules } from './resources/promotion_rules';
|
75
|
+
export { default as Promotions } from './resources/promotions';
|
76
|
+
export { default as Refunds } from './resources/refunds';
|
77
|
+
export { default as ReturnLineItems } from './resources/return_line_items';
|
78
|
+
export { default as Returns } from './resources/returns';
|
79
|
+
export { default as Shipments } from './resources/shipments';
|
80
|
+
export { default as ShippingCategories } from './resources/shipping_categories';
|
81
|
+
export { default as ShippingMethods } from './resources/shipping_methods';
|
82
|
+
export { default as ShippingZones } from './resources/shipping_zones';
|
83
|
+
export { default as SkuListItems } from './resources/sku_list_items';
|
84
|
+
export { default as SkuListPromotionRules } from './resources/sku_list_promotion_rules';
|
85
|
+
export { default as SkuLists } from './resources/sku_lists';
|
86
|
+
export { default as SkuOptions } from './resources/sku_options';
|
87
|
+
export { default as Skus } from './resources/skus';
|
88
|
+
export { default as StockItems } from './resources/stock_items';
|
89
|
+
export { default as StockLineItems } from './resources/stock_line_items';
|
90
|
+
export { default as StockLocations } from './resources/stock_locations';
|
91
|
+
export { default as StockTransfers } from './resources/stock_transfers';
|
92
|
+
export { default as StripeGateways } from './resources/stripe_gateways';
|
93
|
+
export { default as StripePayments } from './resources/stripe_payments';
|
94
|
+
export { default as TaxCalculators } from './resources/tax_calculators';
|
95
|
+
export { default as TaxCategories } from './resources/tax_categories';
|
96
|
+
export { default as TaxRules } from './resources/tax_rules';
|
97
|
+
export { default as TaxjarAccounts } from './resources/taxjar_accounts';
|
98
|
+
export { default as Transactions } from './resources/transactions';
|
99
|
+
export { default as Voids } from './resources/voids';
|
100
|
+
export { default as Webhooks } from './resources/webhooks';
|
101
|
+
export { default as WireTransfers } from './resources/wire_transfers';
|
102
|
+
// ##__API_RESOURCE_TYPES_STOP__##
|
103
|
+
export const resourceList = [
|
104
|
+
// ##__API_RESOURCE_LIST_START__##
|
105
|
+
'addresses',
|
106
|
+
'adjustments',
|
107
|
+
'adyen_gateways',
|
108
|
+
'adyen_payments',
|
109
|
+
'application',
|
110
|
+
'attachments',
|
111
|
+
'authorizations',
|
112
|
+
'avalara_accounts',
|
113
|
+
'billing_info_validation_rules',
|
114
|
+
'bing_geocoders',
|
115
|
+
'braintree_gateways',
|
116
|
+
'braintree_payments',
|
117
|
+
'bundles',
|
118
|
+
'captures',
|
119
|
+
'carrier_accounts',
|
120
|
+
'checkout_com_gateways',
|
121
|
+
'checkout_com_payments',
|
122
|
+
'coupon_codes_promotion_rules',
|
123
|
+
'coupon_recipients',
|
124
|
+
'coupons',
|
125
|
+
'customer_addresses',
|
126
|
+
'customer_groups',
|
127
|
+
'customer_password_resets',
|
128
|
+
'customer_payment_sources',
|
129
|
+
'customer_subscriptions',
|
130
|
+
'customers',
|
131
|
+
'delivery_lead_times',
|
132
|
+
'event_callbacks',
|
133
|
+
'external_gateways',
|
134
|
+
'external_payments',
|
135
|
+
'external_promotions',
|
136
|
+
'external_tax_calculators',
|
137
|
+
'fixed_amount_promotions',
|
138
|
+
'fixed_price_promotions',
|
139
|
+
'free_gift_promotions',
|
140
|
+
'free_shipping_promotions',
|
141
|
+
'geocoders',
|
142
|
+
'gift_card_recipients',
|
143
|
+
'gift_cards',
|
144
|
+
'google_geocoders',
|
145
|
+
'imports',
|
146
|
+
'in_stock_subscriptions',
|
147
|
+
'inventory_models',
|
148
|
+
'inventory_return_locations',
|
149
|
+
'inventory_stock_locations',
|
150
|
+
'line_item_options',
|
151
|
+
'line_items',
|
152
|
+
'manual_gateways',
|
153
|
+
'manual_tax_calculators',
|
154
|
+
'markets',
|
155
|
+
'merchants',
|
156
|
+
'order_amount_promotion_rules',
|
157
|
+
'order_copies',
|
158
|
+
'order_subscriptions',
|
159
|
+
'order_validation_rules',
|
160
|
+
'orders',
|
161
|
+
'organization',
|
162
|
+
'packages',
|
163
|
+
'parcel_line_items',
|
164
|
+
'parcels',
|
165
|
+
'payment_gateways',
|
166
|
+
'payment_methods',
|
167
|
+
'paypal_gateways',
|
168
|
+
'paypal_payments',
|
169
|
+
'percentage_discount_promotions',
|
170
|
+
'price_lists',
|
171
|
+
'prices',
|
172
|
+
'promotion_rules',
|
173
|
+
'promotions',
|
174
|
+
'refunds',
|
175
|
+
'return_line_items',
|
176
|
+
'returns',
|
177
|
+
'shipments',
|
178
|
+
'shipping_categories',
|
179
|
+
'shipping_methods',
|
180
|
+
'shipping_zones',
|
181
|
+
'sku_list_items',
|
182
|
+
'sku_list_promotion_rules',
|
183
|
+
'sku_lists',
|
184
|
+
'sku_options',
|
185
|
+
'skus',
|
186
|
+
'stock_items',
|
187
|
+
'stock_line_items',
|
188
|
+
'stock_locations',
|
189
|
+
'stock_transfers',
|
190
|
+
'stripe_gateways',
|
191
|
+
'stripe_payments',
|
192
|
+
'tax_calculators',
|
193
|
+
'tax_categories',
|
194
|
+
'tax_rules',
|
195
|
+
'taxjar_accounts',
|
196
|
+
'transactions',
|
197
|
+
'voids',
|
198
|
+
'webhooks',
|
199
|
+
'wire_transfers'
|
200
|
+
// ##__API_RESOURCE_LIST_STOP__##
|
201
|
+
];
|
202
|
+
/*
|
203
|
+
type ResourceInfo = {
|
204
|
+
name: string;
|
205
|
+
type: string;
|
206
|
+
api: string;
|
207
|
+
}
|
208
|
+
|
209
|
+
|
210
|
+
export const resourceMap: { [res: string]: ResourceInfo } = {
|
211
|
+
// ##__API_RESOURCE_MAP_START__##
|
212
|
+
addresses: { name: 'address', type: 'addresses', api: 'addresses' },
|
213
|
+
adjustments: { name: 'adjustment', type: 'adjustments', api: 'adjustments' },
|
214
|
+
adyen_gateways: { name: 'adyen_gateway', type: 'adyen_gateways', api: 'adyen_gateways' },
|
215
|
+
adyen_payments: { name: 'adyen_payment', type: 'adyen_payments', api: 'adyen_payments' },
|
216
|
+
application: { name: 'application', type: 'application', api: 'application' },
|
217
|
+
attachments: { name: 'attachment', type: 'attachments', api: 'attachments' },
|
218
|
+
authorizations: { name: 'authorization', type: 'authorizations', api: 'authorizations' },
|
219
|
+
avalara_accounts: { name: 'avalara_account', type: 'avalara_accounts', api: 'avalara_accounts' },
|
220
|
+
billing_info_validation_rules: { name: 'billing_info_validation_rule', type: 'billing_info_validation_rules', api: 'billing_info_validation_rules' },
|
221
|
+
bing_geocoders: { name: 'bing_geocoder', type: 'bing_geocoders', api: 'bing_geocoders' },
|
222
|
+
braintree_gateways: { name: 'braintree_gateway', type: 'braintree_gateways', api: 'braintree_gateways' },
|
223
|
+
braintree_payments: { name: 'braintree_payment', type: 'braintree_payments', api: 'braintree_payments' },
|
224
|
+
bundles: { name: 'bundle', type: 'bundles', api: 'bundles' },
|
225
|
+
captures: { name: 'capture', type: 'captures', api: 'captures' },
|
226
|
+
carrier_accounts: { name: 'carrier_account', type: 'carrier_accounts', api: 'carrier_accounts' },
|
227
|
+
checkout_com_gateways: { name: 'checkout_com_gateway', type: 'checkout_com_gateways', api: 'checkout_com_gateways' },
|
228
|
+
checkout_com_payments: { name: 'checkout_com_payment', type: 'checkout_com_payments', api: 'checkout_com_payments' },
|
229
|
+
coupon_codes_promotion_rules: { name: 'coupon_codes_promotion_rule', type: 'coupon_codes_promotion_rules', api: 'coupon_codes_promotion_rules' },
|
230
|
+
coupons: { name: 'coupon', type: 'coupons', api: 'coupons' },
|
231
|
+
customer_addresses: { name: 'customer_address', type: 'customer_addresses', api: 'customer_addresses' },
|
232
|
+
customer_groups: { name: 'customer_group', type: 'customer_groups', api: 'customer_groups' },
|
233
|
+
customer_password_resets: { name: 'customer_password_reset', type: 'customer_password_resets', api: 'customer_password_resets' },
|
234
|
+
customer_payment_sources: { name: 'customer_payment_source', type: 'customer_payment_sources', api: 'customer_payment_sources' },
|
235
|
+
customer_subscriptions: { name: 'customer_subscription', type: 'customer_subscriptions', api: 'customer_subscriptions' },
|
236
|
+
customers: { name: 'customer', type: 'customers', api: 'customers' },
|
237
|
+
delivery_lead_times: { name: 'delivery_lead_time', type: 'delivery_lead_times', api: 'delivery_lead_times' },
|
238
|
+
external_gateways: { name: 'external_gateway', type: 'external_gateways', api: 'external_gateways' },
|
239
|
+
external_payments: { name: 'external_payment', type: 'external_payments', api: 'external_payments' },
|
240
|
+
external_promotions: { name: 'external_promotion', type: 'external_promotions', api: 'external_promotions' },
|
241
|
+
external_tax_calculators: { name: 'external_tax_calculator', type: 'external_tax_calculators', api: 'external_tax_calculators' },
|
242
|
+
fixed_amount_promotions: { name: 'fixed_amount_promotion', type: 'fixed_amount_promotions', api: 'fixed_amount_promotions' },
|
243
|
+
free_shipping_promotions: { name: 'free_shipping_promotion', type: 'free_shipping_promotions', api: 'free_shipping_promotions' },
|
244
|
+
geocoders: { name: 'geocoder', type: 'geocoders', api: 'geocoders' },
|
245
|
+
gift_card_recipients: { name: 'gift_card_recipient', type: 'gift_card_recipients', api: 'gift_card_recipients' },
|
246
|
+
gift_cards: { name: 'gift_card', type: 'gift_cards', api: 'gift_cards' },
|
247
|
+
google_geocoders: { name: 'google_geocoder', type: 'google_geocoders', api: 'google_geocoders' },
|
248
|
+
imports: { name: 'import', type: 'imports', api: 'imports' },
|
249
|
+
in_stock_subscriptions: { name: 'in_stock_subscription', type: 'in_stock_subscriptions', api: 'in_stock_subscriptions' },
|
250
|
+
inventory_models: { name: 'inventory_model', type: 'inventory_models', api: 'inventory_models' },
|
251
|
+
inventory_return_locations: { name: 'inventory_return_location', type: 'inventory_return_locations', api: 'inventory_return_locations' },
|
252
|
+
inventory_stock_locations: { name: 'inventory_stock_location', type: 'inventory_stock_locations', api: 'inventory_stock_locations' },
|
253
|
+
line_item_options: { name: 'line_item_option', type: 'line_item_options', api: 'line_item_options' },
|
254
|
+
line_items: { name: 'line_item', type: 'line_items', api: 'line_items' },
|
255
|
+
manual_gateways: { name: 'manual_gateway', type: 'manual_gateways', api: 'manual_gateways' },
|
256
|
+
manual_tax_calculators: { name: 'manual_tax_calculator', type: 'manual_tax_calculators', api: 'manual_tax_calculators' },
|
257
|
+
markets: { name: 'market', type: 'markets', api: 'markets' },
|
258
|
+
merchants: { name: 'merchant', type: 'merchants', api: 'merchants' },
|
259
|
+
order_amount_promotion_rules: { name: 'order_amount_promotion_rule', type: 'order_amount_promotion_rules', api: 'order_amount_promotion_rules' },
|
260
|
+
order_copies: { name: 'order_copy', type: 'order_copies', api: 'order_copies' },
|
261
|
+
order_subscriptions: { name: 'order_subscription', type: 'order_subscriptions', api: 'order_subscriptions' },
|
262
|
+
orders: { name: 'order', type: 'orders', api: 'orders' },
|
263
|
+
organization: { name: 'organization', type: 'organization', api: 'organization' },
|
264
|
+
packages: { name: 'package', type: 'packages', api: 'packages' },
|
265
|
+
parcel_line_items: { name: 'parcel_line_item', type: 'parcel_line_items', api: 'parcel_line_items' },
|
266
|
+
parcels: { name: 'parcel', type: 'parcels', api: 'parcels' },
|
267
|
+
payment_gateways: { name: 'payment_gateway', type: 'payment_gateways', api: 'payment_gateways' },
|
268
|
+
payment_methods: { name: 'payment_method', type: 'payment_methods', api: 'payment_methods' },
|
269
|
+
paypal_gateways: { name: 'paypal_gateway', type: 'paypal_gateways', api: 'paypal_gateways' },
|
270
|
+
paypal_payments: { name: 'paypal_payment', type: 'paypal_payments', api: 'paypal_payments' },
|
271
|
+
percentage_discount_promotions: { name: 'percentage_discount_promotion', type: 'percentage_discount_promotions', api: 'percentage_discount_promotions' },
|
272
|
+
price_lists: { name: 'price_list', type: 'price_lists', api: 'price_lists' },
|
273
|
+
prices: { name: 'price', type: 'prices', api: 'prices' },
|
274
|
+
promotion_rules: { name: 'promotion_rule', type: 'promotion_rules', api: 'promotion_rules' },
|
275
|
+
promotions: { name: 'promotion', type: 'promotions', api: 'promotions' },
|
276
|
+
refunds: { name: 'refund', type: 'refunds', api: 'refunds' },
|
277
|
+
return_line_items: { name: 'return_line_item', type: 'return_line_items', api: 'return_line_items' },
|
278
|
+
returns: { name: 'return', type: 'returns', api: 'returns' },
|
279
|
+
shipments: { name: 'shipment', type: 'shipments', api: 'shipments' },
|
280
|
+
shipping_categories: { name: 'shipping_category', type: 'shipping_categories', api: 'shipping_categories' },
|
281
|
+
shipping_methods: { name: 'shipping_method', type: 'shipping_methods', api: 'shipping_methods' },
|
282
|
+
shipping_zones: { name: 'shipping_zone', type: 'shipping_zones', api: 'shipping_zones' },
|
283
|
+
sku_list_items: { name: 'sku_list_item', type: 'sku_list_items', api: 'sku_list_items' },
|
284
|
+
sku_list_promotion_rules: { name: 'sku_list_promotion_rule', type: 'sku_list_promotion_rules', api: 'sku_list_promotion_rules' },
|
285
|
+
sku_lists: { name: 'sku_list', type: 'sku_lists', api: 'sku_lists' },
|
286
|
+
sku_options: { name: 'sku_option', type: 'sku_options', api: 'sku_options' },
|
287
|
+
skus: { name: 'sku', type: 'skus', api: 'skus' },
|
288
|
+
stock_items: { name: 'stock_item', type: 'stock_items', api: 'stock_items' },
|
289
|
+
stock_line_items: { name: 'stock_line_item', type: 'stock_line_items', api: 'stock_line_items' },
|
290
|
+
stock_locations: { name: 'stock_location', type: 'stock_locations', api: 'stock_locations' },
|
291
|
+
stock_transfers: { name: 'stock_transfer', type: 'stock_transfers', api: 'stock_transfers' },
|
292
|
+
stripe_gateways: { name: 'stripe_gateway', type: 'stripe_gateways', api: 'stripe_gateways' },
|
293
|
+
stripe_payments: { name: 'stripe_payment', type: 'stripe_payments', api: 'stripe_payments' },
|
294
|
+
tax_calculators: { name: 'tax_calculator', type: 'tax_calculators', api: 'tax_calculators' },
|
295
|
+
tax_categories: { name: 'tax_category', type: 'tax_categories', api: 'tax_categories' },
|
296
|
+
tax_rules: { name: 'tax_rule', type: 'tax_rules', api: 'tax_rules' },
|
297
|
+
taxjar_accounts: { name: 'taxjar_account', type: 'taxjar_accounts', api: 'taxjar_accounts' },
|
298
|
+
transactions: { name: 'transaction', type: 'transactions', api: 'transactions' },
|
299
|
+
voids: { name: 'void', type: 'voids', api: 'voids' },
|
300
|
+
webhooks: { name: 'webhook', type: 'webhooks', api: 'webhooks' },
|
301
|
+
wire_transfers: { name: 'wire_transfer', type: 'wire_transfers', api: 'wire_transfers' }
|
302
|
+
// ##__API_RESOURCE_MAP_STOP__##
|
303
|
+
} as const
|
304
|
+
*/
|
@@ -0,0 +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 };
|
@@ -0,0 +1,96 @@
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
4
|
+
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");
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
6
|
+
};
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9
|
+
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");
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
11
|
+
};
|
12
|
+
var _ApiClient_accessToken, _ApiClient_client;
|
13
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
14
|
+
import axios from 'axios';
|
15
|
+
import { SdkError, ApiError, ErrorType } from './error';
|
16
|
+
const baseURL = (organization, domain) => {
|
17
|
+
return `https://${organization.toLowerCase()}.${domain ? domain : 'commercelayer.io'}/api`;
|
18
|
+
};
|
19
|
+
const handleError = (error) => {
|
20
|
+
let sdkError = new SdkError({ message: error.message, type: ErrorType.GENERIC });
|
21
|
+
if (axios.isAxiosError(error)) {
|
22
|
+
if (error.response) {
|
23
|
+
// The request was made and the server responded with a status code that falls out of the range of 2xx
|
24
|
+
const apiError = new ApiError(sdkError);
|
25
|
+
apiError.type = ErrorType.RESPONSE;
|
26
|
+
apiError.status = error.response.status;
|
27
|
+
apiError.code = String(apiError.status);
|
28
|
+
apiError.errors = error.response.data.errors;
|
29
|
+
sdkError = apiError;
|
30
|
+
}
|
31
|
+
else if (error.request) {
|
32
|
+
// The request was made but no response was received
|
33
|
+
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of http.ClientRequest in node.js
|
34
|
+
sdkError.type = ErrorType.REQUEST;
|
35
|
+
sdkError.request = error.request;
|
36
|
+
}
|
37
|
+
else {
|
38
|
+
// Something happened in setting up the request that triggered an Error
|
39
|
+
sdkError.type = ErrorType.CLIENT;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
else if (axios.isCancel(error))
|
43
|
+
sdkError.type = ErrorType.CANCEL;
|
44
|
+
else
|
45
|
+
sdkError.source = error;
|
46
|
+
throw sdkError;
|
47
|
+
};
|
48
|
+
class ApiClient {
|
49
|
+
constructor(options) {
|
50
|
+
_ApiClient_accessToken.set(this, void 0);
|
51
|
+
_ApiClient_client.set(this, void 0);
|
52
|
+
this.baseUrl = baseURL(options.organization, options.domain);
|
53
|
+
__classPrivateFieldSet(this, _ApiClient_accessToken, options.accessToken, "f");
|
54
|
+
const axiosConfig = {
|
55
|
+
timeout: options.timeout || 3000
|
56
|
+
};
|
57
|
+
__classPrivateFieldSet(this, _ApiClient_client, axios.create(Object.assign({ baseURL: this.baseUrl, timeout: 3000, headers: {
|
58
|
+
'Accept': 'application/vnd.api+json',
|
59
|
+
'Content-Type': 'application/vnd.api+json',
|
60
|
+
'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f"),
|
61
|
+
} }, axiosConfig)), "f");
|
62
|
+
this.interceptors = __classPrivateFieldGet(this, _ApiClient_client, "f").interceptors;
|
63
|
+
}
|
64
|
+
static create(options) {
|
65
|
+
if (!(options === null || options === void 0 ? void 0 : options.organization))
|
66
|
+
throw new Error("Undefined 'organization' parameter");
|
67
|
+
if (!(options === null || options === void 0 ? void 0 : options.accessToken))
|
68
|
+
throw new Error("Undefined 'accessToken' parameter");
|
69
|
+
return new ApiClient(options);
|
70
|
+
}
|
71
|
+
config(config) {
|
72
|
+
const def = __classPrivateFieldGet(this, _ApiClient_client, "f").defaults;
|
73
|
+
// Axios config
|
74
|
+
if (config.timeout)
|
75
|
+
def.timeout = config.timeout;
|
76
|
+
// API Client config
|
77
|
+
if (config.organization)
|
78
|
+
this.baseUrl = baseURL(config.organization, config.domain);
|
79
|
+
if (config.accessToken)
|
80
|
+
__classPrivateFieldSet(this, _ApiClient_accessToken, config.accessToken, "f");
|
81
|
+
}
|
82
|
+
async request(method, path, body, options) {
|
83
|
+
const data = body ? { data: body } : undefined;
|
84
|
+
const url = path;
|
85
|
+
// Runtime request parameters
|
86
|
+
const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
|
87
|
+
const headers = (options === null || options === void 0 ? void 0 : options.accessToken) ? { 'Authorization': 'Bearer ' + options.accessToken } : undefined;
|
88
|
+
// const start = Date.now()
|
89
|
+
return __classPrivateFieldGet(this, _ApiClient_client, "f").request(Object.assign({ method, baseURL: baseUrl, url, data, headers }, options))
|
90
|
+
.then(response => response.data)
|
91
|
+
.catch(error => handleError(error));
|
92
|
+
// .finally(() => console.log(`<<-- ${method} ${path} ${Date.now() - start}`))
|
93
|
+
}
|
94
|
+
}
|
95
|
+
_ApiClient_accessToken = new WeakMap(), _ApiClient_client = new WeakMap();
|
96
|
+
export default ApiClient;
|
@@ -0,0 +1,118 @@
|
|
1
|
+
import * as api from './api';
|
2
|
+
import { ApiError } from './error';
|
3
|
+
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
|
+
import { ResourcesConfig, ResourcesInitConfig } from './resource';
|
5
|
+
declare type SdkConfig = {};
|
6
|
+
declare type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
7
|
+
declare type CommerceLayerConfig = SdkConfig & ResourcesConfig;
|
8
|
+
declare class CommerceLayerClient {
|
9
|
+
#private;
|
10
|
+
addresses: api.Addresses;
|
11
|
+
adjustments: api.Adjustments;
|
12
|
+
adyen_gateways: api.AdyenGateways;
|
13
|
+
adyen_payments: api.AdyenPayments;
|
14
|
+
application: api.Applications;
|
15
|
+
attachments: api.Attachments;
|
16
|
+
authorizations: api.Authorizations;
|
17
|
+
avalara_accounts: api.AvalaraAccounts;
|
18
|
+
billing_info_validation_rules: api.BillingInfoValidationRules;
|
19
|
+
bing_geocoders: api.BingGeocoders;
|
20
|
+
braintree_gateways: api.BraintreeGateways;
|
21
|
+
braintree_payments: api.BraintreePayments;
|
22
|
+
bundles: api.Bundles;
|
23
|
+
captures: api.Captures;
|
24
|
+
carrier_accounts: api.CarrierAccounts;
|
25
|
+
checkout_com_gateways: api.CheckoutComGateways;
|
26
|
+
checkout_com_payments: api.CheckoutComPayments;
|
27
|
+
coupon_codes_promotion_rules: api.CouponCodesPromotionRules;
|
28
|
+
coupon_recipients: api.CouponRecipients;
|
29
|
+
coupons: api.Coupons;
|
30
|
+
customer_addresses: api.CustomerAddresses;
|
31
|
+
customer_groups: api.CustomerGroups;
|
32
|
+
customer_password_resets: api.CustomerPasswordResets;
|
33
|
+
customer_payment_sources: api.CustomerPaymentSources;
|
34
|
+
customer_subscriptions: api.CustomerSubscriptions;
|
35
|
+
customers: api.Customers;
|
36
|
+
delivery_lead_times: api.DeliveryLeadTimes;
|
37
|
+
event_callbacks: api.EventCallbacks;
|
38
|
+
external_gateways: api.ExternalGateways;
|
39
|
+
external_payments: api.ExternalPayments;
|
40
|
+
external_promotions: api.ExternalPromotions;
|
41
|
+
external_tax_calculators: api.ExternalTaxCalculators;
|
42
|
+
fixed_amount_promotions: api.FixedAmountPromotions;
|
43
|
+
fixed_price_promotions: api.FixedPricePromotions;
|
44
|
+
free_gift_promotions: api.FreeGiftPromotions;
|
45
|
+
free_shipping_promotions: api.FreeShippingPromotions;
|
46
|
+
geocoders: api.Geocoders;
|
47
|
+
gift_card_recipients: api.GiftCardRecipients;
|
48
|
+
gift_cards: api.GiftCards;
|
49
|
+
google_geocoders: api.GoogleGeocoders;
|
50
|
+
imports: api.Imports;
|
51
|
+
in_stock_subscriptions: api.InStockSubscriptions;
|
52
|
+
inventory_models: api.InventoryModels;
|
53
|
+
inventory_return_locations: api.InventoryReturnLocations;
|
54
|
+
inventory_stock_locations: api.InventoryStockLocations;
|
55
|
+
line_item_options: api.LineItemOptions;
|
56
|
+
line_items: api.LineItems;
|
57
|
+
manual_gateways: api.ManualGateways;
|
58
|
+
manual_tax_calculators: api.ManualTaxCalculators;
|
59
|
+
markets: api.Markets;
|
60
|
+
merchants: api.Merchants;
|
61
|
+
order_amount_promotion_rules: api.OrderAmountPromotionRules;
|
62
|
+
order_copies: api.OrderCopies;
|
63
|
+
order_subscriptions: api.OrderSubscriptions;
|
64
|
+
order_validation_rules: api.OrderValidationRules;
|
65
|
+
orders: api.Orders;
|
66
|
+
organization: api.Organizations;
|
67
|
+
packages: api.Packages;
|
68
|
+
parcel_line_items: api.ParcelLineItems;
|
69
|
+
parcels: api.Parcels;
|
70
|
+
payment_gateways: api.PaymentGateways;
|
71
|
+
payment_methods: api.PaymentMethods;
|
72
|
+
paypal_gateways: api.PaypalGateways;
|
73
|
+
paypal_payments: api.PaypalPayments;
|
74
|
+
percentage_discount_promotions: api.PercentageDiscountPromotions;
|
75
|
+
price_lists: api.PriceLists;
|
76
|
+
prices: api.Prices;
|
77
|
+
promotion_rules: api.PromotionRules;
|
78
|
+
promotions: api.Promotions;
|
79
|
+
refunds: api.Refunds;
|
80
|
+
return_line_items: api.ReturnLineItems;
|
81
|
+
returns: api.Returns;
|
82
|
+
shipments: api.Shipments;
|
83
|
+
shipping_categories: api.ShippingCategories;
|
84
|
+
shipping_methods: api.ShippingMethods;
|
85
|
+
shipping_zones: api.ShippingZones;
|
86
|
+
sku_list_items: api.SkuListItems;
|
87
|
+
sku_list_promotion_rules: api.SkuListPromotionRules;
|
88
|
+
sku_lists: api.SkuLists;
|
89
|
+
sku_options: api.SkuOptions;
|
90
|
+
skus: api.Skus;
|
91
|
+
stock_items: api.StockItems;
|
92
|
+
stock_line_items: api.StockLineItems;
|
93
|
+
stock_locations: api.StockLocations;
|
94
|
+
stock_transfers: api.StockTransfers;
|
95
|
+
stripe_gateways: api.StripeGateways;
|
96
|
+
stripe_payments: api.StripePayments;
|
97
|
+
tax_calculators: api.TaxCalculators;
|
98
|
+
tax_categories: api.TaxCategories;
|
99
|
+
tax_rules: api.TaxRules;
|
100
|
+
taxjar_accounts: api.TaxjarAccounts;
|
101
|
+
transactions: api.Transactions;
|
102
|
+
voids: api.Voids;
|
103
|
+
webhooks: api.Webhooks;
|
104
|
+
wire_transfers: api.WireTransfers;
|
105
|
+
constructor(config: CommerceLayerInitConfig);
|
106
|
+
get currentOrganization(): string;
|
107
|
+
config(config: CommerceLayerConfig): void;
|
108
|
+
resources(): readonly string[];
|
109
|
+
isApiError(error: any): error is ApiError;
|
110
|
+
addRequestInterceptor(onFulfilled?: RequestInterceptor, onRejected?: ErrorInterceptor): number;
|
111
|
+
addResponseInterceptor(onFulfilled?: ResponseInterceptor, onRejected?: ErrorInterceptor): number;
|
112
|
+
removeInterceptor(type: InterceptorType, id: number): void;
|
113
|
+
addRawResponseReader(): RawResponseReader;
|
114
|
+
removeRawResponseReader(reader: number | RawResponseReader): void;
|
115
|
+
}
|
116
|
+
declare const CommerceLayer: (config: CommerceLayerInitConfig) => CommerceLayerClient;
|
117
|
+
export default CommerceLayer;
|
118
|
+
export type { CommerceLayerClient, CommerceLayerConfig, CommerceLayerInitConfig };
|