shopify_api 11.0.1 → 12.0.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.
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
@@ -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,
@@ -83,6 +83,11 @@ module ShopifyAPI
83
83
  Context.activate_session(original_session)
84
84
  end
85
85
  end
86
+
87
+ sig { params(str: String).returns(Session) }
88
+ def deserialize(str)
89
+ Oj.load(str)
90
+ end
86
91
  end
87
92
 
88
93
  sig { returns(String) }
@@ -90,16 +95,11 @@ module ShopifyAPI
90
95
  Oj.dump(self)
91
96
  end
92
97
 
93
- sig { params(str: String).returns(Session) }
94
- def self.deserialize(str)
95
- Oj.load(str)
96
- end
97
-
98
98
  alias_method :eql?, :==
99
99
  sig { params(other: T.nilable(Session)).returns(T::Boolean) }
100
100
  def ==(other)
101
101
  if other
102
- T.must(
102
+ (
103
103
  id == other.id &&
104
104
  shop == other.shop &&
105
105
  state == other.state &&
@@ -0,0 +1,26 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module ShopifyAPI
5
+ module Auth
6
+ extend T::Sig
7
+
8
+ class << self
9
+ extend T::Sig
10
+
11
+ sig { params(host: T.nilable(String)).returns(String) }
12
+ def embedded_app_url(host)
13
+ unless Context.setup?
14
+ raise Errors::ContextNotSetupError, "ShopifyAPI::Context not setup, please call ShopifyAPI::Context.setup"
15
+ end
16
+
17
+ unless host
18
+ raise Errors::MissingRequiredArgumentError, "host argument is required"
19
+ end
20
+
21
+ decoded_host = Base64.decode64(host)
22
+ "https://#{decoded_host}/apps/#{Context.api_key}"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -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
@@ -0,0 +1,9 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module ShopifyAPI
5
+ module Errors
6
+ class MissingRequiredArgumentError < StandardError
7
+ end
8
+ end
9
+ 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
  )
@@ -51,6 +51,7 @@ module ShopifyAPI
51
51
  {http_method: :delete, operation: :delete, ids: [:order_id, :id], path: "orders/<order_id>/metafields/<id>.json"},
52
52
  {http_method: :delete, operation: :delete, ids: [:page_id, :id], path: "pages/<page_id>/metafields/<id>.json"},
53
53
  {http_method: :delete, operation: :delete, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
54
+ {http_method: :delete, operation: :delete, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
54
55
  {http_method: :delete, operation: :delete, ids: [:product_id, :id], path: "products/<product_id>/metafields/<id>.json"},
55
56
  {http_method: :delete, operation: :delete, ids: [:variant_id, :id], path: "variants/<variant_id>/metafields/<id>.json"},
56
57
  {http_method: :get, operation: :count, ids: [:article_id], path: "articles/<article_id>/metafields/count.json"},
@@ -61,6 +62,7 @@ module ShopifyAPI
61
62
  {http_method: :get, operation: :count, ids: [], path: "metafields/count.json"},
62
63
  {http_method: :get, operation: :count, ids: [:order_id], path: "orders/<order_id>/metafields/count.json"},
63
64
  {http_method: :get, operation: :count, ids: [:page_id], path: "pages/<page_id>/metafields/count.json"},
65
+ {http_method: :get, operation: :count, ids: [:page_id], path: "pages/<page_id>/metafields/count.json"},
64
66
  {http_method: :get, operation: :count, ids: [:product_image_id], path: "product_images/<product_image_id>/metafields/count.json"},
65
67
  {http_method: :get, operation: :count, ids: [:product_id], path: "products/<product_id>/metafields/count.json"},
66
68
  {http_method: :get, operation: :count, ids: [:variant_id], path: "variants/<variant_id>/metafields/count.json"},
@@ -73,9 +75,9 @@ module ShopifyAPI
73
75
  {http_method: :get, operation: :get, ids: [:customer_id], path: "customers/<customer_id>/metafields.json"},
74
76
  {http_method: :get, operation: :get, ids: [:customer_id, :id], path: "customers/<customer_id>/metafields/<id>.json"},
75
77
  {http_method: :get, operation: :get, ids: [:draft_order_id], path: "draft_orders/<draft_order_id>/metafields.json"},
78
+ {http_method: :get, operation: :get, ids: [:draft_order_id], path: "draft_orders/<draft_order_id>/metafields.json"},
76
79
  {http_method: :get, operation: :get, ids: [:draft_order_id, :id], path: "draft_orders/<draft_order_id>/metafields/<id>.json"},
77
80
  {http_method: :get, operation: :get, ids: [], path: "metafields.json"},
78
- {http_method: :get, operation: :get, ids: [], path: "metafields.json"},
79
81
  {http_method: :get, operation: :get, ids: [:id], path: "metafields/<id>.json"},
80
82
  {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/metafields.json"},
81
83
  {http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/metafields/<id>.json"},
@@ -83,6 +85,7 @@ module ShopifyAPI
83
85
  {http_method: :get, operation: :get, ids: [:page_id, :id], path: "pages/<page_id>/metafields/<id>.json"},
84
86
  {http_method: :get, operation: :get, ids: [:product_image_id], path: "product_images/<product_image_id>/metafields.json"},
85
87
  {http_method: :get, operation: :get, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
88
+ {http_method: :get, operation: :get, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
86
89
  {http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/metafields.json"},
87
90
  {http_method: :get, operation: :get, ids: [:product_id, :id], path: "products/<product_id>/metafields/<id>.json"},
88
91
  {http_method: :get, operation: :get, ids: [:variant_id], path: "variants/<variant_id>/metafields.json"},
@@ -94,12 +97,14 @@ module ShopifyAPI
94
97
  {http_method: :post, operation: :post, ids: [:draft_order_id], path: "draft_orders/<draft_order_id>/metafields.json"},
95
98
  {http_method: :post, operation: :post, ids: [], path: "metafields.json"},
96
99
  {http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/metafields.json"},
100
+ {http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/metafields.json"},
97
101
  {http_method: :post, operation: :post, ids: [:page_id], path: "pages/<page_id>/metafields.json"},
98
102
  {http_method: :post, operation: :post, ids: [:product_image_id], path: "product_images/<product_image_id>/metafields.json"},
99
103
  {http_method: :post, operation: :post, ids: [:product_id], path: "products/<product_id>/metafields.json"},
100
104
  {http_method: :post, operation: :post, ids: [:variant_id], path: "variants/<variant_id>/metafields.json"},
101
105
  {http_method: :put, operation: :put, ids: [:article_id, :id], path: "articles/<article_id>/metafields/<id>.json"},
102
106
  {http_method: :put, operation: :put, ids: [:blog_id, :id], path: "blogs/<blog_id>/metafields/<id>.json"},
107
+ {http_method: :put, operation: :put, ids: [:blog_id, :id], path: "blogs/<blog_id>/metafields/<id>.json"},
103
108
  {http_method: :put, operation: :put, ids: [:collection_id, :id], path: "collections/<collection_id>/metafields/<id>.json"},
104
109
  {http_method: :put, operation: :put, ids: [:customer_id, :id], path: "customers/<customer_id>/metafields/<id>.json"},
105
110
  {http_method: :put, operation: :put, ids: [:draft_order_id, :id], path: "draft_orders/<draft_order_id>/metafields/<id>.json"},
@@ -168,6 +173,7 @@ module ShopifyAPI
168
173
  product_image_id: T.nilable(T.any(Integer, String)),
169
174
  product_id: T.nilable(T.any(Integer, String)),
170
175
  variant_id: T.nilable(T.any(Integer, String)),
176
+ fields: T.untyped,
171
177
  session: Auth::Session
172
178
  ).returns(T.nilable(Metafield))
173
179
  end
@@ -183,12 +189,13 @@ module ShopifyAPI
183
189
  product_image_id: nil,
184
190
  product_id: nil,
185
191
  variant_id: nil,
192
+ fields: nil,
186
193
  session: ShopifyAPI::Context.active_session
187
194
  )
188
195
  result = base_find(
189
196
  session: session,
190
197
  ids: {id: id, article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
191
- params: {},
198
+ params: {fields: fields},
192
199
  )
193
200
  T.cast(result[0], T.nilable(Metafield))
194
201
  end
@@ -252,8 +259,8 @@ module ShopifyAPI
252
259
  updated_at_max: T.untyped,
253
260
  namespace: T.untyped,
254
261
  key: T.untyped,
255
- type: T.untyped,
256
262
  value_type: T.untyped,
263
+ type: T.untyped,
257
264
  fields: T.untyped,
258
265
  metafield: T.nilable(T::Hash[T.untyped, T.untyped]),
259
266
  session: Auth::Session,
@@ -279,8 +286,8 @@ module ShopifyAPI
279
286
  updated_at_max: nil,
280
287
  namespace: nil,
281
288
  key: nil,
282
- type: nil,
283
289
  value_type: nil,
290
+ type: nil,
284
291
  fields: nil,
285
292
  metafield: nil,
286
293
  session: ShopifyAPI::Context.active_session,
@@ -289,7 +296,7 @@ module ShopifyAPI
289
296
  response = base_find(
290
297
  session: session,
291
298
  ids: {article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
292
- 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, namespace: namespace, key: key, type: type, value_type: value_type, fields: fields, metafield: metafield}.merge(kwargs).compact,
299
+ 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, namespace: namespace, key: key, value_type: value_type, type: type, fields: fields, metafield: metafield}.merge(kwargs).compact,
293
300
  )
294
301
 
295
302
  T.cast(response, T::Array[Metafield])
@@ -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
  )
@@ -34,6 +34,8 @@ module ShopifyAPI
34
34
  @multipass_identifier = T.let(nil, T.nilable(String))
35
35
  @note = T.let(nil, T.nilable(String))
36
36
  @orders_count = T.let(nil, T.nilable(Integer))
37
+ @password = T.let(nil, T.nilable(String))
38
+ @password_confirmation = T.let(nil, T.nilable(String))
37
39
  @phone = T.let(nil, T.nilable(String))
38
40
  @sms_marketing_consent = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
39
41
  @state = T.let(nil, T.nilable(String))
@@ -50,6 +52,7 @@ module ShopifyAPI
50
52
  }, T::Hash[Symbol, Class])
51
53
  @has_many = T.let({}, T::Hash[Symbol, Class])
52
54
  @paths = T.let([
55
+ {http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
53
56
  {http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
54
57
  {http_method: :get, operation: :get, ids: [], path: "customers.json"},
55
58
  {http_method: :get, operation: :get, ids: [:id], path: "customers/<id>.json"},
@@ -98,6 +101,10 @@ module ShopifyAPI
98
101
  sig { returns(T.nilable(Integer)) }
99
102
  attr_reader :orders_count
100
103
  sig { returns(T.nilable(String)) }
104
+ attr_reader :password
105
+ sig { returns(T.nilable(String)) }
106
+ attr_reader :password_confirmation
107
+ sig { returns(T.nilable(String)) }
101
108
  attr_reader :phone
102
109
  sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
103
110
  attr_reader :sms_marketing_consent
@@ -137,6 +144,25 @@ module ShopifyAPI
137
144
  T.cast(result[0], T.nilable(Customer))
138
145
  end
139
146
 
147
+ sig do
148
+ params(
149
+ id: T.any(Integer, String),
150
+ session: Auth::Session
151
+ ).returns(T.untyped)
152
+ end
153
+ def delete(
154
+ id:,
155
+ session: ShopifyAPI::Context.active_session
156
+ )
157
+ request(
158
+ http_method: :delete,
159
+ operation: :delete,
160
+ session: session,
161
+ ids: {id: id},
162
+ params: {},
163
+ )
164
+ end
165
+
140
166
  sig do
141
167
  params(
142
168
  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
  )