storyblok 3.2.0 → 3.3.0
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/LICENSE +21 -0
- data/README.md +5 -1
- data/lib/storyblok/client.rb +12 -6
- data/lib/storyblok/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff2b96538cd2959b1a5f3e75a8fe05698875a8daea71fe5ddcf703206fc1efa2
|
4
|
+
data.tar.gz: c2c68e5926b227fb615311fe27da54f710b607cd9ab1282808219522ccbb4777
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54f690a2d6e335334dbaf384576023b5d8571100ad9ba6df9f4187adb9ff87bc5b2fc2f4268314e7f8348ae956727c94c95af5fc1ddebadf70f87d1a5f3a399c
|
7
|
+
data.tar.gz: 319006f9bd1f30487135838e120815d85350e06b49cdbae82190736aeba130a6c2fb35186b27149a24d72f6265695b8ba250842fc3db9fbb9bbf55b7fa143626
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Storyblok GmbH
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -43,7 +43,11 @@ Storyblok::Client.new(version: 'published')
|
|
43
43
|
|
44
44
|
#### Using the APIs on other regions
|
45
45
|
|
46
|
-
You should use the space access token
|
46
|
+
You should use the space access token with the `api_region` parameter whenever your space belongs to other server locations.
|
47
|
+
|
48
|
+
Available regions: `eu`, `us`, `ca` and `ap`.
|
49
|
+
|
50
|
+
Example on US region:
|
47
51
|
|
48
52
|
```ruby
|
49
53
|
client = Storyblok::Client.new(token: 'YOUR_TOKEN', api_region: 'us')
|
data/lib/storyblok/client.rb
CHANGED
@@ -19,7 +19,8 @@ module Storyblok
|
|
19
19
|
component_resolver: ->(component, data) { '' },
|
20
20
|
# :nocov:
|
21
21
|
cache_version: Time.now.to_i,
|
22
|
-
cache: nil
|
22
|
+
cache: nil,
|
23
|
+
request_type: nil
|
23
24
|
}
|
24
25
|
|
25
26
|
attr_reader :configuration, :logger
|
@@ -33,7 +34,8 @@ module Storyblok
|
|
33
34
|
# @option given_configuration [Number] :api_version
|
34
35
|
# @option given_configuration [String] :api_region
|
35
36
|
# @option given_configuration [false, ::Logger] :logger
|
36
|
-
# @option given_configuration [
|
37
|
+
# @option given_configuration [String] :token Required if oauth_token is not set
|
38
|
+
# @option given_configuration [String] :request_type
|
37
39
|
def initialize(given_configuration = {})
|
38
40
|
@configuration = default_configuration.merge(given_configuration)
|
39
41
|
@cache_version = '0'
|
@@ -238,13 +240,17 @@ module Storyblok
|
|
238
240
|
retries_left = 3
|
239
241
|
|
240
242
|
begin
|
243
|
+
headers = {
|
244
|
+
'SB-Agent-Version': Storyblok::VERSION,
|
245
|
+
'SB-Agent': 'SB-RB'
|
246
|
+
}
|
247
|
+
|
248
|
+
headers['X-Request-Type'] = @configuration[:request_type] unless @configuration[:request_type].to_s.empty?
|
249
|
+
|
241
250
|
# rubocop:disable Lint/UselessAssignment
|
242
251
|
res = RestClient.get(
|
243
252
|
"#{endpoint}?#{query_string}",
|
244
|
-
headers=
|
245
|
-
'SB-Agent-Version': Storyblok::VERSION,
|
246
|
-
'SB-Agent': 'SB-RB'
|
247
|
-
}
|
253
|
+
headers = headers
|
248
254
|
)
|
249
255
|
# rubocop:enable Lint/UselessAssignment
|
250
256
|
rescue RestClient::TooManyRequests
|
data/lib/storyblok/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: storyblok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Storyblok (Alexander Feiglstorfer)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- ".rubocop_strict.yml"
|
148
148
|
- ".rubocop_todo.yml"
|
149
149
|
- Gemfile
|
150
|
+
- LICENSE
|
150
151
|
- README.md
|
151
152
|
- examples/cache.rb
|
152
153
|
- examples/example_queries.rb
|
@@ -177,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
178
|
- !ruby/object:Gem::Version
|
178
179
|
version: '0'
|
179
180
|
requirements: []
|
180
|
-
rubygems_version: 3.1.
|
181
|
+
rubygems_version: 3.1.2
|
181
182
|
signing_key:
|
182
183
|
specification_version: 4
|
183
184
|
summary: storyblok
|