app_manager 1.3.9 → 1.4.1
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/Gemfile.lock +59 -67
- data/app/controllers/app_manager/charges_controller.rb +16 -4
- data/lib/app_manager/config.rb +6 -0
- data/lib/app_manager/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: 8c08b2b7330d0590d3de81bd25db16817ddca044984dd3761be00d073ff92b85
|
|
4
|
+
data.tar.gz: eea3b459b131b5da995ed2b067fae91fe2499b03f14f4cf3f286d856986ee868
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d5092dd2ccab3b389eda6f93bb826c66a41f8a6508e8a926d9ebc018b073cf732cbd7b400eb7fde0a6b30bce632651891d93207a2cbdb52c35965ae3ce443d5
|
|
7
|
+
data.tar.gz: d6d93a43535968f4135a8704988b09091b5e2880a534dcb4f8b171a71388d564a782d1911139528782ad0ef536920f1a8be295adef77522105e5f5e3aff1a2cd
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
app_manager (1.
|
|
4
|
+
app_manager (1.4.1)
|
|
5
5
|
activerecord-import (~> 1.4)
|
|
6
6
|
httparty
|
|
7
7
|
kaminari (>= 0.16.3)
|
|
@@ -10,69 +10,69 @@ PATH
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
|
-
actioncable (7.0.
|
|
14
|
-
actionpack (= 7.0.
|
|
15
|
-
activesupport (= 7.0.
|
|
13
|
+
actioncable (7.0.4)
|
|
14
|
+
actionpack (= 7.0.4)
|
|
15
|
+
activesupport (= 7.0.4)
|
|
16
16
|
nio4r (~> 2.0)
|
|
17
17
|
websocket-driver (>= 0.6.1)
|
|
18
|
-
actionmailbox (7.0.
|
|
19
|
-
actionpack (= 7.0.
|
|
20
|
-
activejob (= 7.0.
|
|
21
|
-
activerecord (= 7.0.
|
|
22
|
-
activestorage (= 7.0.
|
|
23
|
-
activesupport (= 7.0.
|
|
18
|
+
actionmailbox (7.0.4)
|
|
19
|
+
actionpack (= 7.0.4)
|
|
20
|
+
activejob (= 7.0.4)
|
|
21
|
+
activerecord (= 7.0.4)
|
|
22
|
+
activestorage (= 7.0.4)
|
|
23
|
+
activesupport (= 7.0.4)
|
|
24
24
|
mail (>= 2.7.1)
|
|
25
25
|
net-imap
|
|
26
26
|
net-pop
|
|
27
27
|
net-smtp
|
|
28
|
-
actionmailer (7.0.
|
|
29
|
-
actionpack (= 7.0.
|
|
30
|
-
actionview (= 7.0.
|
|
31
|
-
activejob (= 7.0.
|
|
32
|
-
activesupport (= 7.0.
|
|
28
|
+
actionmailer (7.0.4)
|
|
29
|
+
actionpack (= 7.0.4)
|
|
30
|
+
actionview (= 7.0.4)
|
|
31
|
+
activejob (= 7.0.4)
|
|
32
|
+
activesupport (= 7.0.4)
|
|
33
33
|
mail (~> 2.5, >= 2.5.4)
|
|
34
34
|
net-imap
|
|
35
35
|
net-pop
|
|
36
36
|
net-smtp
|
|
37
37
|
rails-dom-testing (~> 2.0)
|
|
38
|
-
actionpack (7.0.
|
|
39
|
-
actionview (= 7.0.
|
|
40
|
-
activesupport (= 7.0.
|
|
38
|
+
actionpack (7.0.4)
|
|
39
|
+
actionview (= 7.0.4)
|
|
40
|
+
activesupport (= 7.0.4)
|
|
41
41
|
rack (~> 2.0, >= 2.2.0)
|
|
42
42
|
rack-test (>= 0.6.3)
|
|
43
43
|
rails-dom-testing (~> 2.0)
|
|
44
44
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
45
|
-
actiontext (7.0.
|
|
46
|
-
actionpack (= 7.0.
|
|
47
|
-
activerecord (= 7.0.
|
|
48
|
-
activestorage (= 7.0.
|
|
49
|
-
activesupport (= 7.0.
|
|
45
|
+
actiontext (7.0.4)
|
|
46
|
+
actionpack (= 7.0.4)
|
|
47
|
+
activerecord (= 7.0.4)
|
|
48
|
+
activestorage (= 7.0.4)
|
|
49
|
+
activesupport (= 7.0.4)
|
|
50
50
|
globalid (>= 0.6.0)
|
|
51
51
|
nokogiri (>= 1.8.5)
|
|
52
|
-
actionview (7.0.
|
|
53
|
-
activesupport (= 7.0.
|
|
52
|
+
actionview (7.0.4)
|
|
53
|
+
activesupport (= 7.0.4)
|
|
54
54
|
builder (~> 3.1)
|
|
55
55
|
erubi (~> 1.4)
|
|
56
56
|
rails-dom-testing (~> 2.0)
|
|
57
57
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
58
|
-
activejob (7.0.
|
|
59
|
-
activesupport (= 7.0.
|
|
58
|
+
activejob (7.0.4)
|
|
59
|
+
activesupport (= 7.0.4)
|
|
60
60
|
globalid (>= 0.3.6)
|
|
61
|
-
activemodel (7.0.
|
|
62
|
-
activesupport (= 7.0.
|
|
63
|
-
activerecord (7.0.
|
|
64
|
-
activemodel (= 7.0.
|
|
65
|
-
activesupport (= 7.0.
|
|
61
|
+
activemodel (7.0.4)
|
|
62
|
+
activesupport (= 7.0.4)
|
|
63
|
+
activerecord (7.0.4)
|
|
64
|
+
activemodel (= 7.0.4)
|
|
65
|
+
activesupport (= 7.0.4)
|
|
66
66
|
activerecord-import (1.4.0)
|
|
67
67
|
activerecord (>= 4.2)
|
|
68
|
-
activestorage (7.0.
|
|
69
|
-
actionpack (= 7.0.
|
|
70
|
-
activejob (= 7.0.
|
|
71
|
-
activerecord (= 7.0.
|
|
72
|
-
activesupport (= 7.0.
|
|
68
|
+
activestorage (7.0.4)
|
|
69
|
+
actionpack (= 7.0.4)
|
|
70
|
+
activejob (= 7.0.4)
|
|
71
|
+
activerecord (= 7.0.4)
|
|
72
|
+
activesupport (= 7.0.4)
|
|
73
73
|
marcel (~> 1.0)
|
|
74
74
|
mini_mime (>= 1.1.0)
|
|
75
|
-
activesupport (7.0.
|
|
75
|
+
activesupport (7.0.4)
|
|
76
76
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
77
77
|
i18n (>= 1.6, < 2)
|
|
78
78
|
minitest (>= 5.1)
|
|
@@ -86,7 +86,6 @@ GEM
|
|
|
86
86
|
rexml
|
|
87
87
|
crass (1.0.6)
|
|
88
88
|
diff-lcs (1.5.0)
|
|
89
|
-
digest (3.1.0)
|
|
90
89
|
dotenv (2.1.2)
|
|
91
90
|
erubi (1.11.0)
|
|
92
91
|
globalid (1.0.0)
|
|
@@ -109,7 +108,7 @@ GEM
|
|
|
109
108
|
activerecord
|
|
110
109
|
kaminari-core (= 1.2.2)
|
|
111
110
|
kaminari-core (1.2.2)
|
|
112
|
-
loofah (2.
|
|
111
|
+
loofah (2.19.0)
|
|
113
112
|
crass (~> 1.0.2)
|
|
114
113
|
nokogiri (>= 1.5.9)
|
|
115
114
|
mail (2.7.1)
|
|
@@ -123,20 +122,14 @@ GEM
|
|
|
123
122
|
mini_portile2 (2.8.0)
|
|
124
123
|
minitest (5.16.3)
|
|
125
124
|
multi_xml (0.6.0)
|
|
126
|
-
net-imap (0.
|
|
127
|
-
digest
|
|
125
|
+
net-imap (0.3.1)
|
|
128
126
|
net-protocol
|
|
129
|
-
|
|
130
|
-
net-pop (0.1.1)
|
|
131
|
-
digest
|
|
127
|
+
net-pop (0.1.2)
|
|
132
128
|
net-protocol
|
|
133
|
-
timeout
|
|
134
129
|
net-protocol (0.1.3)
|
|
135
130
|
timeout
|
|
136
|
-
net-smtp (0.3.
|
|
137
|
-
digest
|
|
131
|
+
net-smtp (0.3.2)
|
|
138
132
|
net-protocol
|
|
139
|
-
timeout
|
|
140
133
|
nio4r (2.5.8)
|
|
141
134
|
nokogiri (1.13.8)
|
|
142
135
|
mini_portile2 (~> 2.8.0)
|
|
@@ -149,28 +142,28 @@ GEM
|
|
|
149
142
|
rack (2.2.4)
|
|
150
143
|
rack-test (2.0.2)
|
|
151
144
|
rack (>= 1.3)
|
|
152
|
-
rails (7.0.
|
|
153
|
-
actioncable (= 7.0.
|
|
154
|
-
actionmailbox (= 7.0.
|
|
155
|
-
actionmailer (= 7.0.
|
|
156
|
-
actionpack (= 7.0.
|
|
157
|
-
actiontext (= 7.0.
|
|
158
|
-
actionview (= 7.0.
|
|
159
|
-
activejob (= 7.0.
|
|
160
|
-
activemodel (= 7.0.
|
|
161
|
-
activerecord (= 7.0.
|
|
162
|
-
activestorage (= 7.0.
|
|
163
|
-
activesupport (= 7.0.
|
|
145
|
+
rails (7.0.4)
|
|
146
|
+
actioncable (= 7.0.4)
|
|
147
|
+
actionmailbox (= 7.0.4)
|
|
148
|
+
actionmailer (= 7.0.4)
|
|
149
|
+
actionpack (= 7.0.4)
|
|
150
|
+
actiontext (= 7.0.4)
|
|
151
|
+
actionview (= 7.0.4)
|
|
152
|
+
activejob (= 7.0.4)
|
|
153
|
+
activemodel (= 7.0.4)
|
|
154
|
+
activerecord (= 7.0.4)
|
|
155
|
+
activestorage (= 7.0.4)
|
|
156
|
+
activesupport (= 7.0.4)
|
|
164
157
|
bundler (>= 1.15.0)
|
|
165
|
-
railties (= 7.0.
|
|
158
|
+
railties (= 7.0.4)
|
|
166
159
|
rails-dom-testing (2.0.3)
|
|
167
160
|
activesupport (>= 4.2.0)
|
|
168
161
|
nokogiri (>= 1.6)
|
|
169
162
|
rails-html-sanitizer (1.4.3)
|
|
170
163
|
loofah (~> 2.3)
|
|
171
|
-
railties (7.0.
|
|
172
|
-
actionpack (= 7.0.
|
|
173
|
-
activesupport (= 7.0.
|
|
164
|
+
railties (7.0.4)
|
|
165
|
+
actionpack (= 7.0.4)
|
|
166
|
+
activesupport (= 7.0.4)
|
|
174
167
|
method_source
|
|
175
168
|
rake (>= 12.2)
|
|
176
169
|
thor (~> 1.0)
|
|
@@ -192,7 +185,6 @@ GEM
|
|
|
192
185
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
193
186
|
rspec-support (~> 3.11.0)
|
|
194
187
|
rspec-support (3.11.0)
|
|
195
|
-
strscan (3.0.4)
|
|
196
188
|
thor (1.2.1)
|
|
197
189
|
timeout (0.3.0)
|
|
198
190
|
tzinfo (2.0.5)
|
|
@@ -204,7 +196,7 @@ GEM
|
|
|
204
196
|
websocket-driver (0.7.5)
|
|
205
197
|
websocket-extensions (>= 0.1.0)
|
|
206
198
|
websocket-extensions (0.1.5)
|
|
207
|
-
zeitwerk (2.6.
|
|
199
|
+
zeitwerk (2.6.1)
|
|
208
200
|
|
|
209
201
|
PLATFORMS
|
|
210
202
|
ruby
|
|
@@ -62,10 +62,10 @@ module AppManager
|
|
|
62
62
|
redirect_charge = data["data"]["appSubscriptionCreate"]["confirmationUrl"]
|
|
63
63
|
render json: {'redirect_url' => redirect_charge}
|
|
64
64
|
else
|
|
65
|
-
raise Error, "#{data
|
|
65
|
+
raise Error, "#{data.inspect}"
|
|
66
66
|
end
|
|
67
67
|
else
|
|
68
|
-
raise Error, "#{data
|
|
68
|
+
raise Error, "#{data.inspect}"
|
|
69
69
|
end
|
|
70
70
|
else
|
|
71
71
|
raise ModelNotFound, "Shop not found"
|
|
@@ -136,7 +136,11 @@ module AppManager
|
|
|
136
136
|
end
|
|
137
137
|
embed_host = Base64.encode64(params[:shop] + "/admin")
|
|
138
138
|
# redirect_to "/login?host=#{embed_host}&shop=#{shop}" and return
|
|
139
|
-
|
|
139
|
+
if app_slug.present?
|
|
140
|
+
redirect_to "https://#{params[:shop]}/admin/apps/#{app_slug}"
|
|
141
|
+
else
|
|
142
|
+
redirect_to "#{app_url}?host=#{embed_host}&shop=#{params[:shop]}", :status => 301 and return
|
|
143
|
+
end
|
|
140
144
|
else
|
|
141
145
|
raise Error, "Invalid shopify charge #{charges.insect}"
|
|
142
146
|
end
|
|
@@ -146,7 +150,11 @@ module AppManager
|
|
|
146
150
|
else
|
|
147
151
|
if params[:shop].present?
|
|
148
152
|
embed_host = Base64.encode64(params[:shop] + "/admin")
|
|
149
|
-
|
|
153
|
+
if app_slug.present?
|
|
154
|
+
redirect_to "https://#{params[:shop]}/admin/apps/#{app_slug}"
|
|
155
|
+
else
|
|
156
|
+
redirect_to "#{app_url}?host=#{embed_host}&shop=#{params[:shop]}", :status => 301 and return
|
|
157
|
+
end
|
|
150
158
|
else
|
|
151
159
|
raise Error, "Invalid params, must have charge_id,shop && plan in charge controller"
|
|
152
160
|
end
|
|
@@ -185,6 +193,10 @@ module AppManager
|
|
|
185
193
|
AppManager.configuration.app_url
|
|
186
194
|
end
|
|
187
195
|
|
|
196
|
+
def app_slug
|
|
197
|
+
AppManager.configuration.shopify_app_slug
|
|
198
|
+
end
|
|
199
|
+
|
|
188
200
|
def config_trial_days
|
|
189
201
|
@field_names = AppManager.configuration.field_names
|
|
190
202
|
if !@field_names.nil? && @field_names.has_key?('total_trial_days') && !@field_names['total_trial_days'].nil? && !@field_names['total_trial_days'].blank?
|
data/lib/app_manager/config.rb
CHANGED
|
@@ -13,6 +13,7 @@ module AppManager
|
|
|
13
13
|
attr_accessor :plan_id_or_name_field
|
|
14
14
|
attr_accessor :field_names
|
|
15
15
|
attr_accessor :refresh_by_request_params
|
|
16
|
+
attr_accessor :shopify_app_slug
|
|
16
17
|
|
|
17
18
|
def initialize
|
|
18
19
|
@refresh_by_request_params = true
|
|
@@ -24,6 +25,7 @@ module AppManager
|
|
|
24
25
|
@shopify_table_name = 'shops'
|
|
25
26
|
@shopify_domain_field = 'shopify_domain'
|
|
26
27
|
@plan_id_or_name_field = nil
|
|
28
|
+
@shopify_app_slug = nil
|
|
27
29
|
@field_names = {
|
|
28
30
|
'name' => 'shopify_domain', # sample example: demo-chirag-parmar.myshopify.com
|
|
29
31
|
'shopify_email' => 'email', # chirag.p@hulkapps.com
|
|
@@ -82,5 +84,9 @@ module AppManager
|
|
|
82
84
|
@refresh_by_request_params
|
|
83
85
|
end
|
|
84
86
|
|
|
87
|
+
def shopify_app_slug
|
|
88
|
+
@shopify_app_slug
|
|
89
|
+
end
|
|
90
|
+
|
|
85
91
|
end
|
|
86
92
|
end
|
data/lib/app_manager/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: app_manager
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hulkapps
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-10-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|