souls 0.25.15 → 0.25.19
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 +5 -11
- data/exe/souls +2 -9
- 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 +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b95e788773391bebd59bf7faf921e9d647bb39f564430b45e239e79c2b0ccfed
|
4
|
+
data.tar.gz: 22d8445babf829feb19c61209033f5e9b32196f827468f0ad2f9c40aa75305d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19d6e7e610f56fe92c41c12f2b2175fd92877d2d398a2f246e3a26c18f8cb4d53abb462e4644bf21527c92e9b89e26f16e88e66e68cb682a65c11eecc49b2bc8
|
7
|
+
data.tar.gz: eca89781a54e42932c3835f56b9c70c3ea1cc3f282b9c4c32c0effeb8ce354e313ce1cafb64ceb90e9191f78c9e92ffe18a5ce6bc9b9503cee257d87bf06bc0b
|
data/README.md
CHANGED
@@ -22,19 +22,16 @@
|
|
22
22
|
Welcome to SOULs Serverless Application Framework!
|
23
23
|
|
24
24
|
SOULs is a Serverless Application Framework with Ruby GraphQL.
|
25
|
-
SOULs has
|
26
|
-
You can focus on your business logic.
|
25
|
+
SOULs has 3 strains, API, Worker, and Frontend. It 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.
|
27
27
|
|
28
28
|

|
29
29
|
|
30
|
-
SOULs creates
|
30
|
+
SOULs creates 3 types of framework.
|
31
31
|
|
32
32
|
1. API - GraphQL (Ruby) - Simple API - Cloud Run
|
33
33
|
2. Worker - Google Pub/Sub Worker API (Ruby) - Cloud Run
|
34
|
-
3.
|
35
|
-
4. Admin Web Client - Admin Console and CMS (TypeScript)
|
36
|
-
5. Media Web Client - Media web client with SSG (TypeScript)
|
37
|
-
6. Doc Web Client - Doc web client with SSG (TypeScript)
|
34
|
+
3. Frontend - React Application (TypeScript) - Firebase
|
38
35
|
|
39
36
|
## Dependency
|
40
37
|
|
@@ -81,10 +78,7 @@ And Create Your APP
|
|
81
78
|
Select Strain:
|
82
79
|
1. SOULs GraphQL API
|
83
80
|
2. SOULs Worker
|
84
|
-
3. SOULs
|
85
|
-
4. SOULs Admin Web
|
86
|
-
5. SOULs Media Web
|
87
|
-
6. SOULs Doc Web
|
81
|
+
3. SOULs Frontend Web
|
88
82
|
|
89
83
|
|
90
84
|
## Gemfile 自動更新アップデート
|
data/exe/souls
CHANGED
@@ -18,14 +18,7 @@ begin
|
|
18
18
|
end
|
19
19
|
|
20
20
|
prompt = TTY::Prompt.new
|
21
|
-
choices = [
|
22
|
-
"1. SOULs GraphQL API",
|
23
|
-
"2. SOULs Pub/Sub Worker",
|
24
|
-
"3. SOULs Console Web",
|
25
|
-
"4. SOULs Admin Web",
|
26
|
-
"5. SOULs Media Web",
|
27
|
-
"6. SOULs Doc Web"
|
28
|
-
]
|
21
|
+
choices = ["1. SOULs GraphQL API", "2. SOULs Pub/Sub Worker", "3. SOULs Frontend Web"]
|
29
22
|
choice_num = prompt.select(Paint["Select Strain: ", :cyan], choices)[0].to_i
|
30
23
|
case choice_num
|
31
24
|
when 1, 2
|
@@ -184,7 +177,7 @@ begin
|
|
184
177
|
system("rm -rf ../#{other_app}/db/*")
|
185
178
|
system("cp -r ./db/* ../#{other_app}/db/*")
|
186
179
|
when "t", "test"
|
187
|
-
system("rubocop -
|
180
|
+
system("rubocop -A")
|
188
181
|
system("bundle exec rspec")
|
189
182
|
when "run"
|
190
183
|
system("docker build . -t souls -f Dockerfile.dev")
|
@@ -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.22
|
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.22
|
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.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-08-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: paint
|
@@ -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
|
-
SOULs has
|
60
|
-
SOULs
|
58
|
+
SOULs is a Serverless Application Framework with Ruby GraphQL.
|
59
|
+
SOULs has 3 strains, API, Worker, and Frontend. It 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
|
+
3 strains, API, Worker, and Frontend. It 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: []
|