@commercelayer/sdk 6.0.0-alfa.8 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.mts +7644 -0
- package/lib/index.d.ts +7644 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +2 -0
- package/lib/index.mjs.map +1 -0
- package/package.json +9 -15
- package/lib/cjs/api.d.ts +0 -161
- package/lib/cjs/api.js +0 -377
- package/lib/cjs/client.d.ts +0 -31
- package/lib/cjs/client.js +0 -120
- package/lib/cjs/commercelayer.d.ts +0 -154
- package/lib/cjs/commercelayer.js +0 -365
- package/lib/cjs/common.d.ts +0 -5
- package/lib/cjs/common.js +0 -12
- package/lib/cjs/config.d.ts +0 -15
- package/lib/cjs/config.js +0 -17
- package/lib/cjs/debug.d.ts +0 -3
- package/lib/cjs/debug.js +0 -17
- package/lib/cjs/error.d.ts +0 -30
- package/lib/cjs/error.js +0 -78
- package/lib/cjs/fetch.d.ts +0 -13
- package/lib/cjs/fetch.js +0 -67
- package/lib/cjs/index.d.ts +0 -7
- package/lib/cjs/index.js +0 -11
- package/lib/cjs/interceptor.d.ts +0 -37
- package/lib/cjs/interceptor.js +0 -2
- package/lib/cjs/jsonapi.d.ts +0 -6
- package/lib/cjs/jsonapi.js +0 -92
- package/lib/cjs/model.d.ts +0 -121
- package/lib/cjs/model.js +0 -2
- package/lib/cjs/query.d.ts +0 -18
- package/lib/cjs/query.js +0 -70
- package/lib/cjs/resource.d.ts +0 -86
- package/lib/cjs/resource.js +0 -172
- package/lib/cjs/resources/addresses.d.ts +0 -104
- package/lib/cjs/resources/addresses.js +0 -44
- package/lib/cjs/resources/adjustments.d.ts +0 -43
- package/lib/cjs/resources/adjustments.js +0 -32
- package/lib/cjs/resources/adyen_gateways.d.ts +0 -61
- package/lib/cjs/resources/adyen_gateways.js +0 -40
- package/lib/cjs/resources/adyen_payments.d.ts +0 -52
- package/lib/cjs/resources/adyen_payments.js +0 -43
- package/lib/cjs/resources/application.d.ts +0 -23
- package/lib/cjs/resources/application.js +0 -19
- package/lib/cjs/resources/attachments.d.ts +0 -158
- package/lib/cjs/resources/attachments.js +0 -28
- package/lib/cjs/resources/authorizations.d.ts +0 -71
- package/lib/cjs/resources/authorizations.js +0 -55
- package/lib/cjs/resources/avalara_accounts.d.ts +0 -60
- package/lib/cjs/resources/avalara_accounts.js +0 -44
- package/lib/cjs/resources/axerve_gateways.d.ts +0 -49
- package/lib/cjs/resources/axerve_gateways.js +0 -40
- package/lib/cjs/resources/axerve_payments.d.ts +0 -58
- package/lib/cjs/resources/axerve_payments.js +0 -43
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +0 -40
- package/lib/cjs/resources/billing_info_validation_rules.js +0 -40
- package/lib/cjs/resources/bing_geocoders.d.ts +0 -37
- package/lib/cjs/resources/bing_geocoders.js +0 -36
- package/lib/cjs/resources/braintree_gateways.d.ts +0 -61
- package/lib/cjs/resources/braintree_gateways.js +0 -40
- package/lib/cjs/resources/braintree_payments.d.ts +0 -53
- package/lib/cjs/resources/braintree_payments.js +0 -40
- package/lib/cjs/resources/bundles.d.ts +0 -94
- package/lib/cjs/resources/bundles.js +0 -62
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +0 -138
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +0 -82
- package/lib/cjs/resources/captures.d.ts +0 -61
- package/lib/cjs/resources/captures.js +0 -52
- package/lib/cjs/resources/carrier_accounts.d.ts +0 -31
- package/lib/cjs/resources/carrier_accounts.js +0 -31
- package/lib/cjs/resources/checkout_com_gateways.d.ts +0 -50
- package/lib/cjs/resources/checkout_com_gateways.js +0 -40
- package/lib/cjs/resources/checkout_com_payments.d.ts +0 -66
- package/lib/cjs/resources/checkout_com_payments.js +0 -46
- package/lib/cjs/resources/cleanups.d.ts +0 -41
- package/lib/cjs/resources/cleanups.js +0 -33
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +0 -68
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +0 -36
- package/lib/cjs/resources/coupon_recipients.d.ts +0 -49
- package/lib/cjs/resources/coupon_recipients.js +0 -40
- package/lib/cjs/resources/coupons.d.ts +0 -72
- package/lib/cjs/resources/coupons.js +0 -48
- package/lib/cjs/resources/custom_promotion_rules.d.ts +0 -63
- package/lib/cjs/resources/custom_promotion_rules.js +0 -32
- package/lib/cjs/resources/customer_addresses.d.ts +0 -51
- package/lib/cjs/resources/customer_addresses.js +0 -44
- package/lib/cjs/resources/customer_groups.d.ts +0 -41
- package/lib/cjs/resources/customer_groups.js +0 -44
- package/lib/cjs/resources/customer_password_resets.d.ts +0 -39
- package/lib/cjs/resources/customer_password_resets.js +0 -39
- package/lib/cjs/resources/customer_payment_sources.d.ts +0 -87
- package/lib/cjs/resources/customer_payment_sources.js +0 -40
- package/lib/cjs/resources/customer_subscriptions.d.ts +0 -36
- package/lib/cjs/resources/customer_subscriptions.js +0 -40
- package/lib/cjs/resources/customers.d.ts +0 -77
- package/lib/cjs/resources/customers.js +0 -72
- package/lib/cjs/resources/delivery_lead_times.d.ts +0 -56
- package/lib/cjs/resources/delivery_lead_times.js +0 -44
- package/lib/cjs/resources/event_callbacks.d.ts +0 -26
- package/lib/cjs/resources/event_callbacks.js +0 -23
- package/lib/cjs/resources/events.d.ts +0 -26
- package/lib/cjs/resources/events.js +0 -27
- package/lib/cjs/resources/exports.d.ts +0 -42
- package/lib/cjs/resources/exports.js +0 -29
- package/lib/cjs/resources/external_gateways.d.ts +0 -58
- package/lib/cjs/resources/external_gateways.js +0 -43
- package/lib/cjs/resources/external_payments.d.ts +0 -49
- package/lib/cjs/resources/external_payments.js +0 -44
- package/lib/cjs/resources/external_promotions.d.ts +0 -137
- package/lib/cjs/resources/external_promotions.js +0 -85
- package/lib/cjs/resources/external_tax_calculators.d.ts +0 -46
- package/lib/cjs/resources/external_tax_calculators.js +0 -43
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +0 -134
- package/lib/cjs/resources/fixed_amount_promotions.js +0 -82
- package/lib/cjs/resources/fixed_price_promotions.d.ts +0 -134
- package/lib/cjs/resources/fixed_price_promotions.js +0 -82
- package/lib/cjs/resources/free_gift_promotions.d.ts +0 -132
- package/lib/cjs/resources/free_gift_promotions.js +0 -82
- package/lib/cjs/resources/free_shipping_promotions.d.ts +0 -126
- package/lib/cjs/resources/free_shipping_promotions.js +0 -78
- package/lib/cjs/resources/geocoders.d.ts +0 -26
- package/lib/cjs/resources/geocoders.js +0 -27
- package/lib/cjs/resources/gift_card_recipients.d.ts +0 -49
- package/lib/cjs/resources/gift_card_recipients.js +0 -40
- package/lib/cjs/resources/gift_cards.d.ts +0 -105
- package/lib/cjs/resources/gift_cards.js +0 -64
- package/lib/cjs/resources/google_geocoders.d.ts +0 -37
- package/lib/cjs/resources/google_geocoders.js +0 -36
- package/lib/cjs/resources/imports.d.ts +0 -45
- package/lib/cjs/resources/imports.js +0 -29
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +0 -69
- package/lib/cjs/resources/in_stock_subscriptions.js +0 -54
- package/lib/cjs/resources/inventory_models.d.ts +0 -56
- package/lib/cjs/resources/inventory_models.js +0 -44
- package/lib/cjs/resources/inventory_return_locations.d.ts +0 -48
- package/lib/cjs/resources/inventory_return_locations.js +0 -40
- package/lib/cjs/resources/inventory_stock_locations.d.ts +0 -51
- package/lib/cjs/resources/inventory_stock_locations.js +0 -40
- package/lib/cjs/resources/klarna_gateways.d.ts +0 -49
- package/lib/cjs/resources/klarna_gateways.js +0 -40
- package/lib/cjs/resources/klarna_payments.d.ts +0 -52
- package/lib/cjs/resources/klarna_payments.js +0 -43
- package/lib/cjs/resources/line_item_options.d.ts +0 -70
- package/lib/cjs/resources/line_item_options.js +0 -44
- package/lib/cjs/resources/line_items.d.ts +0 -171
- package/lib/cjs/resources/line_items.js +0 -69
- package/lib/cjs/resources/manual_gateways.d.ts +0 -35
- package/lib/cjs/resources/manual_gateways.js +0 -36
- package/lib/cjs/resources/manual_tax_calculators.d.ts +0 -46
- package/lib/cjs/resources/manual_tax_calculators.js +0 -44
- package/lib/cjs/resources/markets.d.ts +0 -108
- package/lib/cjs/resources/markets.js +0 -66
- package/lib/cjs/resources/merchants.d.ts +0 -43
- package/lib/cjs/resources/merchants.js +0 -40
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +0 -68
- package/lib/cjs/resources/order_amount_promotion_rules.js +0 -32
- package/lib/cjs/resources/order_copies.d.ts +0 -52
- package/lib/cjs/resources/order_copies.js +0 -44
- package/lib/cjs/resources/order_factories.d.ts +0 -35
- package/lib/cjs/resources/order_factories.js +0 -31
- package/lib/cjs/resources/order_subscription_items.d.ts +0 -69
- package/lib/cjs/resources/order_subscription_items.js +0 -36
- package/lib/cjs/resources/order_subscriptions.d.ts +0 -97
- package/lib/cjs/resources/order_subscriptions.js +0 -81
- package/lib/cjs/resources/order_validation_rules.d.ts +0 -28
- package/lib/cjs/resources/order_validation_rules.js +0 -31
- package/lib/cjs/resources/orders.d.ts +0 -390
- package/lib/cjs/resources/orders.js +0 -239
- package/lib/cjs/resources/organization.d.ts +0 -35
- package/lib/cjs/resources/organization.js +0 -19
- package/lib/cjs/resources/packages.d.ts +0 -61
- package/lib/cjs/resources/packages.js +0 -44
- package/lib/cjs/resources/parcel_line_items.d.ts +0 -48
- package/lib/cjs/resources/parcel_line_items.js +0 -40
- package/lib/cjs/resources/parcels.d.ts +0 -127
- package/lib/cjs/resources/parcels.js +0 -52
- package/lib/cjs/resources/payment_gateways.d.ts +0 -26
- package/lib/cjs/resources/payment_gateways.js +0 -27
- package/lib/cjs/resources/payment_methods.d.ts +0 -84
- package/lib/cjs/resources/payment_methods.js +0 -50
- package/lib/cjs/resources/payment_options.d.ts +0 -45
- package/lib/cjs/resources/payment_options.js +0 -36
- package/lib/cjs/resources/paypal_gateways.d.ts +0 -42
- package/lib/cjs/resources/paypal_gateways.js +0 -40
- package/lib/cjs/resources/paypal_payments.d.ts +0 -57
- package/lib/cjs/resources/paypal_payments.js +0 -40
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +0 -132
- package/lib/cjs/resources/percentage_discount_promotions.js +0 -82
- package/lib/cjs/resources/price_frequency_tiers.d.ts +0 -54
- package/lib/cjs/resources/price_frequency_tiers.js +0 -44
- package/lib/cjs/resources/price_lists.d.ts +0 -47
- package/lib/cjs/resources/price_lists.js +0 -40
- package/lib/cjs/resources/price_tiers.d.ts +0 -33
- package/lib/cjs/resources/price_tiers.js +0 -31
- package/lib/cjs/resources/price_volume_tiers.d.ts +0 -54
- package/lib/cjs/resources/price_volume_tiers.js +0 -44
- package/lib/cjs/resources/prices.d.ts +0 -76
- package/lib/cjs/resources/prices.js +0 -56
- package/lib/cjs/resources/promotion_rules.d.ts +0 -30
- package/lib/cjs/resources/promotion_rules.js +0 -23
- package/lib/cjs/resources/promotions.d.ts +0 -64
- package/lib/cjs/resources/promotions.js +0 -63
- package/lib/cjs/resources/recurring_order_copies.d.ts +0 -54
- package/lib/cjs/resources/recurring_order_copies.js +0 -44
- package/lib/cjs/resources/refunds.d.ts +0 -45
- package/lib/cjs/resources/refunds.js +0 -39
- package/lib/cjs/resources/reserved_stocks.d.ts +0 -29
- package/lib/cjs/resources/reserved_stocks.js +0 -31
- package/lib/cjs/resources/resource_errors.d.ts +0 -23
- package/lib/cjs/resources/resource_errors.js +0 -19
- package/lib/cjs/resources/return_line_items.d.ts +0 -53
- package/lib/cjs/resources/return_line_items.js +0 -39
- package/lib/cjs/resources/returns.d.ts +0 -97
- package/lib/cjs/resources/returns.js +0 -95
- package/lib/cjs/resources/satispay_gateways.d.ts +0 -47
- package/lib/cjs/resources/satispay_gateways.js +0 -40
- package/lib/cjs/resources/satispay_payments.d.ts +0 -54
- package/lib/cjs/resources/satispay_payments.js +0 -43
- package/lib/cjs/resources/shipments.d.ts +0 -152
- package/lib/cjs/resources/shipments.js +0 -133
- package/lib/cjs/resources/shipping_categories.d.ts +0 -41
- package/lib/cjs/resources/shipping_categories.js +0 -40
- package/lib/cjs/resources/shipping_method_tiers.d.ts +0 -33
- package/lib/cjs/resources/shipping_method_tiers.js +0 -31
- package/lib/cjs/resources/shipping_methods.d.ts +0 -126
- package/lib/cjs/resources/shipping_methods.js +0 -73
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +0 -51
- package/lib/cjs/resources/shipping_weight_tiers.js +0 -40
- package/lib/cjs/resources/shipping_zones.d.ts +0 -53
- package/lib/cjs/resources/shipping_zones.js +0 -36
- package/lib/cjs/resources/sku_list_items.d.ts +0 -52
- package/lib/cjs/resources/sku_list_items.js +0 -40
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +0 -77
- package/lib/cjs/resources/sku_list_promotion_rules.js +0 -40
- package/lib/cjs/resources/sku_lists.d.ts +0 -65
- package/lib/cjs/resources/sku_lists.js +0 -52
- package/lib/cjs/resources/sku_options.d.ts +0 -72
- package/lib/cjs/resources/sku_options.js +0 -48
- package/lib/cjs/resources/skus.d.ts +0 -97
- package/lib/cjs/resources/skus.js +0 -68
- package/lib/cjs/resources/stock_items.d.ts +0 -60
- package/lib/cjs/resources/stock_items.js +0 -52
- package/lib/cjs/resources/stock_line_items.d.ts +0 -74
- package/lib/cjs/resources/stock_line_items.js +0 -57
- package/lib/cjs/resources/stock_locations.d.ts +0 -65
- package/lib/cjs/resources/stock_locations.js +0 -56
- package/lib/cjs/resources/stock_reservations.d.ts +0 -52
- package/lib/cjs/resources/stock_reservations.js +0 -51
- package/lib/cjs/resources/stock_transfers.d.ts +0 -87
- package/lib/cjs/resources/stock_transfers.js +0 -74
- package/lib/cjs/resources/stripe_gateways.d.ts +0 -46
- package/lib/cjs/resources/stripe_gateways.js +0 -40
- package/lib/cjs/resources/stripe_payments.d.ts +0 -63
- package/lib/cjs/resources/stripe_payments.js +0 -46
- package/lib/cjs/resources/subscription_models.d.ts +0 -50
- package/lib/cjs/resources/subscription_models.js +0 -40
- package/lib/cjs/resources/tags.d.ts +0 -29
- package/lib/cjs/resources/tags.js +0 -28
- package/lib/cjs/resources/tax_calculators.d.ts +0 -29
- package/lib/cjs/resources/tax_calculators.js +0 -31
- package/lib/cjs/resources/tax_categories.d.ts +0 -64
- package/lib/cjs/resources/tax_categories.js +0 -40
- package/lib/cjs/resources/tax_rules.d.ts +0 -74
- package/lib/cjs/resources/tax_rules.js +0 -36
- package/lib/cjs/resources/taxjar_accounts.d.ts +0 -48
- package/lib/cjs/resources/taxjar_accounts.js +0 -44
- package/lib/cjs/resources/transactions.d.ts +0 -42
- package/lib/cjs/resources/transactions.js +0 -35
- package/lib/cjs/resources/versions.d.ts +0 -23
- package/lib/cjs/resources/versions.js +0 -19
- package/lib/cjs/resources/voids.d.ts +0 -45
- package/lib/cjs/resources/voids.js +0 -39
- package/lib/cjs/resources/webhooks.d.ts +0 -56
- package/lib/cjs/resources/webhooks.js +0 -45
- package/lib/cjs/resources/wire_transfers.d.ts +0 -38
- package/lib/cjs/resources/wire_transfers.js +0 -36
- package/lib/cjs/static.d.ts +0 -12
- package/lib/cjs/static.js +0 -50
- package/lib/cjs/util.d.ts +0 -9
- package/lib/cjs/util.js +0 -15
- package/lib/esm/api.d.ts +0 -161
- package/lib/esm/api.js +0 -248
- package/lib/esm/client.d.ts +0 -31
- package/lib/esm/client.js +0 -102
- package/lib/esm/commercelayer.d.ts +0 -154
- package/lib/esm/commercelayer.js +0 -323
- package/lib/esm/common.d.ts +0 -5
- package/lib/esm/common.js +0 -8
- package/lib/esm/config.d.ts +0 -15
- package/lib/esm/config.js +0 -15
- package/lib/esm/debug.d.ts +0 -3
- package/lib/esm/debug.js +0 -15
- package/lib/esm/error.d.ts +0 -30
- package/lib/esm/error.js +0 -78
- package/lib/esm/fetch.d.ts +0 -13
- package/lib/esm/fetch.js +0 -46
- package/lib/esm/index.d.ts +0 -7
- package/lib/esm/index.js +0 -2
- package/lib/esm/interceptor.d.ts +0 -37
- package/lib/esm/interceptor.js +0 -1
- package/lib/esm/jsonapi.d.ts +0 -6
- package/lib/esm/jsonapi.js +0 -85
- package/lib/esm/model.d.ts +0 -121
- package/lib/esm/model.js +0 -1
- package/lib/esm/query.d.ts +0 -18
- package/lib/esm/query.js +0 -62
- package/lib/esm/resource.d.ts +0 -86
- package/lib/esm/resource.js +0 -155
- package/lib/esm/resources/addresses.d.ts +0 -104
- package/lib/esm/resources/addresses.js +0 -42
- package/lib/esm/resources/adjustments.d.ts +0 -43
- package/lib/esm/resources/adjustments.js +0 -30
- package/lib/esm/resources/adyen_gateways.d.ts +0 -61
- package/lib/esm/resources/adyen_gateways.js +0 -38
- package/lib/esm/resources/adyen_payments.d.ts +0 -52
- package/lib/esm/resources/adyen_payments.js +0 -41
- package/lib/esm/resources/application.d.ts +0 -23
- package/lib/esm/resources/application.js +0 -17
- package/lib/esm/resources/attachments.d.ts +0 -158
- package/lib/esm/resources/attachments.js +0 -26
- package/lib/esm/resources/authorizations.d.ts +0 -71
- package/lib/esm/resources/authorizations.js +0 -53
- package/lib/esm/resources/avalara_accounts.d.ts +0 -60
- package/lib/esm/resources/avalara_accounts.js +0 -42
- package/lib/esm/resources/axerve_gateways.d.ts +0 -49
- package/lib/esm/resources/axerve_gateways.js +0 -38
- package/lib/esm/resources/axerve_payments.d.ts +0 -58
- package/lib/esm/resources/axerve_payments.js +0 -41
- package/lib/esm/resources/billing_info_validation_rules.d.ts +0 -40
- package/lib/esm/resources/billing_info_validation_rules.js +0 -38
- package/lib/esm/resources/bing_geocoders.d.ts +0 -37
- package/lib/esm/resources/bing_geocoders.js +0 -34
- package/lib/esm/resources/braintree_gateways.d.ts +0 -61
- package/lib/esm/resources/braintree_gateways.js +0 -38
- package/lib/esm/resources/braintree_payments.d.ts +0 -53
- package/lib/esm/resources/braintree_payments.js +0 -38
- package/lib/esm/resources/bundles.d.ts +0 -94
- package/lib/esm/resources/bundles.js +0 -60
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +0 -138
- package/lib/esm/resources/buy_x_pay_y_promotions.js +0 -80
- package/lib/esm/resources/captures.d.ts +0 -61
- package/lib/esm/resources/captures.js +0 -50
- package/lib/esm/resources/carrier_accounts.d.ts +0 -31
- package/lib/esm/resources/carrier_accounts.js +0 -29
- package/lib/esm/resources/checkout_com_gateways.d.ts +0 -50
- package/lib/esm/resources/checkout_com_gateways.js +0 -38
- package/lib/esm/resources/checkout_com_payments.d.ts +0 -66
- package/lib/esm/resources/checkout_com_payments.js +0 -44
- package/lib/esm/resources/cleanups.d.ts +0 -41
- package/lib/esm/resources/cleanups.js +0 -31
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +0 -68
- package/lib/esm/resources/coupon_codes_promotion_rules.js +0 -34
- package/lib/esm/resources/coupon_recipients.d.ts +0 -49
- package/lib/esm/resources/coupon_recipients.js +0 -38
- package/lib/esm/resources/coupons.d.ts +0 -72
- package/lib/esm/resources/coupons.js +0 -46
- package/lib/esm/resources/custom_promotion_rules.d.ts +0 -63
- package/lib/esm/resources/custom_promotion_rules.js +0 -30
- package/lib/esm/resources/customer_addresses.d.ts +0 -51
- package/lib/esm/resources/customer_addresses.js +0 -42
- package/lib/esm/resources/customer_groups.d.ts +0 -41
- package/lib/esm/resources/customer_groups.js +0 -42
- package/lib/esm/resources/customer_password_resets.d.ts +0 -39
- package/lib/esm/resources/customer_password_resets.js +0 -37
- package/lib/esm/resources/customer_payment_sources.d.ts +0 -87
- package/lib/esm/resources/customer_payment_sources.js +0 -38
- package/lib/esm/resources/customer_subscriptions.d.ts +0 -36
- package/lib/esm/resources/customer_subscriptions.js +0 -38
- package/lib/esm/resources/customers.d.ts +0 -77
- package/lib/esm/resources/customers.js +0 -70
- package/lib/esm/resources/delivery_lead_times.d.ts +0 -56
- package/lib/esm/resources/delivery_lead_times.js +0 -42
- package/lib/esm/resources/event_callbacks.d.ts +0 -26
- package/lib/esm/resources/event_callbacks.js +0 -21
- package/lib/esm/resources/events.d.ts +0 -26
- package/lib/esm/resources/events.js +0 -25
- package/lib/esm/resources/exports.d.ts +0 -42
- package/lib/esm/resources/exports.js +0 -27
- package/lib/esm/resources/external_gateways.d.ts +0 -58
- package/lib/esm/resources/external_gateways.js +0 -41
- package/lib/esm/resources/external_payments.d.ts +0 -49
- package/lib/esm/resources/external_payments.js +0 -42
- package/lib/esm/resources/external_promotions.d.ts +0 -137
- package/lib/esm/resources/external_promotions.js +0 -83
- package/lib/esm/resources/external_tax_calculators.d.ts +0 -46
- package/lib/esm/resources/external_tax_calculators.js +0 -41
- package/lib/esm/resources/fixed_amount_promotions.d.ts +0 -134
- package/lib/esm/resources/fixed_amount_promotions.js +0 -80
- package/lib/esm/resources/fixed_price_promotions.d.ts +0 -134
- package/lib/esm/resources/fixed_price_promotions.js +0 -80
- package/lib/esm/resources/free_gift_promotions.d.ts +0 -132
- package/lib/esm/resources/free_gift_promotions.js +0 -80
- package/lib/esm/resources/free_shipping_promotions.d.ts +0 -126
- package/lib/esm/resources/free_shipping_promotions.js +0 -76
- package/lib/esm/resources/geocoders.d.ts +0 -26
- package/lib/esm/resources/geocoders.js +0 -25
- package/lib/esm/resources/gift_card_recipients.d.ts +0 -49
- package/lib/esm/resources/gift_card_recipients.js +0 -38
- package/lib/esm/resources/gift_cards.d.ts +0 -105
- package/lib/esm/resources/gift_cards.js +0 -62
- package/lib/esm/resources/google_geocoders.d.ts +0 -37
- package/lib/esm/resources/google_geocoders.js +0 -34
- package/lib/esm/resources/imports.d.ts +0 -45
- package/lib/esm/resources/imports.js +0 -27
- package/lib/esm/resources/in_stock_subscriptions.d.ts +0 -69
- package/lib/esm/resources/in_stock_subscriptions.js +0 -52
- package/lib/esm/resources/inventory_models.d.ts +0 -56
- package/lib/esm/resources/inventory_models.js +0 -42
- package/lib/esm/resources/inventory_return_locations.d.ts +0 -48
- package/lib/esm/resources/inventory_return_locations.js +0 -38
- package/lib/esm/resources/inventory_stock_locations.d.ts +0 -51
- package/lib/esm/resources/inventory_stock_locations.js +0 -38
- package/lib/esm/resources/klarna_gateways.d.ts +0 -49
- package/lib/esm/resources/klarna_gateways.js +0 -38
- package/lib/esm/resources/klarna_payments.d.ts +0 -52
- package/lib/esm/resources/klarna_payments.js +0 -41
- package/lib/esm/resources/line_item_options.d.ts +0 -70
- package/lib/esm/resources/line_item_options.js +0 -42
- package/lib/esm/resources/line_items.d.ts +0 -171
- package/lib/esm/resources/line_items.js +0 -67
- package/lib/esm/resources/manual_gateways.d.ts +0 -35
- package/lib/esm/resources/manual_gateways.js +0 -34
- package/lib/esm/resources/manual_tax_calculators.d.ts +0 -46
- package/lib/esm/resources/manual_tax_calculators.js +0 -42
- package/lib/esm/resources/markets.d.ts +0 -108
- package/lib/esm/resources/markets.js +0 -64
- package/lib/esm/resources/merchants.d.ts +0 -43
- package/lib/esm/resources/merchants.js +0 -38
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +0 -68
- package/lib/esm/resources/order_amount_promotion_rules.js +0 -30
- package/lib/esm/resources/order_copies.d.ts +0 -52
- package/lib/esm/resources/order_copies.js +0 -42
- package/lib/esm/resources/order_factories.d.ts +0 -35
- package/lib/esm/resources/order_factories.js +0 -29
- package/lib/esm/resources/order_subscription_items.d.ts +0 -69
- package/lib/esm/resources/order_subscription_items.js +0 -34
- package/lib/esm/resources/order_subscriptions.d.ts +0 -97
- package/lib/esm/resources/order_subscriptions.js +0 -79
- package/lib/esm/resources/order_validation_rules.d.ts +0 -28
- package/lib/esm/resources/order_validation_rules.js +0 -29
- package/lib/esm/resources/orders.d.ts +0 -390
- package/lib/esm/resources/orders.js +0 -237
- package/lib/esm/resources/organization.d.ts +0 -35
- package/lib/esm/resources/organization.js +0 -17
- package/lib/esm/resources/packages.d.ts +0 -61
- package/lib/esm/resources/packages.js +0 -42
- package/lib/esm/resources/parcel_line_items.d.ts +0 -48
- package/lib/esm/resources/parcel_line_items.js +0 -38
- package/lib/esm/resources/parcels.d.ts +0 -127
- package/lib/esm/resources/parcels.js +0 -50
- package/lib/esm/resources/payment_gateways.d.ts +0 -26
- package/lib/esm/resources/payment_gateways.js +0 -25
- package/lib/esm/resources/payment_methods.d.ts +0 -84
- package/lib/esm/resources/payment_methods.js +0 -48
- package/lib/esm/resources/payment_options.d.ts +0 -45
- package/lib/esm/resources/payment_options.js +0 -34
- package/lib/esm/resources/paypal_gateways.d.ts +0 -42
- package/lib/esm/resources/paypal_gateways.js +0 -38
- package/lib/esm/resources/paypal_payments.d.ts +0 -57
- package/lib/esm/resources/paypal_payments.js +0 -38
- package/lib/esm/resources/percentage_discount_promotions.d.ts +0 -132
- package/lib/esm/resources/percentage_discount_promotions.js +0 -80
- package/lib/esm/resources/price_frequency_tiers.d.ts +0 -54
- package/lib/esm/resources/price_frequency_tiers.js +0 -42
- package/lib/esm/resources/price_lists.d.ts +0 -47
- package/lib/esm/resources/price_lists.js +0 -38
- package/lib/esm/resources/price_tiers.d.ts +0 -33
- package/lib/esm/resources/price_tiers.js +0 -29
- package/lib/esm/resources/price_volume_tiers.d.ts +0 -54
- package/lib/esm/resources/price_volume_tiers.js +0 -42
- package/lib/esm/resources/prices.d.ts +0 -76
- package/lib/esm/resources/prices.js +0 -54
- package/lib/esm/resources/promotion_rules.d.ts +0 -30
- package/lib/esm/resources/promotion_rules.js +0 -21
- package/lib/esm/resources/promotions.d.ts +0 -64
- package/lib/esm/resources/promotions.js +0 -61
- package/lib/esm/resources/recurring_order_copies.d.ts +0 -54
- package/lib/esm/resources/recurring_order_copies.js +0 -42
- package/lib/esm/resources/refunds.d.ts +0 -45
- package/lib/esm/resources/refunds.js +0 -37
- package/lib/esm/resources/reserved_stocks.d.ts +0 -29
- package/lib/esm/resources/reserved_stocks.js +0 -29
- package/lib/esm/resources/resource_errors.d.ts +0 -23
- package/lib/esm/resources/resource_errors.js +0 -17
- package/lib/esm/resources/return_line_items.d.ts +0 -53
- package/lib/esm/resources/return_line_items.js +0 -37
- package/lib/esm/resources/returns.d.ts +0 -97
- package/lib/esm/resources/returns.js +0 -93
- package/lib/esm/resources/satispay_gateways.d.ts +0 -47
- package/lib/esm/resources/satispay_gateways.js +0 -38
- package/lib/esm/resources/satispay_payments.d.ts +0 -54
- package/lib/esm/resources/satispay_payments.js +0 -41
- package/lib/esm/resources/shipments.d.ts +0 -152
- package/lib/esm/resources/shipments.js +0 -131
- package/lib/esm/resources/shipping_categories.d.ts +0 -41
- package/lib/esm/resources/shipping_categories.js +0 -38
- package/lib/esm/resources/shipping_method_tiers.d.ts +0 -33
- package/lib/esm/resources/shipping_method_tiers.js +0 -29
- package/lib/esm/resources/shipping_methods.d.ts +0 -126
- package/lib/esm/resources/shipping_methods.js +0 -71
- package/lib/esm/resources/shipping_weight_tiers.d.ts +0 -51
- package/lib/esm/resources/shipping_weight_tiers.js +0 -38
- package/lib/esm/resources/shipping_zones.d.ts +0 -53
- package/lib/esm/resources/shipping_zones.js +0 -34
- package/lib/esm/resources/sku_list_items.d.ts +0 -52
- package/lib/esm/resources/sku_list_items.js +0 -38
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +0 -77
- package/lib/esm/resources/sku_list_promotion_rules.js +0 -38
- package/lib/esm/resources/sku_lists.d.ts +0 -65
- package/lib/esm/resources/sku_lists.js +0 -50
- package/lib/esm/resources/sku_options.d.ts +0 -72
- package/lib/esm/resources/sku_options.js +0 -46
- package/lib/esm/resources/skus.d.ts +0 -97
- package/lib/esm/resources/skus.js +0 -66
- package/lib/esm/resources/stock_items.d.ts +0 -60
- package/lib/esm/resources/stock_items.js +0 -50
- package/lib/esm/resources/stock_line_items.d.ts +0 -74
- package/lib/esm/resources/stock_line_items.js +0 -55
- package/lib/esm/resources/stock_locations.d.ts +0 -65
- package/lib/esm/resources/stock_locations.js +0 -54
- package/lib/esm/resources/stock_reservations.d.ts +0 -52
- package/lib/esm/resources/stock_reservations.js +0 -49
- package/lib/esm/resources/stock_transfers.d.ts +0 -87
- package/lib/esm/resources/stock_transfers.js +0 -72
- package/lib/esm/resources/stripe_gateways.d.ts +0 -46
- package/lib/esm/resources/stripe_gateways.js +0 -38
- package/lib/esm/resources/stripe_payments.d.ts +0 -63
- package/lib/esm/resources/stripe_payments.js +0 -44
- package/lib/esm/resources/subscription_models.d.ts +0 -50
- package/lib/esm/resources/subscription_models.js +0 -38
- package/lib/esm/resources/tags.d.ts +0 -29
- package/lib/esm/resources/tags.js +0 -26
- package/lib/esm/resources/tax_calculators.d.ts +0 -29
- package/lib/esm/resources/tax_calculators.js +0 -29
- package/lib/esm/resources/tax_categories.d.ts +0 -64
- package/lib/esm/resources/tax_categories.js +0 -38
- package/lib/esm/resources/tax_rules.d.ts +0 -74
- package/lib/esm/resources/tax_rules.js +0 -34
- package/lib/esm/resources/taxjar_accounts.d.ts +0 -48
- package/lib/esm/resources/taxjar_accounts.js +0 -42
- package/lib/esm/resources/transactions.d.ts +0 -42
- package/lib/esm/resources/transactions.js +0 -33
- package/lib/esm/resources/versions.d.ts +0 -23
- package/lib/esm/resources/versions.js +0 -17
- package/lib/esm/resources/voids.d.ts +0 -45
- package/lib/esm/resources/voids.js +0 -37
- package/lib/esm/resources/webhooks.d.ts +0 -56
- package/lib/esm/resources/webhooks.js +0 -43
- package/lib/esm/resources/wire_transfers.d.ts +0 -38
- package/lib/esm/resources/wire_transfers.js +0 -34
- package/lib/esm/static.d.ts +0 -12
- package/lib/esm/static.js +0 -24
- package/lib/esm/util.d.ts +0 -9
- package/lib/esm/util.js +0 -11
- package/lib/tsconfig.esm.tsbuildinfo +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
package/lib/esm/commercelayer.js
DELETED
@@ -1,323 +0,0 @@
|
|
1
|
-
import * as api from './api';
|
2
|
-
import { CommerceLayerStatic } from './static';
|
3
|
-
import ResourceAdapter from './resource';
|
4
|
-
import Debug from './debug';
|
5
|
-
const debug = Debug('commercelayer');
|
6
|
-
const OPEN_API_SCHEMA_VERSION = '5.1.0';
|
7
|
-
export { OPEN_API_SCHEMA_VERSION };
|
8
|
-
class CommerceLayerClient {
|
9
|
-
openApiSchemaVersion = OPEN_API_SCHEMA_VERSION;
|
10
|
-
#adapter;
|
11
|
-
#slug;
|
12
|
-
#addresses;
|
13
|
-
#adjustments;
|
14
|
-
#adyen_gateways;
|
15
|
-
#adyen_payments;
|
16
|
-
#application;
|
17
|
-
#attachments;
|
18
|
-
#authorizations;
|
19
|
-
#avalara_accounts;
|
20
|
-
#axerve_gateways;
|
21
|
-
#axerve_payments;
|
22
|
-
#billing_info_validation_rules;
|
23
|
-
#bing_geocoders;
|
24
|
-
#braintree_gateways;
|
25
|
-
#braintree_payments;
|
26
|
-
#bundles;
|
27
|
-
#buy_x_pay_y_promotions;
|
28
|
-
#captures;
|
29
|
-
#carrier_accounts;
|
30
|
-
#checkout_com_gateways;
|
31
|
-
#checkout_com_payments;
|
32
|
-
#cleanups;
|
33
|
-
#coupon_codes_promotion_rules;
|
34
|
-
#coupon_recipients;
|
35
|
-
#coupons;
|
36
|
-
#custom_promotion_rules;
|
37
|
-
#customer_addresses;
|
38
|
-
#customer_groups;
|
39
|
-
#customer_password_resets;
|
40
|
-
#customer_payment_sources;
|
41
|
-
#customer_subscriptions;
|
42
|
-
#customers;
|
43
|
-
#delivery_lead_times;
|
44
|
-
#event_callbacks;
|
45
|
-
#events;
|
46
|
-
#exports;
|
47
|
-
#external_gateways;
|
48
|
-
#external_payments;
|
49
|
-
#external_promotions;
|
50
|
-
#external_tax_calculators;
|
51
|
-
#fixed_amount_promotions;
|
52
|
-
#fixed_price_promotions;
|
53
|
-
#free_gift_promotions;
|
54
|
-
#free_shipping_promotions;
|
55
|
-
#geocoders;
|
56
|
-
#gift_card_recipients;
|
57
|
-
#gift_cards;
|
58
|
-
#google_geocoders;
|
59
|
-
#imports;
|
60
|
-
#in_stock_subscriptions;
|
61
|
-
#inventory_models;
|
62
|
-
#inventory_return_locations;
|
63
|
-
#inventory_stock_locations;
|
64
|
-
#klarna_gateways;
|
65
|
-
#klarna_payments;
|
66
|
-
#line_item_options;
|
67
|
-
#line_items;
|
68
|
-
#manual_gateways;
|
69
|
-
#manual_tax_calculators;
|
70
|
-
#markets;
|
71
|
-
#merchants;
|
72
|
-
#order_amount_promotion_rules;
|
73
|
-
#order_copies;
|
74
|
-
#order_factories;
|
75
|
-
#order_subscription_items;
|
76
|
-
#order_subscriptions;
|
77
|
-
#order_validation_rules;
|
78
|
-
#orders;
|
79
|
-
#organization;
|
80
|
-
#packages;
|
81
|
-
#parcel_line_items;
|
82
|
-
#parcels;
|
83
|
-
#payment_gateways;
|
84
|
-
#payment_methods;
|
85
|
-
#payment_options;
|
86
|
-
#paypal_gateways;
|
87
|
-
#paypal_payments;
|
88
|
-
#percentage_discount_promotions;
|
89
|
-
#price_frequency_tiers;
|
90
|
-
#price_lists;
|
91
|
-
#price_tiers;
|
92
|
-
#price_volume_tiers;
|
93
|
-
#prices;
|
94
|
-
#promotion_rules;
|
95
|
-
#promotions;
|
96
|
-
#recurring_order_copies;
|
97
|
-
#refunds;
|
98
|
-
#reserved_stocks;
|
99
|
-
#resource_errors;
|
100
|
-
#return_line_items;
|
101
|
-
#returns;
|
102
|
-
#satispay_gateways;
|
103
|
-
#satispay_payments;
|
104
|
-
#shipments;
|
105
|
-
#shipping_categories;
|
106
|
-
#shipping_method_tiers;
|
107
|
-
#shipping_methods;
|
108
|
-
#shipping_weight_tiers;
|
109
|
-
#shipping_zones;
|
110
|
-
#sku_list_items;
|
111
|
-
#sku_list_promotion_rules;
|
112
|
-
#sku_lists;
|
113
|
-
#sku_options;
|
114
|
-
#skus;
|
115
|
-
#stock_items;
|
116
|
-
#stock_line_items;
|
117
|
-
#stock_locations;
|
118
|
-
#stock_reservations;
|
119
|
-
#stock_transfers;
|
120
|
-
#stripe_gateways;
|
121
|
-
#stripe_payments;
|
122
|
-
#subscription_models;
|
123
|
-
#tags;
|
124
|
-
#tax_calculators;
|
125
|
-
#tax_categories;
|
126
|
-
#tax_rules;
|
127
|
-
#taxjar_accounts;
|
128
|
-
#transactions;
|
129
|
-
#versions;
|
130
|
-
#voids;
|
131
|
-
#webhooks;
|
132
|
-
#wire_transfers;
|
133
|
-
constructor(config) {
|
134
|
-
debug('new commercelayer instance %O', config);
|
135
|
-
this.#adapter = new ResourceAdapter(config);
|
136
|
-
this.#slug = config.organization;
|
137
|
-
}
|
138
|
-
get addresses() { return this.#addresses || (this.#addresses = new api.Addresses(this.#adapter)); }
|
139
|
-
get adjustments() { return this.#adjustments || (this.#adjustments = new api.Adjustments(this.#adapter)); }
|
140
|
-
get adyen_gateways() { return this.#adyen_gateways || (this.#adyen_gateways = new api.AdyenGateways(this.#adapter)); }
|
141
|
-
get adyen_payments() { return this.#adyen_payments || (this.#adyen_payments = new api.AdyenPayments(this.#adapter)); }
|
142
|
-
get application() { return this.#application || (this.#application = new api.Applications(this.#adapter)); }
|
143
|
-
get attachments() { return this.#attachments || (this.#attachments = new api.Attachments(this.#adapter)); }
|
144
|
-
get authorizations() { return this.#authorizations || (this.#authorizations = new api.Authorizations(this.#adapter)); }
|
145
|
-
get avalara_accounts() { return this.#avalara_accounts || (this.#avalara_accounts = new api.AvalaraAccounts(this.#adapter)); }
|
146
|
-
get axerve_gateways() { return this.#axerve_gateways || (this.#axerve_gateways = new api.AxerveGateways(this.#adapter)); }
|
147
|
-
get axerve_payments() { return this.#axerve_payments || (this.#axerve_payments = new api.AxervePayments(this.#adapter)); }
|
148
|
-
get billing_info_validation_rules() { return this.#billing_info_validation_rules || (this.#billing_info_validation_rules = new api.BillingInfoValidationRules(this.#adapter)); }
|
149
|
-
get bing_geocoders() { return this.#bing_geocoders || (this.#bing_geocoders = new api.BingGeocoders(this.#adapter)); }
|
150
|
-
get braintree_gateways() { return this.#braintree_gateways || (this.#braintree_gateways = new api.BraintreeGateways(this.#adapter)); }
|
151
|
-
get braintree_payments() { return this.#braintree_payments || (this.#braintree_payments = new api.BraintreePayments(this.#adapter)); }
|
152
|
-
get bundles() { return this.#bundles || (this.#bundles = new api.Bundles(this.#adapter)); }
|
153
|
-
get buy_x_pay_y_promotions() { return this.#buy_x_pay_y_promotions || (this.#buy_x_pay_y_promotions = new api.BuyXPayYPromotions(this.#adapter)); }
|
154
|
-
get captures() { return this.#captures || (this.#captures = new api.Captures(this.#adapter)); }
|
155
|
-
get carrier_accounts() { return this.#carrier_accounts || (this.#carrier_accounts = new api.CarrierAccounts(this.#adapter)); }
|
156
|
-
get checkout_com_gateways() { return this.#checkout_com_gateways || (this.#checkout_com_gateways = new api.CheckoutComGateways(this.#adapter)); }
|
157
|
-
get checkout_com_payments() { return this.#checkout_com_payments || (this.#checkout_com_payments = new api.CheckoutComPayments(this.#adapter)); }
|
158
|
-
get cleanups() { return this.#cleanups || (this.#cleanups = new api.Cleanups(this.#adapter)); }
|
159
|
-
get coupon_codes_promotion_rules() { return this.#coupon_codes_promotion_rules || (this.#coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(this.#adapter)); }
|
160
|
-
get coupon_recipients() { return this.#coupon_recipients || (this.#coupon_recipients = new api.CouponRecipients(this.#adapter)); }
|
161
|
-
get coupons() { return this.#coupons || (this.#coupons = new api.Coupons(this.#adapter)); }
|
162
|
-
get custom_promotion_rules() { return this.#custom_promotion_rules || (this.#custom_promotion_rules = new api.CustomPromotionRules(this.#adapter)); }
|
163
|
-
get customer_addresses() { return this.#customer_addresses || (this.#customer_addresses = new api.CustomerAddresses(this.#adapter)); }
|
164
|
-
get customer_groups() { return this.#customer_groups || (this.#customer_groups = new api.CustomerGroups(this.#adapter)); }
|
165
|
-
get customer_password_resets() { return this.#customer_password_resets || (this.#customer_password_resets = new api.CustomerPasswordResets(this.#adapter)); }
|
166
|
-
get customer_payment_sources() { return this.#customer_payment_sources || (this.#customer_payment_sources = new api.CustomerPaymentSources(this.#adapter)); }
|
167
|
-
get customer_subscriptions() { return this.#customer_subscriptions || (this.#customer_subscriptions = new api.CustomerSubscriptions(this.#adapter)); }
|
168
|
-
get customers() { return this.#customers || (this.#customers = new api.Customers(this.#adapter)); }
|
169
|
-
get delivery_lead_times() { return this.#delivery_lead_times || (this.#delivery_lead_times = new api.DeliveryLeadTimes(this.#adapter)); }
|
170
|
-
get event_callbacks() { return this.#event_callbacks || (this.#event_callbacks = new api.EventCallbacks(this.#adapter)); }
|
171
|
-
get events() { return this.#events || (this.#events = new api.Events(this.#adapter)); }
|
172
|
-
get exports() { return this.#exports || (this.#exports = new api.Exports(this.#adapter)); }
|
173
|
-
get external_gateways() { return this.#external_gateways || (this.#external_gateways = new api.ExternalGateways(this.#adapter)); }
|
174
|
-
get external_payments() { return this.#external_payments || (this.#external_payments = new api.ExternalPayments(this.#adapter)); }
|
175
|
-
get external_promotions() { return this.#external_promotions || (this.#external_promotions = new api.ExternalPromotions(this.#adapter)); }
|
176
|
-
get external_tax_calculators() { return this.#external_tax_calculators || (this.#external_tax_calculators = new api.ExternalTaxCalculators(this.#adapter)); }
|
177
|
-
get fixed_amount_promotions() { return this.#fixed_amount_promotions || (this.#fixed_amount_promotions = new api.FixedAmountPromotions(this.#adapter)); }
|
178
|
-
get fixed_price_promotions() { return this.#fixed_price_promotions || (this.#fixed_price_promotions = new api.FixedPricePromotions(this.#adapter)); }
|
179
|
-
get free_gift_promotions() { return this.#free_gift_promotions || (this.#free_gift_promotions = new api.FreeGiftPromotions(this.#adapter)); }
|
180
|
-
get free_shipping_promotions() { return this.#free_shipping_promotions || (this.#free_shipping_promotions = new api.FreeShippingPromotions(this.#adapter)); }
|
181
|
-
get geocoders() { return this.#geocoders || (this.#geocoders = new api.Geocoders(this.#adapter)); }
|
182
|
-
get gift_card_recipients() { return this.#gift_card_recipients || (this.#gift_card_recipients = new api.GiftCardRecipients(this.#adapter)); }
|
183
|
-
get gift_cards() { return this.#gift_cards || (this.#gift_cards = new api.GiftCards(this.#adapter)); }
|
184
|
-
get google_geocoders() { return this.#google_geocoders || (this.#google_geocoders = new api.GoogleGeocoders(this.#adapter)); }
|
185
|
-
get imports() { return this.#imports || (this.#imports = new api.Imports(this.#adapter)); }
|
186
|
-
get in_stock_subscriptions() { return this.#in_stock_subscriptions || (this.#in_stock_subscriptions = new api.InStockSubscriptions(this.#adapter)); }
|
187
|
-
get inventory_models() { return this.#inventory_models || (this.#inventory_models = new api.InventoryModels(this.#adapter)); }
|
188
|
-
get inventory_return_locations() { return this.#inventory_return_locations || (this.#inventory_return_locations = new api.InventoryReturnLocations(this.#adapter)); }
|
189
|
-
get inventory_stock_locations() { return this.#inventory_stock_locations || (this.#inventory_stock_locations = new api.InventoryStockLocations(this.#adapter)); }
|
190
|
-
get klarna_gateways() { return this.#klarna_gateways || (this.#klarna_gateways = new api.KlarnaGateways(this.#adapter)); }
|
191
|
-
get klarna_payments() { return this.#klarna_payments || (this.#klarna_payments = new api.KlarnaPayments(this.#adapter)); }
|
192
|
-
get line_item_options() { return this.#line_item_options || (this.#line_item_options = new api.LineItemOptions(this.#adapter)); }
|
193
|
-
get line_items() { return this.#line_items || (this.#line_items = new api.LineItems(this.#adapter)); }
|
194
|
-
get manual_gateways() { return this.#manual_gateways || (this.#manual_gateways = new api.ManualGateways(this.#adapter)); }
|
195
|
-
get manual_tax_calculators() { return this.#manual_tax_calculators || (this.#manual_tax_calculators = new api.ManualTaxCalculators(this.#adapter)); }
|
196
|
-
get markets() { return this.#markets || (this.#markets = new api.Markets(this.#adapter)); }
|
197
|
-
get merchants() { return this.#merchants || (this.#merchants = new api.Merchants(this.#adapter)); }
|
198
|
-
get order_amount_promotion_rules() { return this.#order_amount_promotion_rules || (this.#order_amount_promotion_rules = new api.OrderAmountPromotionRules(this.#adapter)); }
|
199
|
-
get order_copies() { return this.#order_copies || (this.#order_copies = new api.OrderCopies(this.#adapter)); }
|
200
|
-
get order_factories() { return this.#order_factories || (this.#order_factories = new api.OrderFactories(this.#adapter)); }
|
201
|
-
get order_subscription_items() { return this.#order_subscription_items || (this.#order_subscription_items = new api.OrderSubscriptionItems(this.#adapter)); }
|
202
|
-
get order_subscriptions() { return this.#order_subscriptions || (this.#order_subscriptions = new api.OrderSubscriptions(this.#adapter)); }
|
203
|
-
get order_validation_rules() { return this.#order_validation_rules || (this.#order_validation_rules = new api.OrderValidationRules(this.#adapter)); }
|
204
|
-
get orders() { return this.#orders || (this.#orders = new api.Orders(this.#adapter)); }
|
205
|
-
get organization() { return this.#organization || (this.#organization = new api.Organizations(this.#adapter)); }
|
206
|
-
get packages() { return this.#packages || (this.#packages = new api.Packages(this.#adapter)); }
|
207
|
-
get parcel_line_items() { return this.#parcel_line_items || (this.#parcel_line_items = new api.ParcelLineItems(this.#adapter)); }
|
208
|
-
get parcels() { return this.#parcels || (this.#parcels = new api.Parcels(this.#adapter)); }
|
209
|
-
get payment_gateways() { return this.#payment_gateways || (this.#payment_gateways = new api.PaymentGateways(this.#adapter)); }
|
210
|
-
get payment_methods() { return this.#payment_methods || (this.#payment_methods = new api.PaymentMethods(this.#adapter)); }
|
211
|
-
get payment_options() { return this.#payment_options || (this.#payment_options = new api.PaymentOptions(this.#adapter)); }
|
212
|
-
get paypal_gateways() { return this.#paypal_gateways || (this.#paypal_gateways = new api.PaypalGateways(this.#adapter)); }
|
213
|
-
get paypal_payments() { return this.#paypal_payments || (this.#paypal_payments = new api.PaypalPayments(this.#adapter)); }
|
214
|
-
get percentage_discount_promotions() { return this.#percentage_discount_promotions || (this.#percentage_discount_promotions = new api.PercentageDiscountPromotions(this.#adapter)); }
|
215
|
-
get price_frequency_tiers() { return this.#price_frequency_tiers || (this.#price_frequency_tiers = new api.PriceFrequencyTiers(this.#adapter)); }
|
216
|
-
get price_lists() { return this.#price_lists || (this.#price_lists = new api.PriceLists(this.#adapter)); }
|
217
|
-
get price_tiers() { return this.#price_tiers || (this.#price_tiers = new api.PriceTiers(this.#adapter)); }
|
218
|
-
get price_volume_tiers() { return this.#price_volume_tiers || (this.#price_volume_tiers = new api.PriceVolumeTiers(this.#adapter)); }
|
219
|
-
get prices() { return this.#prices || (this.#prices = new api.Prices(this.#adapter)); }
|
220
|
-
get promotion_rules() { return this.#promotion_rules || (this.#promotion_rules = new api.PromotionRules(this.#adapter)); }
|
221
|
-
get promotions() { return this.#promotions || (this.#promotions = new api.Promotions(this.#adapter)); }
|
222
|
-
get recurring_order_copies() { return this.#recurring_order_copies || (this.#recurring_order_copies = new api.RecurringOrderCopies(this.#adapter)); }
|
223
|
-
get refunds() { return this.#refunds || (this.#refunds = new api.Refunds(this.#adapter)); }
|
224
|
-
get reserved_stocks() { return this.#reserved_stocks || (this.#reserved_stocks = new api.ReservedStocks(this.#adapter)); }
|
225
|
-
get resource_errors() { return this.#resource_errors || (this.#resource_errors = new api.ResourceErrors(this.#adapter)); }
|
226
|
-
get return_line_items() { return this.#return_line_items || (this.#return_line_items = new api.ReturnLineItems(this.#adapter)); }
|
227
|
-
get returns() { return this.#returns || (this.#returns = new api.Returns(this.#adapter)); }
|
228
|
-
get satispay_gateways() { return this.#satispay_gateways || (this.#satispay_gateways = new api.SatispayGateways(this.#adapter)); }
|
229
|
-
get satispay_payments() { return this.#satispay_payments || (this.#satispay_payments = new api.SatispayPayments(this.#adapter)); }
|
230
|
-
get shipments() { return this.#shipments || (this.#shipments = new api.Shipments(this.#adapter)); }
|
231
|
-
get shipping_categories() { return this.#shipping_categories || (this.#shipping_categories = new api.ShippingCategories(this.#adapter)); }
|
232
|
-
get shipping_method_tiers() { return this.#shipping_method_tiers || (this.#shipping_method_tiers = new api.ShippingMethodTiers(this.#adapter)); }
|
233
|
-
get shipping_methods() { return this.#shipping_methods || (this.#shipping_methods = new api.ShippingMethods(this.#adapter)); }
|
234
|
-
get shipping_weight_tiers() { return this.#shipping_weight_tiers || (this.#shipping_weight_tiers = new api.ShippingWeightTiers(this.#adapter)); }
|
235
|
-
get shipping_zones() { return this.#shipping_zones || (this.#shipping_zones = new api.ShippingZones(this.#adapter)); }
|
236
|
-
get sku_list_items() { return this.#sku_list_items || (this.#sku_list_items = new api.SkuListItems(this.#adapter)); }
|
237
|
-
get sku_list_promotion_rules() { return this.#sku_list_promotion_rules || (this.#sku_list_promotion_rules = new api.SkuListPromotionRules(this.#adapter)); }
|
238
|
-
get sku_lists() { return this.#sku_lists || (this.#sku_lists = new api.SkuLists(this.#adapter)); }
|
239
|
-
get sku_options() { return this.#sku_options || (this.#sku_options = new api.SkuOptions(this.#adapter)); }
|
240
|
-
get skus() { return this.#skus || (this.#skus = new api.Skus(this.#adapter)); }
|
241
|
-
get stock_items() { return this.#stock_items || (this.#stock_items = new api.StockItems(this.#adapter)); }
|
242
|
-
get stock_line_items() { return this.#stock_line_items || (this.#stock_line_items = new api.StockLineItems(this.#adapter)); }
|
243
|
-
get stock_locations() { return this.#stock_locations || (this.#stock_locations = new api.StockLocations(this.#adapter)); }
|
244
|
-
get stock_reservations() { return this.#stock_reservations || (this.#stock_reservations = new api.StockReservations(this.#adapter)); }
|
245
|
-
get stock_transfers() { return this.#stock_transfers || (this.#stock_transfers = new api.StockTransfers(this.#adapter)); }
|
246
|
-
get stripe_gateways() { return this.#stripe_gateways || (this.#stripe_gateways = new api.StripeGateways(this.#adapter)); }
|
247
|
-
get stripe_payments() { return this.#stripe_payments || (this.#stripe_payments = new api.StripePayments(this.#adapter)); }
|
248
|
-
get subscription_models() { return this.#subscription_models || (this.#subscription_models = new api.SubscriptionModels(this.#adapter)); }
|
249
|
-
get tags() { return this.#tags || (this.#tags = new api.Tags(this.#adapter)); }
|
250
|
-
get tax_calculators() { return this.#tax_calculators || (this.#tax_calculators = new api.TaxCalculators(this.#adapter)); }
|
251
|
-
get tax_categories() { return this.#tax_categories || (this.#tax_categories = new api.TaxCategories(this.#adapter)); }
|
252
|
-
get tax_rules() { return this.#tax_rules || (this.#tax_rules = new api.TaxRules(this.#adapter)); }
|
253
|
-
get taxjar_accounts() { return this.#taxjar_accounts || (this.#taxjar_accounts = new api.TaxjarAccounts(this.#adapter)); }
|
254
|
-
get transactions() { return this.#transactions || (this.#transactions = new api.Transactions(this.#adapter)); }
|
255
|
-
get versions() { return this.#versions || (this.#versions = new api.Versions(this.#adapter)); }
|
256
|
-
get voids() { return this.#voids || (this.#voids = new api.Voids(this.#adapter)); }
|
257
|
-
get webhooks() { return this.#webhooks || (this.#webhooks = new api.Webhooks(this.#adapter)); }
|
258
|
-
get wire_transfers() { return this.#wire_transfers || (this.#wire_transfers = new api.WireTransfers(this.#adapter)); }
|
259
|
-
get currentOrganization() { return this.#slug; }
|
260
|
-
get interceptors() { return this.#adapter.client.interceptors; }
|
261
|
-
localConfig(config) {
|
262
|
-
if (config.organization)
|
263
|
-
this.#slug = config.organization;
|
264
|
-
}
|
265
|
-
config(config) {
|
266
|
-
debug('config %o', config);
|
267
|
-
this.localConfig(config);
|
268
|
-
if (!config.organization)
|
269
|
-
config.organization = this.currentOrganization;
|
270
|
-
this.#adapter.config(config);
|
271
|
-
return this;
|
272
|
-
}
|
273
|
-
resources() {
|
274
|
-
return CommerceLayerStatic.resources();
|
275
|
-
}
|
276
|
-
singletons() {
|
277
|
-
return CommerceLayerStatic.singletons();
|
278
|
-
}
|
279
|
-
isSingleton(resource) {
|
280
|
-
return CommerceLayerStatic.isSingleton(resource);
|
281
|
-
}
|
282
|
-
isApiError(error) {
|
283
|
-
return CommerceLayerStatic.isApiError(error);
|
284
|
-
}
|
285
|
-
addRequestInterceptor(onSuccess, onFailure) {
|
286
|
-
this.interceptors.request = { onSuccess, onFailure };
|
287
|
-
}
|
288
|
-
addResponseInterceptor(onSuccess, onFailure) {
|
289
|
-
this.interceptors.response = { onSuccess, onFailure };
|
290
|
-
}
|
291
|
-
removeInterceptor(type, id = 1) {
|
292
|
-
this.interceptors[type] = undefined;
|
293
|
-
}
|
294
|
-
addRawResponseReader(options) {
|
295
|
-
const reader = {
|
296
|
-
id: undefined,
|
297
|
-
rawResponse: undefined,
|
298
|
-
headers: undefined,
|
299
|
-
ok: true
|
300
|
-
};
|
301
|
-
async function rawResponseInterceptor(response) {
|
302
|
-
reader.rawResponse = await response?.clone().json().catch(() => { });
|
303
|
-
reader.ok = response.ok;
|
304
|
-
if (options?.headers) {
|
305
|
-
const ho = {};
|
306
|
-
response.headers.forEach((value, key) => { ho[key] = value; });
|
307
|
-
reader.headers = ho;
|
308
|
-
}
|
309
|
-
return response;
|
310
|
-
}
|
311
|
-
this.interceptors.rawReader = { onSuccess: rawResponseInterceptor, onFailure: rawResponseInterceptor };
|
312
|
-
reader.id = 1;
|
313
|
-
return reader;
|
314
|
-
}
|
315
|
-
removeRawResponseReader() {
|
316
|
-
this.interceptors.rawReader = undefined;
|
317
|
-
}
|
318
|
-
}
|
319
|
-
const CommerceLayer = (config) => {
|
320
|
-
return new CommerceLayerClient(config);
|
321
|
-
};
|
322
|
-
export default CommerceLayer;
|
323
|
-
export { CommerceLayer };
|
package/lib/esm/common.d.ts
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
import type { ResourceId, ResourceType } from './resource';
|
2
|
-
declare const isResourceId: (resource: any) => resource is ResourceId;
|
3
|
-
declare const isResourceType: (resource: any) => resource is ResourceType;
|
4
|
-
export { isResourceId, isResourceType };
|
5
|
-
export type ObjectType = Record<string, any>;
|
package/lib/esm/common.js
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import { resourceList } from './api';
|
2
|
-
const isResourceId = (resource) => {
|
3
|
-
return (resource?.type && resource.id) && resourceList.includes(resource.type);
|
4
|
-
};
|
5
|
-
const isResourceType = (resource) => {
|
6
|
-
return resource && (typeof resource.type !== 'undefined') && resource.type && resourceList.includes(resource.type);
|
7
|
-
};
|
8
|
-
export { isResourceId, isResourceType };
|
package/lib/esm/config.d.ts
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
declare const config: {
|
2
|
-
readonly default: {
|
3
|
-
readonly domain: "commercelayer.io";
|
4
|
-
readonly pageNumber: 1;
|
5
|
-
readonly pageSize: 10;
|
6
|
-
};
|
7
|
-
readonly client: {
|
8
|
-
readonly timeout: 15000;
|
9
|
-
readonly requiredAttributes: readonly ["organization", "accessToken"];
|
10
|
-
};
|
11
|
-
readonly jsonapi: {
|
12
|
-
readonly maxResourceIncluded: 2;
|
13
|
-
};
|
14
|
-
};
|
15
|
-
export default config;
|
package/lib/esm/config.js
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
const config = {
|
2
|
-
default: {
|
3
|
-
domain: 'commercelayer.io',
|
4
|
-
pageNumber: 1,
|
5
|
-
pageSize: 10,
|
6
|
-
},
|
7
|
-
client: {
|
8
|
-
timeout: 15000,
|
9
|
-
requiredAttributes: ['organization', 'accessToken'],
|
10
|
-
},
|
11
|
-
jsonapi: {
|
12
|
-
maxResourceIncluded: 2
|
13
|
-
}
|
14
|
-
};
|
15
|
-
export default config;
|
package/lib/esm/debug.d.ts
DELETED
package/lib/esm/debug.js
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
const debuggerFunction = (_pattern, ..._args) => {
|
2
|
-
};
|
3
|
-
let debuggerFactory = (_namespace) => debuggerFunction;
|
4
|
-
try {
|
5
|
-
const debugModule = require('debug');
|
6
|
-
if (debugModule && (typeof debugModule === 'function'))
|
7
|
-
debuggerFactory = debugModule;
|
8
|
-
}
|
9
|
-
catch (error) {
|
10
|
-
}
|
11
|
-
const debugPrefix = 'clsdk';
|
12
|
-
const debug = (namespace) => {
|
13
|
-
return debuggerFactory(`${debugPrefix}:${namespace}`);
|
14
|
-
};
|
15
|
-
export default debug;
|
package/lib/esm/error.d.ts
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
declare enum ErrorType {
|
2
|
-
CLIENT = "client",
|
3
|
-
REQUEST = "request",
|
4
|
-
RESPONSE = "response",
|
5
|
-
CANCEL = "cancel",
|
6
|
-
PARSE = "parse",
|
7
|
-
TIMEOUT = "timeout"
|
8
|
-
}
|
9
|
-
declare class SdkError extends Error {
|
10
|
-
static NAME: string;
|
11
|
-
static isSdkError(error: any): error is SdkError;
|
12
|
-
type: ErrorType;
|
13
|
-
code?: string;
|
14
|
-
source?: Error;
|
15
|
-
constructor(error: {
|
16
|
-
message: string;
|
17
|
-
type?: ErrorType;
|
18
|
-
});
|
19
|
-
}
|
20
|
-
declare class ApiError extends SdkError {
|
21
|
-
static NAME: string;
|
22
|
-
static isApiError(error: any): error is ApiError;
|
23
|
-
errors: any[];
|
24
|
-
status?: number;
|
25
|
-
statusText?: string;
|
26
|
-
constructor(error: SdkError);
|
27
|
-
first(): any;
|
28
|
-
}
|
29
|
-
declare const handleError: (error: Error) => never;
|
30
|
-
export { SdkError, ApiError, ErrorType, handleError };
|
package/lib/esm/error.js
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
import { FetchError } from './fetch';
|
2
|
-
var ErrorType;
|
3
|
-
(function (ErrorType) {
|
4
|
-
ErrorType["CLIENT"] = "client";
|
5
|
-
ErrorType["REQUEST"] = "request";
|
6
|
-
ErrorType["RESPONSE"] = "response";
|
7
|
-
ErrorType["CANCEL"] = "cancel";
|
8
|
-
ErrorType["PARSE"] = "parse";
|
9
|
-
ErrorType["TIMEOUT"] = "timeout";
|
10
|
-
})(ErrorType || (ErrorType = {}));
|
11
|
-
class SdkError extends Error {
|
12
|
-
static NAME = 'SdkError';
|
13
|
-
static isSdkError(error) {
|
14
|
-
return error && [SdkError.NAME, ApiError.NAME].includes(error.name) && Object.values(ErrorType).includes(error.type);
|
15
|
-
}
|
16
|
-
type;
|
17
|
-
code;
|
18
|
-
source;
|
19
|
-
constructor(error) {
|
20
|
-
super(error.message);
|
21
|
-
this.name = SdkError.NAME;
|
22
|
-
this.type = error.type || ErrorType.CLIENT;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
class ApiError extends SdkError {
|
26
|
-
static NAME = 'ApiError';
|
27
|
-
static isApiError(error) {
|
28
|
-
return SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE);
|
29
|
-
}
|
30
|
-
errors = [];
|
31
|
-
status;
|
32
|
-
statusText;
|
33
|
-
constructor(error) {
|
34
|
-
super({ ...error, type: ErrorType.RESPONSE });
|
35
|
-
this.name = ApiError.NAME;
|
36
|
-
}
|
37
|
-
first() {
|
38
|
-
return (this.errors?.length > 0) ? this.errors[0] : undefined;
|
39
|
-
}
|
40
|
-
}
|
41
|
-
const isRequestError = (error) => {
|
42
|
-
return error instanceof TypeError;
|
43
|
-
};
|
44
|
-
const isCancelError = (error) => {
|
45
|
-
return (error instanceof DOMException) && (error.name === 'AbortError');
|
46
|
-
};
|
47
|
-
const isTimeoutError = (error) => {
|
48
|
-
return (error instanceof DOMException) && (error.name === 'TimeoutError');
|
49
|
-
};
|
50
|
-
const handleError = (error) => {
|
51
|
-
let sdkError = new SdkError({ message: error.message });
|
52
|
-
if (FetchError.isFetchError(error)) {
|
53
|
-
const apiError = new ApiError(sdkError);
|
54
|
-
apiError.type = ErrorType.RESPONSE;
|
55
|
-
apiError.status = error.status;
|
56
|
-
apiError.statusText = error.statusText;
|
57
|
-
apiError.code = String(apiError.status);
|
58
|
-
apiError.errors = error.errors || [];
|
59
|
-
if (!apiError.message && apiError.statusText)
|
60
|
-
apiError.message = apiError.statusText;
|
61
|
-
sdkError = apiError;
|
62
|
-
}
|
63
|
-
else if (isRequestError(error)) {
|
64
|
-
sdkError.type = ErrorType.REQUEST;
|
65
|
-
}
|
66
|
-
else if (isCancelError(error)) {
|
67
|
-
sdkError.type = ErrorType.CANCEL;
|
68
|
-
}
|
69
|
-
else if (isTimeoutError(error)) {
|
70
|
-
sdkError.type = ErrorType.TIMEOUT;
|
71
|
-
}
|
72
|
-
else {
|
73
|
-
sdkError.type = ErrorType.CLIENT;
|
74
|
-
sdkError.source = error;
|
75
|
-
}
|
76
|
-
throw sdkError;
|
77
|
-
};
|
78
|
-
export { SdkError, ApiError, ErrorType, handleError };
|
package/lib/esm/fetch.d.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import type { DocWithData } from 'jsonapi-typescript';
|
2
|
-
import type { InterceptorManager } from './interceptor';
|
3
|
-
export type FetchResponse = DocWithData;
|
4
|
-
export type FetchOptions = RequestInit;
|
5
|
-
export declare class FetchError extends Error {
|
6
|
-
#private;
|
7
|
-
static isFetchError: (error: any) => error is FetchError;
|
8
|
-
constructor(status: number, statusText: string, body?: any);
|
9
|
-
get errors(): any[] | undefined;
|
10
|
-
get status(): number;
|
11
|
-
get statusText(): string;
|
12
|
-
}
|
13
|
-
export declare const fetchURL: (url: URL, options: FetchOptions, interceptors?: InterceptorManager) => Promise<FetchResponse>;
|
package/lib/esm/fetch.js
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
import Debug from './debug';
|
2
|
-
const debug = Debug('fetch');
|
3
|
-
export class FetchError extends Error {
|
4
|
-
static isFetchError = (error) => {
|
5
|
-
return error instanceof FetchError;
|
6
|
-
};
|
7
|
-
#errors;
|
8
|
-
#status;
|
9
|
-
#statusText;
|
10
|
-
constructor(status, statusText, body) {
|
11
|
-
super(statusText);
|
12
|
-
this.#status = status;
|
13
|
-
this.#statusText = statusText;
|
14
|
-
if (body)
|
15
|
-
this.#errors = body.errors;
|
16
|
-
}
|
17
|
-
get errors() { return this.#errors; }
|
18
|
-
get status() { return this.#status; }
|
19
|
-
get statusText() { return this.#statusText; }
|
20
|
-
}
|
21
|
-
export const fetchURL = async (url, options, interceptors) => {
|
22
|
-
debug('fetch: %s, %O', url, options || {});
|
23
|
-
if (interceptors?.request?.onSuccess)
|
24
|
-
({ url, options } = await interceptors.request.onSuccess({ url, options }));
|
25
|
-
const request = new Request(url, options);
|
26
|
-
let response = await fetch(request);
|
27
|
-
if (response.ok) {
|
28
|
-
if (interceptors?.rawReader?.onSuccess)
|
29
|
-
await interceptors.rawReader.onSuccess(response);
|
30
|
-
if (interceptors?.response?.onSuccess)
|
31
|
-
response = await interceptors.response.onSuccess(response);
|
32
|
-
}
|
33
|
-
else {
|
34
|
-
if (interceptors?.rawReader?.onFailure)
|
35
|
-
await interceptors.rawReader.onFailure(response);
|
36
|
-
}
|
37
|
-
const responseBody = await response.json().catch(() => { });
|
38
|
-
if (!response.ok) {
|
39
|
-
let error = new FetchError(response.status, response.statusText, responseBody);
|
40
|
-
if (interceptors?.response?.onFailure)
|
41
|
-
error = await interceptors.response.onFailure(error);
|
42
|
-
if (error)
|
43
|
-
throw error;
|
44
|
-
}
|
45
|
-
return responseBody;
|
46
|
-
};
|
package/lib/esm/index.d.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
export { default, CommerceLayer } from './commercelayer';
|
2
|
-
export type { CommerceLayerClient } from './commercelayer';
|
3
|
-
export { CommerceLayerStatic } from './static';
|
4
|
-
export type { QueryParamsRetrieve, QueryParamsList, QueryParams } from './query';
|
5
|
-
export type * from './model';
|
6
|
-
export type { RequestObj, ResponseObj, ErrorObj, HeadersObj } from './interceptor';
|
7
|
-
export type { SdkError, ApiError, ErrorType } from './error';
|
package/lib/esm/index.js
DELETED
package/lib/esm/interceptor.d.ts
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
import type { FetchError, FetchOptions } from "./fetch";
|
2
|
-
type InterceptorEventManager<S extends (RequestInterceptor | ResponseInterceptor), F extends (ErrorInterceptor | ResponseInterceptor)> = {
|
3
|
-
onSuccess?: S;
|
4
|
-
onFailure?: F;
|
5
|
-
};
|
6
|
-
type RequestEventManager = InterceptorEventManager<RequestInterceptor, ErrorInterceptor>;
|
7
|
-
type ResponseEventManager = InterceptorEventManager<ResponseInterceptor, ErrorInterceptor>;
|
8
|
-
type ErrorEventManager = InterceptorEventManager<ResponseInterceptor, ResponseInterceptor>;
|
9
|
-
type InterceptorManager = {
|
10
|
-
request?: RequestEventManager;
|
11
|
-
response?: ResponseEventManager;
|
12
|
-
rawReader?: ErrorEventManager;
|
13
|
-
};
|
14
|
-
type RequestObj = {
|
15
|
-
url: URL;
|
16
|
-
options: FetchOptions;
|
17
|
-
};
|
18
|
-
type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
|
19
|
-
type ResponseObj = Response;
|
20
|
-
type ResponseInterceptor = (response: ResponseObj) => ResponseObj | Promise<ResponseObj>;
|
21
|
-
type ApiHeadersList = 'x-ratelimit-limit' | 'x-ratelimit-count' | 'x-ratelimit-period' | 'x-ratelimit-interval' | 'x-ratelimit-remaining';
|
22
|
-
type ApiHeaders = {
|
23
|
-
[key in ApiHeadersList]: string | number | boolean;
|
24
|
-
};
|
25
|
-
type HeadersObj = Record<string, string> | ApiHeaders;
|
26
|
-
type ErrorObj = FetchError;
|
27
|
-
type ErrorInterceptor = (error: ErrorObj) => ErrorObj | Promise<ErrorObj>;
|
28
|
-
type InterceptorType = 'request' | 'response';
|
29
|
-
export type { InterceptorManager, RequestInterceptor, ResponseInterceptor, ErrorInterceptor, InterceptorType };
|
30
|
-
export type { RequestObj, ResponseObj, ErrorObj, HeadersObj };
|
31
|
-
type RawResponseReader = {
|
32
|
-
id?: number;
|
33
|
-
rawResponse?: any;
|
34
|
-
headers?: HeadersObj;
|
35
|
-
ok: boolean;
|
36
|
-
};
|
37
|
-
export type { RawResponseReader };
|
package/lib/esm/interceptor.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/lib/esm/jsonapi.d.ts
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { DocWithData, ResourceObject as JSONAPIObject } from 'jsonapi-typescript';
|
2
|
-
import type { ResourceCreate, ResourceUpdate, ResourceId, ResourceType, Resource } from './resource';
|
3
|
-
export type { DocWithData };
|
4
|
-
declare const denormalize: <R extends Resource>(response: DocWithData) => R | R[];
|
5
|
-
declare const normalize: (resource: (ResourceCreate & ResourceType) | (ResourceUpdate & ResourceId)) => JSONAPIObject;
|
6
|
-
export { denormalize, normalize };
|