shopify_api 11.0.1 → 12.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/cla.yml +22 -0
  3. data/.github/workflows/close-waiting-for-response-issues.yml +20 -0
  4. data/.github/workflows/remove-labels-on-activity.yml +16 -0
  5. data/.github/workflows/stale.yml +31 -0
  6. data/CHANGELOG.md +62 -53
  7. data/Gemfile.lock +34 -30
  8. data/README.md +3 -3
  9. data/docs/usage/graphql.md +1 -1
  10. data/lib/shopify_api/admin_versions.rb +2 -2
  11. data/lib/shopify_api/auth/file_session_storage.rb +2 -0
  12. data/lib/shopify_api/auth/jwt_payload.rb +2 -2
  13. data/lib/shopify_api/auth/oauth/auth_query.rb +1 -1
  14. data/lib/shopify_api/auth/oauth.rb +5 -5
  15. data/lib/shopify_api/auth/session.rb +7 -7
  16. data/lib/shopify_api/auth.rb +26 -0
  17. data/lib/shopify_api/clients/graphql/client.rb +3 -3
  18. data/lib/shopify_api/clients/graphql/storefront.rb +2 -2
  19. data/lib/shopify_api/clients/http_client.rb +1 -1
  20. data/lib/shopify_api/clients/rest/admin.rb +10 -10
  21. data/lib/shopify_api/errors/missing_required_argument_error.rb +9 -0
  22. data/lib/shopify_api/rest/base.rb +3 -3
  23. data/lib/shopify_api/rest/resources/2022_01/abandoned_checkout.rb +4 -3
  24. data/lib/shopify_api/rest/resources/2022_01/customer.rb +26 -0
  25. data/lib/shopify_api/rest/resources/2022_01/draft_order.rb +3 -1
  26. data/lib/shopify_api/rest/resources/2022_01/fulfillment_request.rb +5 -1
  27. data/lib/shopify_api/rest/resources/2022_01/gift_card.rb +9 -1
  28. data/lib/shopify_api/rest/resources/2022_01/metafield.rb +12 -5
  29. data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +4 -3
  30. data/lib/shopify_api/rest/resources/2022_04/customer.rb +26 -0
  31. data/lib/shopify_api/rest/resources/2022_04/draft_order.rb +3 -1
  32. data/lib/shopify_api/rest/resources/2022_04/fulfillment_request.rb +5 -1
  33. data/lib/shopify_api/rest/resources/2022_04/gift_card.rb +9 -1
  34. data/lib/shopify_api/rest/resources/2022_04/metafield.rb +8 -8
  35. data/lib/shopify_api/rest/resources/2022_07/abandoned_checkout.rb +4 -3
  36. data/lib/shopify_api/rest/resources/2022_07/customer.rb +20 -0
  37. data/lib/shopify_api/rest/resources/2022_07/dispute_evidence.rb +2 -2
  38. data/lib/shopify_api/rest/resources/2022_07/gift_card.rb +9 -1
  39. data/lib/shopify_api/rest/resources/2022_07/metafield.rb +8 -8
  40. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/abandoned_checkout.rb +4 -3
  41. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/access_scope.rb +0 -0
  42. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/android_pay_key.rb +0 -0
  43. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/apple_pay_certificate.rb +0 -0
  44. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/application_charge.rb +0 -0
  45. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/application_credit.rb +0 -0
  46. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/article.rb +0 -0
  47. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/asset.rb +0 -0
  48. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/assigned_fulfillment_order.rb +0 -0
  49. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/balance.rb +0 -0
  50. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/blog.rb +0 -0
  51. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/cancellation_request.rb +0 -0
  52. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/carrier_service.rb +0 -3
  53. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/checkout.rb +0 -0
  54. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/collect.rb +0 -0
  55. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/collection.rb +0 -0
  56. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/collection_listing.rb +0 -0
  57. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/comment.rb +0 -0
  58. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/country.rb +0 -0
  59. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/currency.rb +0 -0
  60. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/custom_collection.rb +0 -0
  61. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/customer.rb +29 -0
  62. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/customer_address.rb +0 -0
  63. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/customer_saved_search.rb +0 -0
  64. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/deprecated_api_call.rb +0 -0
  65. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/discount_code.rb +0 -0
  66. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/dispute.rb +0 -0
  67. data/lib/shopify_api/rest/resources/2022_10/dispute_evidence.rb +117 -0
  68. data/lib/shopify_api/rest/resources/2022_10/dispute_file_upload.rb +81 -0
  69. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/draft_order.rb +3 -1
  70. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/event.rb +0 -0
  71. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment.rb +2 -49
  72. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_event.rb +0 -0
  73. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_order.rb +30 -1
  74. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_request.rb +5 -1
  75. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_service.rb +3 -3
  76. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/gift_card.rb +9 -1
  77. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/gift_card_adjustment.rb +0 -0
  78. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/image.rb +0 -0
  79. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/inventory_item.rb +0 -0
  80. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/inventory_level.rb +0 -0
  81. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/location.rb +0 -0
  82. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/locations_for_move.rb +0 -0
  83. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/marketing_event.rb +0 -0
  84. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/metafield.rb +8 -8
  85. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/mobile_platform_application.rb +0 -0
  86. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/order.rb +3 -0
  87. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/order_risk.rb +0 -0
  88. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/page.rb +0 -0
  89. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payment.rb +0 -0
  90. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payment_gateway.rb +0 -0
  91. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payment_transaction.rb +0 -0
  92. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payout.rb +0 -0
  93. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/policy.rb +0 -0
  94. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/price_rule.rb +3 -3
  95. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/product.rb +0 -0
  96. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/product_listing.rb +0 -0
  97. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/product_resource_feedback.rb +0 -0
  98. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/province.rb +0 -0
  99. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/recurring_application_charge.rb +0 -0
  100. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/redirect.rb +0 -0
  101. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/refund.rb +0 -0
  102. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/report.rb +0 -0
  103. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/resource_feedback.rb +0 -0
  104. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/script_tag.rb +0 -0
  105. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/shipping_zone.rb +0 -0
  106. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/shop.rb +3 -0
  107. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/smart_collection.rb +0 -0
  108. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/storefront_access_token.rb +0 -0
  109. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/tender_transaction.rb +0 -0
  110. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/theme.rb +0 -0
  111. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/transaction.rb +0 -0
  112. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/usage_charge.rb +0 -0
  113. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/user.rb +0 -0
  114. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/variant.rb +0 -0
  115. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/webhook.rb +0 -0
  116. data/lib/shopify_api/utils/graphql_proxy.rb +2 -2
  117. data/lib/shopify_api/utils/session_utils.rb +5 -5
  118. data/lib/shopify_api/version.rb +1 -1
  119. data/lib/shopify_api/webhooks/registrations/http.rb +7 -1
  120. data/lib/shopify_api/webhooks/registry.rb +8 -8
  121. data/service.yml +0 -1
  122. metadata +84 -77
  123. data/.github/probots.yml +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 480de35765a695c4111ca43f241270a12a7eb4a22c83844fa5820a27ac829125
4
- data.tar.gz: 5d20da61c0cad987a0b6048cf6a10460af29e80df2d7c89617e24e12fc5f1049
3
+ metadata.gz: f6e4e09aa88812707194b0ec0726f1e61f448647a01a9d0709201808c05ad99c
4
+ data.tar.gz: ac3fcdb640bb6d1c1614e82d5faf9cd2fce496117187d2daca803a5d96ef8036
5
5
  SHA512:
6
- metadata.gz: 68662d27963ec681ca2b1604e11991f33ae19b3833711828743ac17905c5ed62ed37d2ca425b2042ea2093608ece1cc14d2bc2052f0f6b71c42d21b667e7ef71
7
- data.tar.gz: febcfc8ca74c8bf13529d71d91ef6083075c011edb4aeda539b3e5a7d003471a2536a94180ba182b8bbf335ac7f7d9f4752e49ddfac08d1897e02880b24bbff8
6
+ metadata.gz: c05d906a83000f3a2134875532798224afac9cf270787fadd493b2cc3d820771eac5e3b609766ff9c3d08138a774d8e681d3d93d3c13079d4b655d7a857dddf3
7
+ data.tar.gz: 1b4088cd2457c8d39ec04b466a5dcf492ac62df751c44f359a12a1176ed4b30f4289ae2d8dc0a400c491b377ffc522d71e86b33f898b8ce086b39cec0729495e
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
@@ -0,0 +1,20 @@
1
+ name: Close Waiting for Response Issues
2
+ on:
3
+ schedule:
4
+ - cron: "30 1 * * *"
5
+ workflow_dispatch:
6
+ jobs:
7
+ check-need-info:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: close-issues
11
+ uses: actions-cool/issues-helper@v3
12
+ with:
13
+ actions: 'close-issues'
14
+ token: ${{ secrets.GITHUB_TOKEN }}
15
+ labels: 'Waiting for Response'
16
+ inactive-day: 7
17
+ body: |
18
+ We are closing this issue because we did not hear back regarding additional details we needed to resolve this issue. If the issue persists and you are able to provide the missing clarification we need, feel free to respond and reopen this issue.
19
+
20
+ We appreciate your understanding as we try to manage our number of open issues.
@@ -0,0 +1,16 @@
1
+ name: Remove Stale or Waiting Labels
2
+ on:
3
+ issue_comment:
4
+ types: [created]
5
+ workflow_dispatch:
6
+ jobs:
7
+ remove-labels-on-activity:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - uses: actions-ecosystem/action-remove-labels@v1
12
+ if: contains(github.event.issue.labels.*.name, 'Waiting for Response')
13
+ with:
14
+ labels: |
15
+ Waiting for Response
16
+
@@ -0,0 +1,31 @@
1
+ name: Close inactive issues
2
+ on:
3
+ schedule:
4
+ - cron: "30 1 * * *"
5
+
6
+ jobs:
7
+ close-issues:
8
+ runs-on: ubuntu-latest
9
+ permissions:
10
+ issues: write
11
+ pull-requests: write
12
+ steps:
13
+ - uses: actions/stale@v5
14
+ with:
15
+ days-before-issue-stale: 90
16
+ days-before-issue-close: 14
17
+ stale-issue-label: "Stale"
18
+ stale-issue-message: >
19
+ This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.
20
+ close-issue-message: |
21
+ We are closing this issue because it has been inactive for a few months.
22
+ This probably means that it is not reproducible or it has been fixed in a newer version.
23
+ If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.
24
+
25
+ If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the [CONTRIBUTING.md](https://github.com/Shopify/shopify-api-ruby/blob/main/CONTRIBUTING.md) file for guidelines
26
+
27
+ Thank you!
28
+ days-before-pr-stale: -1
29
+ days-before-pr-close: -1
30
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
31
+ exempt-issue-labels: "feature request"
data/CHANGELOG.md CHANGED
@@ -4,7 +4,16 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
4
4
 
5
5
  ## Unreleased
6
6
 
7
- N/A
7
+ ## Version 12.0.0
8
+
9
+ - [#1027](https://github.com/Shopify/shopify-api-ruby/pull/1027) ⚠️ [Breaking] Remove support for deprecated API version `2021-10` and added support for version `2022-10`
10
+
11
+ - [#1008](https://github.com/Shopify/shopify-api-ruby/pull/1008) Increase session token JWT validation leeway from 5s to 10s
12
+
13
+ ## Version 11.1.0
14
+
15
+ - [#1002](https://github.com/Shopify/shopify-api-ruby/pull/1002) Add new method to construct the host app URL for an embedded app, allowing for safer redirect to app inside appropriate shop admin
16
+ - [#1004](https://github.com/Shopify/shopify-api-ruby/pull/1004) Support full URL and scheme-less URL when registering HTTP webhooks
8
17
 
9
18
  ## Version 11.0.1
10
19
 
@@ -12,71 +21,71 @@ N/A
12
21
 
13
22
  ## Version 11.0.0
14
23
 
15
- - [#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
16
- - [#979](https://github.com/Shopify/shopify_api/pull/979) Update `ShopifyAPI::Context.setup` to take `old_api_secret_key` to support API credentials rotation
17
- - [#977](https://github.com/Shopify/shopify_api/pull/977) Fix webhook requests when a header is present having a symbol key (e.g. `:clearance`)
24
+ - [#987](https://github.com/Shopify/shopify-api-ruby/pull/987) ⚠️ [Breaking] Add REST resources for July 2022 API version, remove support and REST resources for July 2021 (`2021-07`) API version
25
+ - [#979](https://github.com/Shopify/shopify-api-ruby/pull/979) Update `ShopifyAPI::Context.setup` to take `old_api_secret_key` to support API credentials rotation
26
+ - [#977](https://github.com/Shopify/shopify-api-ruby/pull/977) Fix webhook requests when a header is present having a symbol key (e.g. `:clearance`)
18
27
 
19
28
  ## Version 10.1.0
20
29
 
21
- - [#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
22
- - [#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)
23
- - [#959](https://github.com/Shopify/shopify_api/pull/959) Update `LATEST_SUPPORTED_ADMIN_VERSION` to `2022-04` to align it with the current value
30
+ - [#933](https://github.com/Shopify/shopify-api-ruby/pull/933) Fix syntax of GraphQL query in `Webhooks.get_webhook_id` method by removing extra curly brace
31
+ - [#941](https://github.com/Shopify/shopify-api-ruby/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-ruby/issues/930)
32
+ - [#959](https://github.com/Shopify/shopify-api-ruby/pull/959) Update `LATEST_SUPPORTED_ADMIN_VERSION` to `2022-04` to align it with the current value
24
33
 
25
34
  ## Version 10.0.3
26
35
 
27
36
  ### Fixed
28
37
 
29
- - [#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
30
- - [#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.
38
+ - [#935](https://github.com/Shopify/shopify-api-ruby/pull/935) Fix issue [#931](https://github.com/Shopify/shopify-api-ruby/pull/931), weight of variant should be float
39
+ - [#944](https://github.com/Shopify/shopify-api-ruby/pull/944) Deprecated the `validate_shop` method from the JWT class since we can trust the token payload, since it comes from Shopify.
31
40
 
32
41
  ## Version 10.0.2
33
42
 
34
- - [#929](https://github.com/Shopify/shopify_api/pull/929) Aligning sorbet dependencies
43
+ - [#929](https://github.com/Shopify/shopify-api-ruby/pull/929) Aligning sorbet dependencies
35
44
 
36
45
  ## Version 10.0.1
37
46
 
38
47
  ### Fixed
39
48
 
40
- - [#919](https://github.com/Shopify/shopify_api/pull/919) Allow REST resources to configure a deny list of attributes to be excluded when saving
41
- - [#920](https://github.com/Shopify/shopify_api/pull/920) Set all values received from the API response to REST resource objects, and allow setting / getting attributes with special characters (such as `?`)
42
- - [#927](https://github.com/Shopify/shopify_api/pull/927) Fix the `ShopifyAPI::AdminVersions` module for backward compatibility
49
+ - [#919](https://github.com/Shopify/shopify-api-ruby/pull/919) Allow REST resources to configure a deny list of attributes to be excluded when saving
50
+ - [#920](https://github.com/Shopify/shopify-api-ruby/pull/920) Set all values received from the API response to REST resource objects, and allow setting / getting attributes with special characters (such as `?`)
51
+ - [#927](https://github.com/Shopify/shopify-api-ruby/pull/927) Fix the `ShopifyAPI::AdminVersions` module for backward compatibility
43
52
 
44
53
  ## Version 10.0.0
45
54
 
46
- - Major update to the library to provide _all_ essential functions needed for a Shopify app, supporting embedded apps with session tokens. See the [full list of changes](https://github.com/Shopify/shopify_api#breaking-change-notice-for-version-1000) here
55
+ - Major update to the library to provide _all_ essential functions needed for a Shopify app, supporting embedded apps with session tokens. See the [full list of changes](https://github.com/Shopify/shopify-api-ruby#breaking-change-notice-for-version-1000) here
47
56
 
48
57
  ## Version 9.5.1
49
58
 
50
- - [#891](https://github.com/Shopify/shopify_api/pull/891) Removed the upper bound on the `activeresource` dependency to allow apps to use the latest version
59
+ - [#891](https://github.com/Shopify/shopify-api-ruby/pull/891) Removed the upper bound on the `activeresource` dependency to allow apps to use the latest version
51
60
 
52
61
  ## Version 9.5
53
62
 
54
- - [#883](https://github.com/Shopify/shopify_api/pull/883) Add support for Ruby 3.0
63
+ - [#883](https://github.com/Shopify/shopify-api-ruby/pull/883) Add support for Ruby 3.0
55
64
 
56
65
  ## Version 9.4.1
57
66
 
58
- - [#847](https://github.com/Shopify/shopify_api/pull/847) Update `create_permission_url` method to use grant_options
59
- - [#852](https://github.com/Shopify/shopify_api/pull/852) Bumping kramdown to fix a security vulnerability
67
+ - [#847](https://github.com/Shopify/shopify-api-ruby/pull/847) Update `create_permission_url` method to use grant_options
68
+ - [#852](https://github.com/Shopify/shopify-api-ruby/pull/852) Bumping kramdown to fix a security vulnerability
60
69
 
61
70
  ## Version 9.4.0
62
71
 
63
- - [#843](https://github.com/Shopify/shopify_api/pull/843) Introduce a new `access_scopes` attribute on the Session class.
72
+ - [#843](https://github.com/Shopify/shopify-api-ruby/pull/843) Introduce a new `access_scopes` attribute on the Session class.
64
73
  - Specifying this in the Session constructor is optional. By default, this attribute returns `nil`.
65
74
 
66
75
  ## Version 9.3.0
67
76
 
68
- - [#797](https://github.com/Shopify/shopify_api/pull/797) Release new Endpoint `fulfillment_order.open` and `fulfillment_order.reschedule`.
77
+ - [#797](https://github.com/Shopify/shopify-api-ruby/pull/797) Release new Endpoint `fulfillment_order.open` and `fulfillment_order.reschedule`.
69
78
 
70
- - [#818](https://github.com/Shopify/shopify_api/pull/818) Avoid depending on ActiveSupport in Sesssion class.
79
+ - [#818](https://github.com/Shopify/shopify-api-ruby/pull/818) Avoid depending on ActiveSupport in Sesssion class.
71
80
 
72
81
  - Freeze all string literals. This should have no impact unless your application is modifying ('monkeypatching') the internals of the library in an unusual way.
73
82
 
74
- - [#802](https://github.com/Shopify/shopify_api/pull/802) Made `inventory_quantity` a read-only field in Variant
83
+ - [#802](https://github.com/Shopify/shopify-api-ruby/pull/802) Made `inventory_quantity` a read-only field in Variant
75
84
 
76
- - [#821](https://github.com/Shopify/shopify_api/pull/821) Add logging based on environment variable, move log subscriber out of `detailed_log_subscriber`.
85
+ - [#821](https://github.com/Shopify/shopify-api-ruby/pull/821) Add logging based on environment variable, move log subscriber out of `detailed_log_subscriber`.
77
86
  The `ActiveResource::DetailedLogSubscriber` no longer automatically attaches when the class is loaded. If you were previously relying on that behaviour, you'll now need to call `ActiveResource::DetailedLogSubscriber.attach_to(:active_resource_detailed)`. (If using the new `SHOPIFY_LOG_PATH` environment setting then this is handled for you).
78
87
 
79
- - Provide `ApiAccess` value object to encapsulate scope operations [#829](https://github.com/Shopify/shopify_api/pull/829)
88
+ - Provide `ApiAccess` value object to encapsulate scope operations [#829](https://github.com/Shopify/shopify-api-ruby/pull/829)
80
89
 
81
90
  ## Version 9.2.0
82
91
 
@@ -84,52 +93,52 @@ N/A
84
93
 
85
94
  ## Version 9.1.1
86
95
 
87
- - Make cursor based pagination return relative uri's when fetching next and previous pages. [#726](https://github.com/Shopify/shopify_api/pull/726)
96
+ - Make cursor based pagination return relative uri's when fetching next and previous pages. [#726](https://github.com/Shopify/shopify-api-ruby/pull/726)
88
97
 
89
98
  ## Version 9.1.0
90
99
 
91
- - Implements equality operator on `Session` [#714](https://github.com/Shopify/shopify_api/pull/714)
100
+ - Implements equality operator on `Session` [#714](https://github.com/Shopify/shopify-api-ruby/pull/714)
92
101
 
93
102
  ## Version 9.0.4
94
103
 
95
- - Contains [#708](https://github.com/Shopify/shopify_api/pull/708) which is a revert for [#655](https://github.com/shopify/shopify_api/pull/655) due to the deprecated inventory parameters not being removed correctly in some cases
104
+ - Contains [#708](https://github.com/Shopify/shopify-api-ruby/pull/708) which is a revert for [#655](https://github.com/Shopify/shopify-api-ruby/pull/655) due to the deprecated inventory parameters not being removed correctly in some cases
96
105
 
97
106
  ## Version 9.0.3
98
107
 
99
- - We now raise a `ShopifyAPI::ValidationException` exception when clients try to use `Product` and `Variant` with deprecated inventory-related fields in API version `2019-10` or later. [#655](https://github.com/shopify/shopify_api/pull/655) Deprecation and migration information can be found in the following documents:
108
+ - We now raise a `ShopifyAPI::ValidationException` exception when clients try to use `Product` and `Variant` with deprecated inventory-related fields in API version `2019-10` or later. [#655](https://github.com/Shopify/shopify-api-ruby/pull/655) Deprecation and migration information can be found in the following documents:
100
109
  - [Product Variant REST API Reference](https://shopify.dev/docs/admin-api/rest/reference/products/product-variant)
101
110
  - [Migrate your app to support multiple locations](https://shopify.dev/tutorials/migrate-your-app-to-support-multiple-locations)
102
111
  - [Manage product inventory with the Admin API](https://shopify.dev/tutorials/manage-product-inventory-with-admin-api)
103
- - Added support for the Discount Code API batch endpoints [#701](https://github.com/shopify/shopify_api/pull/701)
112
+ - Added support for the Discount Code API batch endpoints [#701](https://github.com/Shopify/shopify-api-ruby/pull/701)
104
113
  - [Create](https://shopify.dev/docs/admin-api/rest/reference/discounts/discountcode#batch_create-2020-01)
105
114
  - [Show](https://shopify.dev/docs/admin-api/rest/reference/discounts/discountcode#batch_show-2020-01)
106
115
  - [List](https://shopify.dev/docs/admin-api/rest/reference/discounts/discountcode#batch_discount_codes_index-2020-01)
107
- - Fix issue in the README to explicitly say clients need to require the `shopify_api` gem [#700](https://github.com/Shopify/shopify_api/pull/700)
116
+ - Fix issue in the README to explicitly say clients need to require the `shopify_api` gem [#700](https://github.com/Shopify/shopify-api-ruby/pull/700)
108
117
 
109
118
  ## Version 9.0.2
110
119
 
111
- - Added optional flag passed to `initialize_clients` to prevent from raising the `InvalidSchema` exception [#693](https://github.com/Shopify/shopify_api/pull/693)
120
+ - Added optional flag passed to `initialize_clients` to prevent from raising the `InvalidSchema` exception [#693](https://github.com/Shopify/shopify-api-ruby/pull/693)
112
121
 
113
122
  ## Version 9.0.1
114
123
 
115
- - Added warning message if API version used is unsupported or soon to be unsupported [#685](https://github.com/Shopify/shopify_api/pull/685)
116
- - Take into account "errors" messages from response body [#677](https://github.com/Shopify/shopify_api/pull/677)
124
+ - Added warning message if API version used is unsupported or soon to be unsupported [#685](https://github.com/Shopify/shopify-api-ruby/pull/685)
125
+ - Take into account "errors" messages from response body [#677](https://github.com/Shopify/shopify-api-ruby/pull/677)
117
126
 
118
127
  ## Version 9.0.0
119
128
 
120
- - Breaking change: Improved GraphQL client [#672](https://github.com/Shopify/shopify_api/pull/672). See the [client docs](docs/graphql.md) for usage and a migration guide.
129
+ - Breaking change: Improved GraphQL client [#672](https://github.com/Shopify/shopify-api-ruby/pull/672). See the [client docs](docs/graphql.md) for usage and a migration guide.
121
130
 
122
- - Added options hash to create_permission_url and makes redirect_uri required [#670](https://github.com/Shopify/shopify_api/pull/670)
131
+ - Added options hash to create_permission_url and makes redirect_uri required [#670](https://github.com/Shopify/shopify-api-ruby/pull/670)
123
132
 
124
- - Release new Endpoint `fulfillment_order.locations_for_move` in 2020-01 REST API version [#669](https://github.com/Shopify/shopify_api/pull/669)
133
+ - Release new Endpoint `fulfillment_order.locations_for_move` in 2020-01 REST API version [#669](https://github.com/Shopify/shopify-api-ruby/pull/669)
125
134
 
126
- - Release new Endpoints for `fulfillment` in 2020-01 REST API version [#639](https://github.com/Shopify/shopify_api/pull/639):
135
+ - Release new Endpoints for `fulfillment` in 2020-01 REST API version [#639](https://github.com/Shopify/shopify-api-ruby/pull/639):
127
136
 
128
137
  - `fulfillment.create` with `line_items_by_fulfillment_order`
129
138
  - `fulfillment.update_tracking`
130
139
  - `fulfillment.cancel`
131
140
 
132
- - Release new Endpoints for `fulfillment_order` in 2020-01 REST API version [#637](https://github.com/Shopify/shopify_api/pull/637):
141
+ - Release new Endpoints for `fulfillment_order` in 2020-01 REST API version [#637](https://github.com/Shopify/shopify-api-ruby/pull/637):
133
142
 
134
143
  - `fulfillment_order.fulfillment_request`
135
144
  - `fulfillment_order.fulfillment_request.accept`
@@ -138,35 +147,35 @@ N/A
138
147
  - `fulfillment_order.cancellation_request.accept`
139
148
  - `fulfillment_order.cancellation_request.reject`
140
149
 
141
- - Release new Endpoints `fulfillment_order.move`, `fulfillment_order.cancel` and `fulfillment_order.close` in 2020-01 REST API version [#635](https://github.com/Shopify/shopify_api/pull/635)
150
+ - Release new Endpoints `fulfillment_order.move`, `fulfillment_order.cancel` and `fulfillment_order.close` in 2020-01 REST API version [#635](https://github.com/Shopify/shopify-api-ruby/pull/635)
142
151
 
143
- - Release new Endpoint `order.fulfillment_orders`, and active resources `AssignedFulfillmentOrder` and `FulfillmentOrder` in 2020-01 REST API version [#633](https://github.com/Shopify/shopify_api/pull/633)
152
+ - Release new Endpoint `order.fulfillment_orders`, and active resources `AssignedFulfillmentOrder` and `FulfillmentOrder` in 2020-01 REST API version [#633](https://github.com/Shopify/shopify-api-ruby/pull/633)
144
153
 
145
154
  ## Version 8.1.0
146
155
 
147
- - Release 2020-01 REST ADMIN API VERSION [#656](https://github.com/Shopify/shopify_api/pull/656)
148
- - Release new Endpoint `collection.products` and `collection.find()` in 2020-01 REST API version [#657](https://github.com/Shopify/shopify_api/pull/657)
149
- - Enrich 4xx errors with error message from response body [#647](https://github.com/Shopify/shopify_api/pull/647)
150
- - Make relative cursor based pagination work across page loads [#625](https://github.com/Shopify/shopify_api/pull/625)
151
- - Small ruby compat fix [#623](https://github.com/Shopify/shopify_api/pull/623)
152
- - Small consistency change [#621](https://github.com/Shopify/shopify_api/pull/621)
156
+ - Release 2020-01 REST ADMIN API VERSION [#656](https://github.com/Shopify/shopify-api-ruby/pull/656)
157
+ - Release new Endpoint `collection.products` and `collection.find()` in 2020-01 REST API version [#657](https://github.com/Shopify/shopify-api-ruby/pull/657)
158
+ - Enrich 4xx errors with error message from response body [#647](https://github.com/Shopify/shopify-api-ruby/pull/647)
159
+ - Make relative cursor based pagination work across page loads [#625](https://github.com/Shopify/shopify-api-ruby/pull/625)
160
+ - Small ruby compat fix [#623](https://github.com/Shopify/shopify-api-ruby/pull/623)
161
+ - Small consistency change [#621](https://github.com/Shopify/shopify-api-ruby/pull/621)
153
162
 
154
163
  ## Version 8.0.0
155
164
 
156
- - Api Version changes [#600](https://github.com/Shopify/shopify_api/pull/600)
165
+ - Api Version changes [#600](https://github.com/Shopify/shopify-api-ruby/pull/600)
157
166
  - Remove static Api Version definitions.
158
167
  - Introduces Api Version lookup modes: `:define_on_unknown` and `:raise_on_unknown`
159
168
  - See [migration notes](README.md#-breaking-change-notice-for-version-800-)
160
169
  - `Session.valid?` checks that api_version `is_a?(ApiVersion)` instead of `present?`
161
- - `ApiVersion::NullVersion` cannot be instantiated and now has a `match?` method [#615](https://github.com/Shopify/shopify_api/pull/615/files)
162
- - Introduces new Collection endpoint for looking up products without knowing collection type. Only available if ApiVersion is `:unstable` [#609](https://github.com/Shopify/shopify_api/pull/609)
170
+ - `ApiVersion::NullVersion` cannot be instantiated and now has a `match?` method [#615](https://github.com/Shopify/shopify-api-ruby/pull/615/files)
171
+ - Introduces new Collection endpoint for looking up products without knowing collection type. Only available if ApiVersion is `:unstable` [#609](https://github.com/Shopify/shopify-api-ruby/pull/609)
163
172
 
164
173
  ## Version 7.1.0
165
174
 
166
175
  - Add 2019-10 to known API versions
167
- - Add support for cursor pagination [#594](https://github.com/Shopify/shopify_api/pull/594) and
168
- [#611](https://github.com/Shopify/shopify_api/pull/611)
169
- - `ShopifyAPI::Base.api_version` now defaults to `ShopifyAPI::ApiVersion::NullVersion` instead of `nil`. Making requests without first setting an ApiVersion raises `ApiVersionNotSetError` instead of `NoMethodError: undefined method 'construct_api_path' for nil:NilClass'` [#605](https://github.com/Shopify/shopify_api/pull/605)
176
+ - Add support for cursor pagination [#594](https://github.com/Shopify/shopify-api-ruby/pull/594) and
177
+ [#611](https://github.com/Shopify/shopify-api-ruby/pull/611)
178
+ - `ShopifyAPI::Base.api_version` now defaults to `ShopifyAPI::ApiVersion::NullVersion` instead of `nil`. Making requests without first setting an ApiVersion raises `ApiVersionNotSetError` instead of `NoMethodError: undefined method 'construct_api_path' for nil:NilClass'` [#605](https://github.com/Shopify/shopify-api-ruby/pull/605)
170
179
 
171
180
  ## Version 7.0.2
172
181
 
@@ -174,7 +183,7 @@ N/A
174
183
 
175
184
  ## Version 7.0.1
176
185
 
177
- - Support passing version string to `ShopifyAPI::Base.api_version` [#563](https://github.com/Shopify/shopify_api/pull/563)
186
+ - Support passing version string to `ShopifyAPI::Base.api_version` [#563](https://github.com/Shopify/shopify-api-ruby/pull/563)
178
187
 
179
188
  ## Version 7.0.0
180
189
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_api (11.0.1)
4
+ shopify_api (12.0.0)
5
5
  concurrent-ruby
6
6
  hash_diff
7
7
  httparty
@@ -29,14 +29,15 @@ GEM
29
29
  rexml
30
30
  diff-lcs (1.5.0)
31
31
  fakefs (1.4.1)
32
- hash_diff (1.0.0)
32
+ hash_diff (1.1.1)
33
33
  hashdiff (1.0.1)
34
34
  httparty (0.20.0)
35
35
  mime-types (~> 3.0)
36
36
  multi_xml (>= 0.5.2)
37
37
  i18n (1.8.11)
38
38
  concurrent-ruby (~> 1.0)
39
- jwt (2.4.1)
39
+ json (2.6.2)
40
+ jwt (2.5.0)
40
41
  method_source (1.0.0)
41
42
  mime-types (3.4.1)
42
43
  mime-types-data (~> 3.2015)
@@ -44,10 +45,11 @@ GEM
44
45
  minitest (5.15.0)
45
46
  mocha (1.13.0)
46
47
  multi_xml (0.6.0)
47
- oj (3.13.15)
48
- openssl (3.0.0)
49
- parallel (1.21.0)
50
- parser (3.1.2.0)
48
+ netrc (0.11.0)
49
+ oj (3.13.21)
50
+ openssl (3.0.1)
51
+ parallel (1.22.1)
52
+ parser (3.1.2.1)
51
53
  ast (~> 2.4.1)
52
54
  pry (0.14.1)
53
55
  coderay (~> 1.1)
@@ -55,44 +57,46 @@ GEM
55
57
  public_suffix (4.0.6)
56
58
  rainbow (3.1.1)
57
59
  rake (13.0.6)
58
- rbi (0.0.14)
60
+ rbi (0.0.15)
59
61
  ast
60
62
  parser (>= 2.6.4.0)
61
63
  sorbet-runtime (>= 0.5.9204)
62
64
  unparser
63
- regexp_parser (2.2.0)
65
+ regexp_parser (2.5.0)
64
66
  rexml (3.2.5)
65
- rubocop (1.25.1)
67
+ rubocop (1.36.0)
68
+ json (~> 2.3)
66
69
  parallel (~> 1.10)
67
- parser (>= 3.1.0.0)
70
+ parser (>= 3.1.2.1)
68
71
  rainbow (>= 2.2.2, < 4.0)
69
72
  regexp_parser (>= 1.8, < 3.0)
70
- rexml
71
- rubocop-ast (>= 1.15.1, < 2.0)
73
+ rexml (>= 3.2.5, < 4.0)
74
+ rubocop-ast (>= 1.20.1, < 2.0)
72
75
  ruby-progressbar (~> 1.7)
73
76
  unicode-display_width (>= 1.4.0, < 3.0)
74
- rubocop-ast (1.15.1)
75
- parser (>= 3.0.1.1)
76
- rubocop-shopify (2.4.0)
77
- rubocop (~> 1.24)
78
- rubocop-sorbet (0.6.5)
77
+ rubocop-ast (1.21.0)
78
+ parser (>= 3.1.1.0)
79
+ rubocop-shopify (2.10.1)
80
+ rubocop (~> 1.35)
81
+ rubocop-sorbet (0.6.11)
79
82
  rubocop (>= 0.90.0)
80
83
  ruby-progressbar (1.11.0)
81
84
  securerandom (0.2.0)
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)
85
+ sorbet (0.5.10438)
86
+ sorbet-static (= 0.5.10438)
87
+ sorbet-runtime (0.5.10438)
88
+ sorbet-static (0.5.10438-universal-darwin-21)
89
+ sorbet-static (0.5.10438-x86_64-linux)
90
+ sorbet-static-and-runtime (0.5.10438)
91
+ sorbet (= 0.5.10438)
92
+ sorbet-runtime (= 0.5.10438)
90
93
  spoom (1.1.11)
91
94
  sorbet (>= 0.5.9204)
92
95
  sorbet-runtime (>= 0.5.9204)
93
96
  thor (>= 0.19.2)
94
- tapioca (0.8.3)
97
+ tapioca (0.10.2)
95
98
  bundler (>= 1.17.3)
99
+ netrc (>= 0.11.0)
96
100
  parallel (>= 1.21.0)
97
101
  pry (>= 0.12.2)
98
102
  rbi (~> 0.0.0, >= 0.0.14)
@@ -103,7 +107,7 @@ GEM
103
107
  thor (1.2.1)
104
108
  tzinfo (2.0.4)
105
109
  concurrent-ruby (~> 1.0)
106
- unicode-display_width (2.1.0)
110
+ unicode-display_width (2.3.0)
107
111
  unparser (0.6.5)
108
112
  diff-lcs (~> 1.3)
109
113
  parser (>= 3.1.0)
@@ -114,10 +118,10 @@ GEM
114
118
  webrick (1.7.0)
115
119
  yard (0.9.28)
116
120
  webrick (~> 1.7.0)
117
- yard-sorbet (0.6.1)
121
+ yard-sorbet (0.7.0)
118
122
  sorbet-runtime (>= 0.5)
119
123
  yard (>= 0.9)
120
- zeitwerk (2.6.0)
124
+ zeitwerk (2.6.1)
121
125
 
122
126
  PLATFORMS
123
127
  arm64-darwin-21
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <!-- ![Build Status]() -->
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
5
- ![Build Status](https://github.com/Shopify/shopify_api/workflows/CI/badge.svg?branch=main)
5
+ ![Build Status](https://github.com/Shopify/shopify-api-ruby/workflows/CI/badge.svg?branch=main)
6
6
 
7
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
8
 
@@ -15,7 +15,7 @@ In addition to the Admin API, this library also allows querying the [Storefront
15
15
 
16
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
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/tree/v9).
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
19
 
20
20
  ## Requirements
21
21
 
@@ -97,7 +97,7 @@ Here are the main features it provides:
97
97
  - Webhook management, with features for adding handlers and registering them with Shopify.
98
98
  - Storefront GraphQL API support
99
99
 
100
- Please refer to [the documentation](https://github.com/Shopify/shopify_api/blob/main/docs/getting_started.md) in this repository for instructions on how to use each of these components.
100
+ Please refer to [the documentation](docs/getting_started.md) in this repository for instructions on how to use each of these components.
101
101
 
102
102
  With this, a lot changed in how apps access the library. Here are the updates you should make when migrating to v10:
103
103
 
@@ -1,6 +1,6 @@
1
1
  # Make a GraphQL API call
2
2
 
3
- Once you have a [session](https://github.com/Shopify/shopify_api/blob/main/docs/usage/oauth.md#fetching-sessions) after completing oauth, you can make GraphQL queries to the Admin API with `ShopifyAPI::Clients::Graphql::Admin`
3
+ Once you have a [session](oauth.md#fetching-sessions) after completing oauth, you can make GraphQL queries to the Admin API with `ShopifyAPI::Clients::Graphql::Admin`
4
4
 
5
5
  Below is an example
6
6
 
@@ -5,13 +5,13 @@ module ShopifyAPI
5
5
  module AdminVersions
6
6
  SUPPORTED_ADMIN_VERSIONS = T.let([
7
7
  "unstable",
8
+ "2022-10",
8
9
  "2022-07",
9
10
  "2022-04",
10
11
  "2022-01",
11
- "2021-10",
12
12
  ], T::Array[String])
13
13
 
14
- LATEST_SUPPORTED_ADMIN_VERSION = T.let("2022-07", String)
14
+ LATEST_SUPPORTED_ADMIN_VERSION = T.let("2022-10", String)
15
15
  end
16
16
 
17
17
  SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS
@@ -1,6 +1,8 @@
1
1
  # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
+ require "fileutils"
5
+
4
6
  module ShopifyAPI
5
7
  module Auth
6
8
  class FileSessionStorage
@@ -6,7 +6,7 @@ module ShopifyAPI
6
6
  class JwtPayload
7
7
  extend T::Sig
8
8
 
9
- JWT_EXPIRATION_LEEWAY = 5
9
+ JWT_EXPIRATION_LEEWAY = 10
10
10
 
11
11
  sig { returns(String) }
12
12
  attr_reader :iss, :dest, :aud, :sub, :jti, :sid
@@ -48,7 +48,7 @@ module ShopifyAPI
48
48
  def validate_shop(shop)
49
49
  Context.logger.warn(
50
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."
51
+ "returns true. It will be removed in v11.",
52
52
  )
53
53
  true
54
54
  end
@@ -18,7 +18,7 @@ module ShopifyAPI
18
18
  timestamp: String,
19
19
  state: String,
20
20
  host: String,
21
- hmac: String
21
+ hmac: String,
22
22
  ).void
23
23
  end
24
24
  def initialize(code:, shop:, timestamp:, state:, host:, hmac:)
@@ -15,7 +15,7 @@ module ShopifyAPI
15
15
  params(
16
16
  shop: String,
17
17
  redirect_path: String,
18
- is_online: T.nilable(T::Boolean)
18
+ is_online: T.nilable(T::Boolean),
19
19
  ).returns(T::Hash[Symbol, T.any(String, SessionCookie)])
20
20
  end
21
21
  def begin_auth(shop:, redirect_path:, is_online: true)
@@ -45,7 +45,7 @@ module ShopifyAPI
45
45
  sig do
46
46
  params(
47
47
  cookies: T::Hash[String, String],
48
- auth_query: AuthQuery
48
+ auth_query: AuthQuery,
49
49
  ).returns(T::Hash[Symbol, T.any(Session, SessionCookie)])
50
50
  end
51
51
  def validate_auth_callback(cookies:, auth_query:)
@@ -75,12 +75,12 @@ module ShopifyAPI
75
75
  cookie = if Context.embedded?
76
76
  SessionCookie.new(
77
77
  value: "",
78
- expires: Time.now
78
+ expires: Time.now,
79
79
  )
80
80
  else
81
81
  SessionCookie.new(
82
82
  value: session.id,
83
- expires: session.online? ? session.expires : nil
83
+ expires: session.online? ? session.expires : nil,
84
84
  )
85
85
  end
86
86
 
@@ -120,7 +120,7 @@ module ShopifyAPI
120
120
  associated_user_scope: associated_user_scope,
121
121
  associated_user: associated_user,
122
122
  expires: expires,
123
- shopify_session_id: session_params[:session]
123
+ shopify_session_id: session_params[:session],
124
124
  )
125
125
  end
126
126
  end