power_api 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +93 -90
- data/README.md +329 -75
- data/app/helpers/power_api/application_helper.rb +57 -0
- data/bin/clean_test_app +2 -0
- data/lib/generators/power_api/controller/controller_generator.rb +27 -15
- data/lib/generators/power_api/exposed_api_config/USAGE +5 -0
- data/lib/generators/power_api/exposed_api_config/exposed_api_config_generator.rb +58 -0
- data/lib/generators/power_api/install/install_generator.rb +2 -44
- data/lib/generators/power_api/internal_api_config/USAGE +5 -0
- data/lib/generators/power_api/internal_api_config/internal_api_config_generator.rb +31 -0
- data/lib/generators/power_api/version/version_generator.rb +2 -2
- data/lib/power_api/engine.rb +8 -1
- data/lib/power_api/errors.rb +2 -0
- data/lib/power_api/generator_helper/active_record_resource.rb +10 -6
- data/lib/power_api/generator_helper/ams_helper.rb +5 -11
- data/lib/power_api/generator_helper/api_helper.rb +61 -0
- data/lib/power_api/generator_helper/controller_helper.rb +45 -15
- data/lib/power_api/generator_helper/routes_helper.rb +22 -7
- data/lib/power_api/generator_helper/rspec_controller_helper.rb +306 -0
- data/lib/power_api/generator_helper/swagger_helper.rb +14 -24
- data/lib/power_api/generator_helpers.rb +2 -1
- data/lib/power_api/version.rb +1 -1
- data/spec/dummy/app/controllers/api/base_controller.rb +2 -0
- data/spec/dummy/app/controllers/api/internal/base_controller.rb +5 -0
- data/spec/dummy/app/controllers/api/internal/blogs_controller.rb +36 -0
- data/spec/dummy/app/serializers/api/internal/blog_serializer.rb +12 -0
- data/spec/dummy/config/initializers/active_model_serializers.rb +1 -0
- data/spec/dummy/config/initializers/api_pagination.rb +32 -0
- data/spec/dummy/config/routes.rb +2 -7
- data/spec/dummy/spec/helpers/power_api/application_helper_spec.rb +171 -0
- data/spec/dummy/spec/lib/power_api/generator_helper/ams_helper_spec.rb +50 -12
- data/spec/dummy/spec/lib/power_api/generator_helper/api_helper_spec.rb +115 -0
- data/spec/dummy/spec/lib/power_api/generator_helper/controller_helper_spec.rb +126 -34
- data/spec/dummy/spec/lib/power_api/generator_helper/routes_helper_spec.rb +29 -5
- data/spec/dummy/spec/lib/power_api/generator_helper/rspec_controller_helper_spec.rb +559 -0
- data/spec/dummy/spec/lib/power_api/generator_helper/swagger_helper_spec.rb +10 -20
- data/spec/dummy/spec/support/shared_examples/active_record_resource_atrributes.rb +22 -3
- metadata +27 -5
- data/lib/power_api/generator_helper/version_helper.rb +0 -16
- data/spec/dummy/spec/lib/power_api/generator_helper/version_helper_spec.rb +0 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15df7added570c9179f92d41e2bbdac7f60a9de59c9f805e7b1fce1abfbb452a
|
4
|
+
data.tar.gz: 97a4e71638625f628cf7a76049a9521c68b3abf2803e09ec48e29fe4969828ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39389f0a07634e631eda86f606caf71080defc871b15048acb0c2aeb8e237406e04932cce9594cd63e48cbc365b6748f281f22ac45e3dc6d01e739038a7f3883
|
7
|
+
data.tar.gz: c7052f7e36848aba66e79149086a5c9a1ae1ccf1b25ac34a2964aa7cab67741d3a6f71cad79d4971d3bc62920741c2aeb6fdbc3f112dd048a7b0935cfc0275af
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
### v2.0.0
|
5
|
+
|
6
|
+
* Add API internal and exposed modes.
|
7
|
+
* Replace `json_api` with `json` adapter.
|
8
|
+
* Add view helper to serialize resources.
|
4
9
|
|
5
10
|
### v1.0.0
|
6
11
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
power_api (
|
4
|
+
power_api (2.0.0)
|
5
5
|
active_model_serializers (~> 0.10.0)
|
6
6
|
api-pagination
|
7
7
|
kaminari
|
@@ -16,71 +16,71 @@ PATH
|
|
16
16
|
GEM
|
17
17
|
remote: https://rubygems.org/
|
18
18
|
specs:
|
19
|
-
actioncable (6.1.
|
20
|
-
actionpack (= 6.1.
|
21
|
-
activesupport (= 6.1.
|
19
|
+
actioncable (6.1.4.4)
|
20
|
+
actionpack (= 6.1.4.4)
|
21
|
+
activesupport (= 6.1.4.4)
|
22
22
|
nio4r (~> 2.0)
|
23
23
|
websocket-driver (>= 0.6.1)
|
24
|
-
actionmailbox (6.1.
|
25
|
-
actionpack (= 6.1.
|
26
|
-
activejob (= 6.1.
|
27
|
-
activerecord (= 6.1.
|
28
|
-
activestorage (= 6.1.
|
29
|
-
activesupport (= 6.1.
|
24
|
+
actionmailbox (6.1.4.4)
|
25
|
+
actionpack (= 6.1.4.4)
|
26
|
+
activejob (= 6.1.4.4)
|
27
|
+
activerecord (= 6.1.4.4)
|
28
|
+
activestorage (= 6.1.4.4)
|
29
|
+
activesupport (= 6.1.4.4)
|
30
30
|
mail (>= 2.7.1)
|
31
|
-
actionmailer (6.1.
|
32
|
-
actionpack (= 6.1.
|
33
|
-
actionview (= 6.1.
|
34
|
-
activejob (= 6.1.
|
35
|
-
activesupport (= 6.1.
|
31
|
+
actionmailer (6.1.4.4)
|
32
|
+
actionpack (= 6.1.4.4)
|
33
|
+
actionview (= 6.1.4.4)
|
34
|
+
activejob (= 6.1.4.4)
|
35
|
+
activesupport (= 6.1.4.4)
|
36
36
|
mail (~> 2.5, >= 2.5.4)
|
37
37
|
rails-dom-testing (~> 2.0)
|
38
|
-
actionpack (6.1.
|
39
|
-
actionview (= 6.1.
|
40
|
-
activesupport (= 6.1.
|
38
|
+
actionpack (6.1.4.4)
|
39
|
+
actionview (= 6.1.4.4)
|
40
|
+
activesupport (= 6.1.4.4)
|
41
41
|
rack (~> 2.0, >= 2.0.9)
|
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 (6.1.
|
46
|
-
actionpack (= 6.1.
|
47
|
-
activerecord (= 6.1.
|
48
|
-
activestorage (= 6.1.
|
49
|
-
activesupport (= 6.1.
|
45
|
+
actiontext (6.1.4.4)
|
46
|
+
actionpack (= 6.1.4.4)
|
47
|
+
activerecord (= 6.1.4.4)
|
48
|
+
activestorage (= 6.1.4.4)
|
49
|
+
activesupport (= 6.1.4.4)
|
50
50
|
nokogiri (>= 1.8.5)
|
51
|
-
actionview (6.1.
|
52
|
-
activesupport (= 6.1.
|
51
|
+
actionview (6.1.4.4)
|
52
|
+
activesupport (= 6.1.4.4)
|
53
53
|
builder (~> 3.1)
|
54
54
|
erubi (~> 1.4)
|
55
55
|
rails-dom-testing (~> 2.0)
|
56
56
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
57
|
-
active_model_serializers (0.10.
|
58
|
-
actionpack (>= 4.1, <
|
59
|
-
activemodel (>= 4.1, <
|
57
|
+
active_model_serializers (0.10.13)
|
58
|
+
actionpack (>= 4.1, < 7.1)
|
59
|
+
activemodel (>= 4.1, < 7.1)
|
60
60
|
case_transform (>= 0.2)
|
61
61
|
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
62
|
-
activejob (6.1.
|
63
|
-
activesupport (= 6.1.
|
62
|
+
activejob (6.1.4.4)
|
63
|
+
activesupport (= 6.1.4.4)
|
64
64
|
globalid (>= 0.3.6)
|
65
|
-
activemodel (6.1.
|
66
|
-
activesupport (= 6.1.
|
67
|
-
activerecord (6.1.
|
68
|
-
activemodel (= 6.1.
|
69
|
-
activesupport (= 6.1.
|
70
|
-
activestorage (6.1.
|
71
|
-
actionpack (= 6.1.
|
72
|
-
activejob (= 6.1.
|
73
|
-
activerecord (= 6.1.
|
74
|
-
activesupport (= 6.1.
|
65
|
+
activemodel (6.1.4.4)
|
66
|
+
activesupport (= 6.1.4.4)
|
67
|
+
activerecord (6.1.4.4)
|
68
|
+
activemodel (= 6.1.4.4)
|
69
|
+
activesupport (= 6.1.4.4)
|
70
|
+
activestorage (6.1.4.4)
|
71
|
+
actionpack (= 6.1.4.4)
|
72
|
+
activejob (= 6.1.4.4)
|
73
|
+
activerecord (= 6.1.4.4)
|
74
|
+
activesupport (= 6.1.4.4)
|
75
75
|
marcel (~> 1.0.0)
|
76
|
-
mini_mime (
|
77
|
-
activesupport (6.1.
|
76
|
+
mini_mime (>= 1.1.0)
|
77
|
+
activesupport (6.1.4.4)
|
78
78
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
79
79
|
i18n (>= 1.6, < 2)
|
80
80
|
minitest (>= 5.1)
|
81
81
|
tzinfo (~> 2.0)
|
82
82
|
zeitwerk (~> 2.3)
|
83
|
-
addressable (2.
|
83
|
+
addressable (2.8.0)
|
84
84
|
public_suffix (>= 2.0.2, < 5.0)
|
85
85
|
api-pagination (4.8.2)
|
86
86
|
ast (2.4.2)
|
@@ -97,7 +97,7 @@ GEM
|
|
97
97
|
thor (>= 0.19.4, < 2.0)
|
98
98
|
tins (~> 1.6)
|
99
99
|
crass (1.0.6)
|
100
|
-
devise (4.8.
|
100
|
+
devise (4.8.1)
|
101
101
|
bcrypt (~> 3.0)
|
102
102
|
orm_adapter (~> 0.1)
|
103
103
|
railties (>= 4.1.0)
|
@@ -113,8 +113,8 @@ GEM
|
|
113
113
|
railties (>= 5.0.0)
|
114
114
|
ffi (1.15.3)
|
115
115
|
formatador (0.3.0)
|
116
|
-
globalid (0.
|
117
|
-
activesupport (>=
|
116
|
+
globalid (1.0.0)
|
117
|
+
activesupport (>= 5.0)
|
118
118
|
guard (2.17.0)
|
119
119
|
formatador (>= 0.2.4)
|
120
120
|
listen (>= 2.7, < 4.0)
|
@@ -129,43 +129,43 @@ GEM
|
|
129
129
|
guard (~> 2.1)
|
130
130
|
guard-compat (~> 1.1)
|
131
131
|
rspec (>= 2.99.0, < 4.0)
|
132
|
-
i18n (1.8.
|
132
|
+
i18n (1.8.11)
|
133
133
|
concurrent-ruby (~> 1.0)
|
134
134
|
jaro_winkler (1.5.4)
|
135
135
|
json (2.5.1)
|
136
136
|
json-schema (2.8.1)
|
137
137
|
addressable (>= 2.4)
|
138
138
|
jsonapi-renderer (0.2.2)
|
139
|
-
kaminari (1.2.
|
139
|
+
kaminari (1.2.2)
|
140
140
|
activesupport (>= 4.1.0)
|
141
|
-
kaminari-actionview (= 1.2.
|
142
|
-
kaminari-activerecord (= 1.2.
|
143
|
-
kaminari-core (= 1.2.
|
144
|
-
kaminari-actionview (1.2.
|
141
|
+
kaminari-actionview (= 1.2.2)
|
142
|
+
kaminari-activerecord (= 1.2.2)
|
143
|
+
kaminari-core (= 1.2.2)
|
144
|
+
kaminari-actionview (1.2.2)
|
145
145
|
actionview
|
146
|
-
kaminari-core (= 1.2.
|
147
|
-
kaminari-activerecord (1.2.
|
146
|
+
kaminari-core (= 1.2.2)
|
147
|
+
kaminari-activerecord (1.2.2)
|
148
148
|
activerecord
|
149
|
-
kaminari-core (= 1.2.
|
150
|
-
kaminari-core (1.2.
|
149
|
+
kaminari-core (= 1.2.2)
|
150
|
+
kaminari-core (1.2.2)
|
151
151
|
listen (3.5.1)
|
152
152
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
153
153
|
rb-inotify (~> 0.9, >= 0.9.10)
|
154
|
-
loofah (2.
|
154
|
+
loofah (2.13.0)
|
155
155
|
crass (~> 1.0.2)
|
156
156
|
nokogiri (>= 1.5.9)
|
157
157
|
lumberjack (1.2.8)
|
158
158
|
mail (2.7.1)
|
159
159
|
mini_mime (>= 0.1.1)
|
160
|
-
marcel (1.0.
|
160
|
+
marcel (1.0.2)
|
161
161
|
method_source (1.0.0)
|
162
|
-
mini_mime (1.
|
163
|
-
minitest (5.
|
162
|
+
mini_mime (1.1.2)
|
163
|
+
minitest (5.15.0)
|
164
164
|
nenv (0.3.0)
|
165
|
-
nio4r (2.5.
|
166
|
-
nokogiri (1.
|
165
|
+
nio4r (2.5.8)
|
166
|
+
nokogiri (1.13.0-x86_64-darwin)
|
167
167
|
racc (~> 1.4)
|
168
|
-
nokogiri (1.
|
168
|
+
nokogiri (1.13.0-x86_64-linux)
|
169
169
|
racc (~> 1.4)
|
170
170
|
notiffany (0.1.3)
|
171
171
|
nenv (~> 0.1)
|
@@ -182,39 +182,39 @@ GEM
|
|
182
182
|
pry (>= 0.10.4)
|
183
183
|
psych (4.0.1)
|
184
184
|
public_suffix (4.0.6)
|
185
|
-
racc (1.
|
185
|
+
racc (1.6.0)
|
186
186
|
rack (2.2.3)
|
187
187
|
rack-test (1.1.0)
|
188
188
|
rack (>= 1.0, < 3)
|
189
|
-
rails (6.1.
|
190
|
-
actioncable (= 6.1.
|
191
|
-
actionmailbox (= 6.1.
|
192
|
-
actionmailer (= 6.1.
|
193
|
-
actionpack (= 6.1.
|
194
|
-
actiontext (= 6.1.
|
195
|
-
actionview (= 6.1.
|
196
|
-
activejob (= 6.1.
|
197
|
-
activemodel (= 6.1.
|
198
|
-
activerecord (= 6.1.
|
199
|
-
activestorage (= 6.1.
|
200
|
-
activesupport (= 6.1.
|
189
|
+
rails (6.1.4.4)
|
190
|
+
actioncable (= 6.1.4.4)
|
191
|
+
actionmailbox (= 6.1.4.4)
|
192
|
+
actionmailer (= 6.1.4.4)
|
193
|
+
actionpack (= 6.1.4.4)
|
194
|
+
actiontext (= 6.1.4.4)
|
195
|
+
actionview (= 6.1.4.4)
|
196
|
+
activejob (= 6.1.4.4)
|
197
|
+
activemodel (= 6.1.4.4)
|
198
|
+
activerecord (= 6.1.4.4)
|
199
|
+
activestorage (= 6.1.4.4)
|
200
|
+
activesupport (= 6.1.4.4)
|
201
201
|
bundler (>= 1.15.0)
|
202
|
-
railties (= 6.1.
|
202
|
+
railties (= 6.1.4.4)
|
203
203
|
sprockets-rails (>= 2.0.0)
|
204
204
|
rails-dom-testing (2.0.3)
|
205
205
|
activesupport (>= 4.2.0)
|
206
206
|
nokogiri (>= 1.6)
|
207
|
-
rails-html-sanitizer (1.
|
207
|
+
rails-html-sanitizer (1.4.2)
|
208
208
|
loofah (~> 2.3)
|
209
|
-
railties (6.1.
|
210
|
-
actionpack (= 6.1.
|
211
|
-
activesupport (= 6.1.
|
209
|
+
railties (6.1.4.4)
|
210
|
+
actionpack (= 6.1.4.4)
|
211
|
+
activesupport (= 6.1.4.4)
|
212
212
|
method_source
|
213
|
-
rake (>= 0.
|
213
|
+
rake (>= 0.13)
|
214
214
|
thor (~> 1.0)
|
215
215
|
rainbow (3.0.0)
|
216
|
-
rake (13.0.
|
217
|
-
ransack (2.
|
216
|
+
rake (13.0.6)
|
217
|
+
ransack (2.5.0)
|
218
218
|
activerecord (>= 5.2.4)
|
219
219
|
activesupport (>= 5.2.4)
|
220
220
|
i18n
|
@@ -281,15 +281,15 @@ GEM
|
|
281
281
|
sprockets (4.0.2)
|
282
282
|
concurrent-ruby (~> 1.0)
|
283
283
|
rack (> 1, < 3)
|
284
|
-
sprockets-rails (3.
|
285
|
-
actionpack (>=
|
286
|
-
activesupport (>=
|
284
|
+
sprockets-rails (3.4.2)
|
285
|
+
actionpack (>= 5.2)
|
286
|
+
activesupport (>= 5.2)
|
287
287
|
sprockets (>= 3.0.0)
|
288
288
|
sqlite3 (1.4.2)
|
289
289
|
sync (0.5.0)
|
290
290
|
term-ansicolor (1.7.1)
|
291
291
|
tins (~> 1.0)
|
292
|
-
thor (1.1
|
292
|
+
thor (1.2.1)
|
293
293
|
tins (1.29.1)
|
294
294
|
sync
|
295
295
|
tzinfo (2.0.4)
|
@@ -301,17 +301,20 @@ GEM
|
|
301
301
|
yard (~> 0.9.11)
|
302
302
|
warden (1.2.9)
|
303
303
|
rack (>= 2.0.9)
|
304
|
+
webrick (1.7.0)
|
304
305
|
websocket-driver (0.7.5)
|
305
306
|
websocket-extensions (>= 0.1.0)
|
306
307
|
websocket-extensions (0.1.5)
|
307
|
-
yard (0.9.
|
308
|
-
|
308
|
+
yard (0.9.27)
|
309
|
+
webrick (~> 1.7.0)
|
310
|
+
zeitwerk (2.5.3)
|
309
311
|
|
310
312
|
PLATFORMS
|
311
313
|
x86_64-darwin-20
|
312
314
|
x86_64-linux
|
313
315
|
|
314
316
|
DEPENDENCIES
|
317
|
+
api-pagination (~> 4.8.2)
|
315
318
|
coveralls
|
316
319
|
factory_bot_rails
|
317
320
|
guard-rspec
|