souls 1.20.5 → 1.20.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/souls/app/graphql/souls_mutation.rb +12 -12
- data/lib/souls/app/graphql/souls_query.rb +2 -2
- data/lib/souls/cli/create/index.rb +1 -1
- 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 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b6a8374d14db465b13dadfecd1bce8613487e577f3192ef98eb17d80fcc1fec
|
4
|
+
data.tar.gz: a9dc1933aaad9768a8bc0ea650d9077e39717a862cadf94784438623c1c8166e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d67d9390f8db88756999be3a1c6179a2cdd640ac3a9cb12350296ad03181bd21e96e6c2f87b7cc9ef75fa72c903dc557328a765505715762c7cde2262a2f866
|
7
|
+
data.tar.gz: 91b7f05596b905be039f79509c0b00f4d735725a34eca0253432545fbb26ada981595706f132ea6099a9f18e83b25dae39cfc4145d52410d224147bd2864dd9a
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module SOULs
|
2
2
|
class SOULsMutation < GraphQL::Schema::RelayClassicMutation
|
3
|
-
def
|
3
|
+
def post(url:, payload: {}, content_type: "application/json")
|
4
4
|
response = Faraday.post(url, payload.to_json, "Content-Type": content_type)
|
5
5
|
response.body
|
6
6
|
end
|
7
7
|
|
8
|
-
def souls_worker_trigger(worker_name:, query_file_name:)
|
8
|
+
def souls_worker_trigger(worker_name:, query_file_name:, args: {})
|
9
9
|
query_file_name = query_file_name.gsub("_", "-")
|
10
10
|
topic_name = "souls-#{worker_name}-#{query_file_name}"
|
11
11
|
query = query_file_name.underscore.camelize(:lower)
|
12
|
-
query_string = souls_make_graphql_query(query: query)
|
12
|
+
query_string = souls_make_graphql_query(query: query, args: args)
|
13
13
|
case ENV["RACK_ENV"]
|
14
14
|
when "production"
|
15
15
|
souls_publish_pubsub_queue(topic_name: topic_name, message: query_string)
|
@@ -18,7 +18,7 @@ module SOULs
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
21
|
+
def souls_check_user_permissions(user, obj, method)
|
22
22
|
raise(StandardError, "Invalid or Missing Token") unless user
|
23
23
|
|
24
24
|
policy_class = obj.class.name + "Policy"
|
@@ -27,7 +27,7 @@ module SOULs
|
|
27
27
|
raise(Pundit::NotAuthorizedError, "permission error!") unless permission
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def souls_fb_auth(token:)
|
31
31
|
FirebaseIdToken::Certificates.request!
|
32
32
|
sleep(3) if ENV["RACK_ENV"] == "development"
|
33
33
|
user = FirebaseIdToken::Signature.verify(token)
|
@@ -36,13 +36,13 @@ module SOULs
|
|
36
36
|
user
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def souls_publish_pubsub_queue(topic_name: "send-mail-job", message: "text!")
|
40
40
|
pubsub = Google::Cloud::Pubsub.new(project: ENV["SOULS_GCP_PROJECT_ID"])
|
41
41
|
topic = pubsub.topic(topic_name)
|
42
42
|
topic.publish(message)
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
45
|
+
def souls_make_graphql_query(query: "newCommentMailer", args: {})
|
46
46
|
if args.blank?
|
47
47
|
query_string = %(query { #{query.to_s.underscore.camelize(:lower)} { response } })
|
48
48
|
else
|
@@ -60,27 +60,27 @@ module SOULs
|
|
60
60
|
query_string
|
61
61
|
end
|
62
62
|
|
63
|
-
def
|
63
|
+
def souls_post_to_dev(worker_name: "", query_string: "")
|
64
64
|
port = souls_get_worker(worker_name: worker_name)[0][:port]
|
65
65
|
endpoint = SOULs.configuration.endpoint
|
66
66
|
res = Net::HTTP.post_form(URI.parse("http://localhost:#{port}#{endpoint}"), { query: query_string })
|
67
67
|
res.body
|
68
68
|
end
|
69
69
|
|
70
|
-
def
|
70
|
+
def souls_get_worker(worker_name: "")
|
71
71
|
workers = SOULs.configuration.workers
|
72
72
|
workers.filter { |n| n[:name] == worker_name }
|
73
73
|
end
|
74
74
|
|
75
|
-
def
|
75
|
+
def souls_auth_check(context)
|
76
76
|
raise(GraphQL::ExecutionError, "You need to sign in!!") if context[:user].nil?
|
77
77
|
end
|
78
78
|
|
79
|
-
def
|
79
|
+
def production?
|
80
80
|
ENV["RACK_ENV"] == "production"
|
81
81
|
end
|
82
82
|
|
83
|
-
def
|
83
|
+
def get_instance_id
|
84
84
|
`curl http://metadata.google.internal/computeMetadata/v1/instance/id -H Metadata-Flavor:Google`
|
85
85
|
end
|
86
86
|
end
|
@@ -5,12 +5,12 @@ module SOULs
|
|
5
5
|
attr_accessor :schedule
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
8
|
+
def post(url:, payload: {}, content_type: "application/json")
|
9
9
|
response = Faraday.post(url, payload.to_json, "Content-Type": content_type)
|
10
10
|
response.body
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def check_user_permissions(user, obj, method)
|
14
14
|
raise(StandardError, "Invalid or Missing Token") unless user
|
15
15
|
|
16
16
|
policy_class = obj.class.name + "Policy"
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.20.
|
1
|
+
1.20.9
|
@@ -1 +1 @@
|
|
1
|
-
1.20.
|
1
|
+
1.20.9
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: souls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.20.
|
4
|
+
version: 1.20.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
8
8
|
- KishiTheMechanic
|
9
9
|
- James Neve
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-01-
|
13
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -72,16 +72,16 @@ dependencies:
|
|
72
72
|
name: graphql
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- - "
|
75
|
+
- - "<="
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 1.
|
77
|
+
version: 1.13.2
|
78
78
|
type: :runtime
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- - "
|
82
|
+
- - "<="
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version: 1.
|
84
|
+
version: 1.13.2
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: paint
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -299,7 +299,7 @@ licenses:
|
|
299
299
|
- Apache-2.0
|
300
300
|
metadata:
|
301
301
|
rubygems_mfa_required: 'true'
|
302
|
-
post_install_message:
|
302
|
+
post_install_message:
|
303
303
|
rdoc_options: []
|
304
304
|
require_paths:
|
305
305
|
- lib
|
@@ -315,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
315
315
|
version: '0'
|
316
316
|
requirements: []
|
317
317
|
rubygems_version: 3.2.32
|
318
|
-
signing_key:
|
318
|
+
signing_key:
|
319
319
|
specification_version: 4
|
320
320
|
summary: Ruby Serverless Framework 'SOULs' | Ruby サーバーレスフレームワーク SOULs. Powered by
|
321
321
|
Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud.
|