app_manager 2.3.3 → 2.3.5

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: 10891e9099aebe402bf46438060e6cd405731e44e9fb2e11e36a4e5626ff13a2
4
- data.tar.gz: d9c572b10a0159c865e75c876501e534df067bd99662a2e9394cebc80498091f
3
+ metadata.gz: de995ea586973a3fe3cfcaee740f6474e24ffb0413a6b6da36eea2f107574736
4
+ data.tar.gz: 3009662562494e3df11b82dfc746eb99857eea841a2b2252c01e118a586a3f04
5
5
  SHA512:
6
- metadata.gz: 2feefe3f19e0a1ae5316bb9853afa2a5cc077fe7546dc82597b1394399a364ec4ea844c022aa46d05a80d8a1d6b0656bdd998668d7ddbc011b0c249fbae9d39c
7
- data.tar.gz: 70fa400868631cf7c331fdfea46f8c6f2f3956bfdd2c796166027b52fccc54ab0cb1926552ee5fe6587d3a337c860a172ed7c72315dad05951c659a9fef080d7
6
+ metadata.gz: 907e45618155d8d13f27d2311b951f59f48176675654b94552563de20546b0ff2d3ad89803b2caf8ad7e977c314e6e9d8603fe4362a1103d29d461b9a23f7f58
7
+ data.tar.gz: 7e1133af4e56aba8175ded0bb956ec51e484b6ef71b384527ded33783d791161666ce752423ab8cae8d2989d103e32b60fe4d823fba27ae457fbff6aaffeba23
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_manager (2.3.3)
4
+ app_manager (2.3.5)
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.2.1)
14
- actionpack (= 7.2.1)
15
- activesupport (= 7.2.1)
13
+ actioncable (8.0.2)
14
+ actionpack (= 8.0.2)
15
+ activesupport (= 8.0.2)
16
16
  nio4r (~> 2.0)
17
17
  websocket-driver (>= 0.6.1)
18
18
  zeitwerk (~> 2.6)
19
- actionmailbox (7.2.1)
20
- actionpack (= 7.2.1)
21
- activejob (= 7.2.1)
22
- activerecord (= 7.2.1)
23
- activestorage (= 7.2.1)
24
- activesupport (= 7.2.1)
19
+ actionmailbox (8.0.2)
20
+ actionpack (= 8.0.2)
21
+ activejob (= 8.0.2)
22
+ activerecord (= 8.0.2)
23
+ activestorage (= 8.0.2)
24
+ activesupport (= 8.0.2)
25
25
  mail (>= 2.8.0)
26
- actionmailer (7.2.1)
27
- actionpack (= 7.2.1)
28
- actionview (= 7.2.1)
29
- activejob (= 7.2.1)
30
- activesupport (= 7.2.1)
26
+ actionmailer (8.0.2)
27
+ actionpack (= 8.0.2)
28
+ actionview (= 8.0.2)
29
+ activejob (= 8.0.2)
30
+ activesupport (= 8.0.2)
31
31
  mail (>= 2.8.0)
32
32
  rails-dom-testing (~> 2.2)
33
- actionpack (7.2.1)
34
- actionview (= 7.2.1)
35
- activesupport (= 7.2.1)
33
+ actionpack (8.0.2)
34
+ actionview (= 8.0.2)
35
+ activesupport (= 8.0.2)
36
36
  nokogiri (>= 1.8.5)
37
- racc
38
- rack (>= 2.2.4, < 3.2)
37
+ rack (>= 2.2.4)
39
38
  rack-session (>= 1.0.1)
40
39
  rack-test (>= 0.6.3)
41
40
  rails-dom-testing (~> 2.2)
42
41
  rails-html-sanitizer (~> 1.6)
43
42
  useragent (~> 0.16)
44
- actiontext (7.2.1)
45
- actionpack (= 7.2.1)
46
- activerecord (= 7.2.1)
47
- activestorage (= 7.2.1)
48
- activesupport (= 7.2.1)
43
+ actiontext (8.0.2)
44
+ actionpack (= 8.0.2)
45
+ activerecord (= 8.0.2)
46
+ activestorage (= 8.0.2)
47
+ activesupport (= 8.0.2)
49
48
  globalid (>= 0.6.0)
50
49
  nokogiri (>= 1.8.5)
51
- actionview (7.2.1)
52
- activesupport (= 7.2.1)
50
+ actionview (8.0.2)
51
+ activesupport (= 8.0.2)
53
52
  builder (~> 3.1)
54
53
  erubi (~> 1.11)
55
54
  rails-dom-testing (~> 2.2)
56
55
  rails-html-sanitizer (~> 1.6)
57
- activejob (7.2.1)
58
- activesupport (= 7.2.1)
56
+ activejob (8.0.2)
57
+ activesupport (= 8.0.2)
59
58
  globalid (>= 0.3.6)
60
- activemodel (7.2.1)
61
- activesupport (= 7.2.1)
62
- activerecord (7.2.1)
63
- activemodel (= 7.2.1)
64
- activesupport (= 7.2.1)
59
+ activemodel (8.0.2)
60
+ activesupport (= 8.0.2)
61
+ activerecord (8.0.2)
62
+ activemodel (= 8.0.2)
63
+ activesupport (= 8.0.2)
65
64
  timeout (>= 0.4.0)
66
65
  activerecord-import (1.8.1)
67
66
  activerecord (>= 4.2)
68
- activestorage (7.2.1)
69
- actionpack (= 7.2.1)
70
- activejob (= 7.2.1)
71
- activerecord (= 7.2.1)
72
- activesupport (= 7.2.1)
67
+ activestorage (8.0.2)
68
+ actionpack (= 8.0.2)
69
+ activejob (= 8.0.2)
70
+ activerecord (= 8.0.2)
71
+ activesupport (= 8.0.2)
73
72
  marcel (~> 1.0)
74
- activesupport (7.2.1)
73
+ activesupport (8.0.2)
75
74
  base64
75
+ benchmark (>= 0.3)
76
76
  bigdecimal
77
77
  concurrent-ruby (~> 1.0, >= 1.3.1)
78
78
  connection_pool (>= 2.2.5)
@@ -82,34 +82,37 @@ GEM
82
82
  minitest (>= 5.1)
83
83
  securerandom (>= 0.3)
84
84
  tzinfo (~> 2.0, >= 2.0.5)
85
+ uri (>= 0.13.1)
85
86
  addressable (2.8.0)
86
87
  public_suffix (>= 2.0.2, < 5.0)
87
88
  base64 (0.2.0)
88
- bigdecimal (3.1.8)
89
+ benchmark (0.4.0)
90
+ bigdecimal (3.1.9)
89
91
  builder (3.3.0)
90
92
  coderay (1.1.3)
91
- concurrent-ruby (1.3.4)
92
- connection_pool (2.4.1)
93
+ concurrent-ruby (1.3.5)
94
+ connection_pool (2.5.3)
93
95
  crack (0.4.5)
94
96
  rexml
95
97
  crass (1.0.6)
96
- csv (3.3.0)
97
- date (3.3.4)
98
+ csv (3.3.4)
99
+ date (3.4.1)
98
100
  diff-lcs (1.5.0)
99
101
  dotenv (2.1.2)
100
102
  drb (2.2.1)
101
- erubi (1.13.0)
103
+ erubi (1.13.1)
102
104
  globalid (1.2.1)
103
105
  activesupport (>= 6.1)
104
106
  hashdiff (1.0.1)
105
- httparty (0.22.0)
107
+ httparty (0.23.1)
106
108
  csv
107
109
  mini_mime (>= 1.0.0)
108
110
  multi_xml (>= 0.5.2)
109
- i18n (1.14.6)
111
+ i18n (1.14.7)
110
112
  concurrent-ruby (~> 1.0)
111
- io-console (0.7.2)
112
- irb (1.14.0)
113
+ io-console (0.8.0)
114
+ irb (1.15.2)
115
+ pp (>= 0.6.0)
113
116
  rdoc (>= 4.0.0)
114
117
  reline (>= 0.4.2)
115
118
  kaminari (1.2.2)
@@ -124,8 +127,8 @@ GEM
124
127
  activerecord
125
128
  kaminari-core (= 1.2.2)
126
129
  kaminari-core (1.2.2)
127
- logger (1.6.1)
128
- loofah (2.22.0)
130
+ logger (1.7.0)
131
+ loofah (2.24.1)
129
132
  crass (~> 1.0.2)
130
133
  nokogiri (>= 1.12.0)
131
134
  mail (2.8.1)
@@ -136,73 +139,77 @@ GEM
136
139
  marcel (1.0.4)
137
140
  method_source (1.0.0)
138
141
  mini_mime (1.1.5)
139
- mini_portile2 (2.8.7)
140
- minitest (5.25.1)
141
- multi_xml (0.7.1)
142
+ mini_portile2 (2.8.9)
143
+ minitest (5.25.5)
144
+ multi_xml (0.7.2)
142
145
  bigdecimal (~> 3.1)
143
- net-imap (0.4.16)
146
+ net-imap (0.5.8)
144
147
  date
145
148
  net-protocol
146
149
  net-pop (0.1.2)
147
150
  net-protocol
148
151
  net-protocol (0.2.2)
149
152
  timeout
150
- net-smtp (0.5.0)
153
+ net-smtp (0.5.1)
151
154
  net-protocol
152
- nio4r (2.7.3)
153
- nokogiri (1.16.7)
155
+ nio4r (2.7.4)
156
+ nokogiri (1.18.8)
154
157
  mini_portile2 (~> 2.8.2)
155
158
  racc (~> 1.4)
156
- nokogiri (1.16.7-x86_64-linux)
159
+ nokogiri (1.18.8-x86_64-linux-gnu)
157
160
  racc (~> 1.4)
161
+ pp (0.6.2)
162
+ prettyprint
163
+ prettyprint (0.2.0)
158
164
  pry (0.14.1)
159
165
  coderay (~> 1.1)
160
166
  method_source (~> 1.0)
161
- psych (5.1.2)
167
+ psych (5.2.6)
168
+ date
162
169
  stringio
163
170
  public_suffix (4.0.6)
164
171
  racc (1.8.1)
165
- rack (3.1.7)
166
- rack-session (2.0.0)
172
+ rack (3.1.14)
173
+ rack-session (2.1.1)
174
+ base64 (>= 0.1.0)
167
175
  rack (>= 3.0.0)
168
- rack-test (2.1.0)
176
+ rack-test (2.2.0)
169
177
  rack (>= 1.3)
170
- rackup (2.1.0)
178
+ rackup (2.2.1)
171
179
  rack (>= 3)
172
- webrick (~> 1.8)
173
- rails (7.2.1)
174
- actioncable (= 7.2.1)
175
- actionmailbox (= 7.2.1)
176
- actionmailer (= 7.2.1)
177
- actionpack (= 7.2.1)
178
- actiontext (= 7.2.1)
179
- actionview (= 7.2.1)
180
- activejob (= 7.2.1)
181
- activemodel (= 7.2.1)
182
- activerecord (= 7.2.1)
183
- activestorage (= 7.2.1)
184
- activesupport (= 7.2.1)
180
+ rails (8.0.2)
181
+ actioncable (= 8.0.2)
182
+ actionmailbox (= 8.0.2)
183
+ actionmailer (= 8.0.2)
184
+ actionpack (= 8.0.2)
185
+ actiontext (= 8.0.2)
186
+ actionview (= 8.0.2)
187
+ activejob (= 8.0.2)
188
+ activemodel (= 8.0.2)
189
+ activerecord (= 8.0.2)
190
+ activestorage (= 8.0.2)
191
+ activesupport (= 8.0.2)
185
192
  bundler (>= 1.15.0)
186
- railties (= 7.2.1)
193
+ railties (= 8.0.2)
187
194
  rails-dom-testing (2.2.0)
188
195
  activesupport (>= 5.0.0)
189
196
  minitest
190
197
  nokogiri (>= 1.6)
191
- rails-html-sanitizer (1.6.0)
198
+ rails-html-sanitizer (1.6.2)
192
199
  loofah (~> 2.21)
193
- nokogiri (~> 1.14)
194
- railties (7.2.1)
195
- actionpack (= 7.2.1)
196
- activesupport (= 7.2.1)
200
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
201
+ railties (8.0.2)
202
+ actionpack (= 8.0.2)
203
+ activesupport (= 8.0.2)
197
204
  irb (~> 1.13)
198
205
  rackup (>= 1.0.0)
199
206
  rake (>= 12.2)
200
207
  thor (~> 1.0, >= 1.2.2)
201
208
  zeitwerk (~> 2.6)
202
209
  rake (13.0.6)
203
- rdoc (6.7.0)
210
+ rdoc (6.13.1)
204
211
  psych (>= 4.0.0)
205
- reline (0.5.10)
212
+ reline (0.6.1)
206
213
  io-console (~> 0.5)
207
214
  rexml (3.2.5)
208
215
  rspec (3.11.0)
@@ -220,22 +227,23 @@ GEM
220
227
  diff-lcs (>= 1.2.0, < 2.0)
221
228
  rspec-support (~> 3.11.0)
222
229
  rspec-support (3.11.0)
223
- securerandom (0.3.1)
224
- stringio (3.1.1)
230
+ securerandom (0.4.1)
231
+ stringio (3.1.7)
225
232
  thor (1.3.2)
226
- timeout (0.4.1)
233
+ timeout (0.4.3)
227
234
  tzinfo (2.0.6)
228
235
  concurrent-ruby (~> 1.0)
229
- useragent (0.16.10)
236
+ uri (1.0.3)
237
+ useragent (0.16.11)
230
238
  webmock (3.14.0)
231
239
  addressable (>= 2.8.0)
232
240
  crack (>= 0.3.2)
233
241
  hashdiff (>= 0.4.0, < 2.0.0)
234
- webrick (1.8.2)
235
- websocket-driver (0.7.6)
242
+ websocket-driver (0.7.7)
243
+ base64
236
244
  websocket-extensions (>= 0.1.0)
237
245
  websocket-extensions (0.1.5)
238
- zeitwerk (2.6.18)
246
+ zeitwerk (2.7.2)
239
247
 
240
248
  PLATFORMS
241
249
  ruby
@@ -20,7 +20,7 @@ module AppManager
20
20
  default_plan_id = nil
21
21
  choose_later = false
22
22
  trial_activated_at = nil
23
- global_plan = nil
23
+ bundle_plan = nil
24
24
  plan_obj = AppManager::Client.new
25
25
  plans = []
26
26
  if params[:shop_domain].present? && !AppManager.configuration.plan_features.nil?
@@ -33,10 +33,14 @@ module AppManager
33
33
  shopify_plan_field = AppManager.configuration.field_names['shopify_plan']
34
34
  shopify_plan = @shop[shopify_plan_field] rescue nil
35
35
  plan = plans && plans.any? && !active_plan_id_or_name.nil? ? (plans.find { |x| x["id"] == active_plan_id_or_name }.present? ? plans.find { |x| x["id"] == active_plan_id_or_name } : nil) : nil
36
- global_plan = plans&.find { |x| x["is_global"] == 1 or x["is_global"] == true }
36
+ # global_plan = plans&.find { |x| x["is_global"] == 1 or x["is_global"] == true }
37
37
  @trial_activated_field = AppManager.configuration.field_names['trial_activated_at']
38
38
  trial_activated_at = @shop[@trial_activated_field] rescue nil
39
39
  active_charge = plan_obj.get_charge(params[:shop_domain])
40
+ if (plan.nil? || plan.empty?) && (active_charge.present? && active_charge.any? && !active_charge['bundle_charge'].nil?)
41
+ global_plan_obj = AppManager::Client.new
42
+ plan = global_plan_obj.get_bundle_plan(active_plan_id_or_name)
43
+ end
40
44
  if active_charge && active_charge.any? && active_charge['active_charge'].nil? && active_charge['cancelled_charge'].nil? && !trial_activated_at && !plan
41
45
  choose_later = true
42
46
  end
@@ -74,6 +78,13 @@ module AppManager
74
78
  promotional_discount = [] if promotional_discount.class.to_s == "Hash" && promotional_discount.has_key?('status') && promotional_discount['status'] == 404
75
79
  end
76
80
 
81
+ if plan.present? && (plan["is_global"] == 1 or plan["is_global"] == true)
82
+ bundle_plan = plan
83
+ else
84
+ global_plan_obj = AppManager::Client.new
85
+ bundle_plan = global_plan_obj.get_bundle_plan
86
+ end
87
+
77
88
  bundle_obj = AppManager::Client.new
78
89
  app_bundle_data = bundle_obj.get_app_bundle_data
79
90
 
@@ -82,11 +93,12 @@ module AppManager
82
93
  'promotional_discount' => promotional_discount,
83
94
  'shopify_plan' => shopify_plan,
84
95
  'plan' => plan,
85
- 'bundle_plan' => global_plan,
96
+ 'bundle_plan' => bundle_plan,
86
97
  'bundle_details' => app_bundle_data,
87
98
  'default_plan_id' => default_plan_id,
88
99
  'choose_later' => choose_later,
89
- 'has_active_charge' => (((active_charge && active_charge.any? && !active_charge['active_charge'].nil?) or !trial_activated_at) ? true : false)
100
+ 'has_active_charge' => (((active_charge && active_charge.any? && !active_charge['active_charge'].nil?) or !trial_activated_at) ? true : false),
101
+ 'global_plan_charge' => plan.present? && plan['is_global'] && active_charge.present? && active_charge.any? && !active_charge['active_charge'].nil? && !active_charge['bundle_charge'].nil?
90
102
  }
91
103
  render json: response
92
104
  end
@@ -69,7 +69,6 @@ module AppManager
69
69
  end
70
70
 
71
71
  def response_from_cache_for_api(http_method, path, options)
72
- Rails.logger.info "Caching data enabled >>>>>>>>>>>>>>>>>>>>>>>>"
73
72
  cache_key = "app-manager-cache/#{ENV['SHOPIFY_APP_SLUG']}/#{path}"
74
73
  if fetch_static_cached_response(cache_key).present?
75
74
  return fetch_static_cached_response(cache_key)
@@ -138,6 +137,8 @@ module AppManager
138
137
  return []
139
138
  when 'activate-global-plan'
140
139
  return nil
140
+ when 'get-bundle-plan'
141
+ return []
141
142
  else
142
143
  return nil
143
144
  end
@@ -43,6 +43,10 @@ module AppManager
43
43
  get("/has-plan?shop_domain=#{shop_domain}&plan_id=#{plan_id}&trial_activated_at=#{trial_activated_at}&grandfathered=#{grandfathered}")
44
44
  end
45
45
 
46
+ def get_bundle_plan(active_plan_id = nil)
47
+ get("/get-bundle-plan", {active_plan_id: active_plan_id})
48
+ end
49
+
46
50
  def get_app_bundle_data
47
51
  get("/app-bundle-data")
48
52
  end
@@ -93,7 +93,7 @@ module AppManager
93
93
  if !plan['discount'].nil? && plan['discount'] != 0
94
94
  discount_type = plan['discount_type'] || "percentage"
95
95
  discount_val = discount_type == "percentage" ? (plan['discount'].to_f/ 100) : "#{plan['discount']}"
96
- if !@api_version.nil? && @api_version.to_s.include?('2024')
96
+ if !@api_version.nil? && @api_version.to_s[/^\d{4}/].to_i >= 2024
97
97
  plan_discount = if plan['discount'] && plan['cycle_count'] && plan['cycle_count'].to_i != 0
98
98
  {
99
99
  "discount" => { "durationLimitInIntervals" => (plan['cycle_count'].to_i),
@@ -240,6 +240,7 @@ module AppManager
240
240
  activeSubscriptions {
241
241
  id
242
242
  name
243
+ status
243
244
  test
244
245
  }
245
246
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppManager
4
- VERSION = "2.3.3"
4
+ VERSION = "2.3.5"
5
5
  end
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: 2.3.3
4
+ version: 2.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahul Tiwari @ Hulkapps
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-24 00:00:00.000000000 Z
11
+ date: 2025-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -132,7 +132,7 @@ files:
132
132
  homepage: https://www.hulkapps.com
133
133
  licenses: []
134
134
  metadata: {}
135
- post_install_message:
135
+ post_install_message:
136
136
  rdoc_options: []
137
137
  require_paths:
138
138
  - lib
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubygems_version: 3.4.10
151
- signing_key:
151
+ signing_key:
152
152
  specification_version: 4
153
153
  summary: An API wrapper of Hulkapps AppManager portal
154
154
  test_files: []