katalyst-google-apis 1.3.0 → 1.3.1
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/app/services/katalyst/google_apis/error.rb +2 -2
- data/app/services/katalyst/google_apis/gemini/generate_content_service.rb +7 -7
- data/app/services/katalyst/google_apis/geocoding/reverse_service.rb +1 -1
- data/app/services/katalyst/google_apis/geocoding/search_service.rb +3 -3
- data/app/services/katalyst/google_apis/recaptcha/assessment_service.rb +1 -1
- data/lib/katalyst/google_apis/config.rb +12 -13
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b20f30239ff09170beb094e155676df9da9a96f7693d90aed8bac756b693e77
|
|
4
|
+
data.tar.gz: d3ab4d196dacb58ed7c1c9b2a04715bd08f6c8871918bc1359c5054839e923d4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: afb1e05bc0bdea960d8a572da3d5448fea590830440f97f753cc99ac2361109268b502f8d90375db938657e201e892bc02312d8f8cbfae624e85124197838a4e
|
|
7
|
+
data.tar.gz: 69fcfce31104540742fd9c23eb8da530695f3eef9137d80ae2aab06340c67f27196dcaad73d5caac374b58e28e93b455e811f5f0345fee674fa3503bde848c62
|
|
@@ -16,11 +16,11 @@ module Katalyst
|
|
|
16
16
|
|
|
17
17
|
def initialize(credentials:, model:, parent:, attempt:, retries:, jitter:)
|
|
18
18
|
@credentials = credentials
|
|
19
|
-
@model
|
|
20
|
-
@parent
|
|
21
|
-
@attempt
|
|
22
|
-
@retries
|
|
23
|
-
@jitter
|
|
19
|
+
@model = model
|
|
20
|
+
@parent = parent
|
|
21
|
+
@attempt = attempt
|
|
22
|
+
@retries = retries
|
|
23
|
+
@jitter = jitter
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def call(payload:)
|
|
@@ -101,8 +101,8 @@ module Katalyst
|
|
|
101
101
|
Kernel.sleep(backoff)
|
|
102
102
|
|
|
103
103
|
@response = nil
|
|
104
|
-
@result
|
|
105
|
-
@error
|
|
104
|
+
@result = nil
|
|
105
|
+
@error = nil
|
|
106
106
|
@attempt += 1
|
|
107
107
|
true
|
|
108
108
|
else
|
|
@@ -23,7 +23,7 @@ module Katalyst
|
|
|
23
23
|
|
|
24
24
|
def call(address:, bounds:)
|
|
25
25
|
@address = address
|
|
26
|
-
@bounds
|
|
26
|
+
@bounds = bounds
|
|
27
27
|
|
|
28
28
|
@response = Curl.get(url, **params) do |http|
|
|
29
29
|
http.headers["Content-Type"] = "application/json; UTF-8"
|
|
@@ -75,7 +75,7 @@ module Katalyst
|
|
|
75
75
|
location = first_location&.dig(:location)
|
|
76
76
|
return if location.blank?
|
|
77
77
|
|
|
78
|
-
latitude
|
|
78
|
+
latitude = location[:latitude]
|
|
79
79
|
longitude = location[:longitude]
|
|
80
80
|
return if latitude.nil? || longitude.nil?
|
|
81
81
|
|
|
@@ -95,7 +95,7 @@ module Katalyst
|
|
|
95
95
|
def params
|
|
96
96
|
low, high = @bounds.split("|")
|
|
97
97
|
|
|
98
|
-
low_lat, low_lng
|
|
98
|
+
low_lat, low_lng = low.split(",")
|
|
99
99
|
high_lat, high_lng = high.split(",")
|
|
100
100
|
|
|
101
101
|
{
|
|
@@ -3,20 +3,19 @@
|
|
|
3
3
|
module Katalyst
|
|
4
4
|
module GoogleApis
|
|
5
5
|
class Config
|
|
6
|
-
|
|
6
|
+
attr_accessor :project_id, :project_number, :service_account_email, :identity_pool, :identity_provider, :recaptcha
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
defaults
|
|
8
|
+
def initialize
|
|
9
|
+
@project_id = ENV.fetch("GOOGLE_PROJECT_ID", nil)
|
|
10
|
+
@project_number = ENV.fetch("GOOGLE_PROJECT_NUMBER", nil)
|
|
11
|
+
@service_account_email = ENV.fetch("GOOGLE_SERVICE_ACCOUNT_EMAIL", nil)
|
|
12
|
+
@identity_pool = ENV.fetch("GOOGLE_OIDC_IDENTITY_POOL", nil)
|
|
13
|
+
@identity_provider = ENV.fetch("GOOGLE_OIDC_IDENTITY_PROVIDER", nil)
|
|
14
|
+
@recaptcha = ActiveSupport::OrderedOptions.new.tap do |defaults|
|
|
15
|
+
defaults.site_key = ENV.fetch("GOOGLE_RECAPTCHA_SITE_KEY", nil)
|
|
16
|
+
defaults.score = ENV.fetch("GOOGLE_RECAPTCHA_SCORE", 0.5).to_f
|
|
17
|
+
defaults.test_mode = !ENV.fetch("VERIFY_RECAPTCHA", !Rails.env.local?)
|
|
18
|
+
end
|
|
20
19
|
end
|
|
21
20
|
end
|
|
22
21
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: katalyst-google-apis
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Katalyst Interactive
|
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
112
112
|
- !ruby/object:Gem::Version
|
|
113
113
|
version: '0'
|
|
114
114
|
requirements: []
|
|
115
|
-
rubygems_version: 4.0.
|
|
115
|
+
rubygems_version: 4.0.10
|
|
116
116
|
specification_version: 4
|
|
117
117
|
summary: Google REST APIs for use in Rails projects
|
|
118
118
|
test_files: []
|