shopify_api 12.1.0 → 12.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3c03360ffab3820b674ee42ec8cc8de1028aa852f07b9b09a1ffb111c81cf5b
4
- data.tar.gz: 727487abd59263c77bdf81dd0e3af9f23914260b54d7fb132d834d5943939202
3
+ metadata.gz: 2112fae23baafc5b3615a58d54d1c8a2b0a1bfcc4c9a9235b6d76bf80bcdff0e
4
+ data.tar.gz: 438373f5072f981e9449daac622b55101002df6139cd24e6bff0cfa5601275ce
5
5
  SHA512:
6
- metadata.gz: a4a7e438b3e0b16e5357c3dbb9f981dcb56bed718a3ea57fab5451b699427dcb651d12ac2a9f40393f6d85fcf0bf2eb737d789cd72540f38faeaed7e0fc3f0aa
7
- data.tar.gz: b67a4fc69202ee4da880052bfc5e6e76c69611b099a555ce5318763c0e691484dab4c09b6b309c90c5475605a1d16a8867ba060ec2e01526b97d25eee86acaeb
6
+ metadata.gz: 700912ad225f507b09b1aef17c8df1f139eb9b951cc7c42115c0db95dd77b3dd4698fdd164744c5312730de7ecaae70b770b4f5b3370d7913150afcab44dfb28
7
+ data.tar.gz: bfd499fc0c32a7e8fc6f523b74b77452ee7edb3581cf045982088d792cb45073846c7138b1c0035b61d1c9420b77500e1be8d2e0cbf89d1e2ff0f2d4f0ba8d90
@@ -12,12 +12,12 @@ jobs:
12
12
  steps:
13
13
  - uses: actions/stale@v5
14
14
  with:
15
- days-before-issue-stale: 90
15
+ days-before-issue-stale: 60
16
16
  days-before-issue-close: 14
17
17
  operations-per-run: 1000
18
18
  stale-issue-label: "Stale"
19
19
  stale-issue-message: >
20
- 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
+ This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
21
21
  close-issue-message: |
22
22
  We are closing this issue because it has been inactive for a few months.
23
23
  This probably means that it is not reproducible or it has been fixed in a newer version.
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## Version 12.2.0
8
+
9
+ - [#1023](https://github.com/Shopify/shopify-api-ruby/pull/1023) Allow custom scopes during the OAuth process
10
+
7
11
  ## Version 12.1.0
8
12
 
9
13
  - [#1017](https://github.com/Shopify/shopify-api-ruby/pull/1017) Add support for `http` with localhost development without using a TLS tunnel
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_api (12.1.0)
4
+ shopify_api (12.2.0)
5
5
  concurrent-ruby
6
6
  hash_diff
7
7
  httparty
@@ -38,6 +38,7 @@ GEM
38
38
  concurrent-ruby (~> 1.0)
39
39
  json (2.6.2)
40
40
  jwt (2.5.0)
41
+ language_server-protocol (3.17.0.1)
41
42
  method_source (1.0.0)
42
43
  mime-types (3.4.1)
43
44
  mime-types-data (~> 3.2015)
@@ -51,6 +52,7 @@ GEM
51
52
  parallel (1.22.1)
52
53
  parser (3.1.2.1)
53
54
  ast (~> 2.4.1)
55
+ prettier_print (0.1.0)
54
56
  pry (0.14.1)
55
57
  coderay (~> 1.1)
56
58
  method_source (~> 1.0)
@@ -80,6 +82,10 @@ GEM
80
82
  rubocop (~> 1.35)
81
83
  rubocop-sorbet (0.6.11)
82
84
  rubocop (>= 0.90.0)
85
+ ruby-lsp (0.3.2)
86
+ language_server-protocol (~> 3.17.0)
87
+ sorbet-runtime
88
+ syntax_tree (>= 3.4)
83
89
  ruby-progressbar (1.11.0)
84
90
  securerandom (0.2.0)
85
91
  sorbet (0.5.10438)
@@ -94,6 +100,8 @@ GEM
94
100
  sorbet (>= 0.5.9204)
95
101
  sorbet-runtime (>= 0.5.9204)
96
102
  thor (>= 0.19.2)
103
+ syntax_tree (3.6.1)
104
+ prettier_print
97
105
  tapioca (0.10.2)
98
106
  bundler (>= 1.17.3)
99
107
  netrc (>= 0.11.0)
@@ -136,6 +144,7 @@ DEPENDENCIES
136
144
  rubocop
137
145
  rubocop-shopify
138
146
  rubocop-sorbet
147
+ ruby-lsp
139
148
  shopify_api!
140
149
  sorbet
141
150
  tapioca
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  This library provides support for Ruby [Shopify apps](https://apps.shopify.com/) to access the [Shopify Admin API](https://shopify.dev/api/admin), by making it easier to perform the following actions:
8
8
 
9
- - Creating [online](https://shopify.dev/concepts/about-apis/authentication#online-access) or [offline](https://shopify.dev/concepts/about-apis/authentication#offline-access) access tokens for the Admin API via OAuth
9
+ - Creating [online](https://shopify.dev/apps/auth/oauth/access-modes#online-access) or [offline](https://shopify.dev/apps/auth/oauth/access-modes#offline-access) access tokens for the Admin API via OAuth
10
10
  - Making requests to the [REST API](https://shopify.dev/api/admin-rest)
11
11
  - Making requests to the [GraphQL API](https://shopify.dev/api/admin-graphql)
12
12
  - Registering/processing webhooks
@@ -5,7 +5,7 @@ The implementation of session storage that you pass in `ShopifyAPI::Context.setu
5
5
 
6
6
  ## Create a New Session Storage Class
7
7
 
8
- You can create a session storage class that includes `ShopifyAPI::Auth::SessionStore` and override the methods as shown in the table and example below:
8
+ You can create a session storage class that includes `ShopifyAPI::Auth::SessionStorage` and override the methods as shown in the table and example below:
9
9
 
10
10
  | Method Name | Input Type | Return Type |
11
11
  | ---------------------- | --------------------------------- | ------------------------------ |
@@ -16,9 +16,18 @@ module ShopifyAPI
16
16
  shop: String,
17
17
  redirect_path: String,
18
18
  is_online: T.nilable(T::Boolean),
19
+ scope_override: T.nilable(T.any(ShopifyAPI::Auth::AuthScopes, T::Array[String], String)),
19
20
  ).returns(T::Hash[Symbol, T.any(String, SessionCookie)])
20
21
  end
21
- def begin_auth(shop:, redirect_path:, is_online: true)
22
+ def begin_auth(shop:, redirect_path:, is_online: true, scope_override: nil)
23
+ scope = if scope_override.nil?
24
+ ShopifyAPI::Context.scope
25
+ elsif scope_override.is_a?(ShopifyAPI::Auth::AuthScopes)
26
+ scope_override
27
+ else
28
+ ShopifyAPI::Auth::AuthScopes.new(scope_override)
29
+ end
30
+
22
31
  unless Context.setup?
23
32
  raise Errors::ContextNotSetupError, "ShopifyAPI::Context not setup, please call ShopifyAPI::Context.setup"
24
33
  end
@@ -30,7 +39,7 @@ module ShopifyAPI
30
39
 
31
40
  query = {
32
41
  client_id: ShopifyAPI::Context.api_key,
33
- scope: ShopifyAPI::Context.scope.to_s,
42
+ scope: scope.to_s,
34
43
  redirect_uri: "#{ShopifyAPI::Context.host}#{redirect_path}",
35
44
  state: state,
36
45
  "grant_options[]": is_online ? "per-user" : "",
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module ShopifyAPI
5
- VERSION = "12.1.0"
5
+ VERSION = "12.2.0"
6
6
  end
data/shopify_api.gemspec CHANGED
@@ -47,6 +47,7 @@ Gem::Specification.new do |s|
47
47
  s.add_development_dependency("rubocop")
48
48
  s.add_development_dependency("rubocop-shopify")
49
49
  s.add_development_dependency("rubocop-sorbet")
50
+ s.add_development_dependency("ruby-lsp")
50
51
  s.add_development_dependency("sorbet")
51
52
  s.add_development_dependency("tapioca")
52
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.0
4
+ version: 12.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-13 00:00:00.000000000 Z
11
+ date: 2022-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -206,6 +206,20 @@ dependencies:
206
206
  - - ">="
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: ruby-lsp
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
209
223
  - !ruby/object:Gem::Dependency
210
224
  name: sorbet
211
225
  requirement: !ruby/object:Gem::Requirement