shopify_api 1.0.4 → 12.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.github/CODEOWNERS +1 -0
- data/.github/ISSUE_TEMPLATE.md +35 -0
- data/.github/dependabot.yml +20 -0
- data/.github/pull_request_template.md +20 -0
- data/.github/workflows/build.yml +42 -0
- data/.github/workflows/cla.yml +22 -0
- data/.github/workflows/close-waiting-for-response-issues.yml +20 -0
- data/.github/workflows/remove-labels-on-activity.yml +16 -0
- data/.github/workflows/stale.yml +32 -0
- data/.rubocop.yml +59 -0
- data/BREAKING_CHANGES_FOR_OLDER_VERSIONS.md +110 -0
- data/CHANGELOG.md +574 -0
- data/CONTRIBUTING.md +9 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +159 -0
- data/LICENSE +2 -2
- data/README.md +138 -0
- data/RELEASING.md +19 -0
- data/Rakefile +16 -50
- data/SECURITY.md +59 -0
- data/bin/tapioca +29 -0
- data/dev.yml +32 -0
- data/docs/README.md +13 -0
- data/docs/getting_started.md +53 -0
- data/docs/issues.md +39 -0
- data/docs/usage/graphql.md +115 -0
- data/docs/usage/graphql_storefront.md +42 -0
- data/docs/usage/oauth.md +104 -0
- data/docs/usage/rest.md +137 -0
- data/docs/usage/session_storage.md +46 -0
- data/docs/usage/webhooks.md +98 -0
- data/lib/shopify_api/admin_versions.rb +19 -0
- data/lib/shopify_api/auth/associated_user.rb +36 -0
- data/lib/shopify_api/auth/auth_scopes.rb +75 -0
- data/lib/shopify_api/auth/file_session_storage.rb +72 -0
- data/lib/shopify_api/auth/jwt_payload.rb +83 -0
- data/lib/shopify_api/auth/oauth/auth_query.rb +47 -0
- data/lib/shopify_api/auth/oauth/session_cookie.rb +28 -0
- data/lib/shopify_api/auth/oauth.rb +135 -0
- data/lib/shopify_api/auth/session.rb +119 -0
- data/lib/shopify_api/auth/session_storage.rb +30 -0
- data/lib/shopify_api/auth.rb +26 -0
- data/lib/shopify_api/clients/graphql/admin.rb +15 -0
- data/lib/shopify_api/clients/graphql/client.rb +40 -0
- data/lib/shopify_api/clients/graphql/storefront.rb +35 -0
- data/lib/shopify_api/clients/http_client.rb +100 -0
- data/lib/shopify_api/clients/http_request.rb +35 -0
- data/lib/shopify_api/clients/http_response.rb +66 -0
- data/lib/shopify_api/clients/rest/admin.rb +118 -0
- data/lib/shopify_api/context.rb +196 -0
- data/lib/shopify_api/errors/context_not_setup_error.rb +9 -0
- data/lib/shopify_api/errors/cookie_not_found_error.rb +9 -0
- data/lib/shopify_api/errors/feature_deprecated_error.rb +9 -0
- data/lib/shopify_api/errors/http_response_error.rb +23 -0
- data/lib/shopify_api/errors/invalid_graphql_request_error.rb +9 -0
- data/lib/shopify_api/errors/invalid_http_request_error.rb +9 -0
- data/lib/shopify_api/errors/invalid_jwt_token_error.rb +9 -0
- data/lib/shopify_api/errors/invalid_oauth_error.rb +9 -0
- data/lib/shopify_api/errors/invalid_webhook_error.rb +9 -0
- data/lib/shopify_api/errors/invalid_webhook_registration_error.rb +9 -0
- data/lib/shopify_api/errors/log_level_not_found_error.rb +9 -0
- data/lib/shopify_api/errors/max_http_retries_exceeded_error.rb +9 -0
- data/lib/shopify_api/errors/missing_jwt_token_error.rb +9 -0
- data/lib/shopify_api/errors/missing_required_argument_error.rb +9 -0
- data/lib/shopify_api/errors/no_active_session_error.rb +9 -0
- data/lib/shopify_api/errors/no_session_cookie_error.rb +9 -0
- data/lib/shopify_api/errors/no_webhook_handler.rb +9 -0
- data/lib/shopify_api/errors/private_app_error.rb +9 -0
- data/lib/shopify_api/errors/request_access_token_error.rb +9 -0
- data/lib/shopify_api/errors/session_not_found_error.rb +9 -0
- data/lib/shopify_api/errors/session_storage_error.rb +9 -0
- data/lib/shopify_api/errors/unsupported_oauth_error.rb +9 -0
- data/lib/shopify_api/errors/unsupported_version_error.rb +9 -0
- data/lib/shopify_api/errors/webhook_registration_error.rb +9 -0
- data/lib/shopify_api/inflector.rb +17 -0
- data/lib/shopify_api/logger.rb +82 -0
- data/lib/shopify_api/rest/base.rb +387 -0
- data/lib/shopify_api/rest/base_errors.rb +32 -0
- data/lib/shopify_api/rest/resources/2022_01/abandoned_checkout.rb +190 -0
- data/lib/shopify_api/rest/resources/2022_01/access_scope.rb +58 -0
- data/lib/shopify_api/rest/resources/2022_01/android_pay_key.rb +77 -0
- data/lib/shopify_api/rest/resources/2022_01/apple_pay_certificate.rb +105 -0
- data/lib/shopify_api/rest/resources/2022_01/application_charge.rb +104 -0
- data/lib/shopify_api/rest/resources/2022_01/application_credit.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_01/article.rb +265 -0
- data/lib/shopify_api/rest/resources/2022_01/asset.rb +118 -0
- data/lib/shopify_api/rest/resources/2022_01/assigned_fulfillment_order.rb +79 -0
- data/lib/shopify_api/rest/resources/2022_01/balance.rb +50 -0
- data/lib/shopify_api/rest/resources/2022_01/blog.rb +162 -0
- data/lib/shopify_api/rest/resources/2022_01/cancellation_request.rb +83 -0
- data/lib/shopify_api/rest/resources/2022_01/carrier_service.rb +116 -0
- data/lib/shopify_api/rest/resources/2022_01/checkout.rb +209 -0
- data/lib/shopify_api/rest/resources/2022_01/collect.rb +142 -0
- data/lib/shopify_api/rest/resources/2022_01/collection.rb +110 -0
- data/lib/shopify_api/rest/resources/2022_01/collection_listing.rb +155 -0
- data/lib/shopify_api/rest/resources/2022_01/comment.rb +283 -0
- data/lib/shopify_api/rest/resources/2022_01/country.rb +137 -0
- data/lib/shopify_api/rest/resources/2022_01/currency.rb +57 -0
- data/lib/shopify_api/rest/resources/2022_01/custom_collection.rb +187 -0
- data/lib/shopify_api/rest/resources/2022_01/customer.rb +318 -0
- data/lib/shopify_api/rest/resources/2022_01/customer_address.rb +201 -0
- data/lib/shopify_api/rest/resources/2022_01/customer_saved_search.rb +169 -0
- data/lib/shopify_api/rest/resources/2022_01/deprecated_api_call.rb +57 -0
- data/lib/shopify_api/rest/resources/2022_01/discount_code.rb +219 -0
- data/lib/shopify_api/rest/resources/2022_01/dispute.rb +111 -0
- data/lib/shopify_api/rest/resources/2022_01/draft_order.rb +275 -0
- data/lib/shopify_api/rest/resources/2022_01/event.rb +148 -0
- data/lib/shopify_api/rest/resources/2022_01/fulfillment.rb +268 -0
- data/lib/shopify_api/rest/resources/2022_01/fulfillment_event.rb +166 -0
- data/lib/shopify_api/rest/resources/2022_01/fulfillment_order.rb +281 -0
- data/lib/shopify_api/rest/resources/2022_01/fulfillment_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_01/fulfillment_service.rb +130 -0
- data/lib/shopify_api/rest/resources/2022_01/gift_card.rb +215 -0
- data/lib/shopify_api/rest/resources/2022_01/gift_card_adjustment.rb +118 -0
- data/lib/shopify_api/rest/resources/2022_01/image.rb +157 -0
- data/lib/shopify_api/rest/resources/2022_01/inventory_item.rb +108 -0
- data/lib/shopify_api/rest/resources/2022_01/inventory_level.rb +179 -0
- data/lib/shopify_api/rest/resources/2022_01/location.rb +167 -0
- data/lib/shopify_api/rest/resources/2022_01/locations_for_move.rb +56 -0
- data/lib/shopify_api/rest/resources/2022_01/marketing_event.rb +209 -0
- data/lib/shopify_api/rest/resources/2022_01/metafield.rb +349 -0
- data/lib/shopify_api/rest/resources/2022_01/mobile_platform_application.rb +110 -0
- data/lib/shopify_api/rest/resources/2022_01/order.rb +473 -0
- data/lib/shopify_api/rest/resources/2022_01/order_risk.rb +135 -0
- data/lib/shopify_api/rest/resources/2022_01/page.rb +194 -0
- data/lib/shopify_api/rest/resources/2022_01/payment.rb +140 -0
- data/lib/shopify_api/rest/resources/2022_01/payment_gateway.rb +143 -0
- data/lib/shopify_api/rest/resources/2022_01/payment_transaction.rb +107 -0
- data/lib/shopify_api/rest/resources/2022_01/payout.rb +97 -0
- data/lib/shopify_api/rest/resources/2022_01/policy.rb +69 -0
- data/lib/shopify_api/rest/resources/2022_01/price_rule.rb +223 -0
- data/lib/shopify_api/rest/resources/2022_01/product.rb +223 -0
- data/lib/shopify_api/rest/resources/2022_01/product_listing.rb +196 -0
- data/lib/shopify_api/rest/resources/2022_01/product_resource_feedback.rb +88 -0
- data/lib/shopify_api/rest/resources/2022_01/province.rb +132 -0
- data/lib/shopify_api/rest/resources/2022_01/recurring_application_charge.rb +167 -0
- data/lib/shopify_api/rest/resources/2022_01/redirect.rb +139 -0
- data/lib/shopify_api/rest/resources/2022_01/refund.rb +151 -0
- data/lib/shopify_api/rest/resources/2022_01/report.rb +121 -0
- data/lib/shopify_api/rest/resources/2022_01/resource_feedback.rb +73 -0
- data/lib/shopify_api/rest/resources/2022_01/script_tag.rb +155 -0
- data/lib/shopify_api/rest/resources/2022_01/shipping_zone.rb +83 -0
- data/lib/shopify_api/rest/resources/2022_01/shop.rb +218 -0
- data/lib/shopify_api/rest/resources/2022_01/smart_collection.rb +216 -0
- data/lib/shopify_api/rest/resources/2022_01/storefront_access_token.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_01/tender_transaction.rb +93 -0
- data/lib/shopify_api/rest/resources/2022_01/theme.rb +120 -0
- data/lib/shopify_api/rest/resources/2022_01/transaction.rb +181 -0
- data/lib/shopify_api/rest/resources/2022_01/usage_charge.rb +97 -0
- data/lib/shopify_api/rest/resources/2022_01/user.rb +138 -0
- data/lib/shopify_api/rest/resources/2022_01/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2022_01/webhook.rb +168 -0
- data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +190 -0
- data/lib/shopify_api/rest/resources/2022_04/access_scope.rb +58 -0
- data/lib/shopify_api/rest/resources/2022_04/android_pay_key.rb +77 -0
- data/lib/shopify_api/rest/resources/2022_04/apple_pay_certificate.rb +105 -0
- data/lib/shopify_api/rest/resources/2022_04/application_charge.rb +104 -0
- data/lib/shopify_api/rest/resources/2022_04/application_credit.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_04/article.rb +265 -0
- data/lib/shopify_api/rest/resources/2022_04/asset.rb +118 -0
- data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +79 -0
- data/lib/shopify_api/rest/resources/2022_04/balance.rb +50 -0
- data/lib/shopify_api/rest/resources/2022_04/blog.rb +162 -0
- data/lib/shopify_api/rest/resources/2022_04/cancellation_request.rb +83 -0
- data/lib/shopify_api/rest/resources/2022_04/carrier_service.rb +116 -0
- data/lib/shopify_api/rest/resources/2022_04/checkout.rb +209 -0
- data/lib/shopify_api/rest/resources/2022_04/collect.rb +142 -0
- data/lib/shopify_api/rest/resources/2022_04/collection.rb +110 -0
- data/lib/shopify_api/rest/resources/2022_04/collection_listing.rb +155 -0
- data/lib/shopify_api/rest/resources/2022_04/comment.rb +283 -0
- data/lib/shopify_api/rest/resources/2022_04/country.rb +137 -0
- data/lib/shopify_api/rest/resources/2022_04/currency.rb +57 -0
- data/lib/shopify_api/rest/resources/2022_04/custom_collection.rb +187 -0
- data/lib/shopify_api/rest/resources/2022_04/customer.rb +321 -0
- data/lib/shopify_api/rest/resources/2022_04/customer_address.rb +201 -0
- data/lib/shopify_api/rest/resources/2022_04/customer_saved_search.rb +169 -0
- data/lib/shopify_api/rest/resources/2022_04/deprecated_api_call.rb +57 -0
- data/lib/shopify_api/rest/resources/2022_04/discount_code.rb +219 -0
- data/lib/shopify_api/rest/resources/2022_04/dispute.rb +111 -0
- data/lib/shopify_api/rest/resources/2022_04/draft_order.rb +275 -0
- data/lib/shopify_api/rest/resources/2022_04/event.rb +148 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +268 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb +166 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +284 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_service.rb +130 -0
- data/lib/shopify_api/rest/resources/2022_04/gift_card.rb +215 -0
- data/lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb +118 -0
- data/lib/shopify_api/rest/resources/2022_04/image.rb +157 -0
- data/lib/shopify_api/rest/resources/2022_04/inventory_item.rb +108 -0
- data/lib/shopify_api/rest/resources/2022_04/inventory_level.rb +179 -0
- data/lib/shopify_api/rest/resources/2022_04/location.rb +167 -0
- data/lib/shopify_api/rest/resources/2022_04/locations_for_move.rb +56 -0
- data/lib/shopify_api/rest/resources/2022_04/marketing_event.rb +209 -0
- data/lib/shopify_api/rest/resources/2022_04/metafield.rb +342 -0
- data/lib/shopify_api/rest/resources/2022_04/mobile_platform_application.rb +110 -0
- data/lib/shopify_api/rest/resources/2022_04/order.rb +473 -0
- data/lib/shopify_api/rest/resources/2022_04/order_risk.rb +135 -0
- data/lib/shopify_api/rest/resources/2022_04/page.rb +194 -0
- data/lib/shopify_api/rest/resources/2022_04/payment.rb +140 -0
- data/lib/shopify_api/rest/resources/2022_04/payment_gateway.rb +143 -0
- data/lib/shopify_api/rest/resources/2022_04/payment_transaction.rb +107 -0
- data/lib/shopify_api/rest/resources/2022_04/payout.rb +97 -0
- data/lib/shopify_api/rest/resources/2022_04/policy.rb +69 -0
- data/lib/shopify_api/rest/resources/2022_04/price_rule.rb +223 -0
- data/lib/shopify_api/rest/resources/2022_04/product.rb +223 -0
- data/lib/shopify_api/rest/resources/2022_04/product_listing.rb +196 -0
- data/lib/shopify_api/rest/resources/2022_04/product_resource_feedback.rb +88 -0
- data/lib/shopify_api/rest/resources/2022_04/province.rb +132 -0
- data/lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb +167 -0
- data/lib/shopify_api/rest/resources/2022_04/redirect.rb +139 -0
- data/lib/shopify_api/rest/resources/2022_04/refund.rb +151 -0
- data/lib/shopify_api/rest/resources/2022_04/report.rb +121 -0
- data/lib/shopify_api/rest/resources/2022_04/resource_feedback.rb +73 -0
- data/lib/shopify_api/rest/resources/2022_04/script_tag.rb +155 -0
- data/lib/shopify_api/rest/resources/2022_04/shipping_zone.rb +83 -0
- data/lib/shopify_api/rest/resources/2022_04/shop.rb +218 -0
- data/lib/shopify_api/rest/resources/2022_04/smart_collection.rb +216 -0
- data/lib/shopify_api/rest/resources/2022_04/storefront_access_token.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_04/tender_transaction.rb +93 -0
- data/lib/shopify_api/rest/resources/2022_04/theme.rb +120 -0
- data/lib/shopify_api/rest/resources/2022_04/transaction.rb +181 -0
- data/lib/shopify_api/rest/resources/2022_04/usage_charge.rb +97 -0
- data/lib/shopify_api/rest/resources/2022_04/user.rb +138 -0
- data/lib/shopify_api/rest/resources/2022_04/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2022_04/webhook.rb +168 -0
- data/lib/shopify_api/rest/resources/2022_07/abandoned_checkout.rb +190 -0
- data/lib/shopify_api/rest/resources/2022_07/access_scope.rb +58 -0
- data/lib/shopify_api/rest/resources/2022_07/android_pay_key.rb +77 -0
- data/lib/shopify_api/rest/resources/2022_07/apple_pay_certificate.rb +105 -0
- data/lib/shopify_api/rest/resources/2022_07/application_charge.rb +104 -0
- data/lib/shopify_api/rest/resources/2022_07/application_credit.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_07/article.rb +265 -0
- data/lib/shopify_api/rest/resources/2022_07/asset.rb +118 -0
- data/lib/shopify_api/rest/resources/2022_07/assigned_fulfillment_order.rb +79 -0
- data/lib/shopify_api/rest/resources/2022_07/balance.rb +50 -0
- data/lib/shopify_api/rest/resources/2022_07/blog.rb +162 -0
- data/lib/shopify_api/rest/resources/2022_07/cancellation_request.rb +83 -0
- data/lib/shopify_api/rest/resources/2022_07/carrier_service.rb +113 -0
- data/lib/shopify_api/rest/resources/2022_07/checkout.rb +209 -0
- data/lib/shopify_api/rest/resources/2022_07/collect.rb +142 -0
- data/lib/shopify_api/rest/resources/2022_07/collection.rb +110 -0
- data/lib/shopify_api/rest/resources/2022_07/collection_listing.rb +155 -0
- data/lib/shopify_api/rest/resources/2022_07/comment.rb +283 -0
- data/lib/shopify_api/rest/resources/2022_07/country.rb +137 -0
- data/lib/shopify_api/rest/resources/2022_07/currency.rb +57 -0
- data/lib/shopify_api/rest/resources/2022_07/custom_collection.rb +187 -0
- data/lib/shopify_api/rest/resources/2022_07/customer.rb +321 -0
- data/lib/shopify_api/rest/resources/2022_07/customer_address.rb +201 -0
- data/lib/shopify_api/rest/resources/2022_07/customer_saved_search.rb +169 -0
- data/lib/shopify_api/rest/resources/2022_07/deprecated_api_call.rb +57 -0
- data/lib/shopify_api/rest/resources/2022_07/discount_code.rb +219 -0
- data/lib/shopify_api/rest/resources/2022_07/dispute.rb +111 -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/2022_07/draft_order.rb +275 -0
- data/lib/shopify_api/rest/resources/2022_07/event.rb +148 -0
- data/lib/shopify_api/rest/resources/2022_07/fulfillment.rb +221 -0
- data/lib/shopify_api/rest/resources/2022_07/fulfillment_event.rb +166 -0
- data/lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb +310 -0
- data/lib/shopify_api/rest/resources/2022_07/fulfillment_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_07/fulfillment_service.rb +130 -0
- data/lib/shopify_api/rest/resources/2022_07/gift_card.rb +215 -0
- data/lib/shopify_api/rest/resources/2022_07/gift_card_adjustment.rb +118 -0
- data/lib/shopify_api/rest/resources/2022_07/image.rb +157 -0
- data/lib/shopify_api/rest/resources/2022_07/inventory_item.rb +108 -0
- data/lib/shopify_api/rest/resources/2022_07/inventory_level.rb +179 -0
- data/lib/shopify_api/rest/resources/2022_07/location.rb +167 -0
- data/lib/shopify_api/rest/resources/2022_07/locations_for_move.rb +56 -0
- data/lib/shopify_api/rest/resources/2022_07/marketing_event.rb +209 -0
- data/lib/shopify_api/rest/resources/2022_07/metafield.rb +342 -0
- data/lib/shopify_api/rest/resources/2022_07/mobile_platform_application.rb +110 -0
- data/lib/shopify_api/rest/resources/2022_07/order.rb +473 -0
- data/lib/shopify_api/rest/resources/2022_07/order_risk.rb +135 -0
- data/lib/shopify_api/rest/resources/2022_07/page.rb +194 -0
- data/lib/shopify_api/rest/resources/2022_07/payment.rb +140 -0
- data/lib/shopify_api/rest/resources/2022_07/payment_gateway.rb +143 -0
- data/lib/shopify_api/rest/resources/2022_07/payment_transaction.rb +107 -0
- data/lib/shopify_api/rest/resources/2022_07/payout.rb +97 -0
- data/lib/shopify_api/rest/resources/2022_07/policy.rb +69 -0
- data/lib/shopify_api/rest/resources/2022_07/price_rule.rb +223 -0
- data/lib/shopify_api/rest/resources/2022_07/product.rb +223 -0
- data/lib/shopify_api/rest/resources/2022_07/product_listing.rb +196 -0
- data/lib/shopify_api/rest/resources/2022_07/product_resource_feedback.rb +88 -0
- data/lib/shopify_api/rest/resources/2022_07/province.rb +132 -0
- data/lib/shopify_api/rest/resources/2022_07/recurring_application_charge.rb +167 -0
- data/lib/shopify_api/rest/resources/2022_07/redirect.rb +139 -0
- data/lib/shopify_api/rest/resources/2022_07/refund.rb +151 -0
- data/lib/shopify_api/rest/resources/2022_07/report.rb +121 -0
- data/lib/shopify_api/rest/resources/2022_07/resource_feedback.rb +73 -0
- data/lib/shopify_api/rest/resources/2022_07/script_tag.rb +155 -0
- data/lib/shopify_api/rest/resources/2022_07/shipping_zone.rb +83 -0
- data/lib/shopify_api/rest/resources/2022_07/shop.rb +218 -0
- data/lib/shopify_api/rest/resources/2022_07/smart_collection.rb +216 -0
- data/lib/shopify_api/rest/resources/2022_07/storefront_access_token.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_07/tender_transaction.rb +93 -0
- data/lib/shopify_api/rest/resources/2022_07/theme.rb +120 -0
- data/lib/shopify_api/rest/resources/2022_07/transaction.rb +181 -0
- data/lib/shopify_api/rest/resources/2022_07/usage_charge.rb +97 -0
- data/lib/shopify_api/rest/resources/2022_07/user.rb +138 -0
- data/lib/shopify_api/rest/resources/2022_07/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2022_07/webhook.rb +168 -0
- data/lib/shopify_api/rest/resources/2022_10/abandoned_checkout.rb +190 -0
- data/lib/shopify_api/rest/resources/2022_10/access_scope.rb +58 -0
- data/lib/shopify_api/rest/resources/2022_10/android_pay_key.rb +77 -0
- data/lib/shopify_api/rest/resources/2022_10/apple_pay_certificate.rb +105 -0
- data/lib/shopify_api/rest/resources/2022_10/application_charge.rb +104 -0
- data/lib/shopify_api/rest/resources/2022_10/application_credit.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_10/article.rb +265 -0
- data/lib/shopify_api/rest/resources/2022_10/asset.rb +118 -0
- data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +79 -0
- data/lib/shopify_api/rest/resources/2022_10/balance.rb +50 -0
- data/lib/shopify_api/rest/resources/2022_10/blog.rb +162 -0
- data/lib/shopify_api/rest/resources/2022_10/cancellation_request.rb +83 -0
- data/lib/shopify_api/rest/resources/2022_10/carrier_service.rb +113 -0
- data/lib/shopify_api/rest/resources/2022_10/checkout.rb +209 -0
- data/lib/shopify_api/rest/resources/2022_10/collect.rb +142 -0
- data/lib/shopify_api/rest/resources/2022_10/collection.rb +110 -0
- data/lib/shopify_api/rest/resources/2022_10/collection_listing.rb +155 -0
- data/lib/shopify_api/rest/resources/2022_10/comment.rb +283 -0
- data/lib/shopify_api/rest/resources/2022_10/country.rb +137 -0
- data/lib/shopify_api/rest/resources/2022_10/currency.rb +57 -0
- data/lib/shopify_api/rest/resources/2022_10/custom_collection.rb +187 -0
- data/lib/shopify_api/rest/resources/2022_10/customer.rb +321 -0
- data/lib/shopify_api/rest/resources/2022_10/customer_address.rb +201 -0
- data/lib/shopify_api/rest/resources/2022_10/customer_saved_search.rb +169 -0
- data/lib/shopify_api/rest/resources/2022_10/deprecated_api_call.rb +57 -0
- data/lib/shopify_api/rest/resources/2022_10/discount_code.rb +219 -0
- data/lib/shopify_api/rest/resources/2022_10/dispute.rb +111 -0
- data/lib/shopify_api/rest/resources/2022_10/dispute_evidence.rb +117 -0
- data/lib/shopify_api/rest/resources/2022_10/dispute_file_upload.rb +81 -0
- data/lib/shopify_api/rest/resources/2022_10/draft_order.rb +275 -0
- data/lib/shopify_api/rest/resources/2022_10/event.rb +148 -0
- data/lib/shopify_api/rest/resources/2022_10/fulfillment.rb +221 -0
- data/lib/shopify_api/rest/resources/2022_10/fulfillment_event.rb +166 -0
- data/lib/shopify_api/rest/resources/2022_10/fulfillment_order.rb +310 -0
- data/lib/shopify_api/rest/resources/2022_10/fulfillment_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_10/fulfillment_service.rb +130 -0
- data/lib/shopify_api/rest/resources/2022_10/gift_card.rb +215 -0
- data/lib/shopify_api/rest/resources/2022_10/gift_card_adjustment.rb +118 -0
- data/lib/shopify_api/rest/resources/2022_10/image.rb +157 -0
- data/lib/shopify_api/rest/resources/2022_10/inventory_item.rb +108 -0
- data/lib/shopify_api/rest/resources/2022_10/inventory_level.rb +179 -0
- data/lib/shopify_api/rest/resources/2022_10/location.rb +167 -0
- data/lib/shopify_api/rest/resources/2022_10/locations_for_move.rb +56 -0
- data/lib/shopify_api/rest/resources/2022_10/marketing_event.rb +209 -0
- data/lib/shopify_api/rest/resources/2022_10/metafield.rb +342 -0
- data/lib/shopify_api/rest/resources/2022_10/mobile_platform_application.rb +110 -0
- data/lib/shopify_api/rest/resources/2022_10/order.rb +476 -0
- data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +135 -0
- data/lib/shopify_api/rest/resources/2022_10/page.rb +194 -0
- data/lib/shopify_api/rest/resources/2022_10/payment.rb +140 -0
- data/lib/shopify_api/rest/resources/2022_10/payment_gateway.rb +143 -0
- data/lib/shopify_api/rest/resources/2022_10/payment_transaction.rb +107 -0
- data/lib/shopify_api/rest/resources/2022_10/payout.rb +97 -0
- data/lib/shopify_api/rest/resources/2022_10/policy.rb +69 -0
- data/lib/shopify_api/rest/resources/2022_10/price_rule.rb +223 -0
- data/lib/shopify_api/rest/resources/2022_10/product.rb +223 -0
- data/lib/shopify_api/rest/resources/2022_10/product_listing.rb +196 -0
- data/lib/shopify_api/rest/resources/2022_10/product_resource_feedback.rb +88 -0
- data/lib/shopify_api/rest/resources/2022_10/province.rb +132 -0
- data/lib/shopify_api/rest/resources/2022_10/recurring_application_charge.rb +167 -0
- data/lib/shopify_api/rest/resources/2022_10/redirect.rb +139 -0
- data/lib/shopify_api/rest/resources/2022_10/refund.rb +151 -0
- data/lib/shopify_api/rest/resources/2022_10/report.rb +121 -0
- data/lib/shopify_api/rest/resources/2022_10/resource_feedback.rb +73 -0
- data/lib/shopify_api/rest/resources/2022_10/script_tag.rb +155 -0
- data/lib/shopify_api/rest/resources/2022_10/shipping_zone.rb +83 -0
- data/lib/shopify_api/rest/resources/2022_10/shop.rb +221 -0
- data/lib/shopify_api/rest/resources/2022_10/smart_collection.rb +216 -0
- data/lib/shopify_api/rest/resources/2022_10/storefront_access_token.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_10/tender_transaction.rb +93 -0
- data/lib/shopify_api/rest/resources/2022_10/theme.rb +120 -0
- data/lib/shopify_api/rest/resources/2022_10/transaction.rb +181 -0
- data/lib/shopify_api/rest/resources/2022_10/usage_charge.rb +97 -0
- data/lib/shopify_api/rest/resources/2022_10/user.rb +138 -0
- data/lib/shopify_api/rest/resources/2022_10/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2022_10/webhook.rb +168 -0
- data/lib/shopify_api/utils/graphql_proxy.rb +52 -0
- data/lib/shopify_api/utils/hmac_validator.rb +44 -0
- data/lib/shopify_api/utils/http_utils.rb +17 -0
- data/lib/shopify_api/utils/session_utils.rb +152 -0
- data/lib/shopify_api/utils/verifiable_query.rb +18 -0
- data/lib/shopify_api/version.rb +6 -0
- data/lib/shopify_api/webhooks/handler.rb +15 -0
- data/lib/shopify_api/webhooks/register_result.rb +14 -0
- data/lib/shopify_api/webhooks/registration.rb +73 -0
- data/lib/shopify_api/webhooks/registrations/event_bridge.rb +61 -0
- data/lib/shopify_api/webhooks/registrations/http.rb +72 -0
- data/lib/shopify_api/webhooks/registrations/pub_sub.rb +65 -0
- data/lib/shopify_api/webhooks/registry.rb +215 -0
- data/lib/shopify_api/webhooks/request.rb +56 -0
- data/lib/shopify_api.rb +23 -472
- data/service.yml +1 -0
- data/shipit.rubygems.yml +1 -0
- data/shopify_api.gemspec +43 -102
- data/sorbet/config +3 -0
- data/sorbet/rbi/gems/activesupport@7.0.1.rbi +654 -0
- data/sorbet/rbi/gems/addressable@2.8.0.rbi +290 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +54 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.1.9.rbi +2401 -0
- data/sorbet/rbi/gems/crack@0.4.5.rbi +57 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +185 -0
- data/sorbet/rbi/gems/fakefs@1.4.1.rbi +571 -0
- data/sorbet/rbi/gems/hash_diff@1.0.0.rbi +47 -0
- data/sorbet/rbi/gems/hashdiff@1.0.1.rbi +82 -0
- data/sorbet/rbi/gems/httparty@0.20.0.rbi +573 -0
- data/sorbet/rbi/gems/i18n@1.8.11.rbi +25 -0
- data/sorbet/rbi/gems/jwt@2.3.0.rbi +437 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
- data/sorbet/rbi/gems/mime-types-data@3.2022.0105.rbi +73 -0
- data/sorbet/rbi/gems/mime-types@3.4.1.rbi +295 -0
- data/sorbet/rbi/gems/minitest@5.15.0.rbi +541 -0
- data/sorbet/rbi/gems/mocha@1.13.0.rbi +986 -0
- data/sorbet/rbi/gems/multi_xml@0.6.0.rbi +36 -0
- data/sorbet/rbi/gems/oj@3.13.11.rbi +274 -0
- data/sorbet/rbi/gems/openssl@3.0.0.rbi +581 -0
- data/sorbet/rbi/gems/parallel@1.21.0.rbi +113 -0
- data/sorbet/rbi/gems/parser@3.1.0.0.rbi +1741 -0
- data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
- data/sorbet/rbi/gems/public_suffix@4.0.6.rbi +145 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +157 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +814 -0
- data/sorbet/rbi/gems/rbi@0.0.11.rbi +1646 -0
- data/sorbet/rbi/gems/regexp_parser@2.2.0.rbi +1130 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +709 -0
- data/sorbet/rbi/gems/rubocop-ast@1.15.1.rbi +1921 -0
- data/sorbet/rbi/gems/rubocop-shopify@2.4.0.rbi +8 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.5.rbi +295 -0
- data/sorbet/rbi/gems/rubocop@1.25.1.rbi +13507 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +405 -0
- data/sorbet/rbi/gems/securerandom@0.1.1.rbi +10 -0
- data/sorbet/rbi/gems/spoom@1.1.8.rbi +1252 -0
- data/sorbet/rbi/gems/tapioca@0.6.3.rbi +1238 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +844 -0
- data/sorbet/rbi/gems/tzinfo@2.0.4.rbi +858 -0
- data/sorbet/rbi/gems/unicode-display_width@2.1.0.rbi +26 -0
- data/sorbet/rbi/gems/unparser@0.6.3.rbi +1816 -0
- data/sorbet/rbi/gems/webmock@3.14.0.rbi +683 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +601 -0
- data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +199 -0
- data/sorbet/rbi/gems/yard@0.9.27.rbi +4145 -0
- data/sorbet/rbi/gems/zeitwerk@2.5.4.rbi +200 -0
- data/sorbet/rbi/shims/fakefs.rbi +1 -0
- data/sorbet/rbi/shims/openssl.rb +3 -0
- data/sorbet/rbi/todo.rbi +8 -0
- data/sorbet/tapioca/config.yml +4 -0
- data/sorbet/tapioca/require.rb +20 -0
- metadata +736 -80
- data/.document +0 -5
- data/.gitignore +0 -5
- data/CHANGELOG +0 -5
- data/README.rdoc +0 -55
- data/VERSION +0 -1
- data/test/order_test.rb +0 -48
- data/test/shopify_api_test.rb +0 -21
- data/test/test_helper.rb +0 -28
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
shopify_api (12.3.0)
|
|
5
|
+
activesupport
|
|
6
|
+
concurrent-ruby
|
|
7
|
+
hash_diff
|
|
8
|
+
httparty
|
|
9
|
+
jwt
|
|
10
|
+
oj
|
|
11
|
+
openssl
|
|
12
|
+
securerandom
|
|
13
|
+
sorbet-runtime
|
|
14
|
+
zeitwerk (~> 2.5, < 2.6.5)
|
|
15
|
+
|
|
16
|
+
GEM
|
|
17
|
+
remote: https://rubygems.org/
|
|
18
|
+
specs:
|
|
19
|
+
activesupport (7.0.4)
|
|
20
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
21
|
+
i18n (>= 1.6, < 2)
|
|
22
|
+
minitest (>= 5.1)
|
|
23
|
+
tzinfo (~> 2.0)
|
|
24
|
+
addressable (2.8.0)
|
|
25
|
+
public_suffix (>= 2.0.2, < 5.0)
|
|
26
|
+
ast (2.4.2)
|
|
27
|
+
byebug (11.1.3)
|
|
28
|
+
coderay (1.1.3)
|
|
29
|
+
concurrent-ruby (1.1.10)
|
|
30
|
+
crack (0.4.5)
|
|
31
|
+
rexml
|
|
32
|
+
diff-lcs (1.5.0)
|
|
33
|
+
fakefs (1.4.1)
|
|
34
|
+
hash_diff (1.1.1)
|
|
35
|
+
hashdiff (1.0.1)
|
|
36
|
+
httparty (0.20.0)
|
|
37
|
+
mime-types (~> 3.0)
|
|
38
|
+
multi_xml (>= 0.5.2)
|
|
39
|
+
i18n (1.12.0)
|
|
40
|
+
concurrent-ruby (~> 1.0)
|
|
41
|
+
json (2.6.2)
|
|
42
|
+
jwt (2.5.0)
|
|
43
|
+
language_server-protocol (3.17.0.1)
|
|
44
|
+
method_source (1.0.0)
|
|
45
|
+
mime-types (3.4.1)
|
|
46
|
+
mime-types-data (~> 3.2015)
|
|
47
|
+
mime-types-data (3.2022.0105)
|
|
48
|
+
minitest (5.15.0)
|
|
49
|
+
mocha (1.13.0)
|
|
50
|
+
multi_xml (0.6.0)
|
|
51
|
+
netrc (0.11.0)
|
|
52
|
+
oj (3.13.23)
|
|
53
|
+
openssl (3.0.1)
|
|
54
|
+
parallel (1.22.1)
|
|
55
|
+
parser (3.1.2.1)
|
|
56
|
+
ast (~> 2.4.1)
|
|
57
|
+
prettier_print (0.1.0)
|
|
58
|
+
pry (0.14.1)
|
|
59
|
+
coderay (~> 1.1)
|
|
60
|
+
method_source (~> 1.0)
|
|
61
|
+
pry-byebug (3.10.1)
|
|
62
|
+
byebug (~> 11.0)
|
|
63
|
+
pry (>= 0.13, < 0.15)
|
|
64
|
+
public_suffix (4.0.6)
|
|
65
|
+
rainbow (3.1.1)
|
|
66
|
+
rake (13.0.6)
|
|
67
|
+
rbi (0.0.15)
|
|
68
|
+
ast
|
|
69
|
+
parser (>= 2.6.4.0)
|
|
70
|
+
sorbet-runtime (>= 0.5.9204)
|
|
71
|
+
unparser
|
|
72
|
+
regexp_parser (2.5.0)
|
|
73
|
+
rexml (3.2.5)
|
|
74
|
+
rubocop (1.36.0)
|
|
75
|
+
json (~> 2.3)
|
|
76
|
+
parallel (~> 1.10)
|
|
77
|
+
parser (>= 3.1.2.1)
|
|
78
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
79
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
80
|
+
rexml (>= 3.2.5, < 4.0)
|
|
81
|
+
rubocop-ast (>= 1.20.1, < 2.0)
|
|
82
|
+
ruby-progressbar (~> 1.7)
|
|
83
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
84
|
+
rubocop-ast (1.21.0)
|
|
85
|
+
parser (>= 3.1.1.0)
|
|
86
|
+
rubocop-shopify (2.10.1)
|
|
87
|
+
rubocop (~> 1.35)
|
|
88
|
+
rubocop-sorbet (0.6.11)
|
|
89
|
+
rubocop (>= 0.90.0)
|
|
90
|
+
ruby-lsp (0.3.2)
|
|
91
|
+
language_server-protocol (~> 3.17.0)
|
|
92
|
+
sorbet-runtime
|
|
93
|
+
syntax_tree (>= 3.4)
|
|
94
|
+
ruby-progressbar (1.11.0)
|
|
95
|
+
securerandom (0.2.1)
|
|
96
|
+
sorbet (0.5.10438)
|
|
97
|
+
sorbet-static (= 0.5.10438)
|
|
98
|
+
sorbet-runtime (0.5.10438)
|
|
99
|
+
sorbet-static (0.5.10438-universal-darwin-21)
|
|
100
|
+
sorbet-static (0.5.10438-x86_64-linux)
|
|
101
|
+
sorbet-static-and-runtime (0.5.10438)
|
|
102
|
+
sorbet (= 0.5.10438)
|
|
103
|
+
sorbet-runtime (= 0.5.10438)
|
|
104
|
+
spoom (1.1.11)
|
|
105
|
+
sorbet (>= 0.5.9204)
|
|
106
|
+
sorbet-runtime (>= 0.5.9204)
|
|
107
|
+
thor (>= 0.19.2)
|
|
108
|
+
syntax_tree (3.6.1)
|
|
109
|
+
prettier_print
|
|
110
|
+
tapioca (0.10.2)
|
|
111
|
+
bundler (>= 1.17.3)
|
|
112
|
+
netrc (>= 0.11.0)
|
|
113
|
+
parallel (>= 1.21.0)
|
|
114
|
+
pry (>= 0.12.2)
|
|
115
|
+
rbi (~> 0.0.0, >= 0.0.14)
|
|
116
|
+
sorbet-static-and-runtime (>= 0.5.9204)
|
|
117
|
+
spoom (~> 1.1.0, >= 1.1.11)
|
|
118
|
+
thor (>= 1.2.0)
|
|
119
|
+
yard-sorbet
|
|
120
|
+
thor (1.2.1)
|
|
121
|
+
tzinfo (2.0.5)
|
|
122
|
+
concurrent-ruby (~> 1.0)
|
|
123
|
+
unicode-display_width (2.3.0)
|
|
124
|
+
unparser (0.6.5)
|
|
125
|
+
diff-lcs (~> 1.3)
|
|
126
|
+
parser (>= 3.1.0)
|
|
127
|
+
webmock (3.14.0)
|
|
128
|
+
addressable (>= 2.8.0)
|
|
129
|
+
crack (>= 0.3.2)
|
|
130
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
131
|
+
webrick (1.7.0)
|
|
132
|
+
yard (0.9.28)
|
|
133
|
+
webrick (~> 1.7.0)
|
|
134
|
+
yard-sorbet (0.7.0)
|
|
135
|
+
sorbet-runtime (>= 0.5)
|
|
136
|
+
yard (>= 0.9)
|
|
137
|
+
zeitwerk (2.6.4)
|
|
138
|
+
|
|
139
|
+
PLATFORMS
|
|
140
|
+
arm64-darwin-21
|
|
141
|
+
x86_64-linux
|
|
142
|
+
|
|
143
|
+
DEPENDENCIES
|
|
144
|
+
fakefs
|
|
145
|
+
minitest
|
|
146
|
+
mocha
|
|
147
|
+
pry-byebug
|
|
148
|
+
rake
|
|
149
|
+
rubocop
|
|
150
|
+
rubocop-shopify
|
|
151
|
+
rubocop-sorbet
|
|
152
|
+
ruby-lsp
|
|
153
|
+
shopify_api!
|
|
154
|
+
sorbet
|
|
155
|
+
tapioca
|
|
156
|
+
webmock
|
|
157
|
+
|
|
158
|
+
BUNDLED WITH
|
|
159
|
+
2.3.4
|
data/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c)
|
|
1
|
+
Copyright (c) 2022 Shopify Inc.
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
4
|
a copy of this software and associated documentation files (the
|
|
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
17
17
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Shopify API Library for Ruby
|
|
2
|
+
|
|
3
|
+
<!-- ![Build Status]() -->
|
|
4
|
+
[](LICENSE)
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
This library provides support for Ruby [Shopify apps](https://apps.shopify.com/) to access the [Shopify Admin API](https://shopify.dev/api/admin), by making it easier to perform the following actions:
|
|
8
|
+
|
|
9
|
+
- Creating [online](https://shopify.dev/apps/auth/oauth/access-modes#online-access) or [offline](https://shopify.dev/apps/auth/oauth/access-modes#offline-access) access tokens for the Admin API via OAuth
|
|
10
|
+
- Making requests to the [REST API](https://shopify.dev/api/admin-rest)
|
|
11
|
+
- Making requests to the [GraphQL API](https://shopify.dev/api/admin-graphql)
|
|
12
|
+
- Registering/processing webhooks
|
|
13
|
+
|
|
14
|
+
In addition to the Admin API, this library also allows querying the [Storefront API](https://shopify.dev/docs/storefront-api).
|
|
15
|
+
|
|
16
|
+
You can use this library in any application that has a Ruby backend, since it doesn't rely on any specific framework — you can include it alongside your preferred stack and use the features that you need to build your app.
|
|
17
|
+
|
|
18
|
+
**Note**: These instructions apply to v10 or later of this package. If you're running v9 in your app, you can find the documentation [in this branch](https://github.com/Shopify/shopify-api-ruby/tree/v9).
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
To follow these usage guides, you will need to:
|
|
23
|
+
|
|
24
|
+
- have a working knowledge of ruby and a web framework such as Rails or Sinatra
|
|
25
|
+
- have a Shopify Partner account and development store
|
|
26
|
+
- have an app already set up in your test store or partner account
|
|
27
|
+
- add the URL and the appropriate redirect for your OAuth callback route to your app settings
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
Add the following to your Gemfile:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
gem "shopify_api"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
or use [bundler](https://bundler.io):
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
bundle add shopify_api
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Steps to use the Gem
|
|
44
|
+
|
|
45
|
+
### Setup Shopify Context
|
|
46
|
+
|
|
47
|
+
Start by initializing the `ShopifyAPI::Context` with the parameters of your app by calling `ShopifyAPI::Context.setup` (example below) when your app starts (e.g `application.rb` in a Rails app).
|
|
48
|
+
|
|
49
|
+
```ruby
|
|
50
|
+
ShopifyAPI::Context.setup(
|
|
51
|
+
api_key: "<api-key>",
|
|
52
|
+
api_secret_key: "<api-secret-key>",
|
|
53
|
+
host: "<https://application-host-name.com>",
|
|
54
|
+
scope: "read_orders,read_products,etc",
|
|
55
|
+
session_storage: ShopifyAPI::Auth::FileSessionStorage.new, # See more details below
|
|
56
|
+
is_embedded: true, # Set to true if you are building an embedded app
|
|
57
|
+
api_version: "2022-01" # The version of the API you would like to use
|
|
58
|
+
is_private: false, # Set to true if you have an existing private app
|
|
59
|
+
)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Setup a Session Store
|
|
63
|
+
|
|
64
|
+
In order for the Shopify API gem to properly store sessions it needs an implementation of `ShopifyAPI::Auth::SessionStorage`. We provide one implementation in the gem, `ShopifyAPI::Auth::FileSessionStorage`, which is suitable for testing/development, but isn't intended for production apps. See the [Session Storage doc](docs/usage/session_storage.md) for instructions on how to create a custom session store for a production application.
|
|
65
|
+
|
|
66
|
+
Session information would is typically stored in cookies on the browser. However, due to restrictions with modern browsers we highly discourage using cookies for embedded apps. For this reason, an app needs to define a storage implementation that the library can use to store and retrieve a session given its ID. In a non-embedded app this ID will come from a cookie, whereas in an embedded app this ID will come from [App Bridge](https://shopify.dev/apps/tools/app-bridge).
|
|
67
|
+
|
|
68
|
+
### Performing OAuth
|
|
69
|
+
|
|
70
|
+
You need to go through OAuth as described [here](https://shopify.dev/apps/auth/oauth) to create sessions for shops using your app.
|
|
71
|
+
The Shopify API gem tries to make this easy by providing functions to begin and complete the OAuth process. See the [Oauth doc](docs/usage/oauth.md) for instructions on how to use these.
|
|
72
|
+
|
|
73
|
+
### Register Webhooks and a Webhook Handler
|
|
74
|
+
|
|
75
|
+
If you intend to use webhooks in your application follow the steps in the [Webhooks doc](docs/usage/webhooks.md) for instructions on registering and handling webhooks.
|
|
76
|
+
|
|
77
|
+
### Start Making Authenticated Shopify Requests
|
|
78
|
+
|
|
79
|
+
Once your app can perform OAuth, it can now make authenticated Shopify API calls using the Admin [REST](docs/usage/rest.md) or [GraphQL](docs/usage/graphql.md) Clients, or the [Storefront API GraphQL Client](docs/usage/graphql_storefront.md).
|
|
80
|
+
|
|
81
|
+
## Breaking Change Notices
|
|
82
|
+
|
|
83
|
+
### Breaking change notice for version 10.0.0
|
|
84
|
+
|
|
85
|
+
We've rewritten this library for v10, so that it provides all essential features for a Shopify app without depending on the [Active Resource](https://github.com/rails/activeresource) or [graphql-client](https://github.com/github/graphql-client) libraries.
|
|
86
|
+
|
|
87
|
+
Here are the main features it provides:
|
|
88
|
+
|
|
89
|
+
- OAuth support, both with online and offline tokens.
|
|
90
|
+
- Full, transparent support for JWT sessions for embedded apps and cookies for non-embedded ones.
|
|
91
|
+
- Removal of support for 3rd party cookies which are increasingly more difficult to use with modern browsers.
|
|
92
|
+
- Admin API support
|
|
93
|
+
- Auto-generated, version-specific REST resources which are similar to `ActiveResource` (though not identical), that provide methods for all endpoints defined in our [REST API reference](https://shopify.dev/api/admin-rest), as well as direct definition of known attributes.
|
|
94
|
+
- A GraphQL client that doesn't rely on the ActiveResource implementation for REST.
|
|
95
|
+
- Webhook management, with features for adding handlers and registering them with Shopify.
|
|
96
|
+
- Storefront GraphQL API support
|
|
97
|
+
|
|
98
|
+
Please refer to [the documentation](docs/getting_started.md) in this repository for instructions on how to use each of these components.
|
|
99
|
+
|
|
100
|
+
With this, a lot changed in how apps access the library. Here are the updates you should make when migrating to v10:
|
|
101
|
+
|
|
102
|
+
- Call `ShopifyAPI::Context.setup` when setting up your app. This class holds global configurations for your app and defines how the library behaves.
|
|
103
|
+
- If not using the `shopify_app` gem, your app needs to provide an implementation of `ShopifyAPI::Auth::SessionStorage` for production. Read more about this [in our documentation](docs/usage/session_storage.md).
|
|
104
|
+
- To change the `User-Agent` header, use `user_agent_prefix` in `ShopifyAPI::Context.setup`.
|
|
105
|
+
- Usages of the `ActiveResource` classes for REST API requests need to be refactored into the new format. You can find detailed examples on how each of the endpoints work in our [reference documentation](https://shopify.dev/api/admin-rest).
|
|
106
|
+
|
|
107
|
+
Please see below a (non-exhaustive) list of common replacements to guide you in your updates, using the `Order` resource as an example.
|
|
108
|
+
|
|
109
|
+
| Before | After |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| `Order.find(:all, params: {param1: value1})` | `Order.all(param1: value1)` |
|
|
112
|
+
| `Order.find(<id>)` | `Order.find(id: <id>)` |
|
|
113
|
+
| `order = Order.new(<id>)`<br/>`order.post(:close)` | `order = Order.new`<br/>`order.close` |
|
|
114
|
+
| `order = Order.new(<id>)`<br/>`order.delete` | `Order.delete(id: <id>)` |
|
|
115
|
+
|
|
116
|
+
## Breaking changes for older versions
|
|
117
|
+
|
|
118
|
+
See [BREAKING_CHANGES_FOR_OLDER_VERSIONS](BREAKING_CHANGES_FOR_OLDER_VERSIONS.md)
|
|
119
|
+
|
|
120
|
+
## Developing this gem
|
|
121
|
+
|
|
122
|
+
After cloning the repository, you can install the dependencies with bundler:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
bundle install
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
To run the automated tests:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
bundle exec rake test
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
We use [rubocop](https://rubocop.org) to lint/format the code. You can run it with the following command:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
bundle exec rubocop
|
|
138
|
+
```
|
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
|
@@ -1,57 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# typed: false
|
|
2
|
+
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Jeweler::Tasks.new do |gem|
|
|
7
|
-
gem.name = "shopify_api"
|
|
8
|
-
gem.summary = "ShopifyAPI is a lightweight gem for accessing the Shopify admin REST web services"
|
|
9
|
-
gem.description = File.read(File.dirname(__FILE__) + "/README.rdoc")
|
|
10
|
-
gem.email = "developers@jadedpixel.com"
|
|
11
|
-
gem.homepage = "http://github.com/Shopify/shopify_api"
|
|
12
|
-
gem.authors = ["Tobias Lütke", "Cody Fauser", "Dennis Theisen"]
|
|
13
|
-
gem.rubyforge_project = "shopify-api"
|
|
14
|
-
gem.add_dependency('activeresource', '>= 2.2.2')
|
|
15
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
|
16
|
-
end
|
|
17
|
-
rescue LoadError
|
|
18
|
-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
require 'rake/testtask'
|
|
22
|
-
Rake::TestTask.new(:test) do |test|
|
|
23
|
-
test.libs << 'lib' << 'test'
|
|
24
|
-
test.pattern = 'test/**/*_test.rb'
|
|
25
|
-
test.verbose = true
|
|
26
|
-
end
|
|
4
|
+
require "rake/testtask"
|
|
5
|
+
require "bundler/gem_tasks"
|
|
27
6
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
test.libs << 'test'
|
|
32
|
-
test.pattern = 'test/**/*_test.rb'
|
|
33
|
-
test.verbose = true
|
|
7
|
+
namespace :test do
|
|
8
|
+
Rake::TestTask.new(:library) do |t|
|
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"].exclude("test/rest/**/*.rb")
|
|
34
10
|
end
|
|
35
|
-
rescue LoadError
|
|
36
|
-
task :rcov do
|
|
37
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
11
|
|
|
12
|
+
Rake::TestTask.new(:rest_wrappers) do |t|
|
|
13
|
+
pattern = if ENV.key?("API_VERSION")
|
|
14
|
+
"test/rest/**/#{ENV.fetch("API_VERSION")}/*.rb"
|
|
15
|
+
else
|
|
16
|
+
"test/rest/**/*.rb"
|
|
17
|
+
end
|
|
41
18
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
require 'rake/rdoctask'
|
|
45
|
-
Rake::RDocTask.new do |rdoc|
|
|
46
|
-
if File.exist?('VERSION.yml')
|
|
47
|
-
config = YAML.load(File.read('VERSION.yml'))
|
|
48
|
-
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
|
49
|
-
else
|
|
50
|
-
version = ""
|
|
19
|
+
t.pattern = pattern
|
|
51
20
|
end
|
|
21
|
+
end
|
|
52
22
|
|
|
53
|
-
|
|
54
|
-
rdoc.title = "shopify_api #{version}"
|
|
55
|
-
rdoc.rdoc_files.include('README*')
|
|
56
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
57
|
-
end
|
|
23
|
+
task test: ["test:library"]
|
data/SECURITY.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported versions
|
|
4
|
+
|
|
5
|
+
### New features
|
|
6
|
+
|
|
7
|
+
New features will only be added to the main branch and will not be made available in point releases.
|
|
8
|
+
|
|
9
|
+
### Bug fixes
|
|
10
|
+
|
|
11
|
+
Only the latest release series will receive bug fixes. When enough bugs are fixed and its deemed worthy to release a new gem, this is the branch it happens from.
|
|
12
|
+
|
|
13
|
+
### Security issues
|
|
14
|
+
|
|
15
|
+
Only the latest release series will receive patches and new versions in case of a security issue.
|
|
16
|
+
|
|
17
|
+
### Severe security issues
|
|
18
|
+
|
|
19
|
+
For severe security issues we will provide new versions as above, and also the last major release series will receive patches and new versions. The classification of the security issue is judged by the core team.
|
|
20
|
+
|
|
21
|
+
### Unsupported Release Series
|
|
22
|
+
|
|
23
|
+
When a release series is no longer supported, it's your own responsibility to deal with bugs and security issues. If you are not comfortable maintaining your own versions, you should upgrade to a supported version.
|
|
24
|
+
|
|
25
|
+
## Reporting a bug
|
|
26
|
+
|
|
27
|
+
All security bugs in shopify repositories should be reported to [our hackerone program](https://hackerone.com/shopify)
|
|
28
|
+
Shopify's whitehat program is our way to reward security researchers for finding serious security vulnerabilities in the In Scope properties listed at the bottom of this page, including our core application (all functionality associated with a Shopify store, particularly your-store.myshopify.com/admin) and certain ancillary applications.
|
|
29
|
+
|
|
30
|
+
## Disclosure Policy
|
|
31
|
+
|
|
32
|
+
We look forward to working with all security researchers and strive to be respectful, always assume the best and treat others as peers. We expect the same in return from all participants. To achieve this, our team strives to:
|
|
33
|
+
|
|
34
|
+
- Reply to all reports within one business day and triage within two business days (if applicable)
|
|
35
|
+
- Be as transparent as possible, answering all inquires about our report decisions and adding hackers to duplicate HackerOne reports
|
|
36
|
+
- Award bounties within a week of resolution (excluding extenuating circumstances)
|
|
37
|
+
- Only close reports as N/A when the issue reported is included in Known Issues, Ineligible Vulnerabilities Types or lacks evidence of a vulnerability
|
|
38
|
+
|
|
39
|
+
**The following rules must be followed in order for any rewards to be paid:**
|
|
40
|
+
|
|
41
|
+
- You may only test against shops you have created which include your HackerOne YOURHANDLE @ wearehackerone.com registered email address.
|
|
42
|
+
- You must not attempt to gain access to, or interact with, any shops other than those created by you.
|
|
43
|
+
- The use of commercial scanners is prohibited (e.g., Nessus).
|
|
44
|
+
- Rules for reporting must be followed.
|
|
45
|
+
- Do not disclose any issues publicly before they have been resolved.
|
|
46
|
+
- Shopify reserves the right to modify the rules for this program or deem any submissions invalid at any time. Shopify may cancel the whitehat program without notice at any time.
|
|
47
|
+
- Contacting Shopify Support over chat, email or phone about your HackerOne report is not allowed. We may disqualify you from receiving a reward, or from participating in the program altogether.
|
|
48
|
+
- You are not an employee of Shopify; employees should report bugs to the internal bug bounty program.
|
|
49
|
+
- You hereby represent, warrant and covenant that any content you submit to Shopify is an original work of authorship and that you are legally entitled to grant the rights and privileges conveyed by these terms. You further represent, warrant and covenant that the consent of no other person or entity is or will be necessary for Shopify to use the submitted content.
|
|
50
|
+
- By submitting content to Shopify, you irrevocably waive all moral rights which you may have in the content.
|
|
51
|
+
- All content submitted by you to Shopify under this program is licensed under the MIT License.
|
|
52
|
+
- You must report any discovered vulnerability to Shopify as soon as you have validated the vulnerability.
|
|
53
|
+
- Failure to follow any of the foregoing rules will disqualify you from participating in this program.
|
|
54
|
+
|
|
55
|
+
** Please see our [Hackerone Profile](https://hackerone.com/shopify) for full details
|
|
56
|
+
|
|
57
|
+
## Receiving Security Updates
|
|
58
|
+
|
|
59
|
+
To recieve all general updates to vulnerabilities, please subscribe to our hackerone [Hacktivity](https://hackerone.com/shopify/hacktivity)
|
data/bin/tapioca
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'tapioca' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("tapioca", "tapioca")
|
data/dev.yml
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: shopify-api
|
|
2
|
+
|
|
3
|
+
type: ruby
|
|
4
|
+
|
|
5
|
+
up:
|
|
6
|
+
- ruby: 3.0.3
|
|
7
|
+
- bundler
|
|
8
|
+
|
|
9
|
+
commands:
|
|
10
|
+
console:
|
|
11
|
+
desc: 'start a ruby shell with ShopifyAPI already loaded'
|
|
12
|
+
aliases: ['c']
|
|
13
|
+
run: bundle exec irb -Ilib -rshopify_api
|
|
14
|
+
style:
|
|
15
|
+
desc: 'run rubocop'
|
|
16
|
+
run: bundle exec rubocop
|
|
17
|
+
typecheck:
|
|
18
|
+
desc: 'run Sorbet typechecking'
|
|
19
|
+
aliases: ['tc']
|
|
20
|
+
run: bundle exec srb tc
|
|
21
|
+
test:
|
|
22
|
+
run: bundle exec rake test
|
|
23
|
+
sanity:
|
|
24
|
+
desc: 'run all static checks against the codebase'
|
|
25
|
+
run: bundle exec rubocop && bundle exec srb tc && bundle exec rake test
|
|
26
|
+
subcommands:
|
|
27
|
+
all:
|
|
28
|
+
desc: 'run all checks regardless of the success states of previous checks'
|
|
29
|
+
run: bundle exec rubocop; bundle exec srb tc; bundle exec rake test
|
|
30
|
+
rbi:
|
|
31
|
+
desc: 'generate .rbi files for specified gem to the project'
|
|
32
|
+
run: bin/tapioca gem
|
data/docs/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Make sure this file is in sync with the Getting started section in README -->
|
|
2
|
+
|
|
3
|
+
# Getting started
|
|
4
|
+
|
|
5
|
+
You can follow our getting started guide to learn how to use this library.
|
|
6
|
+
|
|
7
|
+
- [Getting started](getting_started.md)
|
|
8
|
+
- [Performing OAuth](usage/oauth.md)
|
|
9
|
+
- [REST Admin API](usage/rest.md)
|
|
10
|
+
- [Make a GraphQL API call](usage/graphql.md)
|
|
11
|
+
- [Make a Storefront API call](usage/graphql_storefront.md)
|
|
12
|
+
- [Webhooks](usage/webhooks.md)
|
|
13
|
+
- [Known issues and caveats](issues.md)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Getting started
|
|
2
|
+
|
|
3
|
+
This page will outline everything you need to know and the steps you need to follow in order to start using the Shopify Ruby API gem in your app.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- A working knowledge of ruby and a web framework such as Rails or Sinatra
|
|
8
|
+
- A custom app already set up in your test store or partner account
|
|
9
|
+
- We recommend `ngrok` to tunnel traffic to your localhost for testing
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Add the following to your Gemfile:
|
|
14
|
+
|
|
15
|
+
`gem "shopify_api"`
|
|
16
|
+
|
|
17
|
+
## Steps to use the Gem
|
|
18
|
+
|
|
19
|
+
### Setup Shopify Context
|
|
20
|
+
|
|
21
|
+
Start by initializing the `ShopifyAPI::Context` with the parameters of your app by calling `ShopifyAPI::Context.setup` (example below) when your app starts (e.g `application.rb` in a Rails app).
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
ShopifyAPI::Context.setup(
|
|
25
|
+
api_key: "<api-key>",
|
|
26
|
+
api_secret_key: "<api-secret-key>",
|
|
27
|
+
host_name: "<application-host-name>",
|
|
28
|
+
scope: "read_orders,read_products,etc",
|
|
29
|
+
session_storage: ShopifyAPI::Auth::FileSessionStorage.new, # This is only to be used for testing, more information in session docs
|
|
30
|
+
is_embedded: true, # Set to true if you are building an embedded app
|
|
31
|
+
is_private: false, # Set to true if you are building a private app
|
|
32
|
+
api_version: "2021-01" # The vesion of the API you would like to use
|
|
33
|
+
)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Setup a Session Store
|
|
37
|
+
|
|
38
|
+
In order for the Shopify API gem to properly store sessions it needs an implementation of `ShopifyAPI::Auth::SessionStorage`. There is one provided in the gem, `ShopifyAPI::Auth::FileSessionStorage`, this is suitable for testing, however it is not intended for production apps. See the [Session Storage doc](usage/session_storage.md) for instructions on how to create a custom session store for a production application.
|
|
39
|
+
|
|
40
|
+
Normally session information would be stored in cookies on the browser. However, due to restrictions with modern browsers we highly discourage using cookies for embedded apps. For this reason, an app needs to define a storage implementation that can be used to store and retrieve a session given an ID. In a non embedded app this ID will come from a cookie however, in an embedded app this ID will come from [App Bridge](https://shopify.dev/apps/tools/app-bridge)
|
|
41
|
+
|
|
42
|
+
### Performing OAuth
|
|
43
|
+
|
|
44
|
+
Next, unless you are making a private app, you need to go through OAuth as described [here](https://shopify.dev/apps/auth/oauth) to create sessions for shops using your app.
|
|
45
|
+
The Shopify API gem tries to make this easy by providing functions to begin and complete the OAuth process. See the [Oauth doc](usage/oauth.md) for instructions on how to use these.
|
|
46
|
+
|
|
47
|
+
### Register Webhooks and a Webhook Handler
|
|
48
|
+
|
|
49
|
+
If you intend to use webhooks in your application follow the steps in the [Webhooks doc](usage/webhooks.md) for instructions on registering and handling webhooks.
|
|
50
|
+
|
|
51
|
+
### Start Making Authenticated Shopify Requests
|
|
52
|
+
|
|
53
|
+
You can now start making authenticated Shopify API calls using the Admin [REST](usage/rest.md) or [GraphQL](usage/graphql.md) Clients or the [Storefront GraphQL Client](usage/graphql_storefront.md).
|
data/docs/issues.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Known issues and caveats
|
|
2
|
+
|
|
3
|
+
By following this guide, you will have a fully functional Shopify app. However, there are some things you should be aware of before using your new app in a production environment.
|
|
4
|
+
|
|
5
|
+
## Notes on session handling
|
|
6
|
+
|
|
7
|
+
Before you start writing your application, please note that the Shopify library needs to store some information for OAuth in sessions. Since each application may choose a different strategy to store information, the library cannot dictate any specific storage strategy. When calling `ShopifyAPI::Context.setup`, you'll need to provide an instance of a class that implements the `ShopifyAPI::Auth::SessionStorage` interface.
|
|
8
|
+
|
|
9
|
+
This library provides a very simple implementation of that interface which stores sessions in files, `ShopifyAPI::Auth::FileSessionStorage` ([source code](../lib/shopify_api/auth/file_session_storage.rb)). This class is meant to speed up development with this library, but it is not suitable for production use, because it will lead to disk build-up as old sessions are not cleaned up.
|
|
10
|
+
|
|
11
|
+
Before you deploy your app to production, it should use your selected storage method for sessions. You can do that by creating a class that implements the `SessionStorage` interface and pass that in your `Context.setup` call. Your class will need to implement the methods below.
|
|
12
|
+
|
|
13
|
+
**Note**: After you create your implementation of `SessionStorage`, you should make sure to clean up old sessions periodically in your data storage. The library will delete some sessions when they are no longer useful, but it cannot guarantee that expired sessions are deleted automatically.
|
|
14
|
+
|
|
15
|
+
#### `SessionStorage.storeSession`
|
|
16
|
+
|
|
17
|
+
Creates **or updates** a `Session` object in your storage. This function should return a `bool` indicating whether the operation was successful.
|
|
18
|
+
|
|
19
|
+
| Param | Type | Notes |
|
|
20
|
+
| --------- | --------- | --------------------------- |
|
|
21
|
+
| `session` | `Session` | The session object to store |
|
|
22
|
+
|
|
23
|
+
#### `SessionStorage.loadSession`
|
|
24
|
+
|
|
25
|
+
Fetches a `Session` object from your storage. This function should return a `Session` object, or `null` if it was not found.
|
|
26
|
+
|
|
27
|
+
| Param | Type | Notes |
|
|
28
|
+
| ----------- | -------- | ----------------------------- |
|
|
29
|
+
| `sessionId` | `string` | The id of the session to load |
|
|
30
|
+
|
|
31
|
+
#### `SessionStorage.deleteSession`
|
|
32
|
+
|
|
33
|
+
Deletes a session from your storage. This function should return a `bool` indicating whether the operation was successful.
|
|
34
|
+
|
|
35
|
+
| Param | Type | Notes |
|
|
36
|
+
| ----------- | -------- | ------------------------------- |
|
|
37
|
+
| `sessionId` | `string` | The id of the session to delete |
|
|
38
|
+
|
|
39
|
+
[Back to guide index](README.md)
|