shopify_api 10.1.0 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +0 -1
- data/.github/workflows/cla.yml +22 -0
- data/.rubocop.yml +1 -1
- data/BREAKING_CHANGES_FOR_OLDER_VERSIONS.md +110 -0
- data/CHANGELOG.md +63 -49
- data/Gemfile.lock +26 -21
- data/README.md +5 -108
- data/RELEASING.md +2 -1
- data/docs/usage/graphql.md +1 -1
- data/lib/shopify_api/admin_versions.rb +2 -3
- data/lib/shopify_api/auth/file_session_storage.rb +2 -0
- data/lib/shopify_api/auth/jwt_payload.rb +16 -5
- data/lib/shopify_api/auth/session.rb +6 -6
- data/lib/shopify_api/auth.rb +26 -0
- data/lib/shopify_api/context.rb +6 -2
- data/lib/shopify_api/errors/missing_required_argument_error.rb +9 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/abandoned_checkout.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/access_scope.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/android_pay_key.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/apple_pay_certificate.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/application_charge.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/application_credit.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/article.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/asset.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/assigned_fulfillment_order.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/balance.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/blog.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/cancellation_request.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/carrier_service.rb +0 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/checkout.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collect.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collection.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collection_listing.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/comment.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/country.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/currency.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/custom_collection.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer.rb +12 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer_address.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer_saved_search.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/deprecated_api_call.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/discount_code.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/dispute.rb +0 -0
- data/lib/shopify_api/rest/resources/2022_07/dispute_evidence.rb +117 -0
- data/lib/shopify_api/rest/resources/2022_07/dispute_file_upload.rb +81 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/draft_order.rb +6 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/event.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment.rb +5 -49
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_event.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_order.rb +83 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_request.rb +5 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_service.rb +3 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/gift_card.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/gift_card_adjustment.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/image.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/inventory_item.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/inventory_level.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/location.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/locations_for_move.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/marketing_event.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/metafield.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/mobile_platform_application.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/order.rb +3 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/order_risk.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/page.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment_gateway.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment_transaction.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payout.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/policy.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/price_rule.rb +3 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product_listing.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product_resource_feedback.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/province.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/recurring_application_charge.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/redirect.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/refund.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/report.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/resource_feedback.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/script_tag.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/shipping_zone.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/shop.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/smart_collection.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/storefront_access_token.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/tender_transaction.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/theme.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/transaction.rb +3 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/usage_charge.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/user.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/variant.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/webhook.rb +0 -0
- data/lib/shopify_api/utils/hmac_validator.rb +16 -6
- data/lib/shopify_api/version.rb +1 -1
- data/lib/shopify_api/webhooks/request.rb +1 -1
- data/sorbet/rbi/todo.rbi +0 -1
- metadata +83 -78
- data/.github/probots.yml +0 -2
data/RELEASING.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Releasing ShopifyAPI
|
|
2
2
|
|
|
3
|
-
1. Before releasing, make sure `sorbet` and
|
|
3
|
+
1. Before releasing, make sure `sorbet` and related gems are up to date:
|
|
4
|
+
`bundle update sorbet sorbet-runtime sorbet-static tapioca --conservative`
|
|
4
5
|
1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
|
|
5
6
|
1. Update the version of ShopifyAPI in lib/shopify_api/version.rb
|
|
6
7
|
1. Run `bundle`
|
data/docs/usage/graphql.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Make a GraphQL API call
|
|
2
2
|
|
|
3
|
-
Once you have a [session](
|
|
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,14 +5,13 @@ module ShopifyAPI
|
|
|
5
5
|
module AdminVersions
|
|
6
6
|
SUPPORTED_ADMIN_VERSIONS = T.let([
|
|
7
7
|
"unstable",
|
|
8
|
+
"2022-07",
|
|
8
9
|
"2022-04",
|
|
9
10
|
"2022-01",
|
|
10
11
|
"2021-10",
|
|
11
|
-
"2021-07",
|
|
12
|
-
"2021-04",
|
|
13
12
|
], T::Array[String])
|
|
14
13
|
|
|
15
|
-
LATEST_SUPPORTED_ADMIN_VERSION = T.let("2022-
|
|
14
|
+
LATEST_SUPPORTED_ADMIN_VERSION = T.let("2022-07", String)
|
|
16
15
|
end
|
|
17
16
|
|
|
18
17
|
SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS
|
|
@@ -16,11 +16,12 @@ module ShopifyAPI
|
|
|
16
16
|
|
|
17
17
|
sig { params(token: String).void }
|
|
18
18
|
def initialize(token)
|
|
19
|
-
begin
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
payload_hash = begin
|
|
20
|
+
decode_token(token, Context.api_secret_key)
|
|
21
|
+
rescue ShopifyAPI::Errors::InvalidJwtTokenError
|
|
22
|
+
raise unless Context.old_api_secret_key
|
|
23
|
+
|
|
24
|
+
decode_token(token, T.must(Context.old_api_secret_key))
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
@iss = T.let(payload_hash["iss"], String)
|
|
@@ -67,6 +68,16 @@ module ShopifyAPI
|
|
|
67
68
|
jti == other.jti &&
|
|
68
69
|
sid == other.sid
|
|
69
70
|
end
|
|
71
|
+
|
|
72
|
+
private
|
|
73
|
+
|
|
74
|
+
sig { params(token: String, api_secret_key: String).returns(T::Hash[String, T.untyped]) }
|
|
75
|
+
def decode_token(token, api_secret_key)
|
|
76
|
+
JWT.decode(token, api_secret_key, true,
|
|
77
|
+
{ exp_leeway: JWT_EXPIRATION_LEEWAY, algorithm: "HS256" })[0]
|
|
78
|
+
rescue
|
|
79
|
+
raise ShopifyAPI::Errors::InvalidJwtTokenError, "Failed to parse session token '#{token}'"
|
|
80
|
+
end
|
|
70
81
|
end
|
|
71
82
|
end
|
|
72
83
|
end
|
|
@@ -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
|
-
|
|
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
|
data/lib/shopify_api/context.rb
CHANGED
|
@@ -18,6 +18,7 @@ module ShopifyAPI
|
|
|
18
18
|
@notified_missing_resources_folder = T.let({}, T::Hash[String, T::Boolean])
|
|
19
19
|
@active_session = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
|
20
20
|
@user_agent_prefix = T.let(nil, T.nilable(String))
|
|
21
|
+
@old_api_secret_key = T.let(nil, T.nilable(String))
|
|
21
22
|
|
|
22
23
|
@rest_resource_loader = T.let(nil, T.nilable(Zeitwerk::Loader))
|
|
23
24
|
|
|
@@ -37,6 +38,7 @@ module ShopifyAPI
|
|
|
37
38
|
logger: Logger,
|
|
38
39
|
private_shop: T.nilable(String),
|
|
39
40
|
user_agent_prefix: T.nilable(String),
|
|
41
|
+
old_api_secret_key: T.nilable(String),
|
|
40
42
|
).void
|
|
41
43
|
end
|
|
42
44
|
def setup(
|
|
@@ -50,7 +52,8 @@ module ShopifyAPI
|
|
|
50
52
|
session_storage:,
|
|
51
53
|
logger: Logger.new($stdout),
|
|
52
54
|
private_shop: nil,
|
|
53
|
-
user_agent_prefix: nil
|
|
55
|
+
user_agent_prefix: nil,
|
|
56
|
+
old_api_secret_key: nil
|
|
54
57
|
)
|
|
55
58
|
unless ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS.include?(api_version)
|
|
56
59
|
raise Errors::UnsupportedVersionError,
|
|
@@ -68,6 +71,7 @@ module ShopifyAPI
|
|
|
68
71
|
@logger = logger
|
|
69
72
|
@private_shop = private_shop
|
|
70
73
|
@user_agent_prefix = user_agent_prefix
|
|
74
|
+
@old_api_secret_key = old_api_secret_key
|
|
71
75
|
|
|
72
76
|
load_rest_resources(api_version: api_version)
|
|
73
77
|
end
|
|
@@ -118,7 +122,7 @@ module ShopifyAPI
|
|
|
118
122
|
end
|
|
119
123
|
|
|
120
124
|
sig { returns(T.nilable(String)) }
|
|
121
|
-
attr_reader :private_shop, :user_agent_prefix
|
|
125
|
+
attr_reader :private_shop, :user_agent_prefix, :old_api_secret_key
|
|
122
126
|
|
|
123
127
|
sig { returns(T::Boolean) }
|
|
124
128
|
def embedded?
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -20,7 +20,6 @@ module ShopifyAPI
|
|
|
20
20
|
@admin_graphql_api_id = T.let(nil, T.nilable(String))
|
|
21
21
|
@callback_url = T.let(nil, T.nilable(String))
|
|
22
22
|
@carrier_service_type = T.let(nil, T.nilable(String))
|
|
23
|
-
@format = T.let(nil, T.nilable(String))
|
|
24
23
|
@id = T.let(nil, T.nilable(Integer))
|
|
25
24
|
@name = T.let(nil, T.nilable(String))
|
|
26
25
|
@service_discovery = T.let(nil, T.nilable(T::Boolean))
|
|
@@ -44,8 +43,6 @@ module ShopifyAPI
|
|
|
44
43
|
attr_reader :callback_url
|
|
45
44
|
sig { returns(T.nilable(String)) }
|
|
46
45
|
attr_reader :carrier_service_type
|
|
47
|
-
sig { returns(T.nilable(String)) }
|
|
48
|
-
attr_reader :format
|
|
49
46
|
sig { returns(T.nilable(Integer)) }
|
|
50
47
|
attr_reader :id
|
|
51
48
|
sig { returns(T.nilable(String)) }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -23,6 +23,7 @@ module ShopifyAPI
|
|
|
23
23
|
@currency = T.let(nil, T.nilable(String))
|
|
24
24
|
@default_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
25
25
|
@email = T.let(nil, T.nilable(String))
|
|
26
|
+
@email_marketing_consent = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
26
27
|
@first_name = T.let(nil, T.nilable(String))
|
|
27
28
|
@id = T.let(nil, T.nilable(Integer))
|
|
28
29
|
@last_name = T.let(nil, T.nilable(String))
|
|
@@ -33,7 +34,10 @@ module ShopifyAPI
|
|
|
33
34
|
@multipass_identifier = T.let(nil, T.nilable(String))
|
|
34
35
|
@note = T.let(nil, T.nilable(String))
|
|
35
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))
|
|
36
39
|
@phone = T.let(nil, T.nilable(String))
|
|
40
|
+
@sms_marketing_consent = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
37
41
|
@state = T.let(nil, T.nilable(String))
|
|
38
42
|
@tags = T.let(nil, T.nilable(String))
|
|
39
43
|
@tax_exempt = T.let(nil, T.nilable(T::Boolean))
|
|
@@ -73,6 +77,8 @@ module ShopifyAPI
|
|
|
73
77
|
attr_reader :default_address
|
|
74
78
|
sig { returns(T.nilable(String)) }
|
|
75
79
|
attr_reader :email
|
|
80
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
|
81
|
+
attr_reader :email_marketing_consent
|
|
76
82
|
sig { returns(T.nilable(String)) }
|
|
77
83
|
attr_reader :first_name
|
|
78
84
|
sig { returns(T.nilable(Integer)) }
|
|
@@ -94,7 +100,13 @@ module ShopifyAPI
|
|
|
94
100
|
sig { returns(T.nilable(Integer)) }
|
|
95
101
|
attr_reader :orders_count
|
|
96
102
|
sig { returns(T.nilable(String)) }
|
|
103
|
+
attr_reader :password
|
|
104
|
+
sig { returns(T.nilable(String)) }
|
|
105
|
+
attr_reader :password_confirmation
|
|
106
|
+
sig { returns(T.nilable(String)) }
|
|
97
107
|
attr_reader :phone
|
|
108
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
|
109
|
+
attr_reader :sms_marketing_consent
|
|
98
110
|
sig { returns(T.nilable(String)) }
|
|
99
111
|
attr_reader :state
|
|
100
112
|
sig { returns(T.nilable(String)) }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# typed: false
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
########################################################################################################################
|
|
5
|
+
# This file is auto-generated. If you have an issue, please create a GitHub issue. #
|
|
6
|
+
########################################################################################################################
|
|
7
|
+
|
|
8
|
+
module ShopifyAPI
|
|
9
|
+
class DisputeEvidence < ShopifyAPI::Rest::Base
|
|
10
|
+
extend T::Sig
|
|
11
|
+
|
|
12
|
+
@prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
|
13
|
+
@next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
|
14
|
+
|
|
15
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
|
|
16
|
+
def initialize(session: ShopifyAPI::Context.active_session)
|
|
17
|
+
super(session: session)
|
|
18
|
+
|
|
19
|
+
@access_activity_log = T.let(nil, T.nilable(String))
|
|
20
|
+
@billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
21
|
+
@cancellation_policy_disclosure = T.let(nil, T.nilable(String))
|
|
22
|
+
@cancellation_rebuttal = T.let(nil, T.nilable(String))
|
|
23
|
+
@created_at = T.let(nil, T.nilable(String))
|
|
24
|
+
@customer_email_address = T.let(nil, T.nilable(String))
|
|
25
|
+
@customer_first_name = T.let(nil, T.nilable(String))
|
|
26
|
+
@customer_last_name = T.let(nil, T.nilable(String))
|
|
27
|
+
@dispute_evidence_files = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
28
|
+
@fulfillments = T.let(nil, T.nilable(T::Array[T.untyped]))
|
|
29
|
+
@id = T.let(nil, T.nilable(Integer))
|
|
30
|
+
@payments_dispute_id = T.let(nil, T.nilable(Integer))
|
|
31
|
+
@product_description = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
32
|
+
@refund_policy_disclosure = T.let(nil, T.nilable(String))
|
|
33
|
+
@refund_refusal_explanation = T.let(nil, T.nilable(String))
|
|
34
|
+
@shipping_address_attributes = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
35
|
+
@submitted = T.let(nil, T.nilable(T::Boolean))
|
|
36
|
+
@uncategorized_text = T.let(nil, T.nilable(String))
|
|
37
|
+
@updated_on = T.let(nil, T.nilable(String))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
|
41
|
+
@has_many = T.let({
|
|
42
|
+
fulfillments: Fulfillment
|
|
43
|
+
}, T::Hash[Symbol, Class])
|
|
44
|
+
@paths = T.let([
|
|
45
|
+
{http_method: :get, operation: :get, ids: [:dispute_id], path: "shopify_payments/disputes/<dispute_id>/dispute_evidences.json"},
|
|
46
|
+
{http_method: :put, operation: :put, ids: [:dispute_id], path: "shopify_payments/disputes/<dispute_id>/dispute_evidences.json"}
|
|
47
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
|
48
|
+
|
|
49
|
+
sig { returns(T.nilable(String)) }
|
|
50
|
+
attr_reader :access_activity_log
|
|
51
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
|
52
|
+
attr_reader :billing_address
|
|
53
|
+
sig { returns(T.nilable(String)) }
|
|
54
|
+
attr_reader :cancellation_policy_disclosure
|
|
55
|
+
sig { returns(T.nilable(String)) }
|
|
56
|
+
attr_reader :cancellation_rebuttal
|
|
57
|
+
sig { returns(T.nilable(String)) }
|
|
58
|
+
attr_reader :created_at
|
|
59
|
+
sig { returns(T.nilable(String)) }
|
|
60
|
+
attr_reader :customer_email_address
|
|
61
|
+
sig { returns(T.nilable(String)) }
|
|
62
|
+
attr_reader :customer_first_name
|
|
63
|
+
sig { returns(T.nilable(String)) }
|
|
64
|
+
attr_reader :customer_last_name
|
|
65
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
|
66
|
+
attr_reader :dispute_evidence_files
|
|
67
|
+
sig { returns(T.nilable(T::Array[Fulfillment])) }
|
|
68
|
+
attr_reader :fulfillments
|
|
69
|
+
sig { returns(T.nilable(Integer)) }
|
|
70
|
+
attr_reader :id
|
|
71
|
+
sig { returns(T.nilable(Integer)) }
|
|
72
|
+
attr_reader :payments_dispute_id
|
|
73
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
|
74
|
+
attr_reader :product_description
|
|
75
|
+
sig { returns(T.nilable(String)) }
|
|
76
|
+
attr_reader :refund_policy_disclosure
|
|
77
|
+
sig { returns(T.nilable(String)) }
|
|
78
|
+
attr_reader :refund_refusal_explanation
|
|
79
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
|
80
|
+
attr_reader :shipping_address_attributes
|
|
81
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
82
|
+
attr_reader :submitted
|
|
83
|
+
sig { returns(T.nilable(String)) }
|
|
84
|
+
attr_reader :uncategorized_text
|
|
85
|
+
sig { returns(T.nilable(String)) }
|
|
86
|
+
attr_reader :updated_on
|
|
87
|
+
|
|
88
|
+
class << self
|
|
89
|
+
sig do
|
|
90
|
+
returns(String)
|
|
91
|
+
end
|
|
92
|
+
def primary_key()
|
|
93
|
+
"dispute_id"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
sig do
|
|
97
|
+
params(
|
|
98
|
+
dispute_id: T.any(Integer, String),
|
|
99
|
+
session: Auth::Session
|
|
100
|
+
).returns(T.nilable(DisputeEvidence))
|
|
101
|
+
end
|
|
102
|
+
def find(
|
|
103
|
+
dispute_id:,
|
|
104
|
+
session: ShopifyAPI::Context.active_session
|
|
105
|
+
)
|
|
106
|
+
result = base_find(
|
|
107
|
+
session: session,
|
|
108
|
+
ids: {dispute_id: dispute_id},
|
|
109
|
+
params: {},
|
|
110
|
+
)
|
|
111
|
+
T.cast(result[0], T.nilable(DisputeEvidence))
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
end
|
|
117
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# typed: false
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
########################################################################################################################
|
|
5
|
+
# This file is auto-generated. If you have an issue, please create a GitHub issue. #
|
|
6
|
+
########################################################################################################################
|
|
7
|
+
|
|
8
|
+
module ShopifyAPI
|
|
9
|
+
class DisputeFileUpload < ShopifyAPI::Rest::Base
|
|
10
|
+
extend T::Sig
|
|
11
|
+
|
|
12
|
+
@prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
|
13
|
+
@next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
|
14
|
+
|
|
15
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
|
|
16
|
+
def initialize(session: ShopifyAPI::Context.active_session)
|
|
17
|
+
super(session: session)
|
|
18
|
+
|
|
19
|
+
@dispute_evidence_id = T.let(nil, T.nilable(Integer))
|
|
20
|
+
@dispute_evidence_type = T.let(nil, T.nilable(String))
|
|
21
|
+
@file_size = T.let(nil, T.nilable(Integer))
|
|
22
|
+
@file_type = T.let(nil, T.nilable(String))
|
|
23
|
+
@filename = T.let(nil, T.nilable(String))
|
|
24
|
+
@id = T.let(nil, T.nilable(Integer))
|
|
25
|
+
@original_filename = T.let(nil, T.nilable(String))
|
|
26
|
+
@shop_id = T.let(nil, T.nilable(Integer))
|
|
27
|
+
@url = T.let(nil, T.nilable(String))
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
|
31
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
|
32
|
+
@paths = T.let([
|
|
33
|
+
{http_method: :delete, operation: :delete, ids: [:dispute_id, :id], path: "shopify_payments/disputes/<dispute_id>/dispute_file_uploads/<id>.json"},
|
|
34
|
+
{http_method: :post, operation: :post, ids: [:dispute_id], path: "shopify_payments/disputes/<dispute_id>/dispute_file_uploads.json"}
|
|
35
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
|
36
|
+
|
|
37
|
+
sig { returns(T.nilable(Integer)) }
|
|
38
|
+
attr_reader :dispute_evidence_id
|
|
39
|
+
sig { returns(T.nilable(String)) }
|
|
40
|
+
attr_reader :dispute_evidence_type
|
|
41
|
+
sig { returns(T.nilable(Integer)) }
|
|
42
|
+
attr_reader :file_size
|
|
43
|
+
sig { returns(T.nilable(String)) }
|
|
44
|
+
attr_reader :file_type
|
|
45
|
+
sig { returns(T.nilable(String)) }
|
|
46
|
+
attr_reader :filename
|
|
47
|
+
sig { returns(T.nilable(Integer)) }
|
|
48
|
+
attr_reader :id
|
|
49
|
+
sig { returns(T.nilable(String)) }
|
|
50
|
+
attr_reader :original_filename
|
|
51
|
+
sig { returns(T.nilable(Integer)) }
|
|
52
|
+
attr_reader :shop_id
|
|
53
|
+
sig { returns(T.nilable(String)) }
|
|
54
|
+
attr_reader :url
|
|
55
|
+
|
|
56
|
+
class << self
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
id: T.any(Integer, String),
|
|
60
|
+
dispute_id: T.nilable(T.any(Integer, String)),
|
|
61
|
+
session: Auth::Session
|
|
62
|
+
).returns(T.untyped)
|
|
63
|
+
end
|
|
64
|
+
def delete(
|
|
65
|
+
id:,
|
|
66
|
+
dispute_id: nil,
|
|
67
|
+
session: ShopifyAPI::Context.active_session
|
|
68
|
+
)
|
|
69
|
+
request(
|
|
70
|
+
http_method: :delete,
|
|
71
|
+
operation: :delete,
|
|
72
|
+
session: session,
|
|
73
|
+
ids: {id: id, dispute_id: dispute_id},
|
|
74
|
+
params: {},
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -31,6 +31,7 @@ module ShopifyAPI
|
|
|
31
31
|
@note = T.let(nil, T.nilable(String))
|
|
32
32
|
@note_attributes = T.let(nil, T.nilable(T::Array[T.untyped]))
|
|
33
33
|
@order_id = T.let(nil, T.nilable(Integer))
|
|
34
|
+
@payment_terms = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
34
35
|
@shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
35
36
|
@shipping_line = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
36
37
|
@source_name = T.let(nil, T.nilable(String))
|
|
@@ -92,6 +93,8 @@ module ShopifyAPI
|
|
|
92
93
|
sig { returns(T.nilable(Integer)) }
|
|
93
94
|
attr_reader :order_id
|
|
94
95
|
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
|
96
|
+
attr_reader :payment_terms
|
|
97
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
|
95
98
|
attr_reader :shipping_address
|
|
96
99
|
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
|
97
100
|
attr_reader :shipping_line
|
|
@@ -245,12 +248,14 @@ module ShopifyAPI
|
|
|
245
248
|
|
|
246
249
|
sig do
|
|
247
250
|
params(
|
|
251
|
+
payment_gateway_id: T.untyped,
|
|
248
252
|
payment_pending: T.untyped,
|
|
249
253
|
body: T.untyped,
|
|
250
254
|
kwargs: T.untyped
|
|
251
255
|
).returns(T.untyped)
|
|
252
256
|
end
|
|
253
257
|
def complete(
|
|
258
|
+
payment_gateway_id: nil,
|
|
254
259
|
payment_pending: nil,
|
|
255
260
|
body: nil,
|
|
256
261
|
**kwargs
|
|
@@ -260,7 +265,7 @@ module ShopifyAPI
|
|
|
260
265
|
operation: :complete,
|
|
261
266
|
session: @session,
|
|
262
267
|
ids: {id: @id},
|
|
263
|
-
params: {payment_pending: payment_pending}.merge(kwargs).compact,
|
|
268
|
+
params: {payment_gateway_id: payment_gateway_id, payment_pending: payment_pending}.merge(kwargs).compact,
|
|
264
269
|
body: body,
|
|
265
270
|
entity: self,
|
|
266
271
|
)
|
|
File without changes
|
|
@@ -23,6 +23,7 @@ module ShopifyAPI
|
|
|
23
23
|
@name = T.let(nil, T.nilable(String))
|
|
24
24
|
@notify_customer = T.let(nil, T.nilable(T::Boolean))
|
|
25
25
|
@order_id = T.let(nil, T.nilable(Integer))
|
|
26
|
+
@origin_address = T.let(nil, T.nilable(T::Array[T.untyped]))
|
|
26
27
|
@receipt = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
27
28
|
@service = T.let(nil, T.nilable(String))
|
|
28
29
|
@shipment_status = T.let(nil, T.nilable(String))
|
|
@@ -42,13 +43,8 @@ module ShopifyAPI
|
|
|
42
43
|
{http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/fulfillments.json"},
|
|
43
44
|
{http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/fulfillments/<id>.json"},
|
|
44
45
|
{http_method: :post, operation: :cancel, ids: [:id], path: "fulfillments/<id>/cancel.json"},
|
|
45
|
-
{http_method: :post, operation: :cancel, ids: [:order_id, :id], path: "orders/<order_id>/fulfillments/<id>/cancel.json"},
|
|
46
|
-
{http_method: :post, operation: :complete, ids: [:order_id, :id], path: "orders/<order_id>/fulfillments/<id>/complete.json"},
|
|
47
|
-
{http_method: :post, operation: :open, ids: [:order_id, :id], path: "orders/<order_id>/fulfillments/<id>/open.json"},
|
|
48
46
|
{http_method: :post, operation: :post, ids: [], path: "fulfillments.json"},
|
|
49
|
-
{http_method: :post, operation: :
|
|
50
|
-
{http_method: :post, operation: :update_tracking, ids: [:id], path: "fulfillments/<id>/update_tracking.json"},
|
|
51
|
-
{http_method: :put, operation: :put, ids: [:order_id, :id], path: "orders/<order_id>/fulfillments/<id>.json"}
|
|
47
|
+
{http_method: :post, operation: :update_tracking, ids: [:id], path: "fulfillments/<id>/update_tracking.json"}
|
|
52
48
|
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
|
53
49
|
|
|
54
50
|
sig { returns(T.nilable(String)) }
|
|
@@ -65,6 +61,8 @@ module ShopifyAPI
|
|
|
65
61
|
attr_reader :notify_customer
|
|
66
62
|
sig { returns(T.nilable(Integer)) }
|
|
67
63
|
attr_reader :order_id
|
|
64
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
|
65
|
+
attr_reader :origin_address
|
|
68
66
|
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
|
69
67
|
attr_reader :receipt
|
|
70
68
|
sig { returns(T.nilable(String)) }
|
|
@@ -191,49 +189,7 @@ module ShopifyAPI
|
|
|
191
189
|
http_method: :post,
|
|
192
190
|
operation: :cancel,
|
|
193
191
|
session: @session,
|
|
194
|
-
ids: {id: @id
|
|
195
|
-
params: {}.merge(kwargs).compact,
|
|
196
|
-
body: body,
|
|
197
|
-
entity: self,
|
|
198
|
-
)
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
sig do
|
|
202
|
-
params(
|
|
203
|
-
body: T.untyped,
|
|
204
|
-
kwargs: T.untyped
|
|
205
|
-
).returns(T.untyped)
|
|
206
|
-
end
|
|
207
|
-
def complete(
|
|
208
|
-
body: nil,
|
|
209
|
-
**kwargs
|
|
210
|
-
)
|
|
211
|
-
self.class.request(
|
|
212
|
-
http_method: :post,
|
|
213
|
-
operation: :complete,
|
|
214
|
-
session: @session,
|
|
215
|
-
ids: {id: @id, order_id: @order_id},
|
|
216
|
-
params: {}.merge(kwargs).compact,
|
|
217
|
-
body: body,
|
|
218
|
-
entity: self,
|
|
219
|
-
)
|
|
220
|
-
end
|
|
221
|
-
|
|
222
|
-
sig do
|
|
223
|
-
params(
|
|
224
|
-
body: T.untyped,
|
|
225
|
-
kwargs: T.untyped
|
|
226
|
-
).returns(T.untyped)
|
|
227
|
-
end
|
|
228
|
-
def open(
|
|
229
|
-
body: nil,
|
|
230
|
-
**kwargs
|
|
231
|
-
)
|
|
232
|
-
self.class.request(
|
|
233
|
-
http_method: :post,
|
|
234
|
-
operation: :open,
|
|
235
|
-
session: @session,
|
|
236
|
-
ids: {id: @id, order_id: @order_id},
|
|
192
|
+
ids: {id: @id},
|
|
237
193
|
params: {}.merge(kwargs).compact,
|
|
238
194
|
body: body,
|
|
239
195
|
entity: self,
|
|
File without changes
|