shopify-sinatra-app 1.0.1 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd601f8ec2bc981f54dcda8ce30a7b373e42f0b3db148d400a58f5642dfbfbcc
4
- data.tar.gz: 5a9d30b5cf9ccca7883fb4a7329cdf54bd6ee9a18d5f248137193a90bde27749
3
+ metadata.gz: 3d4212df144a7d460c275e8f7cbfea4c5a0332d5293bb4ea3c1138764748bc37
4
+ data.tar.gz: 2f637570f3210796ec09f812e1c4c58b9110db590eeb7366eb2fc58286f20c84
5
5
  SHA512:
6
- metadata.gz: 01f6a06bcd48313f281a0f59eed41d87dc71da586f095d7192667d67af8cc37ad5b6e18846a2c9bb88298b46d5f240290784edf54e3ca6ca1d69dff5932e4662
7
- data.tar.gz: 49de0b0f1982746dedab5792515a9d27dd777abb74363016db794fa92ce5a365addcb527c6e549920aee93d094e2dcdfcd2209ab5b898a32af26a2ceb1f39bd9
6
+ metadata.gz: 4cfbca73509abcf9b7b77b9e73e2ee0694f2dc280797b8f9188a2adef9acc5c266dcce5503fa3df69e1269ad8db48e1daee27e63305dd65ce0e4f73a7fd41bc6
7
+ data.tar.gz: 5d85a7eafcfced73d5d08d9a8212d764c8ae3ca06b0e05849b6074bef007c5ec3dd3b42974e0c25d0a76c3062a2bb7dbc833fce41360c5114086297420371191
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 1.1.0
2
+ -----
3
+ * update to Shopify App Bridge 3
4
+
1
5
  1.0.1
2
6
  -----
3
7
  * drop sinatra version requirement from gemspec
@@ -1,14 +1,16 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <script src="https://unpkg.com/@shopify/app-bridge"></script>
4
+ <script src="https://unpkg.com/@shopify/app-bridge@3"></script>
5
5
  <script type="text/javascript">
6
6
  var AppBridge = window['app-bridge'];
7
- var createApp = AppBridge.default;
8
7
 
9
- var app = createApp({
10
- apiKey: "<%= SinatraApp.settings.api_key %>",
11
- shopOrigin: "<%= shop_origin %>",
8
+ var host = '<%= shop_host %>';
9
+ var apiKey = '<%= SinatraApp.settings.api_key %>';
10
+
11
+ var app = AppBridge.createApp({
12
+ apiKey: apiKey,
13
+ host: host
12
14
  });
13
15
  </script>
14
16
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous">
@@ -16,8 +16,8 @@ module Sinatra
16
16
  end
17
17
 
18
18
  # for the app bridge initializer
19
- def shop_origin
20
- "#{session[:shopify][:shop]}"
19
+ def shop_host
20
+ "#{session[:shopify][:host]}"
21
21
  end
22
22
 
23
23
  def shopify_session(&blk)
@@ -135,7 +135,7 @@ module Sinatra
135
135
  app.set :public_folder, File.expand_path('public')
136
136
  app.enable :inline_templates
137
137
 
138
- app.set :protection, except: :frame_options
138
+ app.set :protection, except: :frame_options, frame_ancestors: "https://admin.shopify.com;"
139
139
 
140
140
  app.set :api_version, '2019-07'
141
141
  app.set :scope, 'read_products, read_orders'
@@ -197,6 +197,7 @@ module Sinatra
197
197
  app.get '/auth/shopify/callback' do
198
198
  shop_name = params['shop']
199
199
  token = request.env['omniauth.auth']['credentials']['token']
200
+ host = params['host']
200
201
 
201
202
  shop = Shop.find_or_initialize_by(name: shop_name)
202
203
  shop.token = token
@@ -204,6 +205,7 @@ module Sinatra
204
205
 
205
206
  session[:shopify] = {
206
207
  shop: shop_name,
208
+ host: host,
207
209
  token: token
208
210
  }
209
211
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shopify-sinatra-app'
3
- s.version = '1.0.1'
3
+ s.version = '1.1.0'
4
4
 
5
5
  s.summary = 'A classy shopify app'
6
6
  s.description = 'A Sinatra extension for building Shopify Apps. Akin to the shopify_app gem but for Sinatra'
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.files = `git ls-files`.split("\n")
14
14
  s.executables << 'shopify-sinatra-app-generator'
15
15
 
16
- s.add_runtime_dependency 'sinatra'
16
+ s.add_runtime_dependency 'sinatra', '~> 2.2.0'
17
17
  s.add_runtime_dependency 'sinatra-activerecord', '~> 2.0.9'
18
18
  s.add_runtime_dependency 'activesupport'
19
19
  s.add_runtime_dependency 'attr_encrypted', '~> 3.1.0'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-sinatra-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Hughes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-10 00:00:00.000000000 Z
11
+ date: 2022-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 2.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 2.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sinatra-activerecord
29
29
  requirement: !ruby/object:Gem::Requirement