shopify_api 10.0.2 → 11.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +0 -1
- data/.rubocop.yml +1 -1
- data/BREAKING_CHANGES_FOR_OLDER_VERSIONS.md +110 -0
- data/CHANGELOG.md +21 -0
- data/Gemfile.lock +23 -20
- data/README.md +3 -106
- data/RELEASING.md +19 -0
- data/Rakefile +1 -1
- data/docs/usage/graphql.md +1 -1
- data/lib/shopify_api/admin_versions.rb +2 -3
- data/lib/shopify_api/auth/jwt_payload.rb +22 -8
- data/lib/shopify_api/context.rb +6 -2
- data/lib/shopify_api/rest/base.rb +33 -6
- data/lib/shopify_api/rest/resources/2021_10/abandoned_checkout.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/access_scope.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/android_pay_key.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/apple_pay_certificate.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/application_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/application_credit.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/article.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/asset.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/assigned_fulfillment_order.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/balance.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/blog.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/cancellation_request.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/carrier_service.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/checkout.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/collect.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/collection.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/collection_listing.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/comment.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/country.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/currency.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/custom_collection.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/customer.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/customer_address.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/customer_saved_search.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/deprecated_api_call.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/discount_code.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/dispute.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/draft_order.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/event.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/fulfillment.rb +75 -1
- data/lib/shopify_api/rest/resources/2021_10/fulfillment_event.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/fulfillment_order.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/fulfillment_request.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/fulfillment_service.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/gift_card.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/gift_card_adjustment.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/image.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/inventory_item.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/inventory_level.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/location.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/locations_for_move.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/marketing_event.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/metafield.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/mobile_platform_application.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/order.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/order_risk.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/page.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/payment.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/payment_gateway.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/payment_transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/payout.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/policy.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/price_rule.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/product.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/product_listing.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/product_resource_feedback.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/province.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/recurring_application_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/redirect.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/refund.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/report.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/resource_feedback.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/script_tag.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/shipping_zone.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/shop.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/smart_collection.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/storefront_access_token.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/tender_transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/theme.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/usage_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/user.rb +4 -0
- data/lib/shopify_api/rest/resources/2021_10/variant.rb +6 -2
- data/lib/shopify_api/rest/resources/2021_10/webhook.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/abandoned_checkout.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/access_scope.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/android_pay_key.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/apple_pay_certificate.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/application_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/application_credit.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/article.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/asset.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/assigned_fulfillment_order.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/balance.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/blog.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/cancellation_request.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/carrier_service.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/checkout.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/collect.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/collection.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/collection_listing.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/comment.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/country.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/currency.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/custom_collection.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/customer.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/customer_address.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/customer_saved_search.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/deprecated_api_call.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/discount_code.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/dispute.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/draft_order.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/event.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/fulfillment.rb +75 -1
- data/lib/shopify_api/rest/resources/2022_01/fulfillment_event.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/fulfillment_order.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/fulfillment_request.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/fulfillment_service.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/gift_card.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/gift_card_adjustment.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/image.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/inventory_item.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/inventory_level.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/location.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/locations_for_move.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/marketing_event.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/metafield.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/mobile_platform_application.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/order.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/order_risk.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/page.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/payment.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/payment_gateway.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/payment_transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/payout.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/policy.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/price_rule.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/product.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/product_listing.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/product_resource_feedback.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/province.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/recurring_application_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/redirect.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/refund.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/report.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/resource_feedback.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/script_tag.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/shipping_zone.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/shop.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/smart_collection.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/storefront_access_token.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/tender_transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/theme.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/usage_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/user.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_01/variant.rb +6 -2
- data/lib/shopify_api/rest/resources/2022_01/webhook.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/access_scope.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/android_pay_key.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/apple_pay_certificate.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/application_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/application_credit.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/article.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/asset.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/balance.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/blog.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/cancellation_request.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/carrier_service.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/checkout.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/collect.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/collection.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/collection_listing.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/comment.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/country.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/currency.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/custom_collection.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/customer.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/customer_address.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/customer_saved_search.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/deprecated_api_call.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/discount_code.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/dispute.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/draft_order.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/event.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +75 -1
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +7 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_request.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_service.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/gift_card.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/image.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/inventory_item.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/inventory_level.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/location.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/locations_for_move.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/marketing_event.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/metafield.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/mobile_platform_application.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/order.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/order_risk.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/page.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/payment.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/payment_gateway.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/payment_transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/payout.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/policy.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/price_rule.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/product.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/product_listing.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/product_resource_feedback.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/province.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/redirect.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/refund.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/report.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/resource_feedback.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/script_tag.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/shipping_zone.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/shop.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/smart_collection.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/storefront_access_token.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/tender_transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/theme.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/usage_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/user.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_04/variant.rb +6 -2
- data/lib/shopify_api/rest/resources/2022_04/webhook.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/abandoned_checkout.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/access_scope.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/android_pay_key.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/apple_pay_certificate.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/application_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/application_credit.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/article.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/asset.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/assigned_fulfillment_order.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/balance.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/blog.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/cancellation_request.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/carrier_service.rb +4 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/checkout.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collect.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collection.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collection_listing.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/comment.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/country.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/currency.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/custom_collection.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer.rb +16 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer_address.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer_saved_search.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/deprecated_api_call.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/discount_code.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/dispute.rb +4 -0
- data/lib/shopify_api/rest/resources/2022_07/dispute_evidence.rb +117 -0
- data/lib/shopify_api/rest/resources/2022_07/dispute_file_upload.rb +81 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/draft_order.rb +10 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/event.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment.rb +30 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_event.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_order.rb +87 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_request.rb +9 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_service.rb +7 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/gift_card.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/gift_card_adjustment.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/image.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/inventory_item.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/inventory_level.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/location.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/locations_for_move.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/marketing_event.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/metafield.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/mobile_platform_application.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/order.rb +7 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/order_risk.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/page.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment_gateway.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment_transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payout.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/policy.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/price_rule.rb +7 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product_listing.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product_resource_feedback.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/province.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/recurring_application_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/redirect.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/refund.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/report.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/resource_feedback.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/script_tag.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/shipping_zone.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/shop.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/smart_collection.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/storefront_access_token.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/tender_transaction.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/theme.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/transaction.rb +7 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/usage_charge.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/user.rb +4 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/variant.rb +6 -2
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/webhook.rb +4 -0
- data/lib/shopify_api/version.rb +1 -1
- data/lib/shopify_api/webhooks/registry.rb +0 -1
- data/lib/shopify_api/webhooks/request.rb +1 -1
- data/sorbet/rbi/todo.rbi +0 -1
- metadata +81 -78
- data/RELEASING +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6ef6d1ca6d9c8e54ddd8fd1c4ca34fdb015e2fe1157c1a101810c8036a69b02
|
4
|
+
data.tar.gz: 94cf5af5bf1e14d8fa1728bb87d0c138f92bebcdbb16d47885a2e2ce73ffba81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 505926c8d97d9ec73a4dbab76ff42aabf7f0559c503450ada931c51f900a62540ea52cfe4c8e02877a86f515b50b5f7c7f6536fde6d760ff44337d8e68bc6ed5
|
7
|
+
data.tar.gz: 84c6d2c78256cd4b84290ba324d3825ed2365aad7e142bd7f0ca0275f5f9c48d9f2251ff9a022cc2bb663a3a25c5d6c9841af25558a2dd154f62323305e4fd85
|
data/.github/workflows/build.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -0,0 +1,110 @@
|
|
1
|
+
# Breaking changes for older versions
|
2
|
+
|
3
|
+
The breaking changes for the previous major release are listed in the main [README](README.md).
|
4
|
+
The breaking changes for older major releases are listed below.
|
5
|
+
|
6
|
+
### Breaking change notice for version 8.0.0
|
7
|
+
|
8
|
+
Version 7.0.0 introduced ApiVersion, and known versions were hardcoded into the gem. Manually defining API versions is no longer required for versions not listed in the gem. Version 8.0.0 removes the following:
|
9
|
+
* `ShopifyAPI::ApiVersion::Unstable`
|
10
|
+
* `ShopifyAPI::ApiVersion::Release`
|
11
|
+
* `ShopifyAPI::ApiVersion.define_version`
|
12
|
+
|
13
|
+
The following methods on `ApiVersion` have been deprecated:
|
14
|
+
- `.coerce_to_version` deprecated. use `.find_version`
|
15
|
+
- `.define_known_versions` deprecated. Use `.fetch_known_versions`
|
16
|
+
- `.clear_defined_versions` deprecated. Use. `.clear_known_versions`
|
17
|
+
- `.latest_stable_version` deprecated. Use `ShopifyAPI::Meta.admin_versions.find(&:latest_supported)` (this fetches info from Shopify servers. No authentication required.)
|
18
|
+
- `#name` deprecated. Use `#handle`
|
19
|
+
- `#stable?` deprecated. Use `#supported?`
|
20
|
+
|
21
|
+
Version 8.0.0 introduces a _version lookup mode_. By default, `ShopifyAPI::ApiVersion.version_lookup_mode` is `:define_on_unknown`. When setting the api_version on `Session` or `Base`, the `api_version` attribute takes a version handle (i.e. `'2019-07'` or `:unstable`) and sets an instance of `ShopifyAPI::ApiVersion` matching the handle. When the version_lookup_mode is set to `:define_on_unknown`, any handle will naïvely create a new `ApiVersion` if the version is not in the known versions returned by `ShopifyAPI::ApiVersion.versions`.
|
22
|
+
|
23
|
+
To ensure you're setting only known and active versions, call :
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
ShopifyAPI::ApiVersion.version_lookup_mode = :raise_on_unknown
|
27
|
+
ShopifyAPI::ApiVersion.fetch_known_versions
|
28
|
+
```
|
29
|
+
|
30
|
+
Known and active versions are fetched from https://app.shopify.com/services/apis.json and cached. Trying to use a version outside this cached set will raise an error. To switch back to naïve lookup and create a version if one is not found, call `ShopifyAPI::ApiVersion.version_lookup_mode = :define_on_unknown`.
|
31
|
+
|
32
|
+
### Breaking change notice for version 7.0.0
|
33
|
+
|
34
|
+
#### Changes to ShopifyAPI::Session
|
35
|
+
When creating sessions, `api_version`is now required and uses keyword arguments.
|
36
|
+
|
37
|
+
To upgrade your use of ShopifyAPI you will need to make the following changes.
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
ShopifyAPI::Session.new(domain, token, extras)
|
41
|
+
```
|
42
|
+
is now
|
43
|
+
```ruby
|
44
|
+
ShopifyAPI::Session.new(domain: domain, token: token, api_version: api_version, extras: extras)
|
45
|
+
```
|
46
|
+
Note `extras` is still optional. The other arguments are required.
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
ShopifyAPI::Session.temp(domain, token, extras) do
|
50
|
+
...
|
51
|
+
end
|
52
|
+
```
|
53
|
+
is now
|
54
|
+
```ruby
|
55
|
+
ShopifyAPI::Session.temp(domain: domain, token: token, api_version: api_version) do
|
56
|
+
...
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
60
|
+
For example, if you want to use the `2019-04` version, you will create a session like this:
|
61
|
+
```ruby
|
62
|
+
session = ShopifyAPI::Session.new(domain: domain, token: token, api_version: '2019-04')
|
63
|
+
```
|
64
|
+
if you want to use the `unstable` version, you will create a session like this:
|
65
|
+
```ruby
|
66
|
+
session = ShopifyAPI::Session.new(domain: domain, token: token, api_version: :unstable)
|
67
|
+
```
|
68
|
+
|
69
|
+
#### Changes to how to define resources
|
70
|
+
|
71
|
+
If you have defined or customized Resources, classes that extend `ShopifyAPI::Base`:
|
72
|
+
The use of `self.prefix =` has been deprecated; you should now use `self.resource =` and not include `/admin`.
|
73
|
+
For example, if you specified a prefix like this before:
|
74
|
+
```ruby
|
75
|
+
class MyResource < ShopifyAPI::Base
|
76
|
+
self.prefix = '/admin/shop/'
|
77
|
+
end
|
78
|
+
```
|
79
|
+
You will update this to:
|
80
|
+
```ruby
|
81
|
+
class MyResource < ShopifyAPI::Base
|
82
|
+
self.resource_prefix = 'shop/'
|
83
|
+
end
|
84
|
+
```
|
85
|
+
|
86
|
+
#### URL construction
|
87
|
+
|
88
|
+
If you have specified any full paths for API calls in find
|
89
|
+
```ruby
|
90
|
+
def self.current(options={})
|
91
|
+
find(:one, options.merge(from: "/admin/shop.#{format.extension}"))
|
92
|
+
end
|
93
|
+
```
|
94
|
+
would be changed to
|
95
|
+
|
96
|
+
```ruby
|
97
|
+
def self.current(options = {})
|
98
|
+
find(:one, options.merge(
|
99
|
+
from: api_version.construct_api_path("shop.#{format.extension}")
|
100
|
+
))
|
101
|
+
end
|
102
|
+
```
|
103
|
+
|
104
|
+
#### URLs that have not changed
|
105
|
+
|
106
|
+
- OAuth URLs for `authorize`, getting the `access_token` from a code, `access_scopes`, and using a `refresh_token` have _not_ changed.
|
107
|
+
- get: `/admin/oauth/authorize`
|
108
|
+
- post: `/admin/oauth/access_token`
|
109
|
+
- get: `/admin/oauth/access_scopes`
|
110
|
+
- URLs for the merchant’s web admin have _not_ changed. For example: to send the merchant to the product page the url is still `/admin/product/<id>`
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,28 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
Note: For changes to the API, see https://shopify.dev/changelog?filter=api
|
4
|
+
|
3
5
|
## Unreleased
|
4
6
|
|
7
|
+
## Version 11.0.0
|
8
|
+
|
9
|
+
- [#987](https://github.com/Shopify/shopify_api/pull/987) ⚠️ [Breaking] Add REST resources for July 2022 API version, remove support and REST resources for July 2021 (`2021-07`) API version
|
10
|
+
- [#979](https://github.com/Shopify/shopify_api/pull/979) Update `ShopifyAPI::Context.setup` to take `old_api_secret_key` to support API credentials rotation
|
11
|
+
- [#977](https://github.com/Shopify/shopify_api/pull/977) Fix webhook requests when a header is present having a symbol key (e.g. `:clearance`)
|
12
|
+
|
13
|
+
## Version 10.1.0
|
14
|
+
|
15
|
+
- [#933](https://github.com/Shopify/shopify_api/pull/933) Fix syntax of GraphQL query in `Webhooks.get_webhook_id` method by removing extra curly brace
|
16
|
+
- [#941](https://github.com/Shopify/shopify_api/pull/941) Fix `to_hash` to return readonly attributes, unless being used for serialize the object for saving - fix issue [#930](https://github.com/Shopify/shopify_api/issues/930)
|
17
|
+
- [#959](https://github.com/Shopify/shopify_api/pull/959) Update `LATEST_SUPPORTED_ADMIN_VERSION` to `2022-04` to align it with the current value
|
18
|
+
|
19
|
+
## Version 10.0.3
|
20
|
+
|
21
|
+
### Fixed
|
22
|
+
|
23
|
+
- [#935](https://github.com/Shopify/shopify_api/pull/935) Fix issue [#931](https://github.com/Shopify/shopify_api/pull/931), weight of variant should be float
|
24
|
+
- [#944](https://github.com/Shopify/shopify_api/pull/944) Deprecated the `validate_shop` method from the JWT class since we can trust the token payload, since it comes from Shopify.
|
25
|
+
|
5
26
|
## Version 10.0.2
|
6
27
|
|
7
28
|
- [#929](https://github.com/Shopify/shopify_api/pull/929) Aligning sorbet dependencies
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
shopify_api (
|
4
|
+
shopify_api (11.0.0)
|
5
5
|
concurrent-ruby
|
6
6
|
hash_diff
|
7
7
|
httparty
|
@@ -36,7 +36,7 @@ GEM
|
|
36
36
|
multi_xml (>= 0.5.2)
|
37
37
|
i18n (1.8.11)
|
38
38
|
concurrent-ruby (~> 1.0)
|
39
|
-
jwt (2.
|
39
|
+
jwt (2.4.1)
|
40
40
|
method_source (1.0.0)
|
41
41
|
mime-types (3.4.1)
|
42
42
|
mime-types-data (~> 3.2015)
|
@@ -44,10 +44,10 @@ GEM
|
|
44
44
|
minitest (5.15.0)
|
45
45
|
mocha (1.13.0)
|
46
46
|
multi_xml (0.6.0)
|
47
|
-
oj (3.13.
|
47
|
+
oj (3.13.15)
|
48
48
|
openssl (3.0.0)
|
49
49
|
parallel (1.21.0)
|
50
|
-
parser (3.1.
|
50
|
+
parser (3.1.2.0)
|
51
51
|
ast (~> 2.4.1)
|
52
52
|
pry (0.14.1)
|
53
53
|
coderay (~> 1.1)
|
@@ -55,9 +55,9 @@ GEM
|
|
55
55
|
public_suffix (4.0.6)
|
56
56
|
rainbow (3.1.1)
|
57
57
|
rake (13.0.6)
|
58
|
-
rbi (0.0.
|
58
|
+
rbi (0.0.14)
|
59
59
|
ast
|
60
|
-
parser
|
60
|
+
parser (>= 2.6.4.0)
|
61
61
|
sorbet-runtime (>= 0.5.9204)
|
62
62
|
unparser
|
63
63
|
regexp_parser (2.2.0)
|
@@ -79,29 +79,32 @@ GEM
|
|
79
79
|
rubocop (>= 0.90.0)
|
80
80
|
ruby-progressbar (1.11.0)
|
81
81
|
securerandom (0.2.0)
|
82
|
-
sorbet (0.5.
|
83
|
-
sorbet-static (= 0.5.
|
84
|
-
sorbet-runtime (0.5.
|
85
|
-
sorbet-static (0.5.
|
86
|
-
sorbet-static (0.5.
|
87
|
-
|
82
|
+
sorbet (0.5.10109)
|
83
|
+
sorbet-static (= 0.5.10109)
|
84
|
+
sorbet-runtime (0.5.10109)
|
85
|
+
sorbet-static (0.5.10109-universal-darwin-21)
|
86
|
+
sorbet-static (0.5.10109-x86_64-linux)
|
87
|
+
sorbet-static-and-runtime (0.5.10109)
|
88
|
+
sorbet (= 0.5.10109)
|
89
|
+
sorbet-runtime (= 0.5.10109)
|
90
|
+
spoom (1.1.11)
|
88
91
|
sorbet (>= 0.5.9204)
|
89
92
|
sorbet-runtime (>= 0.5.9204)
|
90
93
|
thor (>= 0.19.2)
|
91
|
-
tapioca (0.
|
94
|
+
tapioca (0.8.3)
|
92
95
|
bundler (>= 1.17.3)
|
96
|
+
parallel (>= 1.21.0)
|
93
97
|
pry (>= 0.12.2)
|
94
|
-
rbi (~> 0.0.0, >= 0.0.
|
95
|
-
sorbet-runtime (>= 0.5.9204)
|
96
|
-
|
97
|
-
spoom (~> 1.1.0, >= 1.1.4)
|
98
|
+
rbi (~> 0.0.0, >= 0.0.14)
|
99
|
+
sorbet-static-and-runtime (>= 0.5.9204)
|
100
|
+
spoom (~> 1.1.0, >= 1.1.11)
|
98
101
|
thor (>= 1.2.0)
|
99
102
|
yard-sorbet
|
100
103
|
thor (1.2.1)
|
101
104
|
tzinfo (2.0.4)
|
102
105
|
concurrent-ruby (~> 1.0)
|
103
106
|
unicode-display_width (2.1.0)
|
104
|
-
unparser (0.6.
|
107
|
+
unparser (0.6.5)
|
105
108
|
diff-lcs (~> 1.3)
|
106
109
|
parser (>= 3.1.0)
|
107
110
|
webmock (3.14.0)
|
@@ -109,12 +112,12 @@ GEM
|
|
109
112
|
crack (>= 0.3.2)
|
110
113
|
hashdiff (>= 0.4.0, < 2.0.0)
|
111
114
|
webrick (1.7.0)
|
112
|
-
yard (0.9.
|
115
|
+
yard (0.9.28)
|
113
116
|
webrick (~> 1.7.0)
|
114
117
|
yard-sorbet (0.6.1)
|
115
118
|
sorbet-runtime (>= 0.5)
|
116
119
|
yard (>= 0.9)
|
117
|
-
zeitwerk (2.
|
120
|
+
zeitwerk (2.6.0)
|
118
121
|
|
119
122
|
PLATFORMS
|
120
123
|
arm64-darwin-21
|
data/README.md
CHANGED
@@ -57,7 +57,7 @@ ShopifyAPI::Context.setup(
|
|
57
57
|
session_storage: ShopifyAPI::Auth::FileSessionStorage.new, # See more details below
|
58
58
|
is_embedded: true, # Set to true if you are building an embedded app
|
59
59
|
is_private: false, # Set to true if you are building a private app
|
60
|
-
api_version: "2022-01" # The
|
60
|
+
api_version: "2022-01" # The version of the API you would like to use
|
61
61
|
)
|
62
62
|
```
|
63
63
|
|
@@ -115,112 +115,9 @@ With this, a lot changed in how apps access the library. Here are the updates yo
|
|
115
115
|
| `order = Order.new(<id>)`<br/>`order.post(:close)` | `order = Order.new(session:)`<br/>`order.close()` |
|
116
116
|
| `order = Order.new(<id>)`<br/>`order.delete` | `Order.delete(id: <id>, session:)` |
|
117
117
|
|
118
|
-
|
119
|
-
|
120
|
-
Version 7.0.0 introduced ApiVersion, and known versions were hardcoded into the gem. Manually defining API versions is no longer required for versions not listed in the gem. Version 8.0.0 removes the following:
|
121
|
-
* `ShopifyAPI::ApiVersion::Unstable`
|
122
|
-
* `ShopifyAPI::ApiVersion::Release`
|
123
|
-
* `ShopifyAPI::ApiVersion.define_version`
|
124
|
-
|
125
|
-
The following methods on `ApiVersion` have been deprecated:
|
126
|
-
- `.coerce_to_version` deprecated. use `.find_version`
|
127
|
-
- `.define_known_versions` deprecated. Use `.fetch_known_versions`
|
128
|
-
- `.clear_defined_versions` deprecated. Use. `.clear_known_versions`
|
129
|
-
- `.latest_stable_version` deprecated. Use `ShopifyAPI::Meta.admin_versions.find(&:latest_supported)` (this fetches info from Shopify servers. No authentication required.)
|
130
|
-
- `#name` deprecated. Use `#handle`
|
131
|
-
- `#stable?` deprecated. Use `#supported?`
|
132
|
-
|
133
|
-
Version 8.0.0 introduces a _version lookup mode_. By default, `ShopifyAPI::ApiVersion.version_lookup_mode` is `:define_on_unknown`. When setting the api_version on `Session` or `Base`, the `api_version` attribute takes a version handle (i.e. `'2019-07'` or `:unstable`) and sets an instance of `ShopifyAPI::ApiVersion` matching the handle. When the version_lookup_mode is set to `:define_on_unknown`, any handle will naïvely create a new `ApiVersion` if the version is not in the known versions returned by `ShopifyAPI::ApiVersion.versions`.
|
134
|
-
|
135
|
-
To ensure you're setting only known and active versions, call :
|
136
|
-
|
137
|
-
```ruby
|
138
|
-
ShopifyAPI::ApiVersion.version_lookup_mode = :raise_on_unknown
|
139
|
-
ShopifyAPI::ApiVersion.fetch_known_versions
|
140
|
-
```
|
141
|
-
|
142
|
-
Known and active versions are fetched from https://app.shopify.com/services/apis.json and cached. Trying to use a version outside this cached set will raise an error. To switch back to naïve lookup and create a version if one is not found, call `ShopifyAPI::ApiVersion.version_lookup_mode = :define_on_unknown`.
|
143
|
-
|
144
|
-
### Breaking change notice for version 7.0.0
|
145
|
-
|
146
|
-
#### Changes to ShopifyAPI::Session
|
147
|
-
When creating sessions, `api_version`is now required and uses keyword arguments.
|
148
|
-
|
149
|
-
To upgrade your use of ShopifyAPI you will need to make the following changes.
|
150
|
-
|
151
|
-
```ruby
|
152
|
-
ShopifyAPI::Session.new(domain, token, extras)
|
153
|
-
```
|
154
|
-
is now
|
155
|
-
```ruby
|
156
|
-
ShopifyAPI::Session.new(domain: domain, token: token, api_version: api_version, extras: extras)
|
157
|
-
```
|
158
|
-
Note `extras` is still optional. The other arguments are required.
|
159
|
-
|
160
|
-
```ruby
|
161
|
-
ShopifyAPI::Session.temp(domain, token, extras) do
|
162
|
-
...
|
163
|
-
end
|
164
|
-
```
|
165
|
-
is now
|
166
|
-
```ruby
|
167
|
-
ShopifyAPI::Session.temp(domain: domain, token: token, api_version: api_version) do
|
168
|
-
...
|
169
|
-
end
|
170
|
-
```
|
171
|
-
|
172
|
-
For example, if you want to use the `2019-04` version, you will create a session like this:
|
173
|
-
```ruby
|
174
|
-
session = ShopifyAPI::Session.new(domain: domain, token: token, api_version: '2019-04')
|
175
|
-
```
|
176
|
-
if you want to use the `unstable` version, you will create a session like this:
|
177
|
-
```ruby
|
178
|
-
session = ShopifyAPI::Session.new(domain: domain, token: token, api_version: :unstable)
|
179
|
-
```
|
180
|
-
|
181
|
-
#### Changes to how to define resources
|
182
|
-
|
183
|
-
If you have defined or customized Resources, classes that extend `ShopifyAPI::Base`:
|
184
|
-
The use of `self.prefix =` has been deprecated; you should now use `self.resource =` and not include `/admin`.
|
185
|
-
For example, if you specified a prefix like this before:
|
186
|
-
```ruby
|
187
|
-
class MyResource < ShopifyAPI::Base
|
188
|
-
self.prefix = '/admin/shop/'
|
189
|
-
end
|
190
|
-
```
|
191
|
-
You will update this to:
|
192
|
-
```ruby
|
193
|
-
class MyResource < ShopifyAPI::Base
|
194
|
-
self.resource_prefix = 'shop/'
|
195
|
-
end
|
196
|
-
```
|
197
|
-
|
198
|
-
#### URL construction
|
199
|
-
|
200
|
-
If you have specified any full paths for API calls in find
|
201
|
-
```ruby
|
202
|
-
def self.current(options={})
|
203
|
-
find(:one, options.merge(from: "/admin/shop.#{format.extension}"))
|
204
|
-
end
|
205
|
-
```
|
206
|
-
would be changed to
|
207
|
-
|
208
|
-
```ruby
|
209
|
-
def self.current(options = {})
|
210
|
-
find(:one, options.merge(
|
211
|
-
from: api_version.construct_api_path("shop.#{format.extension}")
|
212
|
-
))
|
213
|
-
end
|
214
|
-
```
|
215
|
-
|
216
|
-
#### URLs that have not changed
|
217
|
-
|
218
|
-
- OAuth URLs for `authorize`, getting the `access_token` from a code, `access_scopes`, and using a `refresh_token` have _not_ changed.
|
219
|
-
- get: `/admin/oauth/authorize`
|
220
|
-
- post: `/admin/oauth/access_token`
|
221
|
-
- get: `/admin/oauth/access_scopes`
|
222
|
-
- URLs for the merchant’s web admin have _not_ changed. For example: to send the merchant to the product page the url is still `/admin/product/<id>`
|
118
|
+
## Breaking changes for older versions
|
223
119
|
|
120
|
+
See [BREAKING_CHANGES_FOR_OLDER_VERSIONS](BREAKING_CHANGES_FOR_OLDER_VERSIONS.md)
|
224
121
|
|
225
122
|
## Developing this gem
|
226
123
|
|
data/RELEASING.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Releasing ShopifyAPI
|
2
|
+
|
3
|
+
1. Before releasing, make sure `sorbet` and related gems are up to date:
|
4
|
+
`bundle update sorbet sorbet-runtime sorbet-static tapioca --conservative`
|
5
|
+
1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
|
6
|
+
1. Update the version of ShopifyAPI in lib/shopify_api/version.rb
|
7
|
+
1. Run `bundle`
|
8
|
+
1. Add a CHANGELOG entry for the new release
|
9
|
+
1. Commit the changes with a commit message like "Packaging for release X.Y.Z"
|
10
|
+
1. Tag the release with the version (Leave REV blank for HEAD or provide a SHA)
|
11
|
+
$ git tag vX.Y.Z REV
|
12
|
+
1. Push out the changes
|
13
|
+
$ git push
|
14
|
+
1. Push out the tags
|
15
|
+
$ git push --tags
|
16
|
+
1. Publish the gem using Shipit
|
17
|
+
1. Consider if the dependency in Shopify/shopify needs updated. It's used only by the tests so is a low risk change.
|
18
|
+
Also consider Shopify/shopify_app whose gemspec depends on this.
|
19
|
+
We don't need to do this for every release, but we should try to keep them relatively up to date.
|
data/Rakefile
CHANGED
data/docs/usage/graphql.md
CHANGED
@@ -5,14 +5,13 @@ module ShopifyAPI
|
|
5
5
|
module AdminVersions
|
6
6
|
SUPPORTED_ADMIN_VERSIONS = T.let([
|
7
7
|
"unstable",
|
8
|
+
"2022-07",
|
8
9
|
"2022-04",
|
9
10
|
"2022-01",
|
10
11
|
"2021-10",
|
11
|
-
"2021-07",
|
12
|
-
"2021-04",
|
13
12
|
], T::Array[String])
|
14
13
|
|
15
|
-
LATEST_SUPPORTED_ADMIN_VERSION = T.let("2022-
|
14
|
+
LATEST_SUPPORTED_ADMIN_VERSION = T.let("2022-07", String)
|
16
15
|
end
|
17
16
|
|
18
17
|
SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS
|
@@ -16,11 +16,12 @@ module ShopifyAPI
|
|
16
16
|
|
17
17
|
sig { params(token: String).void }
|
18
18
|
def initialize(token)
|
19
|
-
begin
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
payload_hash = begin
|
20
|
+
decode_token(token, Context.api_secret_key)
|
21
|
+
rescue ShopifyAPI::Errors::InvalidJwtTokenError
|
22
|
+
raise unless Context.old_api_secret_key
|
23
|
+
|
24
|
+
decode_token(token, T.must(Context.old_api_secret_key))
|
24
25
|
end
|
25
26
|
|
26
27
|
@iss = T.let(payload_hash["iss"], String)
|
@@ -35,8 +36,6 @@ module ShopifyAPI
|
|
35
36
|
|
36
37
|
raise ShopifyAPI::Errors::InvalidJwtTokenError,
|
37
38
|
"Session token had invalid API key" unless @aud == Context.api_key
|
38
|
-
raise ShopifyAPI::Errors::InvalidJwtTokenError,
|
39
|
-
"Session token had invalid shop" unless validate_shop(shop)
|
40
39
|
end
|
41
40
|
|
42
41
|
sig { returns(String) }
|
@@ -44,9 +43,14 @@ module ShopifyAPI
|
|
44
43
|
@dest.gsub("https://", "")
|
45
44
|
end
|
46
45
|
|
46
|
+
# TODO: Remove before releasing v11
|
47
47
|
sig { params(shop: String).returns(T::Boolean) }
|
48
48
|
def validate_shop(shop)
|
49
|
-
|
49
|
+
Context.logger.warn(
|
50
|
+
"Deprecation notice: ShopifyAPI::Auth::JwtPayload.validate_shop no longer checks the given shop and always " \
|
51
|
+
"returns true. It will be removed in v11."
|
52
|
+
)
|
53
|
+
true
|
50
54
|
end
|
51
55
|
|
52
56
|
alias_method :eql?, :==
|
@@ -64,6 +68,16 @@ module ShopifyAPI
|
|
64
68
|
jti == other.jti &&
|
65
69
|
sid == other.sid
|
66
70
|
end
|
71
|
+
|
72
|
+
private
|
73
|
+
|
74
|
+
sig { params(token: String, api_secret_key: String).returns(T::Hash[String, T.untyped]) }
|
75
|
+
def decode_token(token, api_secret_key)
|
76
|
+
JWT.decode(token, api_secret_key, true,
|
77
|
+
{ exp_leeway: JWT_EXPIRATION_LEEWAY, algorithm: "HS256" })[0]
|
78
|
+
rescue
|
79
|
+
raise ShopifyAPI::Errors::InvalidJwtTokenError, "Failed to parse session token '#{token}'"
|
80
|
+
end
|
67
81
|
end
|
68
82
|
end
|
69
83
|
end
|
data/lib/shopify_api/context.rb
CHANGED
@@ -18,6 +18,7 @@ module ShopifyAPI
|
|
18
18
|
@notified_missing_resources_folder = T.let({}, T::Hash[String, T::Boolean])
|
19
19
|
@active_session = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
20
20
|
@user_agent_prefix = T.let(nil, T.nilable(String))
|
21
|
+
@old_api_secret_key = T.let(nil, T.nilable(String))
|
21
22
|
|
22
23
|
@rest_resource_loader = T.let(nil, T.nilable(Zeitwerk::Loader))
|
23
24
|
|
@@ -37,6 +38,7 @@ module ShopifyAPI
|
|
37
38
|
logger: Logger,
|
38
39
|
private_shop: T.nilable(String),
|
39
40
|
user_agent_prefix: T.nilable(String),
|
41
|
+
old_api_secret_key: T.nilable(String),
|
40
42
|
).void
|
41
43
|
end
|
42
44
|
def setup(
|
@@ -50,7 +52,8 @@ module ShopifyAPI
|
|
50
52
|
session_storage:,
|
51
53
|
logger: Logger.new($stdout),
|
52
54
|
private_shop: nil,
|
53
|
-
user_agent_prefix: nil
|
55
|
+
user_agent_prefix: nil,
|
56
|
+
old_api_secret_key: nil
|
54
57
|
)
|
55
58
|
unless ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS.include?(api_version)
|
56
59
|
raise Errors::UnsupportedVersionError,
|
@@ -68,6 +71,7 @@ module ShopifyAPI
|
|
68
71
|
@logger = logger
|
69
72
|
@private_shop = private_shop
|
70
73
|
@user_agent_prefix = user_agent_prefix
|
74
|
+
@old_api_secret_key = old_api_secret_key
|
71
75
|
|
72
76
|
load_rest_resources(api_version: api_version)
|
73
77
|
end
|
@@ -118,7 +122,7 @@ module ShopifyAPI
|
|
118
122
|
end
|
119
123
|
|
120
124
|
sig { returns(T.nilable(String)) }
|
121
|
-
attr_reader :private_shop, :user_agent_prefix
|
125
|
+
attr_reader :private_shop, :user_agent_prefix, :old_api_secret_key
|
122
126
|
|
123
127
|
sig { returns(T::Boolean) }
|
124
128
|
def embedded?
|
@@ -55,6 +55,12 @@ module ShopifyAPI
|
|
55
55
|
sig { returns(T.nilable(String)) }
|
56
56
|
attr_reader :custom_prefix
|
57
57
|
|
58
|
+
sig { returns(T::Hash[Symbol, Class]) }
|
59
|
+
attr_reader :has_many
|
60
|
+
|
61
|
+
sig { returns(T::Hash[Symbol, Class]) }
|
62
|
+
attr_reader :has_one
|
63
|
+
|
58
64
|
sig do
|
59
65
|
params(
|
60
66
|
session: T.nilable(Auth::Session),
|
@@ -261,8 +267,8 @@ module ShopifyAPI
|
|
261
267
|
match.nil? ? true : super
|
262
268
|
end
|
263
269
|
|
264
|
-
sig { returns(T::Hash[String, T.untyped]) }
|
265
|
-
def to_hash
|
270
|
+
sig { params(saving: T::Boolean).returns(T::Hash[String, T.untyped]) }
|
271
|
+
def to_hash(saving = false)
|
266
272
|
hash = {}
|
267
273
|
instance_variables.each do |var|
|
268
274
|
next if [
|
@@ -273,7 +279,7 @@ module ShopifyAPI
|
|
273
279
|
:"@errors",
|
274
280
|
:"@aliased_properties",
|
275
281
|
].include?(var)
|
276
|
-
next if self.class.read_only_attributes&.include?(var)
|
282
|
+
next if saving && self.class.read_only_attributes&.include?(var)
|
277
283
|
|
278
284
|
var = var.to_s.delete("@")
|
279
285
|
attribute = if @aliased_properties.value?(var)
|
@@ -283,9 +289,16 @@ module ShopifyAPI
|
|
283
289
|
end.to_sym
|
284
290
|
|
285
291
|
if self.class.has_many?(attribute)
|
286
|
-
|
292
|
+
attribute_class = self.class.has_many[attribute]
|
293
|
+
hash[attribute.to_s] = get_property(attribute).map do |element|
|
294
|
+
get_element_hash(element, T.unsafe(attribute_class), saving)
|
295
|
+
end.to_a if get_property(attribute)
|
287
296
|
elsif self.class.has_one?(attribute)
|
288
|
-
element_hash =
|
297
|
+
element_hash = get_element_hash(
|
298
|
+
get_property(attribute),
|
299
|
+
T.unsafe(self.class.has_one[attribute]),
|
300
|
+
saving
|
301
|
+
)
|
289
302
|
hash[attribute.to_s] = element_hash if element_hash || @forced_nils[attribute.to_s]
|
290
303
|
elsif !get_property(attribute).nil? || @forced_nils[attribute.to_s]
|
291
304
|
hash[attribute.to_s] =
|
@@ -313,7 +326,7 @@ module ShopifyAPI
|
|
313
326
|
|
314
327
|
sig { params(update_object: T::Boolean).void }
|
315
328
|
def save(update_object: false)
|
316
|
-
hash = HashDiff::Comparison.new(original_state, to_hash).left_diff
|
329
|
+
hash = HashDiff::Comparison.new(original_state, to_hash(true)).left_diff
|
317
330
|
method = hash[self.class.primary_key] ? :put : :post
|
318
331
|
|
319
332
|
path = self.class.get_path(http_method: method, operation: method, entity: self)
|
@@ -355,6 +368,20 @@ module ShopifyAPI
|
|
355
368
|
|
356
369
|
instance_variable_get("@#{clean_key}")
|
357
370
|
end
|
371
|
+
|
372
|
+
sig do
|
373
|
+
params(
|
374
|
+
element: T.nilable(T.any(T::Hash[String, T.untyped], ShopifyAPI::Rest::Base)),
|
375
|
+
attribute_class: Class,
|
376
|
+
saving: T::Boolean,
|
377
|
+
).returns(T.nilable(T::Hash[String, T.untyped]))
|
378
|
+
end
|
379
|
+
def get_element_hash(element, attribute_class, saving)
|
380
|
+
return nil if element.nil?
|
381
|
+
return element.to_hash(saving) unless element.is_a?(Hash)
|
382
|
+
|
383
|
+
T.unsafe(attribute_class).create_instance(session: @session, data: element).to_hash(saving)
|
384
|
+
end
|
358
385
|
end
|
359
386
|
end
|
360
387
|
end
|
@@ -1,6 +1,10 @@
|
|
1
1
|
# typed: false
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
########################################################################################################################
|
5
|
+
# This file is auto-generated. If you have an issue, please create a GitHub issue. #
|
6
|
+
########################################################################################################################
|
7
|
+
|
4
8
|
module ShopifyAPI
|
5
9
|
class AbandonedCheckout < ShopifyAPI::Rest::Base
|
6
10
|
extend T::Sig
|
@@ -1,6 +1,10 @@
|
|
1
1
|
# typed: false
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
########################################################################################################################
|
5
|
+
# This file is auto-generated. If you have an issue, please create a GitHub issue. #
|
6
|
+
########################################################################################################################
|
7
|
+
|
4
8
|
module ShopifyAPI
|
5
9
|
class AccessScope < ShopifyAPI::Rest::Base
|
6
10
|
extend T::Sig
|
@@ -1,6 +1,10 @@
|
|
1
1
|
# typed: false
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
########################################################################################################################
|
5
|
+
# This file is auto-generated. If you have an issue, please create a GitHub issue. #
|
6
|
+
########################################################################################################################
|
7
|
+
|
4
8
|
module ShopifyAPI
|
5
9
|
class AndroidPayKey < ShopifyAPI::Rest::Base
|
6
10
|
extend T::Sig
|