shopify_api 11.1.0 → 12.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/close-waiting-for-response-issues.yml +20 -0
  3. data/.github/workflows/remove-labels-on-activity.yml +16 -0
  4. data/.github/workflows/stale.yml +31 -0
  5. data/CHANGELOG.md +7 -0
  6. data/Gemfile.lock +29 -27
  7. data/lib/shopify_api/admin_versions.rb +2 -2
  8. data/lib/shopify_api/auth/jwt_payload.rb +2 -2
  9. data/lib/shopify_api/auth/oauth/auth_query.rb +1 -1
  10. data/lib/shopify_api/auth/oauth.rb +5 -5
  11. data/lib/shopify_api/auth/session.rb +1 -1
  12. data/lib/shopify_api/clients/graphql/client.rb +3 -3
  13. data/lib/shopify_api/clients/graphql/storefront.rb +2 -2
  14. data/lib/shopify_api/clients/http_client.rb +1 -1
  15. data/lib/shopify_api/clients/rest/admin.rb +10 -10
  16. data/lib/shopify_api/rest/base.rb +3 -3
  17. data/lib/shopify_api/rest/resources/2022_01/abandoned_checkout.rb +4 -3
  18. data/lib/shopify_api/rest/resources/2022_01/customer.rb +26 -0
  19. data/lib/shopify_api/rest/resources/2022_01/draft_order.rb +3 -1
  20. data/lib/shopify_api/rest/resources/2022_01/fulfillment_request.rb +5 -1
  21. data/lib/shopify_api/rest/resources/2022_01/gift_card.rb +9 -1
  22. data/lib/shopify_api/rest/resources/2022_01/metafield.rb +12 -5
  23. data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +4 -3
  24. data/lib/shopify_api/rest/resources/2022_04/customer.rb +26 -0
  25. data/lib/shopify_api/rest/resources/2022_04/draft_order.rb +3 -1
  26. data/lib/shopify_api/rest/resources/2022_04/fulfillment_request.rb +5 -1
  27. data/lib/shopify_api/rest/resources/2022_04/gift_card.rb +9 -1
  28. data/lib/shopify_api/rest/resources/2022_04/metafield.rb +8 -8
  29. data/lib/shopify_api/rest/resources/2022_07/abandoned_checkout.rb +4 -3
  30. data/lib/shopify_api/rest/resources/2022_07/customer.rb +20 -0
  31. data/lib/shopify_api/rest/resources/2022_07/dispute_evidence.rb +2 -2
  32. data/lib/shopify_api/rest/resources/2022_07/gift_card.rb +9 -1
  33. data/lib/shopify_api/rest/resources/2022_07/metafield.rb +8 -8
  34. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/abandoned_checkout.rb +4 -3
  35. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/access_scope.rb +0 -0
  36. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/android_pay_key.rb +0 -0
  37. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/apple_pay_certificate.rb +0 -0
  38. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/application_charge.rb +0 -0
  39. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/application_credit.rb +0 -0
  40. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/article.rb +0 -0
  41. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/asset.rb +0 -0
  42. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/assigned_fulfillment_order.rb +0 -0
  43. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/balance.rb +0 -0
  44. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/blog.rb +0 -0
  45. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/cancellation_request.rb +0 -0
  46. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/carrier_service.rb +0 -3
  47. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/checkout.rb +0 -0
  48. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/collect.rb +0 -0
  49. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/collection.rb +0 -0
  50. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/collection_listing.rb +0 -0
  51. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/comment.rb +0 -0
  52. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/country.rb +0 -0
  53. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/currency.rb +0 -0
  54. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/custom_collection.rb +0 -0
  55. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/customer.rb +29 -0
  56. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/customer_address.rb +0 -0
  57. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/customer_saved_search.rb +0 -0
  58. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/deprecated_api_call.rb +0 -0
  59. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/discount_code.rb +0 -0
  60. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/dispute.rb +0 -0
  61. data/lib/shopify_api/rest/resources/2022_10/dispute_evidence.rb +117 -0
  62. data/lib/shopify_api/rest/resources/2022_10/dispute_file_upload.rb +81 -0
  63. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/draft_order.rb +3 -1
  64. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/event.rb +0 -0
  65. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment.rb +2 -49
  66. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_event.rb +0 -0
  67. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_order.rb +30 -1
  68. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_request.rb +5 -1
  69. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_service.rb +3 -3
  70. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/gift_card.rb +9 -1
  71. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/gift_card_adjustment.rb +0 -0
  72. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/image.rb +0 -0
  73. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/inventory_item.rb +0 -0
  74. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/inventory_level.rb +0 -0
  75. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/location.rb +0 -0
  76. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/locations_for_move.rb +0 -0
  77. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/marketing_event.rb +0 -0
  78. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/metafield.rb +8 -8
  79. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/mobile_platform_application.rb +0 -0
  80. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/order.rb +3 -0
  81. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/order_risk.rb +0 -0
  82. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/page.rb +0 -0
  83. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payment.rb +0 -0
  84. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payment_gateway.rb +0 -0
  85. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payment_transaction.rb +0 -0
  86. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payout.rb +0 -0
  87. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/policy.rb +0 -0
  88. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/price_rule.rb +3 -3
  89. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/product.rb +0 -0
  90. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/product_listing.rb +0 -0
  91. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/product_resource_feedback.rb +0 -0
  92. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/province.rb +0 -0
  93. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/recurring_application_charge.rb +0 -0
  94. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/redirect.rb +0 -0
  95. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/refund.rb +0 -0
  96. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/report.rb +0 -0
  97. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/resource_feedback.rb +0 -0
  98. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/script_tag.rb +0 -0
  99. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/shipping_zone.rb +0 -0
  100. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/shop.rb +3 -0
  101. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/smart_collection.rb +0 -0
  102. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/storefront_access_token.rb +0 -0
  103. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/tender_transaction.rb +0 -0
  104. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/theme.rb +0 -0
  105. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/transaction.rb +0 -0
  106. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/usage_charge.rb +0 -0
  107. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/user.rb +0 -0
  108. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/variant.rb +0 -0
  109. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/webhook.rb +0 -0
  110. data/lib/shopify_api/utils/graphql_proxy.rb +2 -2
  111. data/lib/shopify_api/utils/session_utils.rb +5 -5
  112. data/lib/shopify_api/version.rb +1 -1
  113. data/lib/shopify_api/webhooks/registrations/http.rb +7 -1
  114. data/lib/shopify_api/webhooks/registry.rb +8 -8
  115. data/service.yml +0 -1
  116. metadata +81 -76
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d1425c7556a52cb215845c0706990664207eb78bf0e42f5ef555f16ebb3398b
4
- data.tar.gz: 8fbe1be46b5ebdfaac394195cbf44ae6bcd69fc90b6c8dc0709c417936f9dc2d
3
+ metadata.gz: f6e4e09aa88812707194b0ec0726f1e61f448647a01a9d0709201808c05ad99c
4
+ data.tar.gz: ac3fcdb640bb6d1c1614e82d5faf9cd2fce496117187d2daca803a5d96ef8036
5
5
  SHA512:
6
- metadata.gz: 0efde28dd28d29310a940a27d081e1979e44c8b32d282e845af4caaa93352a2d8a213b644b8868cc4416aece4a4867126b03c6e6f13b5bc36da0e2e3605caf26
7
- data.tar.gz: 3c82238434799b244e9106eaa4c3736944bc4792c7e7794604d4c68ab9ba3587dae5b4573a5dd586c8087253726bed56dc87c257f1cd4d124c149ce3637f6c32
6
+ metadata.gz: c05d906a83000f3a2134875532798224afac9cf270787fadd493b2cc3d820771eac5e3b609766ff9c3d08138a774d8e681d3d93d3c13079d4b655d7a857dddf3
7
+ data.tar.gz: 1b4088cd2457c8d39ec04b466a5dcf492ac62df751c44f359a12a1176ed4b30f4289ae2d8dc0a400c491b377ffc522d71e86b33f898b8ce086b39cec0729495e
@@ -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,9 +4,16 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
4
4
 
5
5
  ## Unreleased
6
6
 
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
+
7
13
  ## Version 11.1.0
8
14
 
9
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
10
17
 
11
18
  ## Version 11.0.1
12
19
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_api (11.1.0)
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)
@@ -45,8 +46,8 @@ GEM
45
46
  mocha (1.13.0)
46
47
  multi_xml (0.6.0)
47
48
  netrc (0.11.0)
48
- oj (3.13.20)
49
- openssl (3.0.0)
49
+ oj (3.13.21)
50
+ openssl (3.0.1)
50
51
  parallel (1.22.1)
51
52
  parser (3.1.2.1)
52
53
  ast (~> 2.4.1)
@@ -61,38 +62,39 @@ GEM
61
62
  parser (>= 2.6.4.0)
62
63
  sorbet-runtime (>= 0.5.9204)
63
64
  unparser
64
- regexp_parser (2.2.0)
65
+ regexp_parser (2.5.0)
65
66
  rexml (3.2.5)
66
- rubocop (1.25.1)
67
+ rubocop (1.36.0)
68
+ json (~> 2.3)
67
69
  parallel (~> 1.10)
68
- parser (>= 3.1.0.0)
70
+ parser (>= 3.1.2.1)
69
71
  rainbow (>= 2.2.2, < 4.0)
70
72
  regexp_parser (>= 1.8, < 3.0)
71
- rexml
72
- rubocop-ast (>= 1.15.1, < 2.0)
73
+ rexml (>= 3.2.5, < 4.0)
74
+ rubocop-ast (>= 1.20.1, < 2.0)
73
75
  ruby-progressbar (~> 1.7)
74
76
  unicode-display_width (>= 1.4.0, < 3.0)
75
- rubocop-ast (1.15.1)
76
- parser (>= 3.0.1.1)
77
- rubocop-shopify (2.4.0)
78
- rubocop (~> 1.24)
79
- 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)
80
82
  rubocop (>= 0.90.0)
81
83
  ruby-progressbar (1.11.0)
82
84
  securerandom (0.2.0)
83
- sorbet (0.5.10297)
84
- sorbet-static (= 0.5.10297)
85
- sorbet-runtime (0.5.10297)
86
- sorbet-static (0.5.10297-universal-darwin-21)
87
- sorbet-static (0.5.10297-x86_64-linux)
88
- sorbet-static-and-runtime (0.5.10297)
89
- sorbet (= 0.5.10297)
90
- sorbet-runtime (= 0.5.10297)
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)
91
93
  spoom (1.1.11)
92
94
  sorbet (>= 0.5.9204)
93
95
  sorbet-runtime (>= 0.5.9204)
94
96
  thor (>= 0.19.2)
95
- tapioca (0.9.2)
97
+ tapioca (0.10.2)
96
98
  bundler (>= 1.17.3)
97
99
  netrc (>= 0.11.0)
98
100
  parallel (>= 1.21.0)
@@ -105,7 +107,7 @@ GEM
105
107
  thor (1.2.1)
106
108
  tzinfo (2.0.4)
107
109
  concurrent-ruby (~> 1.0)
108
- unicode-display_width (2.1.0)
110
+ unicode-display_width (2.3.0)
109
111
  unparser (0.6.5)
110
112
  diff-lcs (~> 1.3)
111
113
  parser (>= 3.1.0)
@@ -116,10 +118,10 @@ GEM
116
118
  webrick (1.7.0)
117
119
  yard (0.9.28)
118
120
  webrick (~> 1.7.0)
119
- yard-sorbet (0.6.1)
121
+ yard-sorbet (0.7.0)
120
122
  sorbet-runtime (>= 0.5)
121
123
  yard (>= 0.9)
122
- zeitwerk (2.6.0)
124
+ zeitwerk (2.6.1)
123
125
 
124
126
  PLATFORMS
125
127
  arm64-darwin-21
@@ -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
@@ -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
@@ -46,7 +46,7 @@ module ShopifyAPI
46
46
  expires: T.nilable(Time),
47
47
  is_online: T.nilable(T::Boolean),
48
48
  associated_user: T.nilable(AssociatedUser),
49
- shopify_session_id: T.nilable(String)
49
+ shopify_session_id: T.nilable(String),
50
50
  ).void
51
51
  end
52
52
  def initialize(shop:, id: nil, state: nil, access_token: "", scope: [], associated_user_scope: nil, expires: nil,
@@ -17,7 +17,7 @@ module ShopifyAPI
17
17
  query: String,
18
18
  variables: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
19
19
  headers: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
20
- tries: Integer
20
+ tries: Integer,
21
21
  ).returns(HttpResponse)
22
22
  end
23
23
  def query(query:, variables: nil, headers: nil, tries: 1)
@@ -30,8 +30,8 @@ module ShopifyAPI
30
30
  query: nil,
31
31
  extra_headers: headers,
32
32
  body_type: "application/json",
33
- tries: tries
34
- )
33
+ tries: tries,
34
+ ),
35
35
  )
36
36
  end
37
37
  end
@@ -11,7 +11,7 @@ module ShopifyAPI
11
11
  id: shop,
12
12
  shop: shop,
13
13
  access_token: "",
14
- is_online: false
14
+ is_online: false,
15
15
  )
16
16
  super(session: session, base_path: "/api")
17
17
  @storefront_access_token = storefront_access_token
@@ -22,7 +22,7 @@ module ShopifyAPI
22
22
  query: String,
23
23
  variables: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
24
24
  headers: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
25
- tries: Integer
25
+ tries: Integer,
26
26
  ).returns(HttpResponse)
27
27
  end
28
28
  def query(query:, variables: nil, headers: {}, tries: 1)
@@ -45,7 +45,7 @@ module ShopifyAPI
45
45
  request_url(request),
46
46
  headers: headers,
47
47
  query: request.query,
48
- body: request.body.class == Hash ? T.unsafe(request.body).to_json : request.body
48
+ body: request.body.class == Hash ? T.unsafe(request.body).to_json : request.body,
49
49
  ), HTTParty::Response)
50
50
 
51
51
  body = res.body.empty? ? {} : JSON.parse(res.body)
@@ -18,13 +18,13 @@ module ShopifyAPI
18
18
  body: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
19
19
  query: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
20
20
  headers: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
21
- tries: T.nilable(Integer)
21
+ tries: T.nilable(Integer),
22
22
  ).returns(HttpResponse)
23
23
  end
24
24
  def get(path:, body: nil, query: nil, headers: nil, tries: 1)
25
25
  request(
26
26
  make_request(http_method: :get, path: path, body: body, query: query, headers: headers,
27
- tries: T.must(tries))
27
+ tries: T.must(tries)),
28
28
  )
29
29
  end
30
30
 
@@ -34,13 +34,13 @@ module ShopifyAPI
34
34
  body: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
35
35
  query: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
36
36
  headers: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
37
- tries: T.nilable(Integer)
37
+ tries: T.nilable(Integer),
38
38
  ).returns(HttpResponse)
39
39
  end
40
40
  def delete(path:, body: nil, query: nil, headers: nil, tries: 1)
41
41
  request(
42
42
  make_request(http_method: :delete, path: path, body: body, query: query, headers: headers,
43
- tries: T.must(tries))
43
+ tries: T.must(tries)),
44
44
  )
45
45
  end
46
46
 
@@ -50,13 +50,13 @@ module ShopifyAPI
50
50
  body: T::Hash[T.any(Symbol, String), T.untyped],
51
51
  query: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
52
52
  headers: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
53
- tries: T.nilable(Integer)
53
+ tries: T.nilable(Integer),
54
54
  ).returns(HttpResponse)
55
55
  end
56
56
  def put(path:, body:, query: nil, headers: nil, tries: 1)
57
57
  request(
58
58
  make_request(http_method: :put, path: path, body: body, query: query, headers: headers,
59
- tries: T.must(tries))
59
+ tries: T.must(tries)),
60
60
  )
61
61
  end
62
62
 
@@ -66,13 +66,13 @@ module ShopifyAPI
66
66
  body: T::Hash[T.any(Symbol, String), T.untyped],
67
67
  query: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
68
68
  headers: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
69
- tries: T.nilable(Integer)
69
+ tries: T.nilable(Integer),
70
70
  ).returns(HttpResponse)
71
71
  end
72
72
  def post(path:, body:, query: nil, headers: nil, tries: 1)
73
73
  request(
74
74
  make_request(http_method: :post, path: path, body: body, query: query, headers: headers,
75
- tries: T.must(tries))
75
+ tries: T.must(tries)),
76
76
  )
77
77
  end
78
78
 
@@ -98,7 +98,7 @@ module ShopifyAPI
98
98
  body: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
99
99
  query: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
100
100
  headers: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
101
- tries: Integer
101
+ tries: Integer,
102
102
  ).returns(HttpRequest)
103
103
  end
104
104
  def make_request(http_method:, path:, body:, query:, headers:, tries:)
@@ -109,7 +109,7 @@ module ShopifyAPI
109
109
  query: query,
110
110
  extra_headers: headers,
111
111
  body_type: body.nil? ? nil : "application/json",
112
- tries: tries
112
+ tries: tries,
113
113
  )
114
114
  end
115
115
  end
@@ -137,7 +137,7 @@ module ShopifyAPI
137
137
  http_method: Symbol,
138
138
  operation: Symbol,
139
139
  entity: T.nilable(Base),
140
- ids: T::Hash[Symbol, T.any(Integer, String)]
140
+ ids: T::Hash[Symbol, T.any(Integer, String)],
141
141
  ).returns(T.nilable(String))
142
142
  end
143
143
  def get_path(http_method:, operation:, entity: nil, ids: {})
@@ -297,7 +297,7 @@ module ShopifyAPI
297
297
  element_hash = get_element_hash(
298
298
  get_property(attribute),
299
299
  T.unsafe(self.class.has_one[attribute]),
300
- saving
300
+ saving,
301
301
  )
302
302
  hash[attribute.to_s] = element_hash if element_hash || @forced_nils[attribute.to_s]
303
303
  elsif !get_property(attribute).nil? || @forced_nils[attribute.to_s]
@@ -312,7 +312,7 @@ module ShopifyAPI
312
312
  def delete(params: {})
313
313
  @client.delete(
314
314
  path: T.must(self.class.get_path(http_method: :delete, operation: :delete, entity: self)),
315
- query: params.compact
315
+ query: params.compact,
316
316
  )
317
317
  rescue ShopifyAPI::Errors::HttpResponseError => e
318
318
  @errors.errors << e
@@ -65,6 +65,7 @@ module ShopifyAPI
65
65
  discount_codes: DiscountCode
66
66
  }, T::Hash[Symbol, Class])
67
67
  @paths = T.let([
68
+ {http_method: :get, operation: :checkouts, ids: [], path: "checkouts.json"},
68
69
  {http_method: :get, operation: :checkouts, ids: [], path: "checkouts.json"}
69
70
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
70
71
 
@@ -150,25 +151,25 @@ module ShopifyAPI
150
151
  class << self
151
152
  sig do
152
153
  params(
153
- limit: T.untyped,
154
154
  since_id: T.untyped,
155
155
  created_at_min: T.untyped,
156
156
  created_at_max: T.untyped,
157
157
  updated_at_min: T.untyped,
158
158
  updated_at_max: T.untyped,
159
159
  status: T.untyped,
160
+ limit: T.untyped,
160
161
  session: Auth::Session,
161
162
  kwargs: T.untyped
162
163
  ).returns(T.untyped)
163
164
  end
164
165
  def checkouts(
165
- limit: nil,
166
166
  since_id: nil,
167
167
  created_at_min: nil,
168
168
  created_at_max: nil,
169
169
  updated_at_min: nil,
170
170
  updated_at_max: nil,
171
171
  status: nil,
172
+ limit: nil,
172
173
  session: ShopifyAPI::Context.active_session,
173
174
  **kwargs
174
175
  )
@@ -177,7 +178,7 @@ module ShopifyAPI
177
178
  operation: :checkouts,
178
179
  session: session,
179
180
  ids: {},
180
- params: {limit: limit, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, status: status}.merge(kwargs).compact,
181
+ params: {since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, status: status, limit: limit}.merge(kwargs).compact,
181
182
  body: {},
182
183
  entity: nil,
183
184
  )
@@ -33,6 +33,8 @@ module ShopifyAPI
33
33
  @multipass_identifier = T.let(nil, T.nilable(String))
34
34
  @note = T.let(nil, T.nilable(String))
35
35
  @orders_count = T.let(nil, T.nilable(Integer))
36
+ @password = T.let(nil, T.nilable(String))
37
+ @password_confirmation = T.let(nil, T.nilable(String))
36
38
  @phone = T.let(nil, T.nilable(String))
37
39
  @sms_marketing_consent = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
38
40
  @state = T.let(nil, T.nilable(String))
@@ -49,6 +51,7 @@ module ShopifyAPI
49
51
  }, T::Hash[Symbol, Class])
50
52
  @has_many = T.let({}, T::Hash[Symbol, Class])
51
53
  @paths = T.let([
54
+ {http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
52
55
  {http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
53
56
  {http_method: :get, operation: :get, ids: [], path: "customers.json"},
54
57
  {http_method: :get, operation: :get, ids: [:id], path: "customers/<id>.json"},
@@ -95,6 +98,10 @@ module ShopifyAPI
95
98
  sig { returns(T.nilable(Integer)) }
96
99
  attr_reader :orders_count
97
100
  sig { returns(T.nilable(String)) }
101
+ attr_reader :password
102
+ sig { returns(T.nilable(String)) }
103
+ attr_reader :password_confirmation
104
+ sig { returns(T.nilable(String)) }
98
105
  attr_reader :phone
99
106
  sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
100
107
  attr_reader :sms_marketing_consent
@@ -134,6 +141,25 @@ module ShopifyAPI
134
141
  T.cast(result[0], T.nilable(Customer))
135
142
  end
136
143
 
144
+ sig do
145
+ params(
146
+ id: T.any(Integer, String),
147
+ session: Auth::Session
148
+ ).returns(T.untyped)
149
+ end
150
+ def delete(
151
+ id:,
152
+ session: ShopifyAPI::Context.active_session
153
+ )
154
+ request(
155
+ http_method: :delete,
156
+ operation: :delete,
157
+ session: session,
158
+ ids: {id: id},
159
+ params: {},
160
+ )
161
+ end
162
+
137
163
  sig do
138
164
  params(
139
165
  ids: T.untyped,
@@ -248,12 +248,14 @@ module ShopifyAPI
248
248
 
249
249
  sig do
250
250
  params(
251
+ payment_gateway_id: T.untyped,
251
252
  payment_pending: T.untyped,
252
253
  body: T.untyped,
253
254
  kwargs: T.untyped
254
255
  ).returns(T.untyped)
255
256
  end
256
257
  def complete(
258
+ payment_gateway_id: nil,
257
259
  payment_pending: nil,
258
260
  body: nil,
259
261
  **kwargs
@@ -263,7 +265,7 @@ module ShopifyAPI
263
265
  operation: :complete,
264
266
  session: @session,
265
267
  ids: {id: @id},
266
- params: {payment_pending: payment_pending}.merge(kwargs).compact,
268
+ params: {payment_gateway_id: payment_gateway_id, payment_pending: payment_pending}.merge(kwargs).compact,
267
269
  body: body,
268
270
  entity: self,
269
271
  )
@@ -59,12 +59,16 @@ module ShopifyAPI
59
59
  sig do
60
60
  params(
61
61
  message: T.untyped,
62
+ reason: T.untyped,
63
+ line_items: T.untyped,
62
64
  body: T.untyped,
63
65
  kwargs: T.untyped
64
66
  ).returns(T.untyped)
65
67
  end
66
68
  def reject(
67
69
  message: nil,
70
+ reason: nil,
71
+ line_items: nil,
68
72
  body: nil,
69
73
  **kwargs
70
74
  )
@@ -73,7 +77,7 @@ module ShopifyAPI
73
77
  operation: :reject,
74
78
  session: @session,
75
79
  ids: {fulfillment_order_id: @fulfillment_order_id},
76
- params: {message: message}.merge(kwargs).compact,
80
+ params: {message: message, reason: reason, line_items: line_items}.merge(kwargs).compact,
77
81
  body: body,
78
82
  entity: self,
79
83
  )
@@ -157,6 +157,10 @@ module ShopifyAPI
157
157
  query: T.untyped,
158
158
  limit: T.untyped,
159
159
  fields: T.untyped,
160
+ created_at_min: T.untyped,
161
+ created_at_max: T.untyped,
162
+ updated_at_min: T.untyped,
163
+ updated_at_max: T.untyped,
160
164
  session: Auth::Session,
161
165
  kwargs: T.untyped
162
166
  ).returns(T.untyped)
@@ -166,6 +170,10 @@ module ShopifyAPI
166
170
  query: nil,
167
171
  limit: nil,
168
172
  fields: nil,
173
+ created_at_min: nil,
174
+ created_at_max: nil,
175
+ updated_at_min: nil,
176
+ updated_at_max: nil,
169
177
  session: ShopifyAPI::Context.active_session,
170
178
  **kwargs
171
179
  )
@@ -174,7 +182,7 @@ module ShopifyAPI
174
182
  operation: :search,
175
183
  session: session,
176
184
  ids: {},
177
- params: {order: order, query: query, limit: limit, fields: fields}.merge(kwargs).compact,
185
+ params: {order: order, query: query, limit: limit, fields: fields, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max}.merge(kwargs).compact,
178
186
  body: {},
179
187
  entity: nil,
180
188
  )