@commercelayer/sdk 5.37.0 → 5.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/api.d.ts +1 -164
- package/lib/cjs/api.js +1 -387
- package/lib/cjs/client.d.ts +1 -39
- package/lib/cjs/client.js +1 -154
- package/lib/cjs/commercelayer.d.ts +1 -153
- package/lib/cjs/commercelayer.js +1 -253
- package/lib/cjs/common.d.ts +1 -5
- package/lib/cjs/common.js +1 -23
- package/lib/cjs/config.d.ts +1 -15
- package/lib/cjs/config.js +1 -19
- package/lib/cjs/debug.d.ts +1 -3
- package/lib/cjs/debug.js +1 -38
- package/lib/cjs/error.d.ts +1 -31
- package/lib/cjs/error.js +1 -77
- package/lib/cjs/index.d.ts +1 -7
- package/lib/cjs/index.js +1 -13
- package/lib/cjs/interceptor.d.ts +1 -25
- package/lib/cjs/interceptor.js +1 -2
- package/lib/cjs/jsonapi.d.ts +1 -6
- package/lib/cjs/jsonapi.js +1 -94
- package/lib/cjs/model.d.ts +1 -124
- package/lib/cjs/model.js +1 -3
- package/lib/cjs/query.d.ts +1 -17
- package/lib/cjs/query.js +1 -69
- package/lib/cjs/resource.d.ts +1 -89
- package/lib/cjs/resource.js +1 -198
- package/lib/cjs/resources/addresses.d.ts +1 -103
- package/lib/cjs/resources/addresses.js +1 -41
- package/lib/cjs/resources/adjustments.d.ts +1 -42
- package/lib/cjs/resources/adjustments.js +1 -29
- package/lib/cjs/resources/adyen_gateways.d.ts +1 -60
- package/lib/cjs/resources/adyen_gateways.js +1 -37
- package/lib/cjs/resources/adyen_payments.d.ts +1 -51
- package/lib/cjs/resources/adyen_payments.js +1 -40
- package/lib/cjs/resources/application.d.ts +1 -22
- package/lib/cjs/resources/application.js +1 -16
- package/lib/cjs/resources/attachments.d.ts +1 -157
- package/lib/cjs/resources/attachments.js +1 -25
- package/lib/cjs/resources/authorizations.d.ts +1 -70
- package/lib/cjs/resources/authorizations.js +1 -52
- package/lib/cjs/resources/avalara_accounts.d.ts +1 -59
- package/lib/cjs/resources/avalara_accounts.js +1 -41
- package/lib/cjs/resources/axerve_gateways.d.ts +1 -48
- package/lib/cjs/resources/axerve_gateways.js +1 -37
- package/lib/cjs/resources/axerve_payments.d.ts +1 -54
- package/lib/cjs/resources/axerve_payments.js +1 -40
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -39
- package/lib/cjs/resources/billing_info_validation_rules.js +1 -37
- package/lib/cjs/resources/bing_geocoders.d.ts +1 -36
- package/lib/cjs/resources/bing_geocoders.js +1 -33
- package/lib/cjs/resources/braintree_gateways.d.ts +1 -60
- package/lib/cjs/resources/braintree_gateways.js +1 -37
- package/lib/cjs/resources/braintree_payments.d.ts +1 -52
- package/lib/cjs/resources/braintree_payments.js +1 -37
- package/lib/cjs/resources/bundles.d.ts +1 -93
- package/lib/cjs/resources/bundles.js +1 -59
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +1 -137
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +1 -79
- package/lib/cjs/resources/captures.d.ts +1 -60
- package/lib/cjs/resources/captures.js +1 -49
- package/lib/cjs/resources/carrier_accounts.d.ts +1 -30
- package/lib/cjs/resources/carrier_accounts.js +1 -28
- package/lib/cjs/resources/checkout_com_gateways.d.ts +1 -49
- package/lib/cjs/resources/checkout_com_gateways.js +1 -37
- package/lib/cjs/resources/checkout_com_payments.d.ts +1 -65
- package/lib/cjs/resources/checkout_com_payments.js +1 -43
- package/lib/cjs/resources/cleanups.d.ts +1 -40
- package/lib/cjs/resources/cleanups.js +1 -30
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -67
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +1 -33
- package/lib/cjs/resources/coupon_recipients.d.ts +1 -48
- package/lib/cjs/resources/coupon_recipients.js +1 -37
- package/lib/cjs/resources/coupons.d.ts +1 -71
- package/lib/cjs/resources/coupons.js +1 -45
- package/lib/cjs/resources/custom_promotion_rules.d.ts +1 -62
- package/lib/cjs/resources/custom_promotion_rules.js +1 -29
- package/lib/cjs/resources/customer_addresses.d.ts +1 -50
- package/lib/cjs/resources/customer_addresses.js +1 -41
- package/lib/cjs/resources/customer_groups.d.ts +1 -40
- package/lib/cjs/resources/customer_groups.js +1 -41
- package/lib/cjs/resources/customer_password_resets.d.ts +1 -38
- package/lib/cjs/resources/customer_password_resets.js +1 -36
- package/lib/cjs/resources/customer_payment_sources.d.ts +1 -86
- package/lib/cjs/resources/customer_payment_sources.js +1 -37
- package/lib/cjs/resources/customer_subscriptions.d.ts +1 -35
- package/lib/cjs/resources/customer_subscriptions.js +1 -37
- package/lib/cjs/resources/customers.d.ts +1 -76
- package/lib/cjs/resources/customers.js +1 -69
- package/lib/cjs/resources/delivery_lead_times.d.ts +1 -55
- package/lib/cjs/resources/delivery_lead_times.js +1 -41
- package/lib/cjs/resources/event_callbacks.d.ts +1 -25
- package/lib/cjs/resources/event_callbacks.js +1 -20
- package/lib/cjs/resources/events.d.ts +1 -25
- package/lib/cjs/resources/events.js +1 -24
- package/lib/cjs/resources/exports.d.ts +1 -41
- package/lib/cjs/resources/exports.js +1 -26
- package/lib/cjs/resources/external_gateways.d.ts +1 -57
- package/lib/cjs/resources/external_gateways.js +1 -40
- package/lib/cjs/resources/external_payments.d.ts +1 -48
- package/lib/cjs/resources/external_payments.js +1 -41
- package/lib/cjs/resources/external_promotions.d.ts +1 -136
- package/lib/cjs/resources/external_promotions.js +1 -82
- package/lib/cjs/resources/external_tax_calculators.d.ts +1 -45
- package/lib/cjs/resources/external_tax_calculators.js +1 -40
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +1 -133
- package/lib/cjs/resources/fixed_amount_promotions.js +1 -79
- package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -133
- package/lib/cjs/resources/fixed_price_promotions.js +1 -79
- package/lib/cjs/resources/free_gift_promotions.d.ts +1 -131
- package/lib/cjs/resources/free_gift_promotions.js +1 -79
- package/lib/cjs/resources/free_shipping_promotions.d.ts +1 -125
- package/lib/cjs/resources/free_shipping_promotions.js +1 -75
- package/lib/cjs/resources/geocoders.d.ts +1 -25
- package/lib/cjs/resources/geocoders.js +1 -24
- package/lib/cjs/resources/gift_card_recipients.d.ts +1 -48
- package/lib/cjs/resources/gift_card_recipients.js +1 -37
- package/lib/cjs/resources/gift_cards.d.ts +1 -104
- package/lib/cjs/resources/gift_cards.js +1 -61
- package/lib/cjs/resources/google_geocoders.d.ts +1 -36
- package/lib/cjs/resources/google_geocoders.js +1 -33
- package/lib/cjs/resources/imports.d.ts +1 -44
- package/lib/cjs/resources/imports.js +1 -26
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -68
- package/lib/cjs/resources/in_stock_subscriptions.js +1 -51
- package/lib/cjs/resources/inventory_models.d.ts +1 -55
- package/lib/cjs/resources/inventory_models.js +1 -41
- package/lib/cjs/resources/inventory_return_locations.d.ts +1 -47
- package/lib/cjs/resources/inventory_return_locations.js +1 -37
- package/lib/cjs/resources/inventory_stock_locations.d.ts +1 -50
- package/lib/cjs/resources/inventory_stock_locations.js +1 -37
- package/lib/cjs/resources/klarna_gateways.d.ts +1 -48
- package/lib/cjs/resources/klarna_gateways.js +1 -37
- package/lib/cjs/resources/klarna_payments.d.ts +1 -48
- package/lib/cjs/resources/klarna_payments.js +1 -40
- package/lib/cjs/resources/line_item_options.d.ts +1 -69
- package/lib/cjs/resources/line_item_options.js +1 -41
- package/lib/cjs/resources/line_items.d.ts +1 -170
- package/lib/cjs/resources/line_items.js +1 -66
- package/lib/cjs/resources/manual_gateways.d.ts +1 -34
- package/lib/cjs/resources/manual_gateways.js +1 -33
- package/lib/cjs/resources/manual_tax_calculators.d.ts +1 -45
- package/lib/cjs/resources/manual_tax_calculators.js +1 -41
- package/lib/cjs/resources/markets.d.ts +1 -107
- package/lib/cjs/resources/markets.js +1 -63
- package/lib/cjs/resources/merchants.d.ts +1 -42
- package/lib/cjs/resources/merchants.js +1 -37
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -67
- package/lib/cjs/resources/order_amount_promotion_rules.js +1 -29
- package/lib/cjs/resources/order_copies.d.ts +1 -51
- package/lib/cjs/resources/order_copies.js +1 -41
- package/lib/cjs/resources/order_factories.d.ts +1 -34
- package/lib/cjs/resources/order_factories.js +1 -28
- package/lib/cjs/resources/order_subscription_items.d.ts +1 -72
- package/lib/cjs/resources/order_subscription_items.js +1 -33
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -98
- package/lib/cjs/resources/order_subscriptions.js +1 -78
- package/lib/cjs/resources/order_validation_rules.d.ts +1 -27
- package/lib/cjs/resources/order_validation_rules.js +1 -28
- package/lib/cjs/resources/orders.d.ts +1 -389
- package/lib/cjs/resources/orders.js +1 -236
- package/lib/cjs/resources/organization.d.ts +1 -34
- package/lib/cjs/resources/organization.js +1 -16
- package/lib/cjs/resources/packages.d.ts +1 -60
- package/lib/cjs/resources/packages.js +1 -41
- package/lib/cjs/resources/parcel_line_items.d.ts +1 -47
- package/lib/cjs/resources/parcel_line_items.js +1 -37
- package/lib/cjs/resources/parcels.d.ts +1 -126
- package/lib/cjs/resources/parcels.js +1 -49
- package/lib/cjs/resources/payment_gateways.d.ts +1 -25
- package/lib/cjs/resources/payment_gateways.js +1 -24
- package/lib/cjs/resources/payment_methods.d.ts +1 -83
- package/lib/cjs/resources/payment_methods.js +1 -47
- package/lib/cjs/resources/payment_options.d.ts +1 -44
- package/lib/cjs/resources/payment_options.js +1 -33
- package/lib/cjs/resources/paypal_gateways.d.ts +1 -41
- package/lib/cjs/resources/paypal_gateways.js +1 -37
- package/lib/cjs/resources/paypal_payments.d.ts +1 -53
- package/lib/cjs/resources/paypal_payments.js +1 -37
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +1 -131
- package/lib/cjs/resources/percentage_discount_promotions.js +1 -79
- package/lib/cjs/resources/price_frequency_tiers.d.ts +1 -53
- package/lib/cjs/resources/price_frequency_tiers.js +1 -41
- package/lib/cjs/resources/price_lists.d.ts +1 -46
- package/lib/cjs/resources/price_lists.js +1 -37
- package/lib/cjs/resources/price_tiers.d.ts +1 -32
- package/lib/cjs/resources/price_tiers.js +1 -28
- package/lib/cjs/resources/price_volume_tiers.d.ts +1 -53
- package/lib/cjs/resources/price_volume_tiers.js +1 -41
- package/lib/cjs/resources/prices.d.ts +1 -84
- package/lib/cjs/resources/prices.js +1 -65
- package/lib/cjs/resources/promotion_rules.d.ts +1 -29
- package/lib/cjs/resources/promotion_rules.js +1 -20
- package/lib/cjs/resources/promotions.d.ts +1 -63
- package/lib/cjs/resources/promotions.js +1 -60
- package/lib/cjs/resources/recurring_order_copies.d.ts +1 -53
- package/lib/cjs/resources/recurring_order_copies.js +1 -41
- package/lib/cjs/resources/refunds.d.ts +1 -44
- package/lib/cjs/resources/refunds.js +1 -36
- package/lib/cjs/resources/reserved_stocks.d.ts +1 -28
- package/lib/cjs/resources/reserved_stocks.js +1 -28
- package/lib/cjs/resources/resource_errors.d.ts +1 -22
- package/lib/cjs/resources/resource_errors.js +1 -16
- package/lib/cjs/resources/return_line_items.d.ts +1 -52
- package/lib/cjs/resources/return_line_items.js +1 -36
- package/lib/cjs/resources/returns.d.ts +1 -96
- package/lib/cjs/resources/returns.js +1 -92
- package/lib/cjs/resources/satispay_gateways.d.ts +1 -46
- package/lib/cjs/resources/satispay_gateways.js +1 -37
- package/lib/cjs/resources/satispay_payments.d.ts +1 -50
- package/lib/cjs/resources/satispay_payments.js +1 -40
- package/lib/cjs/resources/shipments.d.ts +1 -151
- package/lib/cjs/resources/shipments.js +1 -130
- package/lib/cjs/resources/shipping_categories.d.ts +1 -40
- package/lib/cjs/resources/shipping_categories.js +1 -37
- package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -32
- package/lib/cjs/resources/shipping_method_tiers.js +1 -28
- package/lib/cjs/resources/shipping_methods.d.ts +1 -125
- package/lib/cjs/resources/shipping_methods.js +1 -70
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -50
- package/lib/cjs/resources/shipping_weight_tiers.js +1 -37
- package/lib/cjs/resources/shipping_zones.d.ts +1 -52
- package/lib/cjs/resources/shipping_zones.js +1 -33
- package/lib/cjs/resources/sku_list_items.d.ts +1 -51
- package/lib/cjs/resources/sku_list_items.js +1 -37
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -76
- package/lib/cjs/resources/sku_list_promotion_rules.js +1 -37
- package/lib/cjs/resources/sku_lists.d.ts +1 -64
- package/lib/cjs/resources/sku_lists.js +1 -49
- package/lib/cjs/resources/sku_options.d.ts +1 -71
- package/lib/cjs/resources/sku_options.js +1 -45
- package/lib/cjs/resources/skus.d.ts +1 -96
- package/lib/cjs/resources/skus.js +1 -65
- package/lib/cjs/resources/stock_items.d.ts +1 -61
- package/lib/cjs/resources/stock_items.js +1 -52
- package/lib/cjs/resources/stock_line_items.d.ts +1 -73
- package/lib/cjs/resources/stock_line_items.js +1 -54
- package/lib/cjs/resources/stock_locations.d.ts +1 -64
- package/lib/cjs/resources/stock_locations.js +1 -53
- package/lib/cjs/resources/stock_reservations.d.ts +1 -51
- package/lib/cjs/resources/stock_reservations.js +1 -48
- package/lib/cjs/resources/stock_transfers.d.ts +1 -86
- package/lib/cjs/resources/stock_transfers.js +1 -71
- package/lib/cjs/resources/stripe_gateways.d.ts +1 -45
- package/lib/cjs/resources/stripe_gateways.js +1 -37
- package/lib/cjs/resources/stripe_payments.d.ts +1 -59
- package/lib/cjs/resources/stripe_payments.js +1 -43
- package/lib/cjs/resources/subscription_models.d.ts +1 -49
- package/lib/cjs/resources/subscription_models.js +1 -37
- package/lib/cjs/resources/tags.d.ts +1 -28
- package/lib/cjs/resources/tags.js +1 -25
- package/lib/cjs/resources/tax_calculators.d.ts +1 -28
- package/lib/cjs/resources/tax_calculators.js +1 -28
- package/lib/cjs/resources/tax_categories.d.ts +1 -63
- package/lib/cjs/resources/tax_categories.js +1 -37
- package/lib/cjs/resources/tax_rules.d.ts +1 -73
- package/lib/cjs/resources/tax_rules.js +1 -33
- package/lib/cjs/resources/taxjar_accounts.d.ts +1 -47
- package/lib/cjs/resources/taxjar_accounts.js +1 -41
- package/lib/cjs/resources/transactions.d.ts +1 -41
- package/lib/cjs/resources/transactions.js +1 -32
- package/lib/cjs/resources/versions.d.ts +1 -22
- package/lib/cjs/resources/versions.js +1 -16
- package/lib/cjs/resources/voids.d.ts +1 -44
- package/lib/cjs/resources/voids.js +1 -36
- package/lib/cjs/resources/webhooks.d.ts +1 -55
- package/lib/cjs/resources/webhooks.js +1 -42
- package/lib/cjs/resources/wire_transfers.d.ts +1 -37
- package/lib/cjs/resources/wire_transfers.js +1 -33
- package/lib/cjs/static.d.ts +1 -12
- package/lib/cjs/static.js +1 -51
- package/lib/cjs/util.d.ts +1 -4
- package/lib/cjs/util.js +1 -16
- package/lib/esm/api.d.ts +1 -164
- package/lib/esm/api.js +1 -258
- package/lib/esm/client.d.ts +1 -39
- package/lib/esm/client.js +1 -149
- package/lib/esm/commercelayer.d.ts +1 -153
- package/lib/esm/commercelayer.js +1 -224
- package/lib/esm/common.d.ts +1 -5
- package/lib/esm/common.js +1 -19
- package/lib/esm/config.d.ts +1 -15
- package/lib/esm/config.js +1 -17
- package/lib/esm/debug.d.ts +1 -3
- package/lib/esm/debug.js +1 -36
- package/lib/esm/error.d.ts +1 -31
- package/lib/esm/error.js +1 -69
- package/lib/esm/index.d.ts +1 -7
- package/lib/esm/index.js +1 -4
- package/lib/esm/interceptor.d.ts +1 -25
- package/lib/esm/interceptor.js +1 -1
- package/lib/esm/jsonapi.d.ts +1 -6
- package/lib/esm/jsonapi.js +1 -87
- package/lib/esm/model.d.ts +1 -124
- package/lib/esm/model.js +1 -2
- package/lib/esm/query.d.ts +1 -17
- package/lib/esm/query.js +1 -62
- package/lib/esm/resource.d.ts +1 -89
- package/lib/esm/resource.js +1 -191
- package/lib/esm/resources/addresses.d.ts +1 -103
- package/lib/esm/resources/addresses.js +1 -39
- package/lib/esm/resources/adjustments.d.ts +1 -42
- package/lib/esm/resources/adjustments.js +1 -27
- package/lib/esm/resources/adyen_gateways.d.ts +1 -60
- package/lib/esm/resources/adyen_gateways.js +1 -35
- package/lib/esm/resources/adyen_payments.d.ts +1 -51
- package/lib/esm/resources/adyen_payments.js +1 -38
- package/lib/esm/resources/application.d.ts +1 -22
- package/lib/esm/resources/application.js +1 -14
- package/lib/esm/resources/attachments.d.ts +1 -157
- package/lib/esm/resources/attachments.js +1 -23
- package/lib/esm/resources/authorizations.d.ts +1 -70
- package/lib/esm/resources/authorizations.js +1 -50
- package/lib/esm/resources/avalara_accounts.d.ts +1 -59
- package/lib/esm/resources/avalara_accounts.js +1 -39
- package/lib/esm/resources/axerve_gateways.d.ts +1 -48
- package/lib/esm/resources/axerve_gateways.js +1 -35
- package/lib/esm/resources/axerve_payments.d.ts +1 -54
- package/lib/esm/resources/axerve_payments.js +1 -38
- package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -39
- package/lib/esm/resources/billing_info_validation_rules.js +1 -35
- package/lib/esm/resources/bing_geocoders.d.ts +1 -36
- package/lib/esm/resources/bing_geocoders.js +1 -31
- package/lib/esm/resources/braintree_gateways.d.ts +1 -60
- package/lib/esm/resources/braintree_gateways.js +1 -35
- package/lib/esm/resources/braintree_payments.d.ts +1 -52
- package/lib/esm/resources/braintree_payments.js +1 -35
- package/lib/esm/resources/bundles.d.ts +1 -93
- package/lib/esm/resources/bundles.js +1 -57
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -137
- package/lib/esm/resources/buy_x_pay_y_promotions.js +1 -77
- package/lib/esm/resources/captures.d.ts +1 -60
- package/lib/esm/resources/captures.js +1 -47
- package/lib/esm/resources/carrier_accounts.d.ts +1 -30
- package/lib/esm/resources/carrier_accounts.js +1 -26
- package/lib/esm/resources/checkout_com_gateways.d.ts +1 -49
- package/lib/esm/resources/checkout_com_gateways.js +1 -35
- package/lib/esm/resources/checkout_com_payments.d.ts +1 -65
- package/lib/esm/resources/checkout_com_payments.js +1 -41
- package/lib/esm/resources/cleanups.d.ts +1 -40
- package/lib/esm/resources/cleanups.js +1 -28
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -67
- package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -31
- package/lib/esm/resources/coupon_recipients.d.ts +1 -48
- package/lib/esm/resources/coupon_recipients.js +1 -35
- package/lib/esm/resources/coupons.d.ts +1 -71
- package/lib/esm/resources/coupons.js +1 -43
- package/lib/esm/resources/custom_promotion_rules.d.ts +1 -62
- package/lib/esm/resources/custom_promotion_rules.js +1 -27
- package/lib/esm/resources/customer_addresses.d.ts +1 -50
- package/lib/esm/resources/customer_addresses.js +1 -39
- package/lib/esm/resources/customer_groups.d.ts +1 -40
- package/lib/esm/resources/customer_groups.js +1 -39
- package/lib/esm/resources/customer_password_resets.d.ts +1 -38
- package/lib/esm/resources/customer_password_resets.js +1 -34
- package/lib/esm/resources/customer_payment_sources.d.ts +1 -86
- package/lib/esm/resources/customer_payment_sources.js +1 -35
- package/lib/esm/resources/customer_subscriptions.d.ts +1 -35
- package/lib/esm/resources/customer_subscriptions.js +1 -35
- package/lib/esm/resources/customers.d.ts +1 -76
- package/lib/esm/resources/customers.js +1 -67
- package/lib/esm/resources/delivery_lead_times.d.ts +1 -55
- package/lib/esm/resources/delivery_lead_times.js +1 -39
- package/lib/esm/resources/event_callbacks.d.ts +1 -25
- package/lib/esm/resources/event_callbacks.js +1 -18
- package/lib/esm/resources/events.d.ts +1 -25
- package/lib/esm/resources/events.js +1 -22
- package/lib/esm/resources/exports.d.ts +1 -41
- package/lib/esm/resources/exports.js +1 -24
- package/lib/esm/resources/external_gateways.d.ts +1 -57
- package/lib/esm/resources/external_gateways.js +1 -38
- package/lib/esm/resources/external_payments.d.ts +1 -48
- package/lib/esm/resources/external_payments.js +1 -39
- package/lib/esm/resources/external_promotions.d.ts +1 -136
- package/lib/esm/resources/external_promotions.js +1 -80
- package/lib/esm/resources/external_tax_calculators.d.ts +1 -45
- package/lib/esm/resources/external_tax_calculators.js +1 -38
- package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -133
- package/lib/esm/resources/fixed_amount_promotions.js +1 -77
- package/lib/esm/resources/fixed_price_promotions.d.ts +1 -133
- package/lib/esm/resources/fixed_price_promotions.js +1 -77
- package/lib/esm/resources/free_gift_promotions.d.ts +1 -131
- package/lib/esm/resources/free_gift_promotions.js +1 -77
- package/lib/esm/resources/free_shipping_promotions.d.ts +1 -125
- package/lib/esm/resources/free_shipping_promotions.js +1 -73
- package/lib/esm/resources/geocoders.d.ts +1 -25
- package/lib/esm/resources/geocoders.js +1 -22
- package/lib/esm/resources/gift_card_recipients.d.ts +1 -48
- package/lib/esm/resources/gift_card_recipients.js +1 -35
- package/lib/esm/resources/gift_cards.d.ts +1 -104
- package/lib/esm/resources/gift_cards.js +1 -59
- package/lib/esm/resources/google_geocoders.d.ts +1 -36
- package/lib/esm/resources/google_geocoders.js +1 -31
- package/lib/esm/resources/imports.d.ts +1 -44
- package/lib/esm/resources/imports.js +1 -24
- package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -68
- package/lib/esm/resources/in_stock_subscriptions.js +1 -49
- package/lib/esm/resources/inventory_models.d.ts +1 -55
- package/lib/esm/resources/inventory_models.js +1 -39
- package/lib/esm/resources/inventory_return_locations.d.ts +1 -47
- package/lib/esm/resources/inventory_return_locations.js +1 -35
- package/lib/esm/resources/inventory_stock_locations.d.ts +1 -50
- package/lib/esm/resources/inventory_stock_locations.js +1 -35
- package/lib/esm/resources/klarna_gateways.d.ts +1 -48
- package/lib/esm/resources/klarna_gateways.js +1 -35
- package/lib/esm/resources/klarna_payments.d.ts +1 -48
- package/lib/esm/resources/klarna_payments.js +1 -38
- package/lib/esm/resources/line_item_options.d.ts +1 -69
- package/lib/esm/resources/line_item_options.js +1 -39
- package/lib/esm/resources/line_items.d.ts +1 -170
- package/lib/esm/resources/line_items.js +1 -64
- package/lib/esm/resources/manual_gateways.d.ts +1 -34
- package/lib/esm/resources/manual_gateways.js +1 -31
- package/lib/esm/resources/manual_tax_calculators.d.ts +1 -45
- package/lib/esm/resources/manual_tax_calculators.js +1 -39
- package/lib/esm/resources/markets.d.ts +1 -107
- package/lib/esm/resources/markets.js +1 -61
- package/lib/esm/resources/merchants.d.ts +1 -42
- package/lib/esm/resources/merchants.js +1 -35
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -67
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -27
- package/lib/esm/resources/order_copies.d.ts +1 -51
- package/lib/esm/resources/order_copies.js +1 -39
- package/lib/esm/resources/order_factories.d.ts +1 -34
- package/lib/esm/resources/order_factories.js +1 -26
- package/lib/esm/resources/order_subscription_items.d.ts +1 -72
- package/lib/esm/resources/order_subscription_items.js +1 -31
- package/lib/esm/resources/order_subscriptions.d.ts +1 -98
- package/lib/esm/resources/order_subscriptions.js +1 -76
- package/lib/esm/resources/order_validation_rules.d.ts +1 -27
- package/lib/esm/resources/order_validation_rules.js +1 -26
- package/lib/esm/resources/orders.d.ts +1 -389
- package/lib/esm/resources/orders.js +1 -234
- package/lib/esm/resources/organization.d.ts +1 -34
- package/lib/esm/resources/organization.js +1 -14
- package/lib/esm/resources/packages.d.ts +1 -60
- package/lib/esm/resources/packages.js +1 -39
- package/lib/esm/resources/parcel_line_items.d.ts +1 -47
- package/lib/esm/resources/parcel_line_items.js +1 -35
- package/lib/esm/resources/parcels.d.ts +1 -126
- package/lib/esm/resources/parcels.js +1 -47
- package/lib/esm/resources/payment_gateways.d.ts +1 -25
- package/lib/esm/resources/payment_gateways.js +1 -22
- package/lib/esm/resources/payment_methods.d.ts +1 -83
- package/lib/esm/resources/payment_methods.js +1 -45
- package/lib/esm/resources/payment_options.d.ts +1 -44
- package/lib/esm/resources/payment_options.js +1 -31
- package/lib/esm/resources/paypal_gateways.d.ts +1 -41
- package/lib/esm/resources/paypal_gateways.js +1 -35
- package/lib/esm/resources/paypal_payments.d.ts +1 -53
- package/lib/esm/resources/paypal_payments.js +1 -35
- package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -131
- package/lib/esm/resources/percentage_discount_promotions.js +1 -77
- package/lib/esm/resources/price_frequency_tiers.d.ts +1 -53
- package/lib/esm/resources/price_frequency_tiers.js +1 -39
- package/lib/esm/resources/price_lists.d.ts +1 -46
- package/lib/esm/resources/price_lists.js +1 -35
- package/lib/esm/resources/price_tiers.d.ts +1 -32
- package/lib/esm/resources/price_tiers.js +1 -26
- package/lib/esm/resources/price_volume_tiers.d.ts +1 -53
- package/lib/esm/resources/price_volume_tiers.js +1 -39
- package/lib/esm/resources/prices.d.ts +1 -84
- package/lib/esm/resources/prices.js +1 -63
- package/lib/esm/resources/promotion_rules.d.ts +1 -29
- package/lib/esm/resources/promotion_rules.js +1 -18
- package/lib/esm/resources/promotions.d.ts +1 -63
- package/lib/esm/resources/promotions.js +1 -58
- package/lib/esm/resources/recurring_order_copies.d.ts +1 -53
- package/lib/esm/resources/recurring_order_copies.js +1 -39
- package/lib/esm/resources/refunds.d.ts +1 -44
- package/lib/esm/resources/refunds.js +1 -34
- package/lib/esm/resources/reserved_stocks.d.ts +1 -28
- package/lib/esm/resources/reserved_stocks.js +1 -26
- package/lib/esm/resources/resource_errors.d.ts +1 -22
- package/lib/esm/resources/resource_errors.js +1 -14
- package/lib/esm/resources/return_line_items.d.ts +1 -52
- package/lib/esm/resources/return_line_items.js +1 -34
- package/lib/esm/resources/returns.d.ts +1 -96
- package/lib/esm/resources/returns.js +1 -90
- package/lib/esm/resources/satispay_gateways.d.ts +1 -46
- package/lib/esm/resources/satispay_gateways.js +1 -35
- package/lib/esm/resources/satispay_payments.d.ts +1 -50
- package/lib/esm/resources/satispay_payments.js +1 -38
- package/lib/esm/resources/shipments.d.ts +1 -151
- package/lib/esm/resources/shipments.js +1 -128
- package/lib/esm/resources/shipping_categories.d.ts +1 -40
- package/lib/esm/resources/shipping_categories.js +1 -35
- package/lib/esm/resources/shipping_method_tiers.d.ts +1 -32
- package/lib/esm/resources/shipping_method_tiers.js +1 -26
- package/lib/esm/resources/shipping_methods.d.ts +1 -125
- package/lib/esm/resources/shipping_methods.js +1 -68
- package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -50
- package/lib/esm/resources/shipping_weight_tiers.js +1 -35
- package/lib/esm/resources/shipping_zones.d.ts +1 -52
- package/lib/esm/resources/shipping_zones.js +1 -31
- package/lib/esm/resources/sku_list_items.d.ts +1 -51
- package/lib/esm/resources/sku_list_items.js +1 -35
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -76
- package/lib/esm/resources/sku_list_promotion_rules.js +1 -35
- package/lib/esm/resources/sku_lists.d.ts +1 -64
- package/lib/esm/resources/sku_lists.js +1 -47
- package/lib/esm/resources/sku_options.d.ts +1 -71
- package/lib/esm/resources/sku_options.js +1 -43
- package/lib/esm/resources/skus.d.ts +1 -96
- package/lib/esm/resources/skus.js +1 -63
- package/lib/esm/resources/stock_items.d.ts +1 -61
- package/lib/esm/resources/stock_items.js +1 -50
- package/lib/esm/resources/stock_line_items.d.ts +1 -73
- package/lib/esm/resources/stock_line_items.js +1 -52
- package/lib/esm/resources/stock_locations.d.ts +1 -64
- package/lib/esm/resources/stock_locations.js +1 -51
- package/lib/esm/resources/stock_reservations.d.ts +1 -51
- package/lib/esm/resources/stock_reservations.js +1 -46
- package/lib/esm/resources/stock_transfers.d.ts +1 -86
- package/lib/esm/resources/stock_transfers.js +1 -69
- package/lib/esm/resources/stripe_gateways.d.ts +1 -45
- package/lib/esm/resources/stripe_gateways.js +1 -35
- package/lib/esm/resources/stripe_payments.d.ts +1 -59
- package/lib/esm/resources/stripe_payments.js +1 -41
- package/lib/esm/resources/subscription_models.d.ts +1 -49
- package/lib/esm/resources/subscription_models.js +1 -35
- package/lib/esm/resources/tags.d.ts +1 -28
- package/lib/esm/resources/tags.js +1 -23
- package/lib/esm/resources/tax_calculators.d.ts +1 -28
- package/lib/esm/resources/tax_calculators.js +1 -26
- package/lib/esm/resources/tax_categories.d.ts +1 -63
- package/lib/esm/resources/tax_categories.js +1 -35
- package/lib/esm/resources/tax_rules.d.ts +1 -73
- package/lib/esm/resources/tax_rules.js +1 -31
- package/lib/esm/resources/taxjar_accounts.d.ts +1 -47
- package/lib/esm/resources/taxjar_accounts.js +1 -39
- package/lib/esm/resources/transactions.d.ts +1 -41
- package/lib/esm/resources/transactions.js +1 -30
- package/lib/esm/resources/versions.d.ts +1 -22
- package/lib/esm/resources/versions.js +1 -14
- package/lib/esm/resources/voids.d.ts +1 -44
- package/lib/esm/resources/voids.js +1 -34
- package/lib/esm/resources/webhooks.d.ts +1 -55
- package/lib/esm/resources/webhooks.js +1 -40
- package/lib/esm/resources/wire_transfers.d.ts +1 -37
- package/lib/esm/resources/wire_transfers.js +1 -31
- package/lib/esm/static.d.ts +1 -12
- package/lib/esm/static.js +1 -25
- package/lib/esm/util.d.ts +1 -4
- package/lib/esm/util.js +1 -37
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/lib/cjs/common.js
CHANGED
@@ -1,23 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.isResourceType = exports.isResourceId = void 0;
|
4
|
-
const api_1 = require("./api");
|
5
|
-
const isResourceId = (resource) => {
|
6
|
-
return ((resource === null || resource === void 0 ? void 0 : resource.type) && resource.id) && api_1.resourceList.includes(resource.type);
|
7
|
-
};
|
8
|
-
exports.isResourceId = isResourceId;
|
9
|
-
const isResourceType = (resource) => {
|
10
|
-
return resource && (typeof resource.type !== 'undefined') && resource.type && api_1.resourceList.includes(resource.type);
|
11
|
-
};
|
12
|
-
exports.isResourceType = isResourceType;
|
13
|
-
/*
|
14
|
-
// Nullable types
|
15
|
-
type StringNullable = string | null
|
16
|
-
type NumberNullable = number | null
|
17
|
-
type BooleanNullable = boolean | null
|
18
|
-
type ResourceNullable<R extends Resource> = R | null
|
19
|
-
type ResourceArrayNullable<R extends Resource> = R[] | null
|
20
|
-
|
21
|
-
|
22
|
-
export type { StringNullable, NumberNullable, BooleanNullable, ResourceNullable, ResourceArrayNullable }
|
23
|
-
*/
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isResourceType=exports.isResourceId=void 0;const api_1=require("./api"),isResourceId=e=>e?.type&&e.id&&api_1.resourceList.includes(e.type);exports.isResourceId=isResourceId;const isResourceType=e=>e&&typeof e.type<"u"&&e.type&&api_1.resourceList.includes(e.type);exports.isResourceType=isResourceType;
|
package/lib/cjs/config.d.ts
CHANGED
@@ -1,15 +1 @@
|
|
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;
|
1
|
+
declare const config:{readonly default:{readonly domain:"commercelayer.io";readonly pageNumber:1;readonly pageSize:10;};readonly client:{readonly timeout:15000;readonly requiredAttributes:readonly["organization","accessToken"];};readonly jsonapi:{readonly maxResourceIncluded:2;};};export default config;
|
package/lib/cjs/config.js
CHANGED
@@ -1,19 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
// export type ApiMode = 'test' | 'live'
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
const config = {
|
5
|
-
default: {
|
6
|
-
// environment: 'test',
|
7
|
-
domain: 'commercelayer.io',
|
8
|
-
pageNumber: 1,
|
9
|
-
pageSize: 10,
|
10
|
-
},
|
11
|
-
client: {
|
12
|
-
timeout: 15000,
|
13
|
-
requiredAttributes: ['organization', 'accessToken'],
|
14
|
-
},
|
15
|
-
jsonapi: {
|
16
|
-
maxResourceIncluded: 2
|
17
|
-
}
|
18
|
-
};
|
19
|
-
exports.default = config;
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const config={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:15e3,requiredAttributes:["organization","accessToken"]},jsonapi:{maxResourceIncluded:2}};exports.default=config;
|
package/lib/cjs/debug.d.ts
CHANGED
package/lib/cjs/debug.js
CHANGED
@@ -1,38 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
/* Nope debugger */
|
4
|
-
const debuggerFunction = (_pattern, ..._args) => {
|
5
|
-
// console.log(_pattern)
|
6
|
-
};
|
7
|
-
let debuggerFactory = (_namespace) => debuggerFunction;
|
8
|
-
/* Try loading 'debug' module */
|
9
|
-
try {
|
10
|
-
const debugModule = require('debug');
|
11
|
-
if (debugModule && (typeof debugModule === 'function'))
|
12
|
-
debuggerFactory = debugModule;
|
13
|
-
}
|
14
|
-
catch (error) {
|
15
|
-
//
|
16
|
-
}
|
17
|
-
const debugPrefix = 'clsdk';
|
18
|
-
/* Retrieve the name of the caller 'module' */
|
19
|
-
/*
|
20
|
-
const caller = (): string => {
|
21
|
-
|
22
|
-
const err = new Error()
|
23
|
-
|
24
|
-
Error.prepareStackTrace = (_, stack) => stack
|
25
|
-
const stack = err.stack as unknown as NodeJS.CallSite[]
|
26
|
-
Error.prepareStackTrace = undefined
|
27
|
-
|
28
|
-
const fileName = stack[2].getFileName() || '/'
|
29
|
-
|
30
|
-
return fileName.replace(/^.*[\\/]/, '').replace('.ts', '')
|
31
|
-
|
32
|
-
}
|
33
|
-
*/
|
34
|
-
/* Return a debugger for the defined namespace */
|
35
|
-
const debug = (namespace) => {
|
36
|
-
return debuggerFactory(`${debugPrefix}:${namespace}`);
|
37
|
-
};
|
38
|
-
exports.default = debug;
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const debuggerFunction=(e,...t)=>{};let debuggerFactory=e=>debuggerFunction;try{const e=require("debug");e&&typeof e=="function"&&(debuggerFactory=e)}catch{}const debugPrefix="clsdk",debug=e=>debuggerFactory(`${debugPrefix}:${e}`);exports.default=debug;
|
package/lib/cjs/error.d.ts
CHANGED
@@ -1,31 +1 @@
|
|
1
|
-
declare enum ErrorType {
|
2
|
-
CLIENT = "client",// Error instantiating the client
|
3
|
-
REQUEST = "request",// Error preparing API request
|
4
|
-
RESPONSE = "response",// Error response from API
|
5
|
-
CANCEL = "cancel",// Forced request abort using interceptor
|
6
|
-
PARSE = "parse",// Error parsing API resource
|
7
|
-
GENERIC = "generic"
|
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
|
-
request?: any;
|
16
|
-
constructor(error: {
|
17
|
-
message: string;
|
18
|
-
type?: ErrorType;
|
19
|
-
});
|
20
|
-
}
|
21
|
-
declare class ApiError extends SdkError {
|
22
|
-
static NAME: string;
|
23
|
-
static isApiError(error: any): error is ApiError;
|
24
|
-
errors: any[];
|
25
|
-
status?: number;
|
26
|
-
statusText?: string;
|
27
|
-
constructor(error: SdkError);
|
28
|
-
first(): any;
|
29
|
-
}
|
30
|
-
declare const handleError: (error: Error) => never;
|
31
|
-
export { SdkError, ApiError, ErrorType, handleError };
|
1
|
+
declare enum ErrorType{CLIENT="client",REQUEST="request",RESPONSE="response",CANCEL="cancel",PARSE="parse",GENERIC="generic"}declare class SdkError extends Error{static NAME:string;static isSdkError(error:any):error is SdkError;type:ErrorType;code?:string;source?:Error;request?:any;constructor(error:{message:string;type?:ErrorType;});}declare class ApiError extends SdkError{static NAME:string;static isApiError(error:any):error is ApiError;errors:any[];status?:number;statusText?:string;constructor(error:SdkError);first():any;}declare const handleError:(error:Error)=>never;export{SdkError,ApiError,ErrorType,handleError};
|
package/lib/cjs/error.js
CHANGED
@@ -1,77 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.handleError = exports.ErrorType = exports.ApiError = exports.SdkError = void 0;
|
7
|
-
const axios_1 = __importDefault(require("axios"));
|
8
|
-
var ErrorType;
|
9
|
-
(function (ErrorType) {
|
10
|
-
ErrorType["CLIENT"] = "client";
|
11
|
-
ErrorType["REQUEST"] = "request";
|
12
|
-
ErrorType["RESPONSE"] = "response";
|
13
|
-
ErrorType["CANCEL"] = "cancel";
|
14
|
-
ErrorType["PARSE"] = "parse";
|
15
|
-
ErrorType["GENERIC"] = "generic";
|
16
|
-
})(ErrorType || (exports.ErrorType = ErrorType = {}));
|
17
|
-
class SdkError extends Error {
|
18
|
-
static isSdkError(error) {
|
19
|
-
return error && [SdkError.NAME, ApiError.NAME].includes(error.name) && Object.values(ErrorType).includes(error.type);
|
20
|
-
}
|
21
|
-
constructor(error) {
|
22
|
-
super(error.message);
|
23
|
-
this.name = SdkError.NAME; // this.constructor.name
|
24
|
-
this.type = error.type || ErrorType.GENERIC;
|
25
|
-
}
|
26
|
-
}
|
27
|
-
exports.SdkError = SdkError;
|
28
|
-
SdkError.NAME = 'SdkError';
|
29
|
-
class ApiError extends SdkError {
|
30
|
-
static isApiError(error) {
|
31
|
-
return SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE);
|
32
|
-
}
|
33
|
-
constructor(error) {
|
34
|
-
super({ ...error, type: ErrorType.RESPONSE });
|
35
|
-
this.errors = [];
|
36
|
-
this.name = ApiError.NAME; // this.constructor.name
|
37
|
-
}
|
38
|
-
first() {
|
39
|
-
var _a;
|
40
|
-
return (((_a = this.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) ? this.errors[0] : undefined;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
exports.ApiError = ApiError;
|
44
|
-
ApiError.NAME = 'ApiError';
|
45
|
-
const handleError = (error) => {
|
46
|
-
let sdkError = new SdkError({ message: error.message });
|
47
|
-
if (axios_1.default.isAxiosError(error)) {
|
48
|
-
if (error.response) {
|
49
|
-
// The request was made and the server responded with a status code that falls out of the range of 2xx
|
50
|
-
const apiError = new ApiError(sdkError);
|
51
|
-
apiError.type = ErrorType.RESPONSE;
|
52
|
-
apiError.status = error.response.status;
|
53
|
-
apiError.statusText = error.response.statusText;
|
54
|
-
apiError.code = String(apiError.status);
|
55
|
-
apiError.errors = error.response.data.errors;
|
56
|
-
if (!apiError.message && apiError.statusText)
|
57
|
-
apiError.message = apiError.statusText;
|
58
|
-
sdkError = apiError;
|
59
|
-
}
|
60
|
-
else if (error.request) {
|
61
|
-
// The request was made but no response was received
|
62
|
-
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of http.ClientRequest in node.js
|
63
|
-
sdkError.type = ErrorType.REQUEST;
|
64
|
-
sdkError.request = error.request;
|
65
|
-
}
|
66
|
-
else {
|
67
|
-
// Something happened in setting up the request that triggered an Error
|
68
|
-
sdkError.type = ErrorType.CLIENT;
|
69
|
-
}
|
70
|
-
}
|
71
|
-
else if (axios_1.default.isCancel(error))
|
72
|
-
sdkError.type = ErrorType.CANCEL;
|
73
|
-
else
|
74
|
-
sdkError.source = error;
|
75
|
-
throw sdkError;
|
76
|
-
};
|
77
|
-
exports.handleError = handleError;
|
1
|
+
"use strict";var __importDefault=this&&this.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.handleError=exports.ErrorType=exports.ApiError=exports.SdkError=void 0;const axios_1=__importDefault(require("axios"));var ErrorType;(function(s){s.CLIENT="client",s.REQUEST="request",s.RESPONSE="response",s.CANCEL="cancel",s.PARSE="parse",s.GENERIC="generic"})(ErrorType||(exports.ErrorType=ErrorType={}));class SdkError extends Error{static isSdkError(e){return e&&[SdkError.NAME,ApiError.NAME].includes(e.name)&&Object.values(ErrorType).includes(e.type)}constructor(e){super(e.message),this.name=SdkError.NAME,this.type=e.type||ErrorType.GENERIC}}exports.SdkError=SdkError,SdkError.NAME="SdkError";class ApiError extends SdkError{static isApiError(e){return SdkError.isSdkError(e)&&e.name===ApiError.NAME&&e.type===ErrorType.RESPONSE}constructor(e){super({...e,type:ErrorType.RESPONSE}),this.errors=[],this.name=ApiError.NAME}first(){var e;return((e=this.errors)===null||e===void 0?void 0:e.length)>0?this.errors[0]:void 0}}exports.ApiError=ApiError,ApiError.NAME="ApiError";const handleError=s=>{let e=new SdkError({message:s.message});if(axios_1.default.isAxiosError(s))if(s.response){const t=new ApiError(e);t.type=ErrorType.RESPONSE,t.status=s.response.status,t.statusText=s.response.statusText,t.code=String(t.status),t.errors=s.response.data.errors,!t.message&&t.statusText&&(t.message=t.statusText),e=t}else s.request?(e.type=ErrorType.REQUEST,e.request=s.request):e.type=ErrorType.CLIENT;else axios_1.default.isCancel(s)?e.type=ErrorType.CANCEL:e.source=s;throw e};exports.handleError=handleError;
|
package/lib/cjs/index.d.ts
CHANGED
@@ -1,7 +1 @@
|
|
1
|
-
export
|
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';
|
1
|
+
export{default,CommerceLayer}from'./commercelayer';export type{CommerceLayerClient}from'./commercelayer';export{CommerceLayerStatic}from'./static';export type{QueryParamsRetrieve,QueryParamsList,QueryParams}from'./query';export type*from'./model';export type{RequestObj,ResponseObj,ErrorObj,HeadersObj}from'./interceptor';export type{SdkError,ApiError,ErrorType}from'./error';
|
package/lib/cjs/index.js
CHANGED
@@ -1,13 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.CommerceLayerStatic = exports.CommerceLayer = exports.default = void 0;
|
7
|
-
// SDK
|
8
|
-
var commercelayer_1 = require("./commercelayer");
|
9
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(commercelayer_1).default; } });
|
10
|
-
Object.defineProperty(exports, "CommerceLayer", { enumerable: true, get: function () { return commercelayer_1.CommerceLayer; } });
|
11
|
-
// Commerce Layer static functions
|
12
|
-
var static_1 = require("./static");
|
13
|
-
Object.defineProperty(exports, "CommerceLayerStatic", { enumerable: true, get: function () { return static_1.CommerceLayerStatic; } });
|
1
|
+
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayerStatic=exports.CommerceLayer=exports.default=void 0;var commercelayer_1=require("./commercelayer");Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return __importDefault(commercelayer_1).default}}),Object.defineProperty(exports,"CommerceLayer",{enumerable:!0,get:function(){return commercelayer_1.CommerceLayer}});var static_1=require("./static");Object.defineProperty(exports,"CommerceLayerStatic",{enumerable:!0,get:function(){return static_1.CommerceLayerStatic}});
|
package/lib/cjs/interceptor.d.ts
CHANGED
@@ -1,25 +1 @@
|
|
1
|
-
import type
|
2
|
-
type InterceptorManager = {
|
3
|
-
request: AxiosInterceptorManager<AxiosRequestConfig>;
|
4
|
-
response: AxiosInterceptorManager<any>;
|
5
|
-
};
|
6
|
-
type RequestObj = AxiosRequestConfig;
|
7
|
-
type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
|
8
|
-
type ResponseObj = AxiosResponse;
|
9
|
-
type ResponseInterceptor = (response: ResponseObj) => ResponseObj | Promise<ResponseObj>;
|
10
|
-
type ApiHeadersList = 'x-ratelimit-limit' | 'x-ratelimit-count' | 'x-ratelimit-period' | 'x-ratelimit-interval' | 'x-ratelimit-remaining';
|
11
|
-
type ApiHeaders = {
|
12
|
-
[key in ApiHeadersList]: string | number | boolean;
|
13
|
-
};
|
14
|
-
type HeadersObj = (AxiosResponseHeaders | RawAxiosResponseHeaders) & ApiHeaders;
|
15
|
-
type ErrorObj = AxiosError;
|
16
|
-
type ErrorInterceptor = (error: ErrorObj) => ErrorObj | Promise<ErrorObj>;
|
17
|
-
type InterceptorType = 'request' | 'response';
|
18
|
-
export type { InterceptorManager, RequestInterceptor, ResponseInterceptor, ErrorInterceptor, InterceptorType };
|
19
|
-
export type { RequestObj, ResponseObj, ErrorObj, HeadersObj };
|
20
|
-
type RawResponseReader = {
|
21
|
-
id: number | undefined;
|
22
|
-
rawResponse: ResponseObj | undefined;
|
23
|
-
headers: HeadersObj | undefined;
|
24
|
-
};
|
25
|
-
export type { RawResponseReader };
|
1
|
+
import type{AxiosError,AxiosInterceptorManager,AxiosRequestConfig,AxiosResponse,AxiosResponseHeaders,RawAxiosResponseHeaders}from'axios';type InterceptorManager={request:AxiosInterceptorManager<AxiosRequestConfig>;response:AxiosInterceptorManager<any>;};type RequestObj=AxiosRequestConfig;type RequestInterceptor=(request:RequestObj)=>RequestObj|Promise<RequestObj>;type ResponseObj=AxiosResponse;type ResponseInterceptor=(response:ResponseObj)=>ResponseObj|Promise<ResponseObj>;type ApiHeadersList='x-ratelimit-limit'|'x-ratelimit-count'|'x-ratelimit-period'|'x-ratelimit-interval'|'x-ratelimit-remaining';type ApiHeaders={[key in ApiHeadersList]:string|number|boolean;};type HeadersObj=(AxiosResponseHeaders|RawAxiosResponseHeaders)&ApiHeaders;type ErrorObj=AxiosError;type ErrorInterceptor=(error:ErrorObj)=>ErrorObj|Promise<ErrorObj>;type InterceptorType='request'|'response';export type{InterceptorManager,RequestInterceptor,ResponseInterceptor,ErrorInterceptor,InterceptorType};export type{RequestObj,ResponseObj,ErrorObj,HeadersObj};type RawResponseReader={id:number|undefined;rawResponse:ResponseObj|undefined;headers:HeadersObj|undefined;};export type{RawResponseReader};
|
package/lib/cjs/interceptor.js
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
package/lib/cjs/jsonapi.d.ts
CHANGED
@@ -1,6 +1 @@
|
|
1
|
-
import type
|
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 };
|
1
|
+
import type{DocWithData,ResourceObject as JSONAPIObject}from'jsonapi-typescript';import type{ResourceCreate,ResourceUpdate,ResourceId,ResourceType,Resource}from'./resource';export type{DocWithData};declare const denormalize:<R extends Resource>(response:DocWithData)=>R|R[];declare const normalize:(resource:(ResourceCreate&ResourceType)|(ResourceUpdate&ResourceId))=>JSONAPIObject;export{denormalize,normalize};
|
package/lib/cjs/jsonapi.js
CHANGED
@@ -1,94 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.normalize = exports.denormalize = void 0;
|
7
|
-
const common_1 = require("./common");
|
8
|
-
const config_1 = __importDefault(require("./config"));
|
9
|
-
const debug_1 = __importDefault(require("./debug"));
|
10
|
-
const debug = (0, debug_1.default)('jsonapi');
|
11
|
-
// DENORMALIZATION
|
12
|
-
const denormalize = (response) => {
|
13
|
-
let denormalizedResponse;
|
14
|
-
if (response.links)
|
15
|
-
delete response.links;
|
16
|
-
const data = response.data;
|
17
|
-
const included = response.included;
|
18
|
-
if (!data)
|
19
|
-
denormalizedResponse = data;
|
20
|
-
else {
|
21
|
-
if (Array.isArray(data))
|
22
|
-
denormalizedResponse = data.map(res => denormalizeResource(res, included));
|
23
|
-
else
|
24
|
-
denormalizedResponse = denormalizeResource(data, included);
|
25
|
-
}
|
26
|
-
return denormalizedResponse;
|
27
|
-
};
|
28
|
-
exports.denormalize = denormalize;
|
29
|
-
const findIncluded = (rel, included = []) => {
|
30
|
-
const inc = included.find(inc => {
|
31
|
-
return (rel.id === inc.id) && (rel.type === inc.type);
|
32
|
-
});
|
33
|
-
return inc || rel;
|
34
|
-
};
|
35
|
-
const denormalizeResource = (res, included, chain = []) => {
|
36
|
-
debug('denormalize resource: %O, %o', res, included || {});
|
37
|
-
if (!res)
|
38
|
-
return res;
|
39
|
-
const resource = {
|
40
|
-
id: res.id,
|
41
|
-
type: res.type,
|
42
|
-
...res.attributes,
|
43
|
-
};
|
44
|
-
if (res.relationships)
|
45
|
-
Object.keys(res.relationships).forEach(key => {
|
46
|
-
const rel = res.relationships[key].data;
|
47
|
-
if (rel) {
|
48
|
-
if (chain.filter(r => (r.id === rel.id) && (r.type === rel.type)).length >= config_1.default.jsonapi.maxResourceIncluded)
|
49
|
-
resource[key] = rel;
|
50
|
-
else {
|
51
|
-
if (Array.isArray(rel))
|
52
|
-
resource[key] = rel.map((r) => denormalizeResource(findIncluded(r, included), included, [...chain, r]));
|
53
|
-
else
|
54
|
-
resource[key] = denormalizeResource(findIncluded(rel, included), included, [...chain, rel]);
|
55
|
-
}
|
56
|
-
}
|
57
|
-
else if (rel === null)
|
58
|
-
resource[key] = null;
|
59
|
-
});
|
60
|
-
debug('denormalized resource: %O', resource);
|
61
|
-
return resource;
|
62
|
-
};
|
63
|
-
// NORMALIZATION
|
64
|
-
const normalize = (resource) => {
|
65
|
-
debug('normalize resource: %O', resource);
|
66
|
-
const attributes = {};
|
67
|
-
const relationships = {};
|
68
|
-
for (const field in resource) {
|
69
|
-
if (['type', 'id'].includes(field))
|
70
|
-
continue;
|
71
|
-
const value = resource[field];
|
72
|
-
if (Array.isArray(value) && (value.length === 1) && (0, common_1.isResourceType)(value[0]) && (value[0].id === null)) {
|
73
|
-
relationships[field] = { data: [] };
|
74
|
-
}
|
75
|
-
else if (value && (0, common_1.isResourceType)(value) && (value.id === null)) {
|
76
|
-
relationships[field] = { data: null };
|
77
|
-
}
|
78
|
-
else if (value && ((0, common_1.isResourceId)(value) || (Array.isArray(value) && (0, common_1.isResourceId)(value[0])))) {
|
79
|
-
relationships[field] = { data: value };
|
80
|
-
}
|
81
|
-
else
|
82
|
-
attributes[field] = value;
|
83
|
-
}
|
84
|
-
const normalized = {
|
85
|
-
type: resource.type,
|
86
|
-
attributes,
|
87
|
-
relationships
|
88
|
-
};
|
89
|
-
if ((0, common_1.isResourceId)(resource))
|
90
|
-
normalized.id = resource.id;
|
91
|
-
debug('normalized resource: %O', normalized);
|
92
|
-
return normalized;
|
93
|
-
};
|
94
|
-
exports.normalize = normalize;
|
1
|
+
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.normalize=exports.denormalize=void 0;const common_1=require("./common"),config_1=__importDefault(require("./config")),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)("jsonapi"),denormalize=e=>{let n;e.links&&delete e.links;const r=e.data,t=e.included;return r?Array.isArray(r)?n=r.map(o=>denormalizeResource(o,t)):n=denormalizeResource(r,t):n=r,n};exports.denormalize=denormalize;const findIncluded=(e,n=[])=>n.find(t=>e.id===t.id&&e.type===t.type)||e,denormalizeResource=(e,n,r=[])=>{if(debug("denormalize resource: %O, %o",e,n||{}),!e)return e;const t={id:e.id,type:e.type,...e.attributes};return e.relationships&&Object.keys(e.relationships).forEach(o=>{const i=e.relationships[o].data;i?r.filter(s=>s.id===i.id&&s.type===i.type).length>=config_1.default.jsonapi.maxResourceIncluded?t[o]=i:Array.isArray(i)?t[o]=i.map(s=>denormalizeResource(findIncluded(s,n),n,[...r,s])):t[o]=denormalizeResource(findIncluded(i,n),n,[...r,i]):i===null&&(t[o]=null)}),debug("denormalized resource: %O",t),t},normalize=e=>{debug("normalize resource: %O",e);const n={},r={};for(const o in e){if(["type","id"].includes(o))continue;const i=e[o];Array.isArray(i)&&i.length===1&&(0,common_1.isResourceType)(i[0])&&i[0].id===null?r[o]={data:[]}:i&&(0,common_1.isResourceType)(i)&&i.id===null?r[o]={data:null}:i&&((0,common_1.isResourceId)(i)||Array.isArray(i)&&(0,common_1.isResourceId)(i[0]))?r[o]={data:i}:n[o]=i}const t={type:e.type,attributes:n,relationships:r};return(0,common_1.isResourceId)(e)&&(t.id=e.id),debug("normalized resource: %O",t),t};exports.normalize=normalize;
|
package/lib/cjs/model.d.ts
CHANGED
@@ -1,124 +1 @@
|
|
1
|
-
/**
|
2
|
-
* ©2024 Commerce Layer Inc.
|
3
|
-
**/
|
4
|
-
export type { Address, AddressCreate, AddressUpdate } from './resources/addresses';
|
5
|
-
export type { Adjustment, AdjustmentCreate, AdjustmentUpdate } from './resources/adjustments';
|
6
|
-
export type { AdyenGateway, AdyenGatewayCreate, AdyenGatewayUpdate } from './resources/adyen_gateways';
|
7
|
-
export type { AdyenPayment, AdyenPaymentCreate, AdyenPaymentUpdate } from './resources/adyen_payments';
|
8
|
-
export type { Application } from './resources/application';
|
9
|
-
export type { Attachment, AttachmentCreate, AttachmentUpdate } from './resources/attachments';
|
10
|
-
export type { Authorization, AuthorizationUpdate } from './resources/authorizations';
|
11
|
-
export type { AvalaraAccount, AvalaraAccountCreate, AvalaraAccountUpdate } from './resources/avalara_accounts';
|
12
|
-
export type { AxerveGateway, AxerveGatewayCreate, AxerveGatewayUpdate } from './resources/axerve_gateways';
|
13
|
-
export type { AxervePayment, AxervePaymentCreate, AxervePaymentUpdate } from './resources/axerve_payments';
|
14
|
-
export type { BillingInfoValidationRule, BillingInfoValidationRuleCreate, BillingInfoValidationRuleUpdate } from './resources/billing_info_validation_rules';
|
15
|
-
export type { BingGeocoder, BingGeocoderCreate, BingGeocoderUpdate } from './resources/bing_geocoders';
|
16
|
-
export type { BraintreeGateway, BraintreeGatewayCreate, BraintreeGatewayUpdate } from './resources/braintree_gateways';
|
17
|
-
export type { BraintreePayment, BraintreePaymentCreate, BraintreePaymentUpdate } from './resources/braintree_payments';
|
18
|
-
export type { Bundle, BundleCreate, BundleUpdate } from './resources/bundles';
|
19
|
-
export type { BuyXPayYPromotion, BuyXPayYPromotionCreate, BuyXPayYPromotionUpdate } from './resources/buy_x_pay_y_promotions';
|
20
|
-
export type { Capture, CaptureUpdate } from './resources/captures';
|
21
|
-
export type { CarrierAccount } from './resources/carrier_accounts';
|
22
|
-
export type { CheckoutComGateway, CheckoutComGatewayCreate, CheckoutComGatewayUpdate } from './resources/checkout_com_gateways';
|
23
|
-
export type { CheckoutComPayment, CheckoutComPaymentCreate, CheckoutComPaymentUpdate } from './resources/checkout_com_payments';
|
24
|
-
export type { Cleanup, CleanupCreate } from './resources/cleanups';
|
25
|
-
export type { CouponCodesPromotionRule, CouponCodesPromotionRuleCreate, CouponCodesPromotionRuleUpdate } from './resources/coupon_codes_promotion_rules';
|
26
|
-
export type { CouponRecipient, CouponRecipientCreate, CouponRecipientUpdate } from './resources/coupon_recipients';
|
27
|
-
export type { Coupon, CouponCreate, CouponUpdate } from './resources/coupons';
|
28
|
-
export type { CustomPromotionRule, CustomPromotionRuleCreate, CustomPromotionRuleUpdate } from './resources/custom_promotion_rules';
|
29
|
-
export type { CustomerAddress, CustomerAddressCreate, CustomerAddressUpdate } from './resources/customer_addresses';
|
30
|
-
export type { CustomerGroup, CustomerGroupCreate, CustomerGroupUpdate } from './resources/customer_groups';
|
31
|
-
export type { CustomerPasswordReset, CustomerPasswordResetCreate, CustomerPasswordResetUpdate } from './resources/customer_password_resets';
|
32
|
-
export type { CustomerPaymentSource, CustomerPaymentSourceCreate, CustomerPaymentSourceUpdate } from './resources/customer_payment_sources';
|
33
|
-
export type { CustomerSubscription, CustomerSubscriptionCreate, CustomerSubscriptionUpdate } from './resources/customer_subscriptions';
|
34
|
-
export type { Customer, CustomerCreate, CustomerUpdate } from './resources/customers';
|
35
|
-
export type { DeliveryLeadTime, DeliveryLeadTimeCreate, DeliveryLeadTimeUpdate } from './resources/delivery_lead_times';
|
36
|
-
export type { EventCallback } from './resources/event_callbacks';
|
37
|
-
export type { Event } from './resources/events';
|
38
|
-
export type { Export, ExportCreate } from './resources/exports';
|
39
|
-
export type { ExternalGateway, ExternalGatewayCreate, ExternalGatewayUpdate } from './resources/external_gateways';
|
40
|
-
export type { ExternalPayment, ExternalPaymentCreate, ExternalPaymentUpdate } from './resources/external_payments';
|
41
|
-
export type { ExternalPromotion, ExternalPromotionCreate, ExternalPromotionUpdate } from './resources/external_promotions';
|
42
|
-
export type { ExternalTaxCalculator, ExternalTaxCalculatorCreate, ExternalTaxCalculatorUpdate } from './resources/external_tax_calculators';
|
43
|
-
export type { FixedAmountPromotion, FixedAmountPromotionCreate, FixedAmountPromotionUpdate } from './resources/fixed_amount_promotions';
|
44
|
-
export type { FixedPricePromotion, FixedPricePromotionCreate, FixedPricePromotionUpdate } from './resources/fixed_price_promotions';
|
45
|
-
export type { FreeGiftPromotion, FreeGiftPromotionCreate, FreeGiftPromotionUpdate } from './resources/free_gift_promotions';
|
46
|
-
export type { FreeShippingPromotion, FreeShippingPromotionCreate, FreeShippingPromotionUpdate } from './resources/free_shipping_promotions';
|
47
|
-
export type { Geocoder } from './resources/geocoders';
|
48
|
-
export type { GiftCardRecipient, GiftCardRecipientCreate, GiftCardRecipientUpdate } from './resources/gift_card_recipients';
|
49
|
-
export type { GiftCard, GiftCardCreate, GiftCardUpdate } from './resources/gift_cards';
|
50
|
-
export type { GoogleGeocoder, GoogleGeocoderCreate, GoogleGeocoderUpdate } from './resources/google_geocoders';
|
51
|
-
export type { Import, ImportCreate } from './resources/imports';
|
52
|
-
export type { InStockSubscription, InStockSubscriptionCreate, InStockSubscriptionUpdate } from './resources/in_stock_subscriptions';
|
53
|
-
export type { InventoryModel, InventoryModelCreate, InventoryModelUpdate } from './resources/inventory_models';
|
54
|
-
export type { InventoryReturnLocation, InventoryReturnLocationCreate, InventoryReturnLocationUpdate } from './resources/inventory_return_locations';
|
55
|
-
export type { InventoryStockLocation, InventoryStockLocationCreate, InventoryStockLocationUpdate } from './resources/inventory_stock_locations';
|
56
|
-
export type { KlarnaGateway, KlarnaGatewayCreate, KlarnaGatewayUpdate } from './resources/klarna_gateways';
|
57
|
-
export type { KlarnaPayment, KlarnaPaymentCreate, KlarnaPaymentUpdate } from './resources/klarna_payments';
|
58
|
-
export type { LineItemOption, LineItemOptionCreate, LineItemOptionUpdate } from './resources/line_item_options';
|
59
|
-
export type { LineItem, LineItemCreate, LineItemUpdate } from './resources/line_items';
|
60
|
-
export type { ManualGateway, ManualGatewayCreate, ManualGatewayUpdate } from './resources/manual_gateways';
|
61
|
-
export type { ManualTaxCalculator, ManualTaxCalculatorCreate, ManualTaxCalculatorUpdate } from './resources/manual_tax_calculators';
|
62
|
-
export type { Market, MarketCreate, MarketUpdate } from './resources/markets';
|
63
|
-
export type { Merchant, MerchantCreate, MerchantUpdate } from './resources/merchants';
|
64
|
-
export type { OrderAmountPromotionRule, OrderAmountPromotionRuleCreate, OrderAmountPromotionRuleUpdate } from './resources/order_amount_promotion_rules';
|
65
|
-
export type { OrderCopy, OrderCopyCreate, OrderCopyUpdate } from './resources/order_copies';
|
66
|
-
export type { OrderFactory } from './resources/order_factories';
|
67
|
-
export type { OrderSubscriptionItem, OrderSubscriptionItemCreate, OrderSubscriptionItemUpdate } from './resources/order_subscription_items';
|
68
|
-
export type { OrderSubscription, OrderSubscriptionCreate, OrderSubscriptionUpdate } from './resources/order_subscriptions';
|
69
|
-
export type { OrderValidationRule } from './resources/order_validation_rules';
|
70
|
-
export type { Order, OrderCreate, OrderUpdate } from './resources/orders';
|
71
|
-
export type { Organization } from './resources/organization';
|
72
|
-
export type { Package, PackageCreate, PackageUpdate } from './resources/packages';
|
73
|
-
export type { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate } from './resources/parcel_line_items';
|
74
|
-
export type { Parcel, ParcelCreate, ParcelUpdate } from './resources/parcels';
|
75
|
-
export type { PaymentGateway } from './resources/payment_gateways';
|
76
|
-
export type { PaymentMethod, PaymentMethodCreate, PaymentMethodUpdate } from './resources/payment_methods';
|
77
|
-
export type { PaymentOption, PaymentOptionCreate, PaymentOptionUpdate } from './resources/payment_options';
|
78
|
-
export type { PaypalGateway, PaypalGatewayCreate, PaypalGatewayUpdate } from './resources/paypal_gateways';
|
79
|
-
export type { PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate } from './resources/paypal_payments';
|
80
|
-
export type { PercentageDiscountPromotion, PercentageDiscountPromotionCreate, PercentageDiscountPromotionUpdate } from './resources/percentage_discount_promotions';
|
81
|
-
export type { PriceFrequencyTier, PriceFrequencyTierCreate, PriceFrequencyTierUpdate } from './resources/price_frequency_tiers';
|
82
|
-
export type { PriceList, PriceListCreate, PriceListUpdate } from './resources/price_lists';
|
83
|
-
export type { PriceTier } from './resources/price_tiers';
|
84
|
-
export type { PriceVolumeTier, PriceVolumeTierCreate, PriceVolumeTierUpdate } from './resources/price_volume_tiers';
|
85
|
-
export type { Price, PriceCreate, PriceUpdate } from './resources/prices';
|
86
|
-
export type { PromotionRule } from './resources/promotion_rules';
|
87
|
-
export type { Promotion } from './resources/promotions';
|
88
|
-
export type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate } from './resources/recurring_order_copies';
|
89
|
-
export type { Refund } from './resources/refunds';
|
90
|
-
export type { ReservedStock } from './resources/reserved_stocks';
|
91
|
-
export type { ResourceError } from './resources/resource_errors';
|
92
|
-
export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from './resources/return_line_items';
|
93
|
-
export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
|
94
|
-
export type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate } from './resources/satispay_gateways';
|
95
|
-
export type { SatispayPayment, SatispayPaymentCreate, SatispayPaymentUpdate } from './resources/satispay_payments';
|
96
|
-
export type { Shipment, ShipmentCreate, ShipmentUpdate } from './resources/shipments';
|
97
|
-
export type { ShippingCategory, ShippingCategoryCreate, ShippingCategoryUpdate } from './resources/shipping_categories';
|
98
|
-
export type { ShippingMethodTier } from './resources/shipping_method_tiers';
|
99
|
-
export type { ShippingMethod, ShippingMethodCreate, ShippingMethodUpdate } from './resources/shipping_methods';
|
100
|
-
export type { ShippingWeightTier, ShippingWeightTierCreate, ShippingWeightTierUpdate } from './resources/shipping_weight_tiers';
|
101
|
-
export type { ShippingZone, ShippingZoneCreate, ShippingZoneUpdate } from './resources/shipping_zones';
|
102
|
-
export type { SkuListItem, SkuListItemCreate, SkuListItemUpdate } from './resources/sku_list_items';
|
103
|
-
export type { SkuListPromotionRule, SkuListPromotionRuleCreate, SkuListPromotionRuleUpdate } from './resources/sku_list_promotion_rules';
|
104
|
-
export type { SkuList, SkuListCreate, SkuListUpdate } from './resources/sku_lists';
|
105
|
-
export type { SkuOption, SkuOptionCreate, SkuOptionUpdate } from './resources/sku_options';
|
106
|
-
export type { Sku, SkuCreate, SkuUpdate } from './resources/skus';
|
107
|
-
export type { StockItem, StockItemCreate, StockItemUpdate } from './resources/stock_items';
|
108
|
-
export type { StockLineItem, StockLineItemCreate, StockLineItemUpdate } from './resources/stock_line_items';
|
109
|
-
export type { StockLocation, StockLocationCreate, StockLocationUpdate } from './resources/stock_locations';
|
110
|
-
export type { StockReservation, StockReservationCreate, StockReservationUpdate } from './resources/stock_reservations';
|
111
|
-
export type { StockTransfer, StockTransferCreate, StockTransferUpdate } from './resources/stock_transfers';
|
112
|
-
export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate } from './resources/stripe_gateways';
|
113
|
-
export type { StripePayment, StripePaymentCreate, StripePaymentUpdate } from './resources/stripe_payments';
|
114
|
-
export type { SubscriptionModel, SubscriptionModelCreate, SubscriptionModelUpdate } from './resources/subscription_models';
|
115
|
-
export type { Tag, TagCreate, TagUpdate } from './resources/tags';
|
116
|
-
export type { TaxCalculator } from './resources/tax_calculators';
|
117
|
-
export type { TaxCategory, TaxCategoryCreate, TaxCategoryUpdate } from './resources/tax_categories';
|
118
|
-
export type { TaxRule, TaxRuleCreate, TaxRuleUpdate } from './resources/tax_rules';
|
119
|
-
export type { TaxjarAccount, TaxjarAccountCreate, TaxjarAccountUpdate } from './resources/taxjar_accounts';
|
120
|
-
export type { Transaction } from './resources/transactions';
|
121
|
-
export type { Version } from './resources/versions';
|
122
|
-
export type { Void } from './resources/voids';
|
123
|
-
export type { Webhook, WebhookCreate, WebhookUpdate } from './resources/webhooks';
|
124
|
-
export type { WireTransfer, WireTransferCreate, WireTransferUpdate } from './resources/wire_transfers';
|
1
|
+
export type{Address,AddressCreate,AddressUpdate}from'./resources/addresses';export type{Adjustment,AdjustmentCreate,AdjustmentUpdate}from'./resources/adjustments';export type{AdyenGateway,AdyenGatewayCreate,AdyenGatewayUpdate}from'./resources/adyen_gateways';export type{AdyenPayment,AdyenPaymentCreate,AdyenPaymentUpdate}from'./resources/adyen_payments';export type{Application}from'./resources/application';export type{Attachment,AttachmentCreate,AttachmentUpdate}from'./resources/attachments';export type{Authorization,AuthorizationUpdate}from'./resources/authorizations';export type{AvalaraAccount,AvalaraAccountCreate,AvalaraAccountUpdate}from'./resources/avalara_accounts';export type{AxerveGateway,AxerveGatewayCreate,AxerveGatewayUpdate}from'./resources/axerve_gateways';export type{AxervePayment,AxervePaymentCreate,AxervePaymentUpdate}from'./resources/axerve_payments';export type{BillingInfoValidationRule,BillingInfoValidationRuleCreate,BillingInfoValidationRuleUpdate}from'./resources/billing_info_validation_rules';export type{BingGeocoder,BingGeocoderCreate,BingGeocoderUpdate}from'./resources/bing_geocoders';export type{BraintreeGateway,BraintreeGatewayCreate,BraintreeGatewayUpdate}from'./resources/braintree_gateways';export type{BraintreePayment,BraintreePaymentCreate,BraintreePaymentUpdate}from'./resources/braintree_payments';export type{Bundle,BundleCreate,BundleUpdate}from'./resources/bundles';export type{BuyXPayYPromotion,BuyXPayYPromotionCreate,BuyXPayYPromotionUpdate}from'./resources/buy_x_pay_y_promotions';export type{Capture,CaptureUpdate}from'./resources/captures';export type{CarrierAccount}from'./resources/carrier_accounts';export type{CheckoutComGateway,CheckoutComGatewayCreate,CheckoutComGatewayUpdate}from'./resources/checkout_com_gateways';export type{CheckoutComPayment,CheckoutComPaymentCreate,CheckoutComPaymentUpdate}from'./resources/checkout_com_payments';export type{Cleanup,CleanupCreate}from'./resources/cleanups';export type{CouponCodesPromotionRule,CouponCodesPromotionRuleCreate,CouponCodesPromotionRuleUpdate}from'./resources/coupon_codes_promotion_rules';export type{CouponRecipient,CouponRecipientCreate,CouponRecipientUpdate}from'./resources/coupon_recipients';export type{Coupon,CouponCreate,CouponUpdate}from'./resources/coupons';export type{CustomPromotionRule,CustomPromotionRuleCreate,CustomPromotionRuleUpdate}from'./resources/custom_promotion_rules';export type{CustomerAddress,CustomerAddressCreate,CustomerAddressUpdate}from'./resources/customer_addresses';export type{CustomerGroup,CustomerGroupCreate,CustomerGroupUpdate}from'./resources/customer_groups';export type{CustomerPasswordReset,CustomerPasswordResetCreate,CustomerPasswordResetUpdate}from'./resources/customer_password_resets';export type{CustomerPaymentSource,CustomerPaymentSourceCreate,CustomerPaymentSourceUpdate}from'./resources/customer_payment_sources';export type{CustomerSubscription,CustomerSubscriptionCreate,CustomerSubscriptionUpdate}from'./resources/customer_subscriptions';export type{Customer,CustomerCreate,CustomerUpdate}from'./resources/customers';export type{DeliveryLeadTime,DeliveryLeadTimeCreate,DeliveryLeadTimeUpdate}from'./resources/delivery_lead_times';export type{EventCallback}from'./resources/event_callbacks';export type{Event}from'./resources/events';export type{Export,ExportCreate}from'./resources/exports';export type{ExternalGateway,ExternalGatewayCreate,ExternalGatewayUpdate}from'./resources/external_gateways';export type{ExternalPayment,ExternalPaymentCreate,ExternalPaymentUpdate}from'./resources/external_payments';export type{ExternalPromotion,ExternalPromotionCreate,ExternalPromotionUpdate}from'./resources/external_promotions';export type{ExternalTaxCalculator,ExternalTaxCalculatorCreate,ExternalTaxCalculatorUpdate}from'./resources/external_tax_calculators';export type{FixedAmountPromotion,FixedAmountPromotionCreate,FixedAmountPromotionUpdate}from'./resources/fixed_amount_promotions';export type{FixedPricePromotion,FixedPricePromotionCreate,FixedPricePromotionUpdate}from'./resources/fixed_price_promotions';export type{FreeGiftPromotion,FreeGiftPromotionCreate,FreeGiftPromotionUpdate}from'./resources/free_gift_promotions';export type{FreeShippingPromotion,FreeShippingPromotionCreate,FreeShippingPromotionUpdate}from'./resources/free_shipping_promotions';export type{Geocoder}from'./resources/geocoders';export type{GiftCardRecipient,GiftCardRecipientCreate,GiftCardRecipientUpdate}from'./resources/gift_card_recipients';export type{GiftCard,GiftCardCreate,GiftCardUpdate}from'./resources/gift_cards';export type{GoogleGeocoder,GoogleGeocoderCreate,GoogleGeocoderUpdate}from'./resources/google_geocoders';export type{Import,ImportCreate}from'./resources/imports';export type{InStockSubscription,InStockSubscriptionCreate,InStockSubscriptionUpdate}from'./resources/in_stock_subscriptions';export type{InventoryModel,InventoryModelCreate,InventoryModelUpdate}from'./resources/inventory_models';export type{InventoryReturnLocation,InventoryReturnLocationCreate,InventoryReturnLocationUpdate}from'./resources/inventory_return_locations';export type{InventoryStockLocation,InventoryStockLocationCreate,InventoryStockLocationUpdate}from'./resources/inventory_stock_locations';export type{KlarnaGateway,KlarnaGatewayCreate,KlarnaGatewayUpdate}from'./resources/klarna_gateways';export type{KlarnaPayment,KlarnaPaymentCreate,KlarnaPaymentUpdate}from'./resources/klarna_payments';export type{LineItemOption,LineItemOptionCreate,LineItemOptionUpdate}from'./resources/line_item_options';export type{LineItem,LineItemCreate,LineItemUpdate}from'./resources/line_items';export type{ManualGateway,ManualGatewayCreate,ManualGatewayUpdate}from'./resources/manual_gateways';export type{ManualTaxCalculator,ManualTaxCalculatorCreate,ManualTaxCalculatorUpdate}from'./resources/manual_tax_calculators';export type{Market,MarketCreate,MarketUpdate}from'./resources/markets';export type{Merchant,MerchantCreate,MerchantUpdate}from'./resources/merchants';export type{OrderAmountPromotionRule,OrderAmountPromotionRuleCreate,OrderAmountPromotionRuleUpdate}from'./resources/order_amount_promotion_rules';export type{OrderCopy,OrderCopyCreate,OrderCopyUpdate}from'./resources/order_copies';export type{OrderFactory}from'./resources/order_factories';export type{OrderSubscriptionItem,OrderSubscriptionItemCreate,OrderSubscriptionItemUpdate}from'./resources/order_subscription_items';export type{OrderSubscription,OrderSubscriptionCreate,OrderSubscriptionUpdate}from'./resources/order_subscriptions';export type{OrderValidationRule}from'./resources/order_validation_rules';export type{Order,OrderCreate,OrderUpdate}from'./resources/orders';export type{Organization}from'./resources/organization';export type{Package,PackageCreate,PackageUpdate}from'./resources/packages';export type{ParcelLineItem,ParcelLineItemCreate,ParcelLineItemUpdate}from'./resources/parcel_line_items';export type{Parcel,ParcelCreate,ParcelUpdate}from'./resources/parcels';export type{PaymentGateway}from'./resources/payment_gateways';export type{PaymentMethod,PaymentMethodCreate,PaymentMethodUpdate}from'./resources/payment_methods';export type{PaymentOption,PaymentOptionCreate,PaymentOptionUpdate}from'./resources/payment_options';export type{PaypalGateway,PaypalGatewayCreate,PaypalGatewayUpdate}from'./resources/paypal_gateways';export type{PaypalPayment,PaypalPaymentCreate,PaypalPaymentUpdate}from'./resources/paypal_payments';export type{PercentageDiscountPromotion,PercentageDiscountPromotionCreate,PercentageDiscountPromotionUpdate}from'./resources/percentage_discount_promotions';export type{PriceFrequencyTier,PriceFrequencyTierCreate,PriceFrequencyTierUpdate}from'./resources/price_frequency_tiers';export type{PriceList,PriceListCreate,PriceListUpdate}from'./resources/price_lists';export type{PriceTier}from'./resources/price_tiers';export type{PriceVolumeTier,PriceVolumeTierCreate,PriceVolumeTierUpdate}from'./resources/price_volume_tiers';export type{Price,PriceCreate,PriceUpdate}from'./resources/prices';export type{PromotionRule}from'./resources/promotion_rules';export type{Promotion}from'./resources/promotions';export type{RecurringOrderCopy,RecurringOrderCopyCreate,RecurringOrderCopyUpdate}from'./resources/recurring_order_copies';export type{Refund}from'./resources/refunds';export type{ReservedStock}from'./resources/reserved_stocks';export type{ResourceError}from'./resources/resource_errors';export type{ReturnLineItem,ReturnLineItemCreate,ReturnLineItemUpdate}from'./resources/return_line_items';export type{Return,ReturnCreate,ReturnUpdate}from'./resources/returns';export type{SatispayGateway,SatispayGatewayCreate,SatispayGatewayUpdate}from'./resources/satispay_gateways';export type{SatispayPayment,SatispayPaymentCreate,SatispayPaymentUpdate}from'./resources/satispay_payments';export type{Shipment,ShipmentCreate,ShipmentUpdate}from'./resources/shipments';export type{ShippingCategory,ShippingCategoryCreate,ShippingCategoryUpdate}from'./resources/shipping_categories';export type{ShippingMethodTier}from'./resources/shipping_method_tiers';export type{ShippingMethod,ShippingMethodCreate,ShippingMethodUpdate}from'./resources/shipping_methods';export type{ShippingWeightTier,ShippingWeightTierCreate,ShippingWeightTierUpdate}from'./resources/shipping_weight_tiers';export type{ShippingZone,ShippingZoneCreate,ShippingZoneUpdate}from'./resources/shipping_zones';export type{SkuListItem,SkuListItemCreate,SkuListItemUpdate}from'./resources/sku_list_items';export type{SkuListPromotionRule,SkuListPromotionRuleCreate,SkuListPromotionRuleUpdate}from'./resources/sku_list_promotion_rules';export type{SkuList,SkuListCreate,SkuListUpdate}from'./resources/sku_lists';export type{SkuOption,SkuOptionCreate,SkuOptionUpdate}from'./resources/sku_options';export type{Sku,SkuCreate,SkuUpdate}from'./resources/skus';export type{StockItem,StockItemCreate,StockItemUpdate}from'./resources/stock_items';export type{StockLineItem,StockLineItemCreate,StockLineItemUpdate}from'./resources/stock_line_items';export type{StockLocation,StockLocationCreate,StockLocationUpdate}from'./resources/stock_locations';export type{StockReservation,StockReservationCreate,StockReservationUpdate}from'./resources/stock_reservations';export type{StockTransfer,StockTransferCreate,StockTransferUpdate}from'./resources/stock_transfers';export type{StripeGateway,StripeGatewayCreate,StripeGatewayUpdate}from'./resources/stripe_gateways';export type{StripePayment,StripePaymentCreate,StripePaymentUpdate}from'./resources/stripe_payments';export type{SubscriptionModel,SubscriptionModelCreate,SubscriptionModelUpdate}from'./resources/subscription_models';export type{Tag,TagCreate,TagUpdate}from'./resources/tags';export type{TaxCalculator}from'./resources/tax_calculators';export type{TaxCategory,TaxCategoryCreate,TaxCategoryUpdate}from'./resources/tax_categories';export type{TaxRule,TaxRuleCreate,TaxRuleUpdate}from'./resources/tax_rules';export type{TaxjarAccount,TaxjarAccountCreate,TaxjarAccountUpdate}from'./resources/taxjar_accounts';export type{Transaction}from'./resources/transactions';export type{Version}from'./resources/versions';export type{Void}from'./resources/voids';export type{Webhook,WebhookCreate,WebhookUpdate}from'./resources/webhooks';export type{WireTransfer,WireTransferCreate,WireTransferUpdate}from'./resources/wire_transfers';
|
package/lib/cjs/model.js
CHANGED
package/lib/cjs/query.d.ts
CHANGED
@@ -1,17 +1 @@
|
|
1
|
-
import type
|
2
|
-
type QueryFilter = Record<string, string | number | boolean | object | Array<string | number>>;
|
3
|
-
interface QueryParamsRetrieve {
|
4
|
-
include?: string[];
|
5
|
-
fields?: string[] | Record<string, string[]>;
|
6
|
-
}
|
7
|
-
interface QueryParamsList extends QueryParamsRetrieve {
|
8
|
-
sort?: string[] | Record<string, 'asc' | 'desc'>;
|
9
|
-
filters?: QueryFilter;
|
10
|
-
pageNumber?: number;
|
11
|
-
pageSize?: number;
|
12
|
-
}
|
13
|
-
type QueryParams = QueryParamsRetrieve | QueryParamsList;
|
14
|
-
export type { QueryParamsRetrieve, QueryParamsList, QueryParams, QueryFilter };
|
15
|
-
declare const isParamsList: (params: any) => params is QueryParamsList;
|
16
|
-
declare const generateQueryStringParams: (params: QueryParamsRetrieve | QueryParamsList | undefined, res: string | ResourceType) => Record<string, string>;
|
17
|
-
export { generateQueryStringParams, isParamsList };
|
1
|
+
import type{ResourceType}from"./resource";type QueryFilter=Record<string,string|number|boolean|object|Array<string|number>>;interface QueryParamsRetrieve{include?:string[];fields?:string[]|Record<string,string[]>;}interface QueryParamsList extends QueryParamsRetrieve{sort?:string[]|Record<string,'asc'|'desc'>;filters?:QueryFilter;pageNumber?:number;pageSize?:number;}type QueryParams=QueryParamsRetrieve|QueryParamsList;export type{QueryParamsRetrieve,QueryParamsList,QueryParams,QueryFilter};declare const isParamsList:(params:any)=>params is QueryParamsList;declare const generateQueryStringParams:(params:QueryParamsRetrieve|QueryParamsList|undefined,res:string|ResourceType)=>Record<string,string>;export{generateQueryStringParams,isParamsList};
|