@shopify/shopify-api 6.0.0-rc7 → 6.0.0-rc8
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/CHANGELOG.md +1 -1
- package/README.md +20 -19
- package/adapters/__e2etests__/utils.d.ts.map +1 -1
- package/adapters/__e2etests__/utils.js +6 -3
- package/adapters/__e2etests__/utils.js.map +1 -1
- package/adapters/cf-worker/index.js +0 -1
- package/adapters/cf-worker/index.js.map +1 -1
- package/adapters/mock/adapter.d.ts +0 -2
- package/adapters/mock/adapter.d.ts.map +1 -1
- package/adapters/mock/adapter.js +1 -6
- package/adapters/mock/adapter.js.map +1 -1
- package/adapters/mock/index.js +0 -1
- package/adapters/mock/index.js.map +1 -1
- package/adapters/node/adapter.d.ts +0 -2
- package/adapters/node/adapter.d.ts.map +1 -1
- package/adapters/node/adapter.js +1 -8
- package/adapters/node/adapter.js.map +1 -1
- package/adapters/node/index.js +0 -1
- package/adapters/node/index.js.map +1 -1
- package/lib/auth/oauth/oauth.d.ts.map +1 -1
- package/lib/auth/oauth/oauth.js +26 -11
- package/lib/auth/oauth/oauth.js.map +1 -1
- package/lib/base-types.d.ts +21 -9
- package/lib/base-types.d.ts.map +1 -1
- package/lib/base-types.js +1 -0
- package/lib/base-types.js.map +1 -1
- package/lib/billing/check.d.ts.map +1 -1
- package/lib/billing/check.js +1 -4
- package/lib/billing/check.js.map +1 -1
- package/lib/billing/request.d.ts.map +1 -1
- package/lib/billing/request.js +1 -4
- package/lib/billing/request.js.map +1 -1
- package/lib/billing/types.d.ts +3 -3
- package/lib/billing/types.d.ts.map +1 -1
- package/lib/clients/graphql/graphql_client.d.ts +16 -28
- package/lib/clients/graphql/graphql_client.d.ts.map +1 -1
- package/lib/clients/graphql/graphql_client.js +73 -57
- package/lib/clients/graphql/graphql_client.js.map +1 -1
- package/lib/clients/graphql/graphql_proxy.d.ts +1 -1
- package/lib/clients/graphql/graphql_proxy.d.ts.map +1 -1
- package/lib/clients/graphql/graphql_proxy.js +15 -25
- package/lib/clients/graphql/graphql_proxy.js.map +1 -1
- package/lib/clients/graphql/storefront_client.d.ts +12 -25
- package/lib/clients/graphql/storefront_client.d.ts.map +1 -1
- package/lib/clients/graphql/storefront_client.js +52 -18
- package/lib/clients/graphql/storefront_client.js.map +1 -1
- package/lib/clients/graphql/types.d.ts +10 -2
- package/lib/clients/graphql/types.d.ts.map +1 -1
- package/lib/clients/http_client/http_client.d.ts +32 -30
- package/lib/clients/http_client/http_client.d.ts.map +1 -1
- package/lib/clients/http_client/http_client.js +279 -248
- package/lib/clients/http_client/http_client.js.map +1 -1
- package/lib/clients/index.d.ts +10 -72
- package/lib/clients/index.d.ts.map +1 -1
- package/lib/clients/index.js +2 -1
- package/lib/clients/index.js.map +1 -1
- package/lib/clients/rest/rest_client.d.ts +17 -28
- package/lib/clients/rest/rest_client.d.ts.map +1 -1
- package/lib/clients/rest/rest_client.js +110 -102
- package/lib/clients/rest/rest_client.js.map +1 -1
- package/lib/clients/rest/types.d.ts +4 -0
- package/lib/clients/rest/types.d.ts.map +1 -1
- package/lib/config.d.ts +1 -2
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +11 -10
- package/lib/config.js.map +1 -1
- package/lib/error.d.ts +0 -2
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +1 -9
- package/lib/error.js.map +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/logger/index.d.ts +10 -0
- package/lib/logger/index.d.ts.map +1 -0
- package/lib/logger/index.js +39 -0
- package/lib/logger/index.js.map +1 -0
- package/lib/logger/log.d.ts +6 -0
- package/lib/logger/log.d.ts.map +1 -0
- package/lib/logger/log.js +57 -0
- package/lib/logger/log.js.map +1 -0
- package/lib/logger/types.d.ts +6 -0
- package/lib/logger/types.d.ts.map +1 -0
- package/{runtime/session → lib/logger}/types.js +0 -0
- package/{runtime/session → lib/logger}/types.js.map +0 -0
- package/lib/session/classes.d.ts +0 -1
- package/lib/session/classes.d.ts.map +1 -1
- package/lib/session/classes.js +1 -3
- package/lib/session/classes.js.map +1 -1
- package/lib/session/index.d.ts +2 -5
- package/lib/session/index.d.ts.map +1 -1
- package/lib/session/index.js +3 -10
- package/lib/session/index.js.map +1 -1
- package/lib/session/session-utils.d.ts +2 -8
- package/lib/session/session-utils.d.ts.map +1 -1
- package/lib/session/session-utils.js +27 -124
- package/lib/session/session-utils.js.map +1 -1
- package/lib/session/session.d.ts +6 -2
- package/lib/session/session.d.ts.map +1 -1
- package/lib/session/session.js +121 -0
- package/lib/session/session.js.map +1 -1
- package/lib/session/types.d.ts +10 -26
- package/lib/session/types.d.ts.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/webhooks/index.d.ts +2 -2
- package/lib/webhooks/process.d.ts.map +1 -1
- package/lib/webhooks/process.js +10 -1
- package/lib/webhooks/process.js.map +1 -1
- package/lib/webhooks/register.d.ts +2 -2
- package/lib/webhooks/register.d.ts.map +1 -1
- package/lib/webhooks/register.js +59 -22
- package/lib/webhooks/register.js.map +1 -1
- package/lib/webhooks/registry.d.ts +1 -1
- package/lib/webhooks/registry.d.ts.map +1 -1
- package/lib/webhooks/registry.js +108 -50
- package/lib/webhooks/registry.js.map +1 -1
- package/lib/webhooks/types.d.ts +2 -2
- package/lib/webhooks/types.d.ts.map +1 -1
- package/lib/webhooks/types.js.map +1 -1
- package/package.json +7 -18
- package/rest/admin/2022-01/abandoned_checkout.d.ts +2 -2
- package/rest/admin/2022-01/abandoned_checkout.d.ts.map +1 -1
- package/rest/admin/2022-01/access_scope.d.ts +2 -2
- package/rest/admin/2022-01/access_scope.d.ts.map +1 -1
- package/rest/admin/2022-01/android_pay_key.d.ts +3 -3
- package/rest/admin/2022-01/android_pay_key.d.ts.map +1 -1
- package/rest/admin/2022-01/apple_pay_certificate.d.ts +4 -4
- package/rest/admin/2022-01/apple_pay_certificate.d.ts.map +1 -1
- package/rest/admin/2022-01/application_charge.d.ts +3 -3
- package/rest/admin/2022-01/application_charge.d.ts.map +1 -1
- package/rest/admin/2022-01/application_credit.d.ts +3 -3
- package/rest/admin/2022-01/application_credit.d.ts.map +1 -1
- package/rest/admin/2022-01/article.d.ts +7 -7
- package/rest/admin/2022-01/article.d.ts.map +1 -1
- package/rest/admin/2022-01/asset.d.ts +3 -3
- package/rest/admin/2022-01/asset.d.ts.map +1 -1
- package/rest/admin/2022-01/assigned_fulfillment_order.d.ts +2 -2
- package/rest/admin/2022-01/assigned_fulfillment_order.d.ts.map +1 -1
- package/rest/admin/2022-01/balance.d.ts +2 -2
- package/rest/admin/2022-01/balance.d.ts.map +1 -1
- package/rest/admin/2022-01/blog.d.ts +5 -5
- package/rest/admin/2022-01/blog.d.ts.map +1 -1
- package/rest/admin/2022-01/carrier_service.d.ts +4 -4
- package/rest/admin/2022-01/carrier_service.d.ts.map +1 -1
- package/rest/admin/2022-01/checkout.d.ts +3 -3
- package/rest/admin/2022-01/checkout.d.ts.map +1 -1
- package/rest/admin/2022-01/collect.d.ts +5 -5
- package/rest/admin/2022-01/collect.d.ts.map +1 -1
- package/rest/admin/2022-01/collection.d.ts +3 -3
- package/rest/admin/2022-01/collection.d.ts.map +1 -1
- package/rest/admin/2022-01/collection_listing.d.ts +5 -5
- package/rest/admin/2022-01/collection_listing.d.ts.map +1 -1
- package/rest/admin/2022-01/comment.d.ts +4 -4
- package/rest/admin/2022-01/comment.d.ts.map +1 -1
- package/rest/admin/2022-01/country.d.ts +5 -5
- package/rest/admin/2022-01/country.d.ts.map +1 -1
- package/rest/admin/2022-01/currency.d.ts +2 -2
- package/rest/admin/2022-01/currency.d.ts.map +1 -1
- package/rest/admin/2022-01/custom_collection.d.ts +5 -5
- package/rest/admin/2022-01/custom_collection.d.ts.map +1 -1
- package/rest/admin/2022-01/customer.d.ts +7 -7
- package/rest/admin/2022-01/customer.d.ts.map +1 -1
- package/rest/admin/2022-01/customer_address.d.ts +4 -4
- package/rest/admin/2022-01/customer_address.d.ts.map +1 -1
- package/rest/admin/2022-01/customer_saved_search.d.ts +6 -6
- package/rest/admin/2022-01/customer_saved_search.d.ts.map +1 -1
- package/rest/admin/2022-01/deprecated_api_call.d.ts +2 -2
- package/rest/admin/2022-01/deprecated_api_call.d.ts.map +1 -1
- package/rest/admin/2022-01/discount_code.d.ts +7 -7
- package/rest/admin/2022-01/discount_code.d.ts.map +1 -1
- package/rest/admin/2022-01/dispute.d.ts +3 -3
- package/rest/admin/2022-01/dispute.d.ts.map +1 -1
- package/rest/admin/2022-01/draft_order.d.ts +5 -5
- package/rest/admin/2022-01/draft_order.d.ts.map +1 -1
- package/rest/admin/2022-01/event.d.ts +4 -4
- package/rest/admin/2022-01/event.d.ts.map +1 -1
- package/rest/admin/2022-01/fulfillment.d.ts +4 -4
- package/rest/admin/2022-01/fulfillment.d.ts.map +1 -1
- package/rest/admin/2022-01/fulfillment_event.d.ts +4 -4
- package/rest/admin/2022-01/fulfillment_event.d.ts.map +1 -1
- package/rest/admin/2022-01/fulfillment_order.d.ts +3 -3
- package/rest/admin/2022-01/fulfillment_order.d.ts.map +1 -1
- package/rest/admin/2022-01/fulfillment_service.d.ts +4 -4
- package/rest/admin/2022-01/fulfillment_service.d.ts.map +1 -1
- package/rest/admin/2022-01/gift_card.d.ts +5 -5
- package/rest/admin/2022-01/gift_card.d.ts.map +1 -1
- package/rest/admin/2022-01/gift_card_adjustment.d.ts +3 -3
- package/rest/admin/2022-01/gift_card_adjustment.d.ts.map +1 -1
- package/rest/admin/2022-01/image.d.ts +5 -5
- package/rest/admin/2022-01/image.d.ts.map +1 -1
- package/rest/admin/2022-01/inventory_item.d.ts +3 -3
- package/rest/admin/2022-01/inventory_item.d.ts.map +1 -1
- package/rest/admin/2022-01/inventory_level.d.ts +3 -3
- package/rest/admin/2022-01/inventory_level.d.ts.map +1 -1
- package/rest/admin/2022-01/location.d.ts +5 -5
- package/rest/admin/2022-01/location.d.ts.map +1 -1
- package/rest/admin/2022-01/locations_for_move.d.ts +2 -2
- package/rest/admin/2022-01/locations_for_move.d.ts.map +1 -1
- package/rest/admin/2022-01/marketing_event.d.ts +5 -5
- package/rest/admin/2022-01/marketing_event.d.ts.map +1 -1
- package/rest/admin/2022-01/metafield.d.ts +5 -5
- package/rest/admin/2022-01/metafield.d.ts.map +1 -1
- package/rest/admin/2022-01/mobile_platform_application.d.ts +4 -4
- package/rest/admin/2022-01/mobile_platform_application.d.ts.map +1 -1
- package/rest/admin/2022-01/order.d.ts +5 -5
- package/rest/admin/2022-01/order.d.ts.map +1 -1
- package/rest/admin/2022-01/order_risk.d.ts +4 -4
- package/rest/admin/2022-01/order_risk.d.ts.map +1 -1
- package/rest/admin/2022-01/page.d.ts +5 -5
- package/rest/admin/2022-01/page.d.ts.map +1 -1
- package/rest/admin/2022-01/payment.d.ts +4 -4
- package/rest/admin/2022-01/payment.d.ts.map +1 -1
- package/rest/admin/2022-01/payment_gateway.d.ts +4 -4
- package/rest/admin/2022-01/payment_gateway.d.ts.map +1 -1
- package/rest/admin/2022-01/payment_transaction.d.ts +2 -2
- package/rest/admin/2022-01/payment_transaction.d.ts.map +1 -1
- package/rest/admin/2022-01/payout.d.ts +3 -3
- package/rest/admin/2022-01/payout.d.ts.map +1 -1
- package/rest/admin/2022-01/policy.d.ts +2 -2
- package/rest/admin/2022-01/policy.d.ts.map +1 -1
- package/rest/admin/2022-01/price_rule.d.ts +5 -5
- package/rest/admin/2022-01/price_rule.d.ts.map +1 -1
- package/rest/admin/2022-01/product.d.ts +5 -5
- package/rest/admin/2022-01/product.d.ts.map +1 -1
- package/rest/admin/2022-01/product_listing.d.ts +6 -6
- package/rest/admin/2022-01/product_listing.d.ts.map +1 -1
- package/rest/admin/2022-01/product_resource_feedback.d.ts +2 -2
- package/rest/admin/2022-01/product_resource_feedback.d.ts.map +1 -1
- package/rest/admin/2022-01/province.d.ts +4 -4
- package/rest/admin/2022-01/province.d.ts.map +1 -1
- package/rest/admin/2022-01/recurring_application_charge.d.ts +4 -4
- package/rest/admin/2022-01/recurring_application_charge.d.ts.map +1 -1
- package/rest/admin/2022-01/redirect.d.ts +5 -5
- package/rest/admin/2022-01/redirect.d.ts.map +1 -1
- package/rest/admin/2022-01/refund.d.ts +3 -3
- package/rest/admin/2022-01/refund.d.ts.map +1 -1
- package/rest/admin/2022-01/report.d.ts +4 -4
- package/rest/admin/2022-01/report.d.ts.map +1 -1
- package/rest/admin/2022-01/resource_feedback.d.ts +2 -2
- package/rest/admin/2022-01/resource_feedback.d.ts.map +1 -1
- package/rest/admin/2022-01/script_tag.d.ts +5 -5
- package/rest/admin/2022-01/script_tag.d.ts.map +1 -1
- package/rest/admin/2022-01/shipping_zone.d.ts +2 -2
- package/rest/admin/2022-01/shipping_zone.d.ts.map +1 -1
- package/rest/admin/2022-01/shop.d.ts +2 -2
- package/rest/admin/2022-01/shop.d.ts.map +1 -1
- package/rest/admin/2022-01/smart_collection.d.ts +5 -5
- package/rest/admin/2022-01/smart_collection.d.ts.map +1 -1
- package/rest/admin/2022-01/storefront_access_token.d.ts +3 -3
- package/rest/admin/2022-01/storefront_access_token.d.ts.map +1 -1
- package/rest/admin/2022-01/tender_transaction.d.ts +2 -2
- package/rest/admin/2022-01/tender_transaction.d.ts.map +1 -1
- package/rest/admin/2022-01/theme.d.ts +4 -4
- package/rest/admin/2022-01/theme.d.ts.map +1 -1
- package/rest/admin/2022-01/transaction.d.ts +4 -4
- package/rest/admin/2022-01/transaction.d.ts.map +1 -1
- package/rest/admin/2022-01/usage_charge.d.ts +3 -3
- package/rest/admin/2022-01/usage_charge.d.ts.map +1 -1
- package/rest/admin/2022-01/user.d.ts +4 -4
- package/rest/admin/2022-01/user.d.ts.map +1 -1
- package/rest/admin/2022-01/variant.d.ts +5 -5
- package/rest/admin/2022-01/variant.d.ts.map +1 -1
- package/rest/admin/2022-01/webhook.d.ts +5 -5
- package/rest/admin/2022-01/webhook.d.ts.map +1 -1
- package/rest/admin/2022-04/abandoned_checkout.d.ts +2 -2
- package/rest/admin/2022-04/abandoned_checkout.d.ts.map +1 -1
- package/rest/admin/2022-04/access_scope.d.ts +2 -2
- package/rest/admin/2022-04/access_scope.d.ts.map +1 -1
- package/rest/admin/2022-04/android_pay_key.d.ts +3 -3
- package/rest/admin/2022-04/android_pay_key.d.ts.map +1 -1
- package/rest/admin/2022-04/apple_pay_certificate.d.ts +4 -4
- package/rest/admin/2022-04/apple_pay_certificate.d.ts.map +1 -1
- package/rest/admin/2022-04/application_charge.d.ts +3 -3
- package/rest/admin/2022-04/application_charge.d.ts.map +1 -1
- package/rest/admin/2022-04/application_credit.d.ts +3 -3
- package/rest/admin/2022-04/application_credit.d.ts.map +1 -1
- package/rest/admin/2022-04/article.d.ts +7 -7
- package/rest/admin/2022-04/article.d.ts.map +1 -1
- package/rest/admin/2022-04/asset.d.ts +3 -3
- package/rest/admin/2022-04/asset.d.ts.map +1 -1
- package/rest/admin/2022-04/assigned_fulfillment_order.d.ts +2 -2
- package/rest/admin/2022-04/assigned_fulfillment_order.d.ts.map +1 -1
- package/rest/admin/2022-04/balance.d.ts +2 -2
- package/rest/admin/2022-04/balance.d.ts.map +1 -1
- package/rest/admin/2022-04/blog.d.ts +5 -5
- package/rest/admin/2022-04/blog.d.ts.map +1 -1
- package/rest/admin/2022-04/carrier_service.d.ts +4 -4
- package/rest/admin/2022-04/carrier_service.d.ts.map +1 -1
- package/rest/admin/2022-04/checkout.d.ts +3 -3
- package/rest/admin/2022-04/checkout.d.ts.map +1 -1
- package/rest/admin/2022-04/collect.d.ts +5 -5
- package/rest/admin/2022-04/collect.d.ts.map +1 -1
- package/rest/admin/2022-04/collection.d.ts +3 -3
- package/rest/admin/2022-04/collection.d.ts.map +1 -1
- package/rest/admin/2022-04/collection_listing.d.ts +5 -5
- package/rest/admin/2022-04/collection_listing.d.ts.map +1 -1
- package/rest/admin/2022-04/comment.d.ts +4 -4
- package/rest/admin/2022-04/comment.d.ts.map +1 -1
- package/rest/admin/2022-04/country.d.ts +5 -5
- package/rest/admin/2022-04/country.d.ts.map +1 -1
- package/rest/admin/2022-04/currency.d.ts +2 -2
- package/rest/admin/2022-04/currency.d.ts.map +1 -1
- package/rest/admin/2022-04/custom_collection.d.ts +5 -5
- package/rest/admin/2022-04/custom_collection.d.ts.map +1 -1
- package/rest/admin/2022-04/customer.d.ts +7 -7
- package/rest/admin/2022-04/customer.d.ts.map +1 -1
- package/rest/admin/2022-04/customer_address.d.ts +4 -4
- package/rest/admin/2022-04/customer_address.d.ts.map +1 -1
- package/rest/admin/2022-04/customer_saved_search.d.ts +6 -6
- package/rest/admin/2022-04/customer_saved_search.d.ts.map +1 -1
- package/rest/admin/2022-04/deprecated_api_call.d.ts +2 -2
- package/rest/admin/2022-04/deprecated_api_call.d.ts.map +1 -1
- package/rest/admin/2022-04/discount_code.d.ts +7 -7
- package/rest/admin/2022-04/discount_code.d.ts.map +1 -1
- package/rest/admin/2022-04/dispute.d.ts +3 -3
- package/rest/admin/2022-04/dispute.d.ts.map +1 -1
- package/rest/admin/2022-04/draft_order.d.ts +5 -5
- package/rest/admin/2022-04/draft_order.d.ts.map +1 -1
- package/rest/admin/2022-04/event.d.ts +4 -4
- package/rest/admin/2022-04/event.d.ts.map +1 -1
- package/rest/admin/2022-04/fulfillment.d.ts +4 -4
- package/rest/admin/2022-04/fulfillment.d.ts.map +1 -1
- package/rest/admin/2022-04/fulfillment_event.d.ts +4 -4
- package/rest/admin/2022-04/fulfillment_event.d.ts.map +1 -1
- package/rest/admin/2022-04/fulfillment_order.d.ts +3 -3
- package/rest/admin/2022-04/fulfillment_order.d.ts.map +1 -1
- package/rest/admin/2022-04/fulfillment_service.d.ts +4 -4
- package/rest/admin/2022-04/fulfillment_service.d.ts.map +1 -1
- package/rest/admin/2022-04/gift_card.d.ts +5 -5
- package/rest/admin/2022-04/gift_card.d.ts.map +1 -1
- package/rest/admin/2022-04/gift_card_adjustment.d.ts +3 -3
- package/rest/admin/2022-04/gift_card_adjustment.d.ts.map +1 -1
- package/rest/admin/2022-04/image.d.ts +5 -5
- package/rest/admin/2022-04/image.d.ts.map +1 -1
- package/rest/admin/2022-04/inventory_item.d.ts +3 -3
- package/rest/admin/2022-04/inventory_item.d.ts.map +1 -1
- package/rest/admin/2022-04/inventory_level.d.ts +3 -3
- package/rest/admin/2022-04/inventory_level.d.ts.map +1 -1
- package/rest/admin/2022-04/location.d.ts +5 -5
- package/rest/admin/2022-04/location.d.ts.map +1 -1
- package/rest/admin/2022-04/locations_for_move.d.ts +2 -2
- package/rest/admin/2022-04/locations_for_move.d.ts.map +1 -1
- package/rest/admin/2022-04/marketing_event.d.ts +5 -5
- package/rest/admin/2022-04/marketing_event.d.ts.map +1 -1
- package/rest/admin/2022-04/metafield.d.ts +5 -5
- package/rest/admin/2022-04/metafield.d.ts.map +1 -1
- package/rest/admin/2022-04/mobile_platform_application.d.ts +4 -4
- package/rest/admin/2022-04/mobile_platform_application.d.ts.map +1 -1
- package/rest/admin/2022-04/order.d.ts +5 -5
- package/rest/admin/2022-04/order.d.ts.map +1 -1
- package/rest/admin/2022-04/order_risk.d.ts +4 -4
- package/rest/admin/2022-04/order_risk.d.ts.map +1 -1
- package/rest/admin/2022-04/page.d.ts +5 -5
- package/rest/admin/2022-04/page.d.ts.map +1 -1
- package/rest/admin/2022-04/payment.d.ts +4 -4
- package/rest/admin/2022-04/payment.d.ts.map +1 -1
- package/rest/admin/2022-04/payment_gateway.d.ts +4 -4
- package/rest/admin/2022-04/payment_gateway.d.ts.map +1 -1
- package/rest/admin/2022-04/payment_transaction.d.ts +2 -2
- package/rest/admin/2022-04/payment_transaction.d.ts.map +1 -1
- package/rest/admin/2022-04/payout.d.ts +3 -3
- package/rest/admin/2022-04/payout.d.ts.map +1 -1
- package/rest/admin/2022-04/policy.d.ts +2 -2
- package/rest/admin/2022-04/policy.d.ts.map +1 -1
- package/rest/admin/2022-04/price_rule.d.ts +5 -5
- package/rest/admin/2022-04/price_rule.d.ts.map +1 -1
- package/rest/admin/2022-04/product.d.ts +5 -5
- package/rest/admin/2022-04/product.d.ts.map +1 -1
- package/rest/admin/2022-04/product_listing.d.ts +6 -6
- package/rest/admin/2022-04/product_listing.d.ts.map +1 -1
- package/rest/admin/2022-04/product_resource_feedback.d.ts +2 -2
- package/rest/admin/2022-04/product_resource_feedback.d.ts.map +1 -1
- package/rest/admin/2022-04/province.d.ts +4 -4
- package/rest/admin/2022-04/province.d.ts.map +1 -1
- package/rest/admin/2022-04/recurring_application_charge.d.ts +4 -4
- package/rest/admin/2022-04/recurring_application_charge.d.ts.map +1 -1
- package/rest/admin/2022-04/redirect.d.ts +5 -5
- package/rest/admin/2022-04/redirect.d.ts.map +1 -1
- package/rest/admin/2022-04/refund.d.ts +3 -3
- package/rest/admin/2022-04/refund.d.ts.map +1 -1
- package/rest/admin/2022-04/report.d.ts +4 -4
- package/rest/admin/2022-04/report.d.ts.map +1 -1
- package/rest/admin/2022-04/resource_feedback.d.ts +2 -2
- package/rest/admin/2022-04/resource_feedback.d.ts.map +1 -1
- package/rest/admin/2022-04/script_tag.d.ts +5 -5
- package/rest/admin/2022-04/script_tag.d.ts.map +1 -1
- package/rest/admin/2022-04/shipping_zone.d.ts +2 -2
- package/rest/admin/2022-04/shipping_zone.d.ts.map +1 -1
- package/rest/admin/2022-04/shop.d.ts +2 -2
- package/rest/admin/2022-04/shop.d.ts.map +1 -1
- package/rest/admin/2022-04/smart_collection.d.ts +5 -5
- package/rest/admin/2022-04/smart_collection.d.ts.map +1 -1
- package/rest/admin/2022-04/storefront_access_token.d.ts +3 -3
- package/rest/admin/2022-04/storefront_access_token.d.ts.map +1 -1
- package/rest/admin/2022-04/tender_transaction.d.ts +2 -2
- package/rest/admin/2022-04/tender_transaction.d.ts.map +1 -1
- package/rest/admin/2022-04/theme.d.ts +4 -4
- package/rest/admin/2022-04/theme.d.ts.map +1 -1
- package/rest/admin/2022-04/transaction.d.ts +4 -4
- package/rest/admin/2022-04/transaction.d.ts.map +1 -1
- package/rest/admin/2022-04/usage_charge.d.ts +3 -3
- package/rest/admin/2022-04/usage_charge.d.ts.map +1 -1
- package/rest/admin/2022-04/user.d.ts +4 -4
- package/rest/admin/2022-04/user.d.ts.map +1 -1
- package/rest/admin/2022-04/variant.d.ts +5 -5
- package/rest/admin/2022-04/variant.d.ts.map +1 -1
- package/rest/admin/2022-04/webhook.d.ts +5 -5
- package/rest/admin/2022-04/webhook.d.ts.map +1 -1
- package/rest/admin/2022-07/abandoned_checkout.d.ts +2 -2
- package/rest/admin/2022-07/abandoned_checkout.d.ts.map +1 -1
- package/rest/admin/2022-07/access_scope.d.ts +2 -2
- package/rest/admin/2022-07/access_scope.d.ts.map +1 -1
- package/rest/admin/2022-07/android_pay_key.d.ts +3 -3
- package/rest/admin/2022-07/android_pay_key.d.ts.map +1 -1
- package/rest/admin/2022-07/apple_pay_certificate.d.ts +4 -4
- package/rest/admin/2022-07/apple_pay_certificate.d.ts.map +1 -1
- package/rest/admin/2022-07/application_charge.d.ts +3 -3
- package/rest/admin/2022-07/application_charge.d.ts.map +1 -1
- package/rest/admin/2022-07/application_credit.d.ts +3 -3
- package/rest/admin/2022-07/application_credit.d.ts.map +1 -1
- package/rest/admin/2022-07/article.d.ts +7 -7
- package/rest/admin/2022-07/article.d.ts.map +1 -1
- package/rest/admin/2022-07/asset.d.ts +3 -3
- package/rest/admin/2022-07/asset.d.ts.map +1 -1
- package/rest/admin/2022-07/assigned_fulfillment_order.d.ts +2 -2
- package/rest/admin/2022-07/assigned_fulfillment_order.d.ts.map +1 -1
- package/rest/admin/2022-07/balance.d.ts +2 -2
- package/rest/admin/2022-07/balance.d.ts.map +1 -1
- package/rest/admin/2022-07/blog.d.ts +5 -5
- package/rest/admin/2022-07/blog.d.ts.map +1 -1
- package/rest/admin/2022-07/carrier_service.d.ts +4 -4
- package/rest/admin/2022-07/carrier_service.d.ts.map +1 -1
- package/rest/admin/2022-07/checkout.d.ts +3 -3
- package/rest/admin/2022-07/checkout.d.ts.map +1 -1
- package/rest/admin/2022-07/collect.d.ts +5 -5
- package/rest/admin/2022-07/collect.d.ts.map +1 -1
- package/rest/admin/2022-07/collection.d.ts +3 -3
- package/rest/admin/2022-07/collection.d.ts.map +1 -1
- package/rest/admin/2022-07/collection_listing.d.ts +5 -5
- package/rest/admin/2022-07/collection_listing.d.ts.map +1 -1
- package/rest/admin/2022-07/comment.d.ts +4 -4
- package/rest/admin/2022-07/comment.d.ts.map +1 -1
- package/rest/admin/2022-07/country.d.ts +5 -5
- package/rest/admin/2022-07/country.d.ts.map +1 -1
- package/rest/admin/2022-07/currency.d.ts +2 -2
- package/rest/admin/2022-07/currency.d.ts.map +1 -1
- package/rest/admin/2022-07/custom_collection.d.ts +5 -5
- package/rest/admin/2022-07/custom_collection.d.ts.map +1 -1
- package/rest/admin/2022-07/customer.d.ts +7 -7
- package/rest/admin/2022-07/customer.d.ts.map +1 -1
- package/rest/admin/2022-07/customer_address.d.ts +4 -4
- package/rest/admin/2022-07/customer_address.d.ts.map +1 -1
- package/rest/admin/2022-07/customer_saved_search.d.ts +6 -6
- package/rest/admin/2022-07/customer_saved_search.d.ts.map +1 -1
- package/rest/admin/2022-07/deprecated_api_call.d.ts +2 -2
- package/rest/admin/2022-07/deprecated_api_call.d.ts.map +1 -1
- package/rest/admin/2022-07/discount_code.d.ts +7 -7
- package/rest/admin/2022-07/discount_code.d.ts.map +1 -1
- package/rest/admin/2022-07/dispute.d.ts +3 -3
- package/rest/admin/2022-07/dispute.d.ts.map +1 -1
- package/rest/admin/2022-07/dispute_evidence.d.ts +2 -2
- package/rest/admin/2022-07/dispute_evidence.d.ts.map +1 -1
- package/rest/admin/2022-07/dispute_file_upload.d.ts +2 -2
- package/rest/admin/2022-07/dispute_file_upload.d.ts.map +1 -1
- package/rest/admin/2022-07/draft_order.d.ts +5 -5
- package/rest/admin/2022-07/draft_order.d.ts.map +1 -1
- package/rest/admin/2022-07/event.d.ts +4 -4
- package/rest/admin/2022-07/event.d.ts.map +1 -1
- package/rest/admin/2022-07/fulfillment.d.ts +4 -4
- package/rest/admin/2022-07/fulfillment.d.ts.map +1 -1
- package/rest/admin/2022-07/fulfillment_event.d.ts +4 -4
- package/rest/admin/2022-07/fulfillment_event.d.ts.map +1 -1
- package/rest/admin/2022-07/fulfillment_order.d.ts +3 -3
- package/rest/admin/2022-07/fulfillment_order.d.ts.map +1 -1
- package/rest/admin/2022-07/fulfillment_service.d.ts +4 -4
- package/rest/admin/2022-07/fulfillment_service.d.ts.map +1 -1
- package/rest/admin/2022-07/gift_card.d.ts +5 -5
- package/rest/admin/2022-07/gift_card.d.ts.map +1 -1
- package/rest/admin/2022-07/gift_card_adjustment.d.ts +3 -3
- package/rest/admin/2022-07/gift_card_adjustment.d.ts.map +1 -1
- package/rest/admin/2022-07/image.d.ts +5 -5
- package/rest/admin/2022-07/image.d.ts.map +1 -1
- package/rest/admin/2022-07/inventory_item.d.ts +3 -3
- package/rest/admin/2022-07/inventory_item.d.ts.map +1 -1
- package/rest/admin/2022-07/inventory_level.d.ts +3 -3
- package/rest/admin/2022-07/inventory_level.d.ts.map +1 -1
- package/rest/admin/2022-07/location.d.ts +5 -5
- package/rest/admin/2022-07/location.d.ts.map +1 -1
- package/rest/admin/2022-07/locations_for_move.d.ts +2 -2
- package/rest/admin/2022-07/locations_for_move.d.ts.map +1 -1
- package/rest/admin/2022-07/marketing_event.d.ts +5 -5
- package/rest/admin/2022-07/marketing_event.d.ts.map +1 -1
- package/rest/admin/2022-07/metafield.d.ts +5 -5
- package/rest/admin/2022-07/metafield.d.ts.map +1 -1
- package/rest/admin/2022-07/mobile_platform_application.d.ts +4 -4
- package/rest/admin/2022-07/mobile_platform_application.d.ts.map +1 -1
- package/rest/admin/2022-07/order.d.ts +5 -5
- package/rest/admin/2022-07/order.d.ts.map +1 -1
- package/rest/admin/2022-07/order_risk.d.ts +4 -4
- package/rest/admin/2022-07/order_risk.d.ts.map +1 -1
- package/rest/admin/2022-07/page.d.ts +5 -5
- package/rest/admin/2022-07/page.d.ts.map +1 -1
- package/rest/admin/2022-07/payment.d.ts +4 -4
- package/rest/admin/2022-07/payment.d.ts.map +1 -1
- package/rest/admin/2022-07/payment_gateway.d.ts +4 -4
- package/rest/admin/2022-07/payment_gateway.d.ts.map +1 -1
- package/rest/admin/2022-07/payment_transaction.d.ts +2 -2
- package/rest/admin/2022-07/payment_transaction.d.ts.map +1 -1
- package/rest/admin/2022-07/payout.d.ts +3 -3
- package/rest/admin/2022-07/payout.d.ts.map +1 -1
- package/rest/admin/2022-07/policy.d.ts +2 -2
- package/rest/admin/2022-07/policy.d.ts.map +1 -1
- package/rest/admin/2022-07/price_rule.d.ts +5 -5
- package/rest/admin/2022-07/price_rule.d.ts.map +1 -1
- package/rest/admin/2022-07/product.d.ts +5 -5
- package/rest/admin/2022-07/product.d.ts.map +1 -1
- package/rest/admin/2022-07/product_listing.d.ts +6 -6
- package/rest/admin/2022-07/product_listing.d.ts.map +1 -1
- package/rest/admin/2022-07/product_resource_feedback.d.ts +2 -2
- package/rest/admin/2022-07/product_resource_feedback.d.ts.map +1 -1
- package/rest/admin/2022-07/province.d.ts +4 -4
- package/rest/admin/2022-07/province.d.ts.map +1 -1
- package/rest/admin/2022-07/recurring_application_charge.d.ts +4 -4
- package/rest/admin/2022-07/recurring_application_charge.d.ts.map +1 -1
- package/rest/admin/2022-07/redirect.d.ts +5 -5
- package/rest/admin/2022-07/redirect.d.ts.map +1 -1
- package/rest/admin/2022-07/refund.d.ts +3 -3
- package/rest/admin/2022-07/refund.d.ts.map +1 -1
- package/rest/admin/2022-07/report.d.ts +4 -4
- package/rest/admin/2022-07/report.d.ts.map +1 -1
- package/rest/admin/2022-07/resource_feedback.d.ts +2 -2
- package/rest/admin/2022-07/resource_feedback.d.ts.map +1 -1
- package/rest/admin/2022-07/script_tag.d.ts +5 -5
- package/rest/admin/2022-07/script_tag.d.ts.map +1 -1
- package/rest/admin/2022-07/shipping_zone.d.ts +2 -2
- package/rest/admin/2022-07/shipping_zone.d.ts.map +1 -1
- package/rest/admin/2022-07/shop.d.ts +2 -2
- package/rest/admin/2022-07/shop.d.ts.map +1 -1
- package/rest/admin/2022-07/smart_collection.d.ts +5 -5
- package/rest/admin/2022-07/smart_collection.d.ts.map +1 -1
- package/rest/admin/2022-07/storefront_access_token.d.ts +3 -3
- package/rest/admin/2022-07/storefront_access_token.d.ts.map +1 -1
- package/rest/admin/2022-07/tender_transaction.d.ts +2 -2
- package/rest/admin/2022-07/tender_transaction.d.ts.map +1 -1
- package/rest/admin/2022-07/theme.d.ts +4 -4
- package/rest/admin/2022-07/theme.d.ts.map +1 -1
- package/rest/admin/2022-07/transaction.d.ts +4 -4
- package/rest/admin/2022-07/transaction.d.ts.map +1 -1
- package/rest/admin/2022-07/usage_charge.d.ts +3 -3
- package/rest/admin/2022-07/usage_charge.d.ts.map +1 -1
- package/rest/admin/2022-07/user.d.ts +4 -4
- package/rest/admin/2022-07/user.d.ts.map +1 -1
- package/rest/admin/2022-07/variant.d.ts +5 -5
- package/rest/admin/2022-07/variant.d.ts.map +1 -1
- package/rest/admin/2022-07/webhook.d.ts +5 -5
- package/rest/admin/2022-07/webhook.d.ts.map +1 -1
- package/rest/admin/2022-10/abandoned_checkout.d.ts +2 -2
- package/rest/admin/2022-10/abandoned_checkout.d.ts.map +1 -1
- package/rest/admin/2022-10/access_scope.d.ts +2 -2
- package/rest/admin/2022-10/access_scope.d.ts.map +1 -1
- package/rest/admin/2022-10/android_pay_key.d.ts +3 -3
- package/rest/admin/2022-10/android_pay_key.d.ts.map +1 -1
- package/rest/admin/2022-10/apple_pay_certificate.d.ts +4 -4
- package/rest/admin/2022-10/apple_pay_certificate.d.ts.map +1 -1
- package/rest/admin/2022-10/application_charge.d.ts +3 -3
- package/rest/admin/2022-10/application_charge.d.ts.map +1 -1
- package/rest/admin/2022-10/application_credit.d.ts +3 -3
- package/rest/admin/2022-10/application_credit.d.ts.map +1 -1
- package/rest/admin/2022-10/article.d.ts +7 -7
- package/rest/admin/2022-10/article.d.ts.map +1 -1
- package/rest/admin/2022-10/asset.d.ts +3 -3
- package/rest/admin/2022-10/asset.d.ts.map +1 -1
- package/rest/admin/2022-10/assigned_fulfillment_order.d.ts +2 -2
- package/rest/admin/2022-10/assigned_fulfillment_order.d.ts.map +1 -1
- package/rest/admin/2022-10/balance.d.ts +2 -2
- package/rest/admin/2022-10/balance.d.ts.map +1 -1
- package/rest/admin/2022-10/blog.d.ts +5 -5
- package/rest/admin/2022-10/blog.d.ts.map +1 -1
- package/rest/admin/2022-10/carrier_service.d.ts +4 -4
- package/rest/admin/2022-10/carrier_service.d.ts.map +1 -1
- package/rest/admin/2022-10/checkout.d.ts +3 -3
- package/rest/admin/2022-10/checkout.d.ts.map +1 -1
- package/rest/admin/2022-10/collect.d.ts +5 -5
- package/rest/admin/2022-10/collect.d.ts.map +1 -1
- package/rest/admin/2022-10/collection.d.ts +3 -3
- package/rest/admin/2022-10/collection.d.ts.map +1 -1
- package/rest/admin/2022-10/collection_listing.d.ts +5 -5
- package/rest/admin/2022-10/collection_listing.d.ts.map +1 -1
- package/rest/admin/2022-10/comment.d.ts +4 -4
- package/rest/admin/2022-10/comment.d.ts.map +1 -1
- package/rest/admin/2022-10/country.d.ts +5 -5
- package/rest/admin/2022-10/country.d.ts.map +1 -1
- package/rest/admin/2022-10/currency.d.ts +2 -2
- package/rest/admin/2022-10/currency.d.ts.map +1 -1
- package/rest/admin/2022-10/custom_collection.d.ts +5 -5
- package/rest/admin/2022-10/custom_collection.d.ts.map +1 -1
- package/rest/admin/2022-10/customer.d.ts +7 -7
- package/rest/admin/2022-10/customer.d.ts.map +1 -1
- package/rest/admin/2022-10/customer_address.d.ts +4 -4
- package/rest/admin/2022-10/customer_address.d.ts.map +1 -1
- package/rest/admin/2022-10/customer_saved_search.d.ts +6 -6
- package/rest/admin/2022-10/customer_saved_search.d.ts.map +1 -1
- package/rest/admin/2022-10/deprecated_api_call.d.ts +2 -2
- package/rest/admin/2022-10/deprecated_api_call.d.ts.map +1 -1
- package/rest/admin/2022-10/discount_code.d.ts +7 -7
- package/rest/admin/2022-10/discount_code.d.ts.map +1 -1
- package/rest/admin/2022-10/dispute.d.ts +3 -3
- package/rest/admin/2022-10/dispute.d.ts.map +1 -1
- package/rest/admin/2022-10/dispute_evidence.d.ts +2 -2
- package/rest/admin/2022-10/dispute_evidence.d.ts.map +1 -1
- package/rest/admin/2022-10/dispute_file_upload.d.ts +2 -2
- package/rest/admin/2022-10/dispute_file_upload.d.ts.map +1 -1
- package/rest/admin/2022-10/draft_order.d.ts +5 -5
- package/rest/admin/2022-10/draft_order.d.ts.map +1 -1
- package/rest/admin/2022-10/event.d.ts +4 -4
- package/rest/admin/2022-10/event.d.ts.map +1 -1
- package/rest/admin/2022-10/fulfillment.d.ts +4 -4
- package/rest/admin/2022-10/fulfillment.d.ts.map +1 -1
- package/rest/admin/2022-10/fulfillment_event.d.ts +4 -4
- package/rest/admin/2022-10/fulfillment_event.d.ts.map +1 -1
- package/rest/admin/2022-10/fulfillment_order.d.ts +3 -3
- package/rest/admin/2022-10/fulfillment_order.d.ts.map +1 -1
- package/rest/admin/2022-10/fulfillment_service.d.ts +4 -4
- package/rest/admin/2022-10/fulfillment_service.d.ts.map +1 -1
- package/rest/admin/2022-10/gift_card.d.ts +5 -5
- package/rest/admin/2022-10/gift_card.d.ts.map +1 -1
- package/rest/admin/2022-10/gift_card_adjustment.d.ts +3 -3
- package/rest/admin/2022-10/gift_card_adjustment.d.ts.map +1 -1
- package/rest/admin/2022-10/image.d.ts +5 -5
- package/rest/admin/2022-10/image.d.ts.map +1 -1
- package/rest/admin/2022-10/inventory_item.d.ts +3 -3
- package/rest/admin/2022-10/inventory_item.d.ts.map +1 -1
- package/rest/admin/2022-10/inventory_level.d.ts +3 -3
- package/rest/admin/2022-10/inventory_level.d.ts.map +1 -1
- package/rest/admin/2022-10/location.d.ts +5 -5
- package/rest/admin/2022-10/location.d.ts.map +1 -1
- package/rest/admin/2022-10/locations_for_move.d.ts +2 -2
- package/rest/admin/2022-10/locations_for_move.d.ts.map +1 -1
- package/rest/admin/2022-10/marketing_event.d.ts +5 -5
- package/rest/admin/2022-10/marketing_event.d.ts.map +1 -1
- package/rest/admin/2022-10/metafield.d.ts +5 -5
- package/rest/admin/2022-10/metafield.d.ts.map +1 -1
- package/rest/admin/2022-10/mobile_platform_application.d.ts +4 -4
- package/rest/admin/2022-10/mobile_platform_application.d.ts.map +1 -1
- package/rest/admin/2022-10/order.d.ts +5 -5
- package/rest/admin/2022-10/order.d.ts.map +1 -1
- package/rest/admin/2022-10/order_risk.d.ts +4 -4
- package/rest/admin/2022-10/order_risk.d.ts.map +1 -1
- package/rest/admin/2022-10/page.d.ts +5 -5
- package/rest/admin/2022-10/page.d.ts.map +1 -1
- package/rest/admin/2022-10/payment.d.ts +4 -4
- package/rest/admin/2022-10/payment.d.ts.map +1 -1
- package/rest/admin/2022-10/payment_gateway.d.ts +4 -4
- package/rest/admin/2022-10/payment_gateway.d.ts.map +1 -1
- package/rest/admin/2022-10/payment_transaction.d.ts +2 -2
- package/rest/admin/2022-10/payment_transaction.d.ts.map +1 -1
- package/rest/admin/2022-10/payout.d.ts +3 -3
- package/rest/admin/2022-10/payout.d.ts.map +1 -1
- package/rest/admin/2022-10/policy.d.ts +2 -2
- package/rest/admin/2022-10/policy.d.ts.map +1 -1
- package/rest/admin/2022-10/price_rule.d.ts +5 -5
- package/rest/admin/2022-10/price_rule.d.ts.map +1 -1
- package/rest/admin/2022-10/product.d.ts +5 -5
- package/rest/admin/2022-10/product.d.ts.map +1 -1
- package/rest/admin/2022-10/product_listing.d.ts +6 -6
- package/rest/admin/2022-10/product_listing.d.ts.map +1 -1
- package/rest/admin/2022-10/product_resource_feedback.d.ts +2 -2
- package/rest/admin/2022-10/product_resource_feedback.d.ts.map +1 -1
- package/rest/admin/2022-10/province.d.ts +4 -4
- package/rest/admin/2022-10/province.d.ts.map +1 -1
- package/rest/admin/2022-10/recurring_application_charge.d.ts +4 -4
- package/rest/admin/2022-10/recurring_application_charge.d.ts.map +1 -1
- package/rest/admin/2022-10/redirect.d.ts +5 -5
- package/rest/admin/2022-10/redirect.d.ts.map +1 -1
- package/rest/admin/2022-10/refund.d.ts +3 -3
- package/rest/admin/2022-10/refund.d.ts.map +1 -1
- package/rest/admin/2022-10/report.d.ts +4 -4
- package/rest/admin/2022-10/report.d.ts.map +1 -1
- package/rest/admin/2022-10/resource_feedback.d.ts +2 -2
- package/rest/admin/2022-10/resource_feedback.d.ts.map +1 -1
- package/rest/admin/2022-10/script_tag.d.ts +5 -5
- package/rest/admin/2022-10/script_tag.d.ts.map +1 -1
- package/rest/admin/2022-10/shipping_zone.d.ts +2 -2
- package/rest/admin/2022-10/shipping_zone.d.ts.map +1 -1
- package/rest/admin/2022-10/shop.d.ts +2 -2
- package/rest/admin/2022-10/shop.d.ts.map +1 -1
- package/rest/admin/2022-10/smart_collection.d.ts +5 -5
- package/rest/admin/2022-10/smart_collection.d.ts.map +1 -1
- package/rest/admin/2022-10/storefront_access_token.d.ts +3 -3
- package/rest/admin/2022-10/storefront_access_token.d.ts.map +1 -1
- package/rest/admin/2022-10/tender_transaction.d.ts +2 -2
- package/rest/admin/2022-10/tender_transaction.d.ts.map +1 -1
- package/rest/admin/2022-10/theme.d.ts +4 -4
- package/rest/admin/2022-10/theme.d.ts.map +1 -1
- package/rest/admin/2022-10/transaction.d.ts +4 -4
- package/rest/admin/2022-10/transaction.d.ts.map +1 -1
- package/rest/admin/2022-10/usage_charge.d.ts +3 -3
- package/rest/admin/2022-10/usage_charge.d.ts.map +1 -1
- package/rest/admin/2022-10/user.d.ts +4 -4
- package/rest/admin/2022-10/user.d.ts.map +1 -1
- package/rest/admin/2022-10/variant.d.ts +5 -5
- package/rest/admin/2022-10/variant.d.ts.map +1 -1
- package/rest/admin/2022-10/webhook.d.ts +5 -5
- package/rest/admin/2022-10/webhook.d.ts.map +1 -1
- package/rest/base.d.ts +8 -8
- package/rest/base.d.ts.map +1 -1
- package/rest/base.js +1 -4
- package/rest/base.js.map +1 -1
- package/rest/types.d.ts +2 -2
- package/rest/types.d.ts.map +1 -1
- package/runtime/index.d.ts +0 -1
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +0 -1
- package/runtime/index.js.map +1 -1
- package/runtime/types.d.ts +0 -1
- package/runtime/types.d.ts.map +1 -1
- package/runtime/types.js +0 -1
- package/runtime/types.js.map +1 -1
- package/.github/CODEOWNERS +0 -1
- package/.github/ISSUE_TEMPLATE/BUG_REPORT.md +0 -35
- package/.github/ISSUE_TEMPLATE/ENHANCEMENT.md +0 -25
- package/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +0 -30
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -34
- package/.github/stale.yml +0 -42
- package/.github/workflows/ci.yml +0 -27
- package/.github/workflows/cla.yml +0 -22
- package/.github/workflows/markdown_link_check.yml +0 -12
- package/.github/workflows/markdown_link_checker_config.json +0 -4
- package/CODE_OF_CONDUCT.md +0 -46
- package/CONTRIBUTING.md +0 -39
- package/RELEASING.md +0 -77
- package/adapters/__e2etests__/.env.test +0 -1
- package/docs/issues.md +0 -25
- package/docs/migrating-to-v6.md +0 -952
- package/docs/usage/billing.md +0 -169
- package/docs/usage/customsessions.md +0 -154
- package/docs/usage/graphql.md +0 -132
- package/docs/usage/oauth.md +0 -171
- package/docs/usage/rest.md +0 -179
- package/docs/usage/runtimes.md +0 -54
- package/docs/usage/storefront.md +0 -72
- package/docs/usage/utils.md +0 -30
- package/docs/usage/webhooks.md +0 -225
- package/docs/usage/withsession.md +0 -74
- package/lib/clients/http_client/__tests__/test_logs.txt +0 -0
- package/lib/session/delete-current.d.ts +0 -4
- package/lib/session/delete-current.d.ts.map +0 -1
- package/lib/session/delete-current.js +0 -33
- package/lib/session/delete-current.js.map +0 -1
- package/lib/session/delete-offline.d.ts +0 -4
- package/lib/session/delete-offline.d.ts.map +0 -1
- package/lib/session/delete-offline.js +0 -22
- package/lib/session/delete-offline.js.map +0 -1
- package/lib/session/get-current.d.ts +0 -5
- package/lib/session/get-current.d.ts.map +0 -1
- package/lib/session/get-current.js +0 -32
- package/lib/session/get-current.js.map +0 -1
- package/lib/session/get-offline.d.ts +0 -4
- package/lib/session/get-offline.d.ts.map +0 -1
- package/lib/session/get-offline.js +0 -33
- package/lib/session/get-offline.js.map +0 -1
- package/lib/session/session_storage.d.ts +0 -41
- package/lib/session/session_storage.d.ts.map +0 -1
- package/lib/session/session_storage.js +0 -16
- package/lib/session/session_storage.js.map +0 -1
- package/lib/session/with-session.d.ts +0 -4
- package/lib/session/with-session.d.ts.map +0 -1
- package/lib/session/with-session.js +0 -54
- package/lib/session/with-session.js.map +0 -1
- package/runtime/crypto/__tests__/produce-node-base64.mjs +0 -18
- package/runtime/crypto/__tests__/produce-node-hmac.mjs +0 -27
- package/runtime/crypto/__tests__/random.mjs +0 -7
- package/runtime/session/index.d.ts +0 -5
- package/runtime/session/index.d.ts.map +0 -1
- package/runtime/session/index.js +0 -15
- package/runtime/session/index.js.map +0 -1
- package/runtime/session/types.d.ts +0 -3
- package/runtime/session/types.d.ts.map +0 -1
- package/session-storage/README.md +0 -211
- package/session-storage/__tests__/redis.conf +0 -1
- package/session-storage/custom.d.ts +0 -20
- package/session-storage/custom.d.ts.map +0 -1
- package/session-storage/custom.js +0 -156
- package/session-storage/custom.js.map +0 -1
- package/session-storage/kv.d.ts +0 -17
- package/session-storage/kv.d.ts.map +0 -1
- package/session-storage/kv.js +0 -184
- package/session-storage/kv.js.map +0 -1
- package/session-storage/memory.d.ts +0 -11
- package/session-storage/memory.d.ts.map +0 -1
- package/session-storage/memory.js +0 -61
- package/session-storage/memory.js.map +0 -1
- package/session-storage/mongodb.d.ts +0 -25
- package/session-storage/mongodb.d.ts.map +0 -1
- package/session-storage/mongodb.js +0 -190
- package/session-storage/mongodb.js.map +0 -1
- package/session-storage/mysql.d.ts +0 -24
- package/session-storage/mysql.d.ts.map +0 -1
- package/session-storage/mysql.js +0 -200
- package/session-storage/mysql.js.map +0 -1
- package/session-storage/postgresql.d.ts +0 -26
- package/session-storage/postgresql.d.ts.map +0 -1
- package/session-storage/postgresql.js +0 -218
- package/session-storage/postgresql.js.map +0 -1
- package/session-storage/redis.d.ts +0 -24
- package/session-storage/redis.d.ts.map +0 -1
- package/session-storage/redis.js +0 -178
- package/session-storage/redis.js.map +0 -1
- package/session-storage/sqlite.d.ts +0 -21
- package/session-storage/sqlite.d.ts.map +0 -1
- package/session-storage/sqlite.js +0 -175
- package/session-storage/sqlite.js.map +0 -1
package/docs/migrating-to-v6.md
DELETED
|
@@ -1,952 +0,0 @@
|
|
|
1
|
-
# Migrating to v6
|
|
2
|
-
|
|
3
|
-
We've extended the functionality of this library so that it can now run on JavaScript runtimes other than Node.js, as long as there is a runtime adapter for it.
|
|
4
|
-
|
|
5
|
-
To migrate your Node.js app to use this new adaptable version of the API library, you'll need to add an import of the node adapter in your app, _before_ importing the library functions themselves.
|
|
6
|
-
Note you only need to import this once in your app.
|
|
7
|
-
|
|
8
|
-
```js
|
|
9
|
-
import '@shopify/shopify-api/adapters/node';
|
|
10
|
-
import { ... } from '@shopify/shopify-api';
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
This automatically sets the library up to run on the Node.js runtime.
|
|
14
|
-
|
|
15
|
-
In addition to making the library compatible with multiple runtimes, we've also improved its public interface to make it easier for apps to load only the features they need from the library.
|
|
16
|
-
Once you set up your app with the right adapter, you can follow the next sections for instructions on how to upgrade the individual methods that were changed.
|
|
17
|
-
|
|
18
|
-
**Note 1**: the examples below are assuming your app is running using Express.js, but the library still works with different frameworks as before.
|
|
19
|
-
|
|
20
|
-
**Note 2**: in general, method calls in v6 of the library take parameter objects instead of positional parameters. A :warning: symbol will highlight where these changes have occurred below, as forgetting to migrate the parameters into parameter objects can result in confusing app behaviour.
|
|
21
|
-
|
|
22
|
-
## Table of contents
|
|
23
|
-
|
|
24
|
-
To make it easier to navigate this guide, here is an overview of the sections it contains:
|
|
25
|
-
|
|
26
|
-
- [Renamed `Shopify.Context` to `shopify.config`](#renamed-shopifycontext-to-shopifyconfig)
|
|
27
|
-
- [Passing in framework requests / responses](#passing-in-framework-requests--responses)
|
|
28
|
-
- [Simplified namespace for errors](#simplified-namespace-for-errors)
|
|
29
|
-
- [Changes to `Session` and `SessionStorage`](#changes-to-session-and-sessionstorage)
|
|
30
|
-
- [Changes to authentication functions](#changes-to-authentication-functions)
|
|
31
|
-
- [Changes to API clients](#changes-to-api-clients)
|
|
32
|
-
- [Billing](#billing)
|
|
33
|
-
- [Utility functions](#utility-functions)
|
|
34
|
-
- [Changes to webhook functions](#changes-to-webhook-functions)
|
|
35
|
-
- [Changes to use of REST resources](#changes-to-use-of-rest-resources)
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Renamed `Shopify.Context` to `shopify.config`
|
|
40
|
-
|
|
41
|
-
We've refactored the way objects are exported by this library, to remove the main static singleton `Shopify` object with global settings stored in `Shopify.Context`.
|
|
42
|
-
|
|
43
|
-
Even though that object has no business logic, the fact that the configuration is global made it hard to mock for tests and to set up multiple instances of it.
|
|
44
|
-
Part of the changes we made were to create a library object with local settings, to make it feel more idiomatic and easier to work with.
|
|
45
|
-
|
|
46
|
-
In general, those changes don't affect any library functionality, unless explicitly mentioned below.
|
|
47
|
-
You will probably need to search and replace most of the imports to this library to leverage the new approach, but it should not require any functionality changes.
|
|
48
|
-
|
|
49
|
-
1. Apps no longer set up the library with `Shopify.Context.initialize()`. The new library object constructor takes in the configuration.
|
|
50
|
-
<div>Before
|
|
51
|
-
|
|
52
|
-
```ts
|
|
53
|
-
import {Shopify} from '@shopify/shopify-api';
|
|
54
|
-
Shopify.Context.initialize({ API_KEY: '...', ... });
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
</div><div>After
|
|
58
|
-
|
|
59
|
-
```ts
|
|
60
|
-
import {shopifyApi} from '@shopify/shopify-api';
|
|
61
|
-
const shopify = shopifyApi({ apiKey: '...', ... });
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
1. `Shopify.Context` was replaced with `shopify.config`, and config options are now `camelCase` instead of `UPPER_CASE`.
|
|
67
|
-
<div>Before
|
|
68
|
-
|
|
69
|
-
```ts
|
|
70
|
-
console.log(Shopify.Context.API_KEY);
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
</div><div>After
|
|
74
|
-
|
|
75
|
-
```ts
|
|
76
|
-
console.log(shopify.config.apiKey);
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
1. `Shopify.Context.throwIfUnitialized` and `UninitializedContextError` were removed.
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Passing in framework requests / responses
|
|
86
|
-
|
|
87
|
-
Using the v5 or earlier version of the library, apps would generally call library functions as follows:
|
|
88
|
-
|
|
89
|
-
```ts
|
|
90
|
-
app.get(
|
|
91
|
-
'/path',
|
|
92
|
-
async (req: http.IncomingMessage, res: http.ServerResponse) => {
|
|
93
|
-
const redirectUri = await Shopify.Auth.beginAuth(req, res);
|
|
94
|
-
res.redirect(redirectUri);
|
|
95
|
-
},
|
|
96
|
-
);
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
To enable the library to work across runtimes, we've abstracted these objects into `rawRequest` and `rawResponse?`.
|
|
100
|
-
As a general rule, you'll need to update calls like above to:
|
|
101
|
-
|
|
102
|
-
```ts
|
|
103
|
-
app.get(
|
|
104
|
-
'/path',
|
|
105
|
-
async (req: http.IncomingMessage, res: http.ServerResponse) => {
|
|
106
|
-
// Library will automatically trigger the redirect in res
|
|
107
|
-
await shopify.auth.begin({rawRequest: req, rawResponse: res});
|
|
108
|
-
},
|
|
109
|
-
);
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
For runtimes that expect handlers to _return_ a `Response` object, rather than passing it in as a parameter (like CloudFlare workers), you can skip the `rawResponse` value.
|
|
113
|
-
|
|
114
|
-
```ts
|
|
115
|
-
async function handleFetch(request: Request): Promise<Response> {
|
|
116
|
-
// Library will return the Response object
|
|
117
|
-
return shopify.auth.begin({rawRequest: request});
|
|
118
|
-
},
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## Simplified namespace for errors
|
|
124
|
-
|
|
125
|
-
Using the v5 or earlier version of the library, error types were available via the `Shopify` instance, e.g., `Shopify.Errors.HttpResponseError`. In v6, they are now exported by the library and can be imported without any namespace prefix.
|
|
126
|
-
|
|
127
|
-
<div>Before
|
|
128
|
-
|
|
129
|
-
```ts
|
|
130
|
-
app.post('/webhooks', async (req, res) => {
|
|
131
|
-
try {
|
|
132
|
-
await Shopify.Webhooks.Registry.process(req, res);
|
|
133
|
-
} catch (error) {
|
|
134
|
-
if (error instanceof Shopify.Errors.InvalidWebhookError) {
|
|
135
|
-
console.log(`Webhook processing error:\n\tmessage = ${error.message}`);
|
|
136
|
-
} else {
|
|
137
|
-
console.log('Other error:\n\t', error);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
</div><div>:warning: After
|
|
144
|
-
|
|
145
|
-
```ts
|
|
146
|
-
import {InvalidWebhookError} from '@shopify/shopify-api';
|
|
147
|
-
|
|
148
|
-
// ...
|
|
149
|
-
|
|
150
|
-
app.post('/webhooks', async (req, res) => {
|
|
151
|
-
try {
|
|
152
|
-
await shopify.webhooks.process({
|
|
153
|
-
rawBody: (req as any).rawBody, // as a string
|
|
154
|
-
rawRequest: req,
|
|
155
|
-
rawResponse: res,
|
|
156
|
-
});
|
|
157
|
-
} catch (error) {
|
|
158
|
-
if (error instanceof InvalidWebhookError) {
|
|
159
|
-
console.log(
|
|
160
|
-
`Webhook processing error:\n\tmessage = ${error.message}\n\tresponse = ${error.response}`,
|
|
161
|
-
);
|
|
162
|
-
} else {
|
|
163
|
-
console.log('Other error:\n\t', error);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Changes to `Session` and `SessionStorage`
|
|
172
|
-
|
|
173
|
-
1. `SessionStorage` is no longer an interface, but an abstract class. If you're using your own implementation of the interface, you need to replace `implements SessionStorage` with `extends SessionStorage`.
|
|
174
|
-
<div>Before
|
|
175
|
-
|
|
176
|
-
```ts
|
|
177
|
-
import {SessionStorage} from '@shopify/shopify-api';
|
|
178
|
-
class MySessionStorage implements SessionStorage {
|
|
179
|
-
// ...
|
|
180
|
-
}
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
</div><div>After
|
|
184
|
-
|
|
185
|
-
```ts
|
|
186
|
-
import {SessionStorage} from '@shopify/shopify-api';
|
|
187
|
-
class MySessionStorage extends SessionStorage {
|
|
188
|
-
// ...
|
|
189
|
-
}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
</div>
|
|
193
|
-
|
|
194
|
-
1. Since not all adapters work on all runtimes, they've been separated in their own import path. To use the provided storage options, you can import them directly using the following pattern:
|
|
195
|
-
<div>Before
|
|
196
|
-
|
|
197
|
-
```ts
|
|
198
|
-
import {MemorySessionStorage} from '@shopify/shopify-api';
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
</div><div>After
|
|
202
|
-
|
|
203
|
-
```ts
|
|
204
|
-
import {MemorySessionStorage} from '@shopify/shopify-api/session-storage/memory';
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
</div>
|
|
208
|
-
|
|
209
|
-
1. The `Session` constructor now takes an object which allows all properties of a session, and `Session.cloneSession` was removed since we can use a session as arguments for the clone.
|
|
210
|
-
<div>Before
|
|
211
|
-
|
|
212
|
-
```ts
|
|
213
|
-
import {Session} from '@shopify/shopify-api';
|
|
214
|
-
const session = new Session(
|
|
215
|
-
'session-id',
|
|
216
|
-
'shop.myshopify.com',
|
|
217
|
-
'state1234',
|
|
218
|
-
true,
|
|
219
|
-
);
|
|
220
|
-
session.accessToken = 'token';
|
|
221
|
-
const clone = Session.cloneSession(session, 'newId');
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
</div><div>:warning: After
|
|
225
|
-
|
|
226
|
-
```ts
|
|
227
|
-
import {Session} from '@shopify/shopify-api';
|
|
228
|
-
const session = new Session({
|
|
229
|
-
id: 'session-id',
|
|
230
|
-
shop: 'shop.myshopify.com',
|
|
231
|
-
state: 'state1234',
|
|
232
|
-
isOnline: true,
|
|
233
|
-
accessToken: 'token',
|
|
234
|
-
});
|
|
235
|
-
const clone = new Session({...session, id: 'newId'});
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
</div>
|
|
239
|
-
|
|
240
|
-
1. The `isActive()` method of `Session` now takes a `scopes` parameter. If the scopes of the session don't match the scopes of the application (e.g., app has been restarted with new scopes), the session is deemed to be inactive and OAuth should be initiated again.
|
|
241
|
-
<div>Before
|
|
242
|
-
|
|
243
|
-
```ts
|
|
244
|
-
const session = await Shopify.Utils.loadCurrentSession(req, res);
|
|
245
|
-
|
|
246
|
-
if (!session.isActive()) {
|
|
247
|
-
// current session is not active - either expired or scopes have changed
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
</div><div>:warning: After
|
|
252
|
-
|
|
253
|
-
```ts
|
|
254
|
-
const session = await shopify.session.getCurrent({
|
|
255
|
-
isOnline: true,
|
|
256
|
-
rawRequest: req,
|
|
257
|
-
rawResponse: res,
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
if (!session.isActive(shopify.config.scopes)) {
|
|
261
|
-
// current session is not active - either expired or scopes have changed
|
|
262
|
-
}
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
</div>
|
|
266
|
-
|
|
267
|
-
---
|
|
268
|
-
|
|
269
|
-
## Changes to authentication functions
|
|
270
|
-
|
|
271
|
-
The OAuth methods still behave the same way, but we've updated their signatures to make it easier to work with them. See the [updated OAuth instructions](./usage/oauth.md) for a complete example.
|
|
272
|
-
|
|
273
|
-
1. `Shopify.Auth.beginAuth()` is now `shopify.auth.begin()`, it takes in an object, and it now also triggers a redirect response to the correct endpoint.
|
|
274
|
-
<div>Before
|
|
275
|
-
|
|
276
|
-
```ts
|
|
277
|
-
const redirectUri = await Shopify.Auth.beginAuth(
|
|
278
|
-
req,
|
|
279
|
-
res,
|
|
280
|
-
'my-shop.com',
|
|
281
|
-
'/auth/callback',
|
|
282
|
-
true,
|
|
283
|
-
);
|
|
284
|
-
// App had to redirect to the returned URL
|
|
285
|
-
res.redirect(redirectUri);
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
</div><div>:warning: After
|
|
289
|
-
|
|
290
|
-
```ts
|
|
291
|
-
// Library handles redirecting
|
|
292
|
-
await shopify.auth.begin({
|
|
293
|
-
shop: 'my-shop.com',
|
|
294
|
-
callbackPath: '/auth/callback',
|
|
295
|
-
isOnline: true,
|
|
296
|
-
rawRequest: req,
|
|
297
|
-
rawResponse: res,
|
|
298
|
-
});
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
</div>
|
|
302
|
-
|
|
303
|
-
1. `Shopify.Auth.validateAuthCallback()` is now `shopify.auth.callback()`, it now takes an object with an `isOnline` value, but the `query` argument is no longer necessary - it will be read from the request. This method will set the appropriate response headers.
|
|
304
|
-
<div>Before
|
|
305
|
-
|
|
306
|
-
```ts
|
|
307
|
-
const session = Shopify.Auth.validateAuthCallback(
|
|
308
|
-
req,
|
|
309
|
-
res,
|
|
310
|
-
req.query as AuthQuery,
|
|
311
|
-
);
|
|
312
|
-
// session.accessToken...
|
|
313
|
-
res.redirect('url');
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
</div><div>:warning: After
|
|
317
|
-
|
|
318
|
-
```ts
|
|
319
|
-
const callbackResponse = shopify.auth.callback({
|
|
320
|
-
isOnline: true,
|
|
321
|
-
rawRequest: req,
|
|
322
|
-
rawResponse: res,
|
|
323
|
-
});
|
|
324
|
-
// callbackResponse.session.accessToken...
|
|
325
|
-
res.redirect('url');
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
</div>
|
|
329
|
-
|
|
330
|
-
1. The `shopify.auth` component only exports the key functions now to make the API simpler, so `getCookieSessionId`, `getJwtSessionId`, `getOfflineSessionId`, `getCurrentSessionId` are no longer exported. They're internal library functions.
|
|
331
|
-
|
|
332
|
-
1. There is a new `shopify.session` object which contains session-specific functions. See the [Utility functions](#utility-functions) section for the specific changes.
|
|
333
|
-
|
|
334
|
-
---
|
|
335
|
-
|
|
336
|
-
## Changes to API clients
|
|
337
|
-
|
|
338
|
-
The API clients this package provides now take an object of arguments, rather than positional ones. The returned objects behave the same way they did before, so you'll only need to update the constructor calls.
|
|
339
|
-
|
|
340
|
-
1. REST Admin API client:
|
|
341
|
-
|
|
342
|
-
<div>Before
|
|
343
|
-
|
|
344
|
-
```ts
|
|
345
|
-
const restClient = new Shopify.Clients.Rest(
|
|
346
|
-
session.shop,
|
|
347
|
-
session.accessToken,
|
|
348
|
-
);
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
</div><div>:warning: After
|
|
352
|
-
|
|
353
|
-
```ts
|
|
354
|
-
const restClient = new shopify.clients.Rest({
|
|
355
|
-
domain: session.shop,
|
|
356
|
-
accessToken: session.accessToken,
|
|
357
|
-
});
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
</div>
|
|
361
|
-
|
|
362
|
-
1. GraphQL Admin API client:
|
|
363
|
-
|
|
364
|
-
<div>Before
|
|
365
|
-
|
|
366
|
-
```ts
|
|
367
|
-
const graphqlClient = new Shopify.Clients.Graphql(
|
|
368
|
-
session.shop,
|
|
369
|
-
session.accessToken,
|
|
370
|
-
);
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
</div><div>:warning: After
|
|
374
|
-
|
|
375
|
-
```ts
|
|
376
|
-
const graphqlClient = new shopify.clients.Graphql({
|
|
377
|
-
domain: session.shop,
|
|
378
|
-
accessToken: session.accessToken,
|
|
379
|
-
});
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
</div>
|
|
383
|
-
|
|
384
|
-
1. Storefront API client:
|
|
385
|
-
|
|
386
|
-
<div>Before
|
|
387
|
-
|
|
388
|
-
```ts
|
|
389
|
-
const storefrontClient = new Shopify.Clients.Storefront(
|
|
390
|
-
session.shop,
|
|
391
|
-
storefrontAccessToken,
|
|
392
|
-
);
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
</div><div>:warning: After
|
|
396
|
-
|
|
397
|
-
```ts
|
|
398
|
-
const storefrontClient = new shopify.clients.Storefront({
|
|
399
|
-
domain: session.shop,
|
|
400
|
-
accessToken: storefrontAccessToken,
|
|
401
|
-
});
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
</div>
|
|
405
|
-
|
|
406
|
-
The `HttpResponseError`, `HttpRetriableError`, `HttpInternalError`, and `HttpThrottlingError` classes were updated to include more information on the errors.
|
|
407
|
-
|
|
408
|
-
<div>Before
|
|
409
|
-
|
|
410
|
-
```ts
|
|
411
|
-
catch (err) {
|
|
412
|
-
if (err instanceof HttpResponseError) {
|
|
413
|
-
console.log(err.code, err.statusText);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
</div><div>After
|
|
419
|
-
|
|
420
|
-
```ts
|
|
421
|
-
catch (err) {
|
|
422
|
-
if (err instanceof HttpResponseError) {
|
|
423
|
-
console.log(err.response.code, err.response.statusText, err.response);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
</div>
|
|
429
|
-
|
|
430
|
-
---
|
|
431
|
-
|
|
432
|
-
## Billing
|
|
433
|
-
|
|
434
|
-
The billing functionality hasn't changed, but the main difference is that the library now provides separate methods for checking and requesting payment, which gives apps more freedom to implement their billing logic.
|
|
435
|
-
|
|
436
|
-
To configure billing, you can now pass in more than one billing plan, and they're indexed by plan name:
|
|
437
|
-
|
|
438
|
-
<div>Before
|
|
439
|
-
|
|
440
|
-
```ts
|
|
441
|
-
Shopify.Context.initialize({
|
|
442
|
-
// ...
|
|
443
|
-
billing: {
|
|
444
|
-
chargeName: 'My plan',
|
|
445
|
-
amount: 5.0,
|
|
446
|
-
currencyCode: 'USD',
|
|
447
|
-
interval: BillingInterval.Every30Days,
|
|
448
|
-
},
|
|
449
|
-
});
|
|
450
|
-
```
|
|
451
|
-
|
|
452
|
-
</div><div>After
|
|
453
|
-
|
|
454
|
-
```ts
|
|
455
|
-
const shopify = shopifyApi({
|
|
456
|
-
// ...
|
|
457
|
-
billing: {
|
|
458
|
-
'My plan': {
|
|
459
|
-
amount: 5.0,
|
|
460
|
-
currencyCode: 'USD',
|
|
461
|
-
interval: BillingInterval.Every30Days,
|
|
462
|
-
},
|
|
463
|
-
},
|
|
464
|
-
});
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
</div>
|
|
468
|
-
|
|
469
|
-
We broke the `Shopify.Billing.check` method up into `shopify.billing.check` and `shopify.billing.request`, as mentioned above:
|
|
470
|
-
|
|
471
|
-
<div>Before
|
|
472
|
-
|
|
473
|
-
```ts
|
|
474
|
-
const {hasPayment, confirmBillingUrl} = await Shopify.Billing.check({
|
|
475
|
-
session,
|
|
476
|
-
isTest: true,
|
|
477
|
-
});
|
|
478
|
-
|
|
479
|
-
if (!hasPayment) {
|
|
480
|
-
return redirect(confirmBillingUrl);
|
|
481
|
-
}
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
</div><div>After
|
|
485
|
-
|
|
486
|
-
```ts
|
|
487
|
-
const hasPayment = await shopify.billing.check({
|
|
488
|
-
session,
|
|
489
|
-
plans: 'My plan',
|
|
490
|
-
isTest: true,
|
|
491
|
-
});
|
|
492
|
-
|
|
493
|
-
if (!hasPayment) {
|
|
494
|
-
const confirmationUrl = await shopify.billing.request({
|
|
495
|
-
session,
|
|
496
|
-
plan: 'My plan',
|
|
497
|
-
isTest: true,
|
|
498
|
-
});
|
|
499
|
-
return redirect(confirmationUrl);
|
|
500
|
-
}
|
|
501
|
-
```
|
|
502
|
-
|
|
503
|
-
Note that when calling `check`, apps can pass in one or more plans, and it will return true if any of them match. The `request` method creates a charge using the configuration of the given plan name.
|
|
504
|
-
|
|
505
|
-
</div>
|
|
506
|
-
|
|
507
|
-
---
|
|
508
|
-
|
|
509
|
-
## Utility functions
|
|
510
|
-
|
|
511
|
-
The previous `Shopify.Utils` object contained functions that relied on the global configuration object, but those have been refactored to use the instance-specific configuration.
|
|
512
|
-
We also felt that the `Utils` object had some functions that belong to other parts of the library, so some of these functions have been moved to other sub-objects - keep an eye out for those changes in the list below!
|
|
513
|
-
|
|
514
|
-
Here are all the specific changes that we made to the `Utils` object:
|
|
515
|
-
|
|
516
|
-
1. `Shopify.Utils.generateLocalHmac` was removed because it's only meant to be used internally by the library.
|
|
517
|
-
1. The `storeSession` method was removed since sessions shouldn't be stored using the library unless the library is doing it. Apps can still save data to their sessions as they please, as long as the data is properly exported to the library via the configured `SessionStorage`.
|
|
518
|
-
1. `validateHmac` is now `async`.
|
|
519
|
-
<div>Before
|
|
520
|
-
|
|
521
|
-
```ts
|
|
522
|
-
const isValid = Shopify.Utils.validateHmac(req.query);
|
|
523
|
-
```
|
|
524
|
-
|
|
525
|
-
</div><div>After
|
|
526
|
-
|
|
527
|
-
```ts
|
|
528
|
-
const isValid = await shopify.utils.validateHmac(req.query);
|
|
529
|
-
```
|
|
530
|
-
|
|
531
|
-
</div>
|
|
532
|
-
|
|
533
|
-
1. `nonce`, `safeCompare`, and `getEmbeddedAppUrl` have moved to `shopify.auth`. `getEmbeddedAppUrl` is now `async` and takes in an object.
|
|
534
|
-
<div>Before
|
|
535
|
-
|
|
536
|
-
```ts
|
|
537
|
-
const nonce = Shopify.Utils.nonce();
|
|
538
|
-
const match = Shopify.Utils.safeCompare(strA, strB);
|
|
539
|
-
const redirectUrl = Shopify.Utils.getEmbeddedAppUrl(req, res);
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
</div><div>:warning: After
|
|
543
|
-
|
|
544
|
-
```ts
|
|
545
|
-
const nonce = shopify.auth.nonce();
|
|
546
|
-
const match = shopify.auth.safeCompare(strA, strB);
|
|
547
|
-
const redirectUrl = await shopify.auth.getEmbeddedAppUrl({
|
|
548
|
-
rawRequest: req,
|
|
549
|
-
rawResponse: res,
|
|
550
|
-
});
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
</div>
|
|
554
|
-
|
|
555
|
-
1. `Shopify.Context.LOG_FILE` was replaced with `shopify.config.logFunction` so it can work without file-system access.
|
|
556
|
-
<div>Before
|
|
557
|
-
|
|
558
|
-
```ts
|
|
559
|
-
Shopify.Context.initialize({LOG_FILE: 'path/to/file.log'});
|
|
560
|
-
```
|
|
561
|
-
|
|
562
|
-
</div><div>After
|
|
563
|
-
|
|
564
|
-
```ts
|
|
565
|
-
const shopify = new shopifyApi({
|
|
566
|
-
logFunction: async (severity: string, message: string) => {
|
|
567
|
-
fs.appendFile(
|
|
568
|
-
'path/to/file.log',
|
|
569
|
-
`${new Date()} [${severity}]: ${message}`,
|
|
570
|
-
);
|
|
571
|
-
},
|
|
572
|
-
});
|
|
573
|
-
```
|
|
574
|
-
|
|
575
|
-
</div>
|
|
576
|
-
|
|
577
|
-
1. `Shopify.Utils.decodeSessionToken` is now `shopify.session.decodeSessionToken`, and it's `async`.
|
|
578
|
-
<div>Before
|
|
579
|
-
|
|
580
|
-
```ts
|
|
581
|
-
const payload = Shopify.Utils.decodeSessionToken(token);
|
|
582
|
-
```
|
|
583
|
-
|
|
584
|
-
</div><div>After
|
|
585
|
-
|
|
586
|
-
```ts
|
|
587
|
-
const payload = await shopify.session.decodeSessionToken(token);
|
|
588
|
-
```
|
|
589
|
-
|
|
590
|
-
</div>
|
|
591
|
-
|
|
592
|
-
1. `Shopify.Utils.loadCurrentSession` is now `shopify.session.getCurrent`, it takes in an object, and the `isOnline` param is mandatory.
|
|
593
|
-
<div>Before
|
|
594
|
-
|
|
595
|
-
```ts
|
|
596
|
-
const session = await Shopify.Utils.loadCurrentSession(req, res);
|
|
597
|
-
```
|
|
598
|
-
|
|
599
|
-
</div><div>:warning: After
|
|
600
|
-
|
|
601
|
-
```ts
|
|
602
|
-
const session = await shopify.session.getCurrent({
|
|
603
|
-
isOnline: true,
|
|
604
|
-
rawRequest: req,
|
|
605
|
-
rawResponse: res,
|
|
606
|
-
});
|
|
607
|
-
```
|
|
608
|
-
|
|
609
|
-
</div>
|
|
610
|
-
|
|
611
|
-
1. `Shopify.Utils.deleteCurrentSession` is now `shopify.session.deleteCurrent`, it takes in an object, and the `isOnline` param is mandatory.
|
|
612
|
-
<div>Before
|
|
613
|
-
|
|
614
|
-
```ts
|
|
615
|
-
const session = await Shopify.Utils.deleteCurrentSession(req, res);
|
|
616
|
-
```
|
|
617
|
-
|
|
618
|
-
</div><div>:warning: After
|
|
619
|
-
|
|
620
|
-
```ts
|
|
621
|
-
const session = await shopify.session.deleteCurrent({
|
|
622
|
-
isOnline: true,
|
|
623
|
-
rawRequest: req,
|
|
624
|
-
rawResponse: res,
|
|
625
|
-
});
|
|
626
|
-
```
|
|
627
|
-
|
|
628
|
-
</div>
|
|
629
|
-
|
|
630
|
-
1. `Shopify.Utils.loadOfflineSession` is now `shopify.session.getOffline`, and it now takes an object. It still **_does not_** validate the given arguments and should only be used if you trust the source of the shop argument.
|
|
631
|
-
<div>Before
|
|
632
|
-
|
|
633
|
-
```ts
|
|
634
|
-
const session = await Shopify.Utils.loadOfflineSession(
|
|
635
|
-
'my-shop.myshopify.com',
|
|
636
|
-
true,
|
|
637
|
-
);
|
|
638
|
-
```
|
|
639
|
-
|
|
640
|
-
</div><div>:warning: After
|
|
641
|
-
|
|
642
|
-
```ts
|
|
643
|
-
const session = await shopify.session.getOffline({
|
|
644
|
-
shop: 'my-shop.myshopify.com',
|
|
645
|
-
includeExpired: true,
|
|
646
|
-
});
|
|
647
|
-
```
|
|
648
|
-
|
|
649
|
-
</div>
|
|
650
|
-
|
|
651
|
-
1. `Shopify.Utils.deleteOfflineSession` is now `shopify.session.deleteOffline`, and it now takes an object.
|
|
652
|
-
<div>Before
|
|
653
|
-
|
|
654
|
-
```ts
|
|
655
|
-
const success = await Shopify.Utils.deleteOfflineSession(
|
|
656
|
-
'my-shop.myshopify.com',
|
|
657
|
-
);
|
|
658
|
-
```
|
|
659
|
-
|
|
660
|
-
</div><div>:warning: After
|
|
661
|
-
|
|
662
|
-
```ts
|
|
663
|
-
const success = await shopify.session.deleteOffline({
|
|
664
|
-
shop: 'my-shop.myshopify.com',
|
|
665
|
-
});
|
|
666
|
-
```
|
|
667
|
-
|
|
668
|
-
</div>
|
|
669
|
-
|
|
670
|
-
1. `Shopify.Utils.withSession` is now `shopify.session.withSession`, and it no longer takes a `shop` argument, it will always authenticate the request to get the shop. The client type is now an enum to make it easier to see the available options.
|
|
671
|
-
<div>Before
|
|
672
|
-
|
|
673
|
-
```ts
|
|
674
|
-
const {client, session} = await Shopify.Utils.withSession({
|
|
675
|
-
clientType: 'rest',
|
|
676
|
-
isOnline: true,
|
|
677
|
-
req,
|
|
678
|
-
res,
|
|
679
|
-
shop: 'my-shop.myshopify.com',
|
|
680
|
-
});
|
|
681
|
-
```
|
|
682
|
-
|
|
683
|
-
</div><div>After
|
|
684
|
-
|
|
685
|
-
```ts
|
|
686
|
-
import {ClientType} from '@shopify/shopify-api';
|
|
687
|
-
|
|
688
|
-
const {client, session} = await shopify.session.withSession({
|
|
689
|
-
clientType: ClientType.Rest,
|
|
690
|
-
isOnline: true,
|
|
691
|
-
rawRequest: req,
|
|
692
|
-
rawResponse: res,
|
|
693
|
-
});
|
|
694
|
-
```
|
|
695
|
-
|
|
696
|
-
</div>
|
|
697
|
-
|
|
698
|
-
1. `Shopify.Utils.graphqlProxy` is now `shopify.clients.graphqlProxy`, and it takes the body as an argument instead of parsing it from the request. This will make it easier for apps to use a body parser with this function.
|
|
699
|
-
<div>Before
|
|
700
|
-
|
|
701
|
-
```ts
|
|
702
|
-
const response = await Shopify.Utils.graphqlProxy(req, res);
|
|
703
|
-
```
|
|
704
|
-
|
|
705
|
-
</div><div>:warning: After
|
|
706
|
-
|
|
707
|
-
```ts
|
|
708
|
-
const response = await shopify.clients.graphqlProxy({
|
|
709
|
-
rawBody: req.rawBody, // From my app
|
|
710
|
-
rawRequest: req,
|
|
711
|
-
rawResponse: res,
|
|
712
|
-
});
|
|
713
|
-
```
|
|
714
|
-
|
|
715
|
-
</div>
|
|
716
|
-
|
|
717
|
-
---
|
|
718
|
-
|
|
719
|
-
## Changes to webhook functions
|
|
720
|
-
|
|
721
|
-
In v6, apps can now set up multiple handlers per webhook topic, and we simplified the library's interface to reduce the number of methods needed.
|
|
722
|
-
|
|
723
|
-
The following methods are now available:
|
|
724
|
-
|
|
725
|
-
- `addHandlers`
|
|
726
|
-
- `register`
|
|
727
|
-
- `process`
|
|
728
|
-
- `getHandlers`
|
|
729
|
-
- `getTopicsAdded` replaces the previous `getTopics`
|
|
730
|
-
|
|
731
|
-
And the following methods are no longer supported:
|
|
732
|
-
|
|
733
|
-
- `addHandler`
|
|
734
|
-
- `registerAll`
|
|
735
|
-
- `getHandler`
|
|
736
|
-
- `isWebhookPath`
|
|
737
|
-
|
|
738
|
-
For more details on the updated webhook functions, see the [documentation](./usage/webhooks.md).
|
|
739
|
-
|
|
740
|
-
Below are instructions on how webhooks work now:
|
|
741
|
-
|
|
742
|
-
1. You can call `shopify.webhooks.addHandlers` with a list of handlers, indexed by topic. Note that you must now use delivery method-specific fields instead of `path`, like `callbackUrl` and `arn`, to match the GrahpQL API behavior.
|
|
743
|
-
|
|
744
|
-
<div>Before
|
|
745
|
-
|
|
746
|
-
```ts
|
|
747
|
-
Shopify.Webhooks.Registry.addHandler('PRODUCTS_CREATE', {
|
|
748
|
-
path: '/webhooks',
|
|
749
|
-
webhookHandler: handleWebhookRequest,
|
|
750
|
-
});
|
|
751
|
-
```
|
|
752
|
-
|
|
753
|
-
</div><div>:warning: After
|
|
754
|
-
|
|
755
|
-
```ts
|
|
756
|
-
shopify.webhooks.addHandlers({
|
|
757
|
-
PRODUCTS_CREATE: {
|
|
758
|
-
deliveryMethod: DeliveryMethod.Http,
|
|
759
|
-
callbackUrl: '/webhooks',
|
|
760
|
-
callback: handleWebhookRequest,
|
|
761
|
-
},
|
|
762
|
-
TOPIC_1: [handler, handler2],
|
|
763
|
-
TOPIC_2: handler3,
|
|
764
|
-
});
|
|
765
|
-
```
|
|
766
|
-
|
|
767
|
-
</div>
|
|
768
|
-
|
|
769
|
-
> **Note**: if you're using TypeScript, the handlers are typed based on the `deliveryMethod` you select.
|
|
770
|
-
|
|
771
|
-
1. `Shopify.Webhooks.Registry.register` is now `shopify.webhooks.register`, and it now only takes in the session fields. It will register any handlers you added, and delete registrations that don't match the new configuration. That means the final webhooks registered for a shop will always match your configuration.
|
|
772
|
-
|
|
773
|
-
<div>Before
|
|
774
|
-
|
|
775
|
-
```ts
|
|
776
|
-
const response = await Shopify.Webhooks.Registry.register({
|
|
777
|
-
path: '/webhooks',
|
|
778
|
-
topic: 'PRODUCTS_CREATE',
|
|
779
|
-
accessToken: session.accessToken,
|
|
780
|
-
shop: session.shop,
|
|
781
|
-
});
|
|
782
|
-
```
|
|
783
|
-
|
|
784
|
-
</div><div>After
|
|
785
|
-
|
|
786
|
-
```ts
|
|
787
|
-
const response = await shopify.webhooks.register({
|
|
788
|
-
accessToken: session.accessToken,
|
|
789
|
-
shop: session.shop,
|
|
790
|
-
});
|
|
791
|
-
|
|
792
|
-
// Response will be a list indexed by topic:
|
|
793
|
-
console.log(response[topic][0].success, response[topic][0].result);
|
|
794
|
-
```
|
|
795
|
-
|
|
796
|
-
</div>
|
|
797
|
-
|
|
798
|
-
1. `Shopify.Webhooks.Registry.process` is now `shopify.webhooks.process`, and it takes the body as an argument instead of parsing it from the request. This will make it easier for apps to use a body parser with this function.
|
|
799
|
-
<div>Before
|
|
800
|
-
|
|
801
|
-
```ts
|
|
802
|
-
app.post('/webhooks', async (req, res) => {
|
|
803
|
-
try {
|
|
804
|
-
await Shopify.Webhooks.Registry.process(req, res);
|
|
805
|
-
} catch (error) {
|
|
806
|
-
console.log(error.message);
|
|
807
|
-
}
|
|
808
|
-
});
|
|
809
|
-
```
|
|
810
|
-
|
|
811
|
-
</div><div>:warning: After
|
|
812
|
-
|
|
813
|
-
```ts
|
|
814
|
-
app.post('/webhooks', async (req, res) => {
|
|
815
|
-
try {
|
|
816
|
-
// Note: this example assumes that the raw content of the body of the request
|
|
817
|
-
// has been read and is available at req.rawBody; this will likely differ
|
|
818
|
-
// depending on which body parser is used.
|
|
819
|
-
await shopify.webhooks.process({
|
|
820
|
-
rawBody: (req as any).rawBody, // as a string
|
|
821
|
-
rawRequest: req,
|
|
822
|
-
rawResponse: res,
|
|
823
|
-
});
|
|
824
|
-
} catch (error) {
|
|
825
|
-
console.log(error.message);
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
```
|
|
829
|
-
|
|
830
|
-
</div>
|
|
831
|
-
|
|
832
|
-
1. `Shopify.Webhooks.Registry.getHandler` is now `shopify.webhooks.getHandlers`, and returns all handler configurations for that topic.
|
|
833
|
-
<div>Before
|
|
834
|
-
|
|
835
|
-
```ts
|
|
836
|
-
Shopify.Webhooks.Registry.addHandler({
|
|
837
|
-
topic: 'PRODUCTS',
|
|
838
|
-
path: '/webhooks',
|
|
839
|
-
webhookHandler: productsWebhookHandler,
|
|
840
|
-
});
|
|
841
|
-
|
|
842
|
-
const productsHandler = Shopify.Webhooks.Registry.getHandler('PRODUCTS');
|
|
843
|
-
// productsHandler = {path: '/webhooks', webhookHandler: productsWebhookHandler}
|
|
844
|
-
```
|
|
845
|
-
|
|
846
|
-
</div><div>:warning: After
|
|
847
|
-
|
|
848
|
-
```ts
|
|
849
|
-
shopify.webhooks.addHandlers({
|
|
850
|
-
PRODUCTS: {
|
|
851
|
-
deliveryMethod: DeliveryMethod.Http,
|
|
852
|
-
callbackUrl: '/webhooks',
|
|
853
|
-
callback: productsWebhookHandler,
|
|
854
|
-
},
|
|
855
|
-
});
|
|
856
|
-
|
|
857
|
-
// Is an array of handler configurations
|
|
858
|
-
const handlers = shopify.webhooks.getHandlers('PRODUCTS');
|
|
859
|
-
```
|
|
860
|
-
|
|
861
|
-
</div>
|
|
862
|
-
|
|
863
|
-
1. `Shopify.Webhooks.Registry.getTopics` is now `shopify.webhooks.getTopicsAdded`, to indicate that it returns the topics added using either `addHttpHandler` or `addHttpHandlers`.
|
|
864
|
-
<div>Before
|
|
865
|
-
|
|
866
|
-
```ts
|
|
867
|
-
Shopify.Webhooks.Registry.addHandlers({
|
|
868
|
-
PRODUCTS_CREATE: {
|
|
869
|
-
path: '/webhooks',
|
|
870
|
-
webhookHandler: productCreateWebhookHandler,
|
|
871
|
-
},
|
|
872
|
-
PRODUCTS_DELETE: {
|
|
873
|
-
path: '/webhooks',
|
|
874
|
-
webhookHandler: productDeleteWebhookHandler,
|
|
875
|
-
},
|
|
876
|
-
});
|
|
877
|
-
|
|
878
|
-
const topics = Shopify.Webhooks.Registry.getTopics();
|
|
879
|
-
// topics = ['PRODUCTS_CREATE', 'PRODUCTS_DELETE']
|
|
880
|
-
```
|
|
881
|
-
|
|
882
|
-
</div><div>:warning: After
|
|
883
|
-
|
|
884
|
-
```ts
|
|
885
|
-
shopify.webhooks.addHandlers({
|
|
886
|
-
PRODUCTS_CREATE: {
|
|
887
|
-
deliveryMethod: DeliveryMethod.Http,
|
|
888
|
-
callbackUrl: '/webhooks',
|
|
889
|
-
callback: productCreateWebhookHandler,
|
|
890
|
-
},
|
|
891
|
-
PRODUCTS_DELETE: {
|
|
892
|
-
deliveryMethod: DeliveryMethod.Http,
|
|
893
|
-
callbackUrl: '/webhooks',
|
|
894
|
-
callback: productDeleteWebhookHandler,
|
|
895
|
-
},
|
|
896
|
-
});
|
|
897
|
-
|
|
898
|
-
const topics = shopify.webhooks.getTopicsAdded();
|
|
899
|
-
// topics = ['PRODUCTS_CREATE', 'PRODUCTS_DELETE']
|
|
900
|
-
```
|
|
901
|
-
|
|
902
|
-
</div>
|
|
903
|
-
|
|
904
|
-
---
|
|
905
|
-
|
|
906
|
-
## Changes to use of REST resources
|
|
907
|
-
|
|
908
|
-
REST resources were added to version 3 of the API library and were accessed by importing directly from the `dist` folder of the `@shopify/shopify-api`.
|
|
909
|
-
|
|
910
|
-
Starting with v6, they can now be accessed via the shopify API directly.
|
|
911
|
-
|
|
912
|
-
<div>Before
|
|
913
|
-
|
|
914
|
-
```ts
|
|
915
|
-
app.get('/api/products/count', async (req, res) => {
|
|
916
|
-
const session = await Shopify.Utils.loadCurrentSession(req, res, false);
|
|
917
|
-
const {Product} = await import(
|
|
918
|
-
`@shopify/shopify-api/dist/rest-resources/${Shopify.Context.API_VERSION}/index.js`
|
|
919
|
-
);
|
|
920
|
-
|
|
921
|
-
const countData = await Product.count({session});
|
|
922
|
-
res.status(200).send(countData);
|
|
923
|
-
});
|
|
924
|
-
```
|
|
925
|
-
|
|
926
|
-
</div><div>:warning: After
|
|
927
|
-
|
|
928
|
-
```ts
|
|
929
|
-
import {shopifyApi, ApiVersion} from '@shopify/shopify-api';
|
|
930
|
-
import {restResources} from '@shopify/shopify-api/rest/admin/2022-10'; // must match apiVersion used for shopifyApi()
|
|
931
|
-
|
|
932
|
-
const shopify = shopifyApi({
|
|
933
|
-
// ...
|
|
934
|
-
apiVersion: ApiVersion.October22,
|
|
935
|
-
restResources,
|
|
936
|
-
});
|
|
937
|
-
|
|
938
|
-
// ...
|
|
939
|
-
|
|
940
|
-
app.get('/api/products/count', async (req, res) => {
|
|
941
|
-
const session = await shopify.session.getCurrent({
|
|
942
|
-
isOnline: false,
|
|
943
|
-
rawRequest: req,
|
|
944
|
-
rawResponse: res,
|
|
945
|
-
});
|
|
946
|
-
|
|
947
|
-
const countData = await shopify.rest.Product.count({session});
|
|
948
|
-
res.status(200).send(countData);
|
|
949
|
-
});
|
|
950
|
-
```
|
|
951
|
-
|
|
952
|
-
See [using REST resources](usage/rest.md#using-rest-resources) for more details.
|