app_manager 2.3.3 → 2.3.4

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: b0be1075e7e608c2737aca9bb4818e480c6208cbb97abc6b0b429a032dfa1b91
4
+ data.tar.gz: 61387d3e6ccd7374638f09f607eee94040f3e32b866e4e8178472e567a62f8f0
5
5
  SHA512:
6
- metadata.gz: 2feefe3f19e0a1ae5316bb9853afa2a5cc077fe7546dc82597b1394399a364ec4ea844c022aa46d05a80d8a1d6b0656bdd998668d7ddbc011b0c249fbae9d39c
7
- data.tar.gz: 70fa400868631cf7c331fdfea46f8c6f2f3956bfdd2c796166027b52fccc54ab0cb1926552ee5fe6587d3a337c860a172ed7c72315dad05951c659a9fef080d7
6
+ metadata.gz: 5a5a849caca69d4f99379828fb433e0b597eb59ae185b4df7915f74080dcffaed725e25b21e3b006f37d44fe9607e92063b66a6079677f954c5f083812737289
7
+ data.tar.gz: 975b470af5da3742bd93f6bf374d39c23405a63c0f10917bdd2a624656400aeb0f1960ca6877ef532d3a44e21db6380ec60f18b6723ff7656423400b2716a5a2
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.4)
5
5
  activerecord-import (~> 1.4)
6
6
  httparty
7
7
  kaminari (>= 0.16.3)
@@ -10,29 +10,29 @@ 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 (7.2.1.1)
14
+ actionpack (= 7.2.1.1)
15
+ activesupport (= 7.2.1.1)
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 (7.2.1.1)
20
+ actionpack (= 7.2.1.1)
21
+ activejob (= 7.2.1.1)
22
+ activerecord (= 7.2.1.1)
23
+ activestorage (= 7.2.1.1)
24
+ activesupport (= 7.2.1.1)
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 (7.2.1.1)
27
+ actionpack (= 7.2.1.1)
28
+ actionview (= 7.2.1.1)
29
+ activejob (= 7.2.1.1)
30
+ activesupport (= 7.2.1.1)
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 (7.2.1.1)
34
+ actionview (= 7.2.1.1)
35
+ activesupport (= 7.2.1.1)
36
36
  nokogiri (>= 1.8.5)
37
37
  racc
38
38
  rack (>= 2.2.4, < 3.2)
@@ -41,37 +41,37 @@ GEM
41
41
  rails-dom-testing (~> 2.2)
42
42
  rails-html-sanitizer (~> 1.6)
43
43
  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)
44
+ actiontext (7.2.1.1)
45
+ actionpack (= 7.2.1.1)
46
+ activerecord (= 7.2.1.1)
47
+ activestorage (= 7.2.1.1)
48
+ activesupport (= 7.2.1.1)
49
49
  globalid (>= 0.6.0)
50
50
  nokogiri (>= 1.8.5)
51
- actionview (7.2.1)
52
- activesupport (= 7.2.1)
51
+ actionview (7.2.1.1)
52
+ activesupport (= 7.2.1.1)
53
53
  builder (~> 3.1)
54
54
  erubi (~> 1.11)
55
55
  rails-dom-testing (~> 2.2)
56
56
  rails-html-sanitizer (~> 1.6)
57
- activejob (7.2.1)
58
- activesupport (= 7.2.1)
57
+ activejob (7.2.1.1)
58
+ activesupport (= 7.2.1.1)
59
59
  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)
60
+ activemodel (7.2.1.1)
61
+ activesupport (= 7.2.1.1)
62
+ activerecord (7.2.1.1)
63
+ activemodel (= 7.2.1.1)
64
+ activesupport (= 7.2.1.1)
65
65
  timeout (>= 0.4.0)
66
66
  activerecord-import (1.8.1)
67
67
  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)
68
+ activestorage (7.2.1.1)
69
+ actionpack (= 7.2.1.1)
70
+ activejob (= 7.2.1.1)
71
+ activerecord (= 7.2.1.1)
72
+ activesupport (= 7.2.1.1)
73
73
  marcel (~> 1.0)
74
- activesupport (7.2.1)
74
+ activesupport (7.2.1.1)
75
75
  base64
76
76
  bigdecimal
77
77
  concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -109,7 +109,7 @@ GEM
109
109
  i18n (1.14.6)
110
110
  concurrent-ruby (~> 1.0)
111
111
  io-console (0.7.2)
112
- irb (1.14.0)
112
+ irb (1.14.1)
113
113
  rdoc (>= 4.0.0)
114
114
  reline (>= 0.4.2)
115
115
  kaminari (1.2.2)
@@ -140,7 +140,7 @@ GEM
140
140
  minitest (5.25.1)
141
141
  multi_xml (0.7.1)
142
142
  bigdecimal (~> 3.1)
143
- net-imap (0.4.16)
143
+ net-imap (0.5.0)
144
144
  date
145
145
  net-protocol
146
146
  net-pop (0.1.2)
@@ -162,7 +162,7 @@ GEM
162
162
  stringio
163
163
  public_suffix (4.0.6)
164
164
  racc (1.8.1)
165
- rack (3.1.7)
165
+ rack (3.1.8)
166
166
  rack-session (2.0.0)
167
167
  rack (>= 3.0.0)
168
168
  rack-test (2.1.0)
@@ -170,20 +170,20 @@ GEM
170
170
  rackup (2.1.0)
171
171
  rack (>= 3)
172
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)
173
+ rails (7.2.1.1)
174
+ actioncable (= 7.2.1.1)
175
+ actionmailbox (= 7.2.1.1)
176
+ actionmailer (= 7.2.1.1)
177
+ actionpack (= 7.2.1.1)
178
+ actiontext (= 7.2.1.1)
179
+ actionview (= 7.2.1.1)
180
+ activejob (= 7.2.1.1)
181
+ activemodel (= 7.2.1.1)
182
+ activerecord (= 7.2.1.1)
183
+ activestorage (= 7.2.1.1)
184
+ activesupport (= 7.2.1.1)
185
185
  bundler (>= 1.15.0)
186
- railties (= 7.2.1)
186
+ railties (= 7.2.1.1)
187
187
  rails-dom-testing (2.2.0)
188
188
  activesupport (>= 5.0.0)
189
189
  minitest
@@ -191,9 +191,9 @@ GEM
191
191
  rails-html-sanitizer (1.6.0)
192
192
  loofah (~> 2.21)
193
193
  nokogiri (~> 1.14)
194
- railties (7.2.1)
195
- actionpack (= 7.2.1)
196
- activesupport (= 7.2.1)
194
+ railties (7.2.1.1)
195
+ actionpack (= 7.2.1.1)
196
+ activesupport (= 7.2.1.1)
197
197
  irb (~> 1.13)
198
198
  rackup (>= 1.0.0)
199
199
  rake (>= 12.2)
@@ -235,7 +235,7 @@ GEM
235
235
  websocket-driver (0.7.6)
236
236
  websocket-extensions (>= 0.1.0)
237
237
  websocket-extensions (0.1.5)
238
- zeitwerk (2.6.18)
238
+ zeitwerk (2.7.0)
239
239
 
240
240
  PLATFORMS
241
241
  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
@@ -138,6 +138,8 @@ module AppManager
138
138
  return []
139
139
  when 'activate-global-plan'
140
140
  return nil
141
+ when 'get-bundle-plan'
142
+ return []
141
143
  else
142
144
  return nil
143
145
  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
@@ -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.4"
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.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahul Tiwari @ Hulkapps
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-24 00:00:00.000000000 Z
11
+ date: 2024-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty