app_manager 1.4.0 → 1.4.2

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: 323da6aca37d494397aea55d292e70a76b0a7280116fbda06eef42a23359147b
4
- data.tar.gz: 9e73448ce7fd0d997780dde01638c8d9c342a9408faf58e28fe231d65b577a7b
3
+ metadata.gz: d468cb1d631b3dd1d1ba0e8f76e40325c016b829c647c96d94ed0de4c61fe695
4
+ data.tar.gz: ec9a70baaa08bf3ccaebb45dde27e4f5dde7daf72fafe6c79c3ac158e9c649fe
5
5
  SHA512:
6
- metadata.gz: 12b8049dcef01005dce9b9debba9a0eb1d9921e73d4af6d629fb68fbb028711a26d9942031ed654bb93da656a2674e35d891f6bc6acf5b335db646e2a8698978
7
- data.tar.gz: 62f134c579d43e5187bc0a8cb3c6dd172e36f8b040f2e2421657b7072ac4c7f0ccff910c333f79097380149db8dc4c15c98bcd309e947e347059314f92905a4b
6
+ metadata.gz: 7215b1509241685ed730efaa6c19d291f653e5bc06f24599bd37610512a54ce854b24f4e0a7c82be31638d404f11e57f7bd13cf3b6b97084781cd29741658cce
7
+ data.tar.gz: 3f08b7e25236d1aee6fb8a5488fc8f07545bcfb388865d352b7d83c65a55470b4b8397a2fed24f795b8c7b94fec92c7ce5632aa4eb5ea5224818a342c46772c0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_manager (1.4.0)
4
+ app_manager (1.4.2)
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.3.1)
14
- actionpack (= 7.0.3.1)
15
- activesupport (= 7.0.3.1)
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.3.1)
19
- actionpack (= 7.0.3.1)
20
- activejob (= 7.0.3.1)
21
- activerecord (= 7.0.3.1)
22
- activestorage (= 7.0.3.1)
23
- activesupport (= 7.0.3.1)
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.3.1)
29
- actionpack (= 7.0.3.1)
30
- actionview (= 7.0.3.1)
31
- activejob (= 7.0.3.1)
32
- activesupport (= 7.0.3.1)
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.3.1)
39
- actionview (= 7.0.3.1)
40
- activesupport (= 7.0.3.1)
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.3.1)
46
- actionpack (= 7.0.3.1)
47
- activerecord (= 7.0.3.1)
48
- activestorage (= 7.0.3.1)
49
- activesupport (= 7.0.3.1)
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.3.1)
53
- activesupport (= 7.0.3.1)
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.3.1)
59
- activesupport (= 7.0.3.1)
58
+ activejob (7.0.4)
59
+ activesupport (= 7.0.4)
60
60
  globalid (>= 0.3.6)
61
- activemodel (7.0.3.1)
62
- activesupport (= 7.0.3.1)
63
- activerecord (7.0.3.1)
64
- activemodel (= 7.0.3.1)
65
- activesupport (= 7.0.3.1)
66
- activerecord-import (1.4.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
+ activerecord-import (1.4.1)
67
67
  activerecord (>= 4.2)
68
- activestorage (7.0.3.1)
69
- actionpack (= 7.0.3.1)
70
- activejob (= 7.0.3.1)
71
- activerecord (= 7.0.3.1)
72
- activesupport (= 7.0.3.1)
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.3.1)
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.18.0)
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.2.3)
127
- digest
125
+ net-imap (0.3.1)
128
126
  net-protocol
129
- strscan
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.1)
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.3.1)
153
- actioncable (= 7.0.3.1)
154
- actionmailbox (= 7.0.3.1)
155
- actionmailer (= 7.0.3.1)
156
- actionpack (= 7.0.3.1)
157
- actiontext (= 7.0.3.1)
158
- actionview (= 7.0.3.1)
159
- activejob (= 7.0.3.1)
160
- activemodel (= 7.0.3.1)
161
- activerecord (= 7.0.3.1)
162
- activestorage (= 7.0.3.1)
163
- activesupport (= 7.0.3.1)
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.3.1)
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.3.1)
172
- actionpack (= 7.0.3.1)
173
- activesupport (= 7.0.3.1)
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.0)
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["errors"].as_json}"
65
+ raise Error, "#{data.inspect}"
66
66
  end
67
67
  else
68
- raise Error, "#{data["errors"]}"
68
+ raise Error, "#{data.inspect}"
69
69
  end
70
70
  else
71
71
  raise ModelNotFound, "Shop not found"
@@ -86,7 +86,7 @@ module AppManager
86
86
  plans = plans.values if !plans.nil?
87
87
  shopify_plans = params[:shopify_plans] || nil
88
88
  shopify_plans = shopify_plans.values if !shopify_plans.nil?
89
- items_per_page = 25
89
+ items_per_page = params[:itemsPerPage] || 25
90
90
  @shopify_email = AppManager.configuration.field_names['shopify_email']
91
91
  @shopify_plan_name_field = AppManager.configuration.field_names['shopify_plan']
92
92
  if params[:search]
@@ -100,20 +100,21 @@ module AppManager
100
100
  data = data.where(@shopify_plan_name_field => shopify_plans) if !shopify_plans.nil?
101
101
  data = data.page(params[:page]).per(items_per_page)
102
102
  end
103
+ all_user_count = model.count
103
104
  users = {
104
105
  "current_page" => data && data.current_page ? data.current_page : 0,
105
106
  "data" => data ? data.collect { |st| @field_names.map { |key, value| [key, "#{st[value]}"] }.to_h } : [],
106
107
  "first_page_url" => "#{app_url}/api/app-manager/users?page=1",
107
- "from" => data && data.total_pages ? 1 : 0,
108
+ "from" => data && data.total_pages ? data.current_page == 1 ? 1 : ((data.current_page-1)*items_per_page)+1 : 0,
108
109
  "last_page" => data && data.total_pages ? data.total_pages : 0,
109
110
  "last_page_url" => data && data.total_pages ? "#{app_url}/api/app-manager/users?page=#{data.total_pages}" : nil,
110
111
  "links" => '',
111
112
  "next_page_url" => data && data.next_page ? "#{app_url}/api/app-manager/users?page=#{data.next_page}" : nil,
112
113
  "path" => "#{app_url}/api/app-manager/users",
113
- "per_page" => 1,
114
+ "per_page" => items_per_page,
114
115
  "prev_page_url" => data && data.prev_page ? "#{app_url}/api/app-manager/users?page=#{data.prev_page}" : nil,
115
- "to" => data && data.total_pages ? data.total_pages : 0,
116
- "total" => data && data.total_pages ? data.total_pages : 0,
116
+ "to" => data && data.total_pages ? data.current_page == data.total_pages ? all_user_count : ((data && data.current_page ? data.current_page : 0)*data.size) : 0,
117
+ "total" => all_user_count,
117
118
  }
118
119
  render json: users
119
120
 
@@ -128,8 +128,8 @@ module AppManager
128
128
  #Complete
129
129
  def save_api_app_structures(app_structures)
130
130
  begin
131
- # ActiveRecord::Base.establish_connection(:app_manager).connection.execute("TRUNCATE app_structures RESTART IDENTITY")
132
- AppManager::AppStructure.connection.truncate(AppManager::AppStructure.table_name)
131
+ ActiveRecord::Base.establish_connection(:app_manager).connection.execute("TRUNCATE app_structures RESTART IDENTITY")
132
+ # AppManager::AppStructure.connection.truncate(AppManager::AppStructure.table_name)
133
133
  rescue
134
134
  AppManager::AppStructure.delete_all
135
135
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppManager
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.2"
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: 1.4.0
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hulkapps
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-06 00:00:00.000000000 Z
11
+ date: 2022-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty