shopify-cli 2.15.5 → 2.15.6
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/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/shopify_cli/services/app/serve/serve_service.rb +1 -1
- data/lib/shopify_cli/tasks/update_dashboard_urls.rb +20 -6
- data/lib/shopify_cli/theme/dev_server/local_assets.rb +1 -1
- data/lib/shopify_cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 756d40b258dafcaa9e3fd02305cbc3eb4bc1416b5711f22543c9b6221c4bd888
|
4
|
+
data.tar.gz: 476eea5325f671f2e3a1337700356f895792c1e4b2568dc56e38c58b4d1e93d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11bee20d53a3809978a2cf37a7f4ed3e759f0edd7d53ac8ec9e08dad76c1bd3ed8fcbf66262dc686d7bf929fec256685189facaf1255c2f51c2f566757b7ae29
|
7
|
+
data.tar.gz: 8cb0d2cb3d2edf801f752b74ed8534816180e257d3a1afef8fb0b13ffa5a3a85388bd6bb71df04d0c42bf450cedd1008e473f36cf48722435eea912645dcb1e9
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
|
|
2
2
|
|
3
3
|
## [Unreleased]
|
4
4
|
|
5
|
+
## Version 2.15.6 - 2022-04-12
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
* [#2246](https://github.com/Shopify/shopify-cli/pull/2246): Fix callback urls for app serve
|
9
|
+
|
5
10
|
## Version 2.15.5 - 2022-04-08
|
6
11
|
|
7
12
|
### Fixed
|
data/Gemfile.lock
CHANGED
@@ -1,18 +1,21 @@
|
|
1
|
+
require "set"
|
2
|
+
|
1
3
|
module ShopifyCLI
|
2
4
|
module Tasks
|
3
5
|
class UpdateDashboardURLS < ShopifyCLI::Task
|
4
6
|
NGROK_REGEX = /https:\/\/([a-z0-9\-]+\.ngrok\.io)(.*)/
|
5
7
|
|
6
|
-
def call(ctx, url:,
|
8
|
+
def call(ctx, url:, callback_urls:)
|
7
9
|
@ctx = ctx
|
8
10
|
project = ShopifyCLI::Project.current
|
9
11
|
api_key = project.env.api_key
|
10
12
|
result = ShopifyCLI::PartnersAPI.query(ctx, "get_app_urls", apiKey: api_key)
|
11
13
|
app = result["data"]["app"]
|
12
14
|
|
13
|
-
|
15
|
+
constructed_urls = construct_redirect_urls(app["redirectUrlWhitelist"], url, callback_urls)
|
16
|
+
|
17
|
+
return if already_updated(app, constructed_urls, url)
|
14
18
|
|
15
|
-
constructed_urls = construct_redirect_urls(app["redirectUrlWhitelist"], url, callback_url)
|
16
19
|
ShopifyCLI::PartnersAPI.query(@ctx, "update_dashboard_urls", input: {
|
17
20
|
applicationUrl: url,
|
18
21
|
redirectUrlWhitelist: constructed_urls,
|
@@ -25,7 +28,7 @@ module ShopifyCLI
|
|
25
28
|
raise
|
26
29
|
end
|
27
30
|
|
28
|
-
def construct_redirect_urls(urls, new_url,
|
31
|
+
def construct_redirect_urls(urls, new_url, callback_urls)
|
29
32
|
new_urls = urls.map do |url|
|
30
33
|
if (match = url.match(NGROK_REGEX))
|
31
34
|
"#{new_url}#{match[2]}"
|
@@ -33,11 +36,22 @@ module ShopifyCLI
|
|
33
36
|
url
|
34
37
|
end
|
35
38
|
end
|
36
|
-
|
37
|
-
new_urls.
|
39
|
+
callback_urls.each do |callback_url|
|
40
|
+
if new_urls.grep(/#{new_url}#{callback_url}/).empty?
|
41
|
+
new_urls.push("#{new_url}#{callback_url}")
|
42
|
+
end
|
38
43
|
end
|
39
44
|
new_urls.uniq
|
40
45
|
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def already_updated(app, new_redirect_urls, new_url)
|
50
|
+
current_url = app["applicationUrl"]
|
51
|
+
current_redirect_urls = app["redirectUrlWhitelist"]
|
52
|
+
current_url.match(new_url) &&
|
53
|
+
Set.new(current_redirect_urls) == Set.new(new_redirect_urls)
|
54
|
+
end
|
41
55
|
end
|
42
56
|
end
|
43
57
|
end
|
data/lib/shopify_cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.15.
|
4
|
+
version: 2.15.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|