souls 0.25.14 → 0.25.18
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/README.md +1 -1
- data/exe/souls +1 -1
- data/lib/souls.rb +1 -7
- data/lib/souls/generate/mutation.rb +6 -6
- data/lib/souls/generate/rspec_policy.rb +3 -3
- data/lib/souls/generate/rspec_query.rb +35 -35
- data/lib/souls/generate/rspec_resolver.rb +44 -44
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b37b1bd07ccc1f56e0d2bec995d2e0a25870c5b2fae39ccba829fb714250c658
|
4
|
+
data.tar.gz: 4e09f36c6d09ab3573b2f3eed08ef0b7d5a485ad87e36cc8c3045a925965145b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f28323d5e145c0171eb127c9078e7057dc2c76a075b394a89bac3a7a1a829fb82fa2b9deb44d1d921890d175b3eeb31a999910d3a9a42ca9ed41f4233d68ac85
|
7
|
+
data.tar.gz: e573f692123e85db8ac9d5ccaa8b561375d05623d1d432982546af51e6f4513e5a0b9ef974a476dac5fbb2e26dc1c844c02f9f7590cab29998e7390b46db323e
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ Welcome to SOULs Serverless Application Framework!
|
|
23
23
|
|
24
24
|
SOULs is a Serverless Application Framework with Ruby GraphQL.
|
25
25
|
SOULs has six strains, API, Worker, Console, Admin, Media, Doc, and can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud. No more routing for Backends!
|
26
|
-
You can focus on your business logic.
|
26
|
+
You can focus on your business logic.
|
27
27
|
|
28
28
|

|
29
29
|
|
data/exe/souls
CHANGED
@@ -184,7 +184,7 @@ begin
|
|
184
184
|
system("rm -rf ../#{other_app}/db/*")
|
185
185
|
system("cp -r ./db/* ../#{other_app}/db/*")
|
186
186
|
when "t", "test"
|
187
|
-
system("rubocop -
|
187
|
+
system("rubocop -A")
|
188
188
|
system("bundle exec rspec")
|
189
189
|
when "run"
|
190
190
|
system("docker build . -t souls -f Dockerfile.dev")
|
data/lib/souls.rb
CHANGED
@@ -174,7 +174,7 @@ module Souls
|
|
174
174
|
bucket_url = "gs://souls-bucket/boilerplates"
|
175
175
|
file_name = "#{service_name}-v#{new_ver}.tgz"
|
176
176
|
release_name = "#{service_name}-latest.tgz"
|
177
|
-
|
177
|
+
update_service_gemfile(service_name: service_name)
|
178
178
|
|
179
179
|
case current_dir_name
|
180
180
|
when "souls"
|
@@ -257,12 +257,6 @@ module Souls
|
|
257
257
|
end
|
258
258
|
end
|
259
259
|
|
260
|
-
def update_backend_gemfile
|
261
|
-
%w[api worker].each do |service_name|
|
262
|
-
update_service_gemfile(service_name: service_name)
|
263
|
-
end
|
264
|
-
end
|
265
|
-
|
266
260
|
def update_service_gemfile(service_name: "api")
|
267
261
|
file_dir = "./apps/#{service_name}"
|
268
262
|
file_path = "#{file_dir}/Gemfile"
|
@@ -10,9 +10,9 @@ module Souls
|
|
10
10
|
File.open(file_path, "w") do |new_line|
|
11
11
|
new_line.write(<<~TEXT)
|
12
12
|
module Mutations
|
13
|
-
module
|
13
|
+
module Base::#{singularized_class_name.camelize}
|
14
14
|
class Create#{singularized_class_name.camelize} < BaseMutation
|
15
|
-
field :#{singularized_class_name}_edge, Types::#{singularized_class_name.camelize}.edge_type, null: false
|
15
|
+
field :#{singularized_class_name}_edge, Types::#{singularized_class_name.camelize}Type.edge_type, null: false
|
16
16
|
field :error, String, null: true
|
17
17
|
|
18
18
|
TEXT
|
@@ -104,9 +104,9 @@ module Souls
|
|
104
104
|
File.open(file_path, "w") do |new_line|
|
105
105
|
new_line.write(<<~TEXT)
|
106
106
|
module Mutations
|
107
|
-
module
|
107
|
+
module Base::#{class_name.camelize}
|
108
108
|
class Update#{class_name.camelize} < BaseMutation
|
109
|
-
field :#{class_name}_edge, Types::#{class_name.camelize}.edge_type, null: false
|
109
|
+
field :#{class_name}_edge, Types::#{class_name.camelize}Type.edge_type, null: false
|
110
110
|
|
111
111
|
argument :id, String, required: true
|
112
112
|
TEXT
|
@@ -211,7 +211,7 @@ module Souls
|
|
211
211
|
File.open(file_path, "w") do |f|
|
212
212
|
f.write(<<~TEXT)
|
213
213
|
module Mutations
|
214
|
-
module
|
214
|
+
module Base::#{class_name.camelize}
|
215
215
|
class Delete#{class_name.camelize} < BaseMutation
|
216
216
|
field :#{class_name}, Types::#{class_name.camelize}Type, null: false
|
217
217
|
argument :id, String, required: true
|
@@ -240,7 +240,7 @@ module Souls
|
|
240
240
|
File.open(file_path, "w") do |f|
|
241
241
|
f.write(<<~TEXT)
|
242
242
|
module Mutations
|
243
|
-
module
|
243
|
+
module Base::#{class_name.camelize}
|
244
244
|
class DestroyDelete#{class_name.camelize} < BaseMutation
|
245
245
|
field :#{class_name}, Types::#{class_name.camelize}Type, null: false
|
246
246
|
argument :id, String, required: true
|
@@ -15,7 +15,7 @@ module Souls
|
|
15
15
|
let(:#{class_name.underscore}) { FactoryBot.create(:#{class_name.underscore}) }
|
16
16
|
|
17
17
|
context "being a visitor" do
|
18
|
-
let(:user) { FactoryBot.create(:user,
|
18
|
+
let(:user) { FactoryBot.create(:user, roles: :normal) }
|
19
19
|
|
20
20
|
it { is_expected.to permit_action(:index) }
|
21
21
|
it { is_expected.to permit_action(:show) }
|
@@ -23,13 +23,13 @@ module Souls
|
|
23
23
|
end
|
24
24
|
|
25
25
|
context "being a user" do
|
26
|
-
let(:user) { FactoryBot.create(:user,
|
26
|
+
let(:user) { FactoryBot.create(:user, roles: :user) }
|
27
27
|
|
28
28
|
it { is_expected.to permit_actions([:create, :update]) }
|
29
29
|
end
|
30
30
|
|
31
31
|
context "being an admin" do
|
32
|
-
let(:user) { FactoryBot.create(:user,
|
32
|
+
let(:user) { FactoryBot.create(:user, roles: :admin) }
|
33
33
|
|
34
34
|
it { is_expected.to permit_actions([:create, :update, :delete]) }
|
35
35
|
end
|
@@ -26,23 +26,23 @@ module Souls
|
|
26
26
|
if line.include?("end") || line.include?("t.index")
|
27
27
|
if @relation_params.empty?
|
28
28
|
new_line.write(<<-TEXT)
|
29
|
-
|
29
|
+
let!(:#{class_name}) { FactoryBot.create(:#{class_name}) }
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
let(:query) do
|
32
|
+
data_id = Base64.encode64("#{class_name.camelize}:\#{#{class_name.singularize.underscore}.id}")
|
33
|
+
%(query {
|
34
|
+
#{class_name.singularize.camelize(:lower)}(id: \\"\#{data_id}\\") {
|
35
|
+
id
|
36
36
|
TEXT
|
37
37
|
else
|
38
38
|
new_line.write(<<-TEXT)
|
39
|
-
|
39
|
+
let(:#{class_name}) { FactoryBot.create(:#{class_name}, #{@relation_params.join(', ')}) }
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
let(:query) do
|
42
|
+
data_id = Base64.encode64("#{class_name.camelize}:\#{#{class_name.singularize.underscore}.id}")
|
43
|
+
%(query {
|
44
|
+
#{class_name.singularize.camelize(:lower)}(id: \\"\#{data_id}\\") {
|
45
|
+
id
|
46
46
|
TEXT
|
47
47
|
end
|
48
48
|
break
|
@@ -70,25 +70,25 @@ module Souls
|
|
70
70
|
f.each_line.with_index do |line, _i|
|
71
71
|
if @on
|
72
72
|
if line.include?("end") || line.include?("t.index")
|
73
|
-
new_line.write(
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
73
|
+
new_line.write(<<-TEXT)
|
74
|
+
}
|
75
|
+
}
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
subject(:result) do
|
80
|
+
SoulsApiSchema.execute(query).as_json
|
81
|
+
end
|
82
|
+
|
83
|
+
it "return #{class_name.camelize} Data" do
|
84
|
+
begin
|
85
|
+
a1 = result.dig("data", "#{class_name.singularize.camelize(:lower)}")
|
86
|
+
raise unless a1.present?
|
87
|
+
rescue
|
88
|
+
raise StandardError, result
|
89
|
+
end
|
90
|
+
expect(a1).to include(
|
91
|
+
"id" => be_a(String),
|
92
92
|
TEXT
|
93
93
|
break
|
94
94
|
end
|
@@ -133,14 +133,14 @@ module Souls
|
|
133
133
|
case type
|
134
134
|
when "text", "date", "datetime"
|
135
135
|
if array_true
|
136
|
-
new_line.write("
|
136
|
+
new_line.write(" \"#{name.camelize(:lower)}\" => be_all(String),\n")
|
137
137
|
else
|
138
|
-
new_line.write("
|
138
|
+
new_line.write(" \"#{name.camelize(:lower)}\" => be_a(String),\n")
|
139
139
|
end
|
140
140
|
when "boolean"
|
141
|
-
new_line.write("
|
141
|
+
new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_in([true, false]),\n")
|
142
142
|
when "string", "bigint", "integer", "float"
|
143
|
-
new_line.write("
|
143
|
+
new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_a(#{field}),\n")
|
144
144
|
end
|
145
145
|
end
|
146
146
|
end
|
@@ -26,31 +26,31 @@ module Souls
|
|
26
26
|
if line.include?("end") || line.include?("t.index")
|
27
27
|
if @relation_params.empty?
|
28
28
|
new_line.write(<<-TEXT)
|
29
|
-
|
29
|
+
let!(:#{class_name}) { FactoryBot.create(:#{class_name}) }
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
let(:query) do
|
32
|
+
%(query {
|
33
|
+
#{class_name.singularize.camelize(:lower)}Search(filter: {
|
34
|
+
isDeleted: false
|
35
|
+
}) {
|
36
|
+
edges {
|
37
|
+
cursor
|
38
|
+
node {
|
39
|
+
id
|
40
40
|
TEXT
|
41
41
|
else
|
42
42
|
new_line.write(<<-TEXT)
|
43
|
-
|
43
|
+
let!(:#{class_name}) { FactoryBot.create(:#{class_name}, #{@relation_params.join(', ')}) }
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
45
|
+
let(:query) do
|
46
|
+
%(query {
|
47
|
+
#{class_name.singularize.camelize(:lower)}Search(filter: {
|
48
|
+
isDeleted: false
|
49
|
+
}) {
|
50
|
+
edges {
|
51
|
+
cursor
|
52
|
+
node {
|
53
|
+
id
|
54
54
|
TEXT
|
55
55
|
end
|
56
56
|
break
|
@@ -79,35 +79,35 @@ module Souls
|
|
79
79
|
if @on
|
80
80
|
if line.include?("end") || line.include?("t.index")
|
81
81
|
new_line.write(<<-TEXT)
|
82
|
+
}
|
83
|
+
}
|
84
|
+
nodes {
|
85
|
+
id
|
86
|
+
}
|
87
|
+
pageInfo {
|
88
|
+
endCursor
|
89
|
+
hasNextPage
|
90
|
+
startCursor
|
91
|
+
hasPreviousPage
|
82
92
|
}
|
83
|
-
}
|
84
|
-
nodes {
|
85
|
-
id
|
86
|
-
}
|
87
|
-
pageInfo {
|
88
|
-
endCursor
|
89
|
-
hasNextPage
|
90
|
-
startCursor
|
91
|
-
hasPreviousPage
|
92
93
|
}
|
93
94
|
}
|
94
|
-
|
95
|
-
|
96
|
-
end
|
97
|
-
|
98
|
-
subject(:result) do
|
99
|
-
SoulsApiSchema.execute(query).as_json
|
100
|
-
end
|
95
|
+
)
|
96
|
+
end
|
101
97
|
|
102
|
-
|
103
|
-
|
104
|
-
a1 = result.dig("data", "#{class_name.singularize.camelize(:lower)}Search", "edges")[0]["node"]
|
105
|
-
raise unless a1.present?
|
106
|
-
rescue
|
107
|
-
raise StandardError, result
|
98
|
+
subject(:result) do
|
99
|
+
SoulsApiSchema.execute(query).as_json
|
108
100
|
end
|
109
|
-
|
110
|
-
|
101
|
+
|
102
|
+
it "return #{class_name.camelize} Data" do
|
103
|
+
begin
|
104
|
+
a1 = result.dig("data", "#{class_name.singularize.camelize(:lower)}Search", "edges")[0]["node"]
|
105
|
+
raise unless a1.present?
|
106
|
+
rescue
|
107
|
+
raise StandardError, result
|
108
|
+
end
|
109
|
+
expect(a1).to include(
|
110
|
+
"id" => be_a(String),
|
111
111
|
TEXT
|
112
112
|
break
|
113
113
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.21
|
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.21
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: souls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.25.
|
4
|
+
version: 0.25.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -55,9 +55,10 @@ dependencies:
|
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: 0.3.0
|
57
57
|
description: |-
|
58
|
-
SOULs is a Serverless Application Framework.
|
59
|
-
|
60
|
-
|
58
|
+
SOULs is a Serverless Application Framework with Ruby GraphQL.
|
59
|
+
SOULs has six strains, API, Worker, Frontend, and can be used in combination according to the purpose.
|
60
|
+
SOULs Ruby GraphQL API / Worker and Easy to deploy to Google Cloud. No more routing for Backends!
|
61
|
+
You can focus on your business logic.
|
61
62
|
email:
|
62
63
|
- f.kawasaki@elsoul.nl
|
63
64
|
- s.kishi@elsoul.nl
|
@@ -123,8 +124,8 @@ requirements: []
|
|
123
124
|
rubygems_version: 3.2.22
|
124
125
|
signing_key:
|
125
126
|
specification_version: 4
|
126
|
-
summary: SOULs is a Serverless Application Framework. SOULs has
|
127
|
-
|
128
|
-
|
129
|
-
|
127
|
+
summary: SOULs is a Serverless Application Framework with Ruby GraphQL. SOULs has
|
128
|
+
six strains, API, Worker, Frontend, and can be used in combination according to
|
129
|
+
the purpose. SOULs Ruby GraphQL API / Worker and Easy to deploy to Google Cloud.
|
130
|
+
No more routing for Backends! You can focus on your business logic.
|
130
131
|
test_files: []
|