contentstack 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release-gem.yml +3 -7
- data/CHANGELOG.md +7 -1
- data/CODEOWNERS +1 -1
- data/Gemfile.lock +27 -22
- data/LICENSE.txt +1 -1
- data/lib/contentstack/client.rb +15 -11
- data/lib/contentstack/region.rb +2 -1
- data/lib/contentstack/version.rb +2 -2
- data/spec/contentstack_spec.rb +15 -10
- metadata +5 -7
- data/.github/workflows/sast-scan.yml +0 -11
- data/.github/workflows/secrets-scan.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79cfe8aeaad0941d21a637ef8f87713cbaaf4a51376bb1969b45c59565536302
|
4
|
+
data.tar.gz: bd4f522c7f22bafd7d0fa4b3aedd831545cf45be8d5ba66c13a02bd7e336cfb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf719d78118b2c1d1ebf10e1cc7ae47bf9b548f158b4d4399e0f1d4813fd39636eb7f0c92e1614a102ce880ce901dd09939bcbd31dd22617b4c78501a8d0d9ab
|
7
|
+
data.tar.gz: 67262e37224ce8a9d0249b497a09caeefea1ed99a3ea5bcd63833fa78551774c824946f18a6b7a56916ba328db914dc7bbb4f7f05772ce2c2da7090a264b9947
|
@@ -15,17 +15,13 @@ jobs:
|
|
15
15
|
steps:
|
16
16
|
- uses: actions/checkout@v3
|
17
17
|
- name: Set up Ruby 2.7
|
18
|
-
uses:
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
19
|
with:
|
20
|
-
ruby-version: 2.7
|
20
|
+
ruby-version: '2.7'
|
21
21
|
|
22
22
|
- name: Publish to RubyGems
|
23
23
|
run: |
|
24
|
-
mkdir -p $HOME/.gem
|
25
|
-
touch $HOME/.gem/credentials
|
26
|
-
chmod 0600 $HOME/.gem/credentials
|
27
|
-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
28
24
|
gem build *.gemspec
|
29
25
|
gem push *.gem
|
30
26
|
env:
|
31
|
-
GEM_HOST_API_KEY:
|
27
|
+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
## CHANGELOG
|
2
2
|
|
3
|
-
## Version 0.
|
3
|
+
## Version 0.8.0
|
4
|
+
### Date: 14th-May-2024
|
5
|
+
### Enhancement
|
6
|
+
- Region support for GCP-NA added
|
7
|
+
|
8
|
+
------------------------------------------------
|
9
|
+
## Version 0.7.0
|
4
10
|
### Date: 17th-Apr-2023
|
5
11
|
### Enhancement
|
6
12
|
- Include metadata support for Asset, Entry and Query,
|
data/CODEOWNERS
CHANGED
@@ -1 +1 @@
|
|
1
|
-
* @contentstack/security-admin
|
1
|
+
* @contentstack/security-admin
|
data/Gemfile.lock
CHANGED
@@ -1,42 +1,48 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
5
|
-
contentstack (0.7.0)
|
4
|
+
contentstack (0.8.0)
|
6
5
|
activesupport (>= 3.2)
|
7
6
|
contentstack_utils (~> 1.0)
|
8
7
|
|
9
8
|
GEM
|
10
9
|
remote: https://rubygems.org/
|
11
10
|
specs:
|
12
|
-
activesupport (7.
|
11
|
+
activesupport (7.1.3.2)
|
12
|
+
base64
|
13
|
+
bigdecimal
|
13
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
|
+
connection_pool (>= 2.2.5)
|
16
|
+
drb
|
14
17
|
i18n (>= 1.6, < 2)
|
15
18
|
minitest (>= 5.1)
|
19
|
+
mutex_m
|
16
20
|
tzinfo (~> 2.0)
|
17
|
-
addressable (2.8.
|
21
|
+
addressable (2.8.6)
|
18
22
|
public_suffix (>= 2.0.2, < 6.0)
|
19
|
-
|
20
|
-
|
23
|
+
base64 (0.2.0)
|
24
|
+
bigdecimal (3.1.8)
|
25
|
+
concurrent-ruby (1.2.3)
|
26
|
+
connection_pool (2.4.1)
|
27
|
+
contentstack_utils (1.2.0)
|
21
28
|
activesupport (>= 3.2)
|
22
29
|
nokogiri (~> 1.11)
|
23
|
-
crack (0.
|
30
|
+
crack (1.0.0)
|
31
|
+
bigdecimal
|
24
32
|
rexml
|
25
|
-
diff-lcs (1.5.
|
33
|
+
diff-lcs (1.5.1)
|
26
34
|
docile (1.4.0)
|
27
|
-
|
28
|
-
|
35
|
+
drb (2.2.1)
|
36
|
+
hashdiff (1.1.0)
|
37
|
+
i18n (1.14.5)
|
29
38
|
concurrent-ruby (~> 1.0)
|
30
|
-
|
31
|
-
|
32
|
-
nokogiri (1.
|
33
|
-
mini_portile2 (~> 2.8.0)
|
34
|
-
racc (~> 1.4)
|
35
|
-
nokogiri (1.14.3-x64-mingw32)
|
39
|
+
minitest (5.22.3)
|
40
|
+
mutex_m (0.2.0)
|
41
|
+
nokogiri (1.15.6-arm64-darwin)
|
36
42
|
racc (~> 1.4)
|
37
|
-
public_suffix (5.0.
|
38
|
-
racc (1.
|
39
|
-
rexml (3.2.
|
43
|
+
public_suffix (5.0.5)
|
44
|
+
racc (1.7.3)
|
45
|
+
rexml (3.2.6)
|
40
46
|
rspec (3.10.0)
|
41
47
|
rspec-core (~> 3.10.0)
|
42
48
|
rspec-expectations (~> 3.10.0)
|
@@ -62,11 +68,10 @@ GEM
|
|
62
68
|
addressable (>= 2.3.6)
|
63
69
|
crack (>= 0.3.2)
|
64
70
|
hashdiff (>= 0.4.0, < 2.0.0)
|
65
|
-
yard (0.9.
|
71
|
+
yard (0.9.36)
|
66
72
|
|
67
73
|
PLATFORMS
|
68
|
-
|
69
|
-
x64-mingw32
|
74
|
+
arm64-darwin-22
|
70
75
|
|
71
76
|
DEPENDENCIES
|
72
77
|
contentstack!
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2012-
|
3
|
+
Copyright (c) 2012-2024 Contentstack. All Rights Reserved
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/lib/contentstack/client.rb
CHANGED
@@ -36,7 +36,7 @@ module Contentstack
|
|
36
36
|
raise Contentstack::Error.new("Proxy Port Should not be Empty") if @proxy_details.present? && @proxy_details[:port].empty?
|
37
37
|
API.init_api(api_key, delivery_token, environment, @host, @branch, @live_preview, @proxy_details, retry_options)
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
def content_types
|
41
41
|
ContentType.all
|
42
42
|
end
|
@@ -56,21 +56,21 @@ module Contentstack
|
|
56
56
|
def live_preview_query(query={})
|
57
57
|
API.live_preview_query(query)
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
# Syncs your Contentstack data with your app and ensures that the data is always up-to-date by providing delta updates
|
61
|
-
#
|
61
|
+
#
|
62
62
|
# Stack.sync({'init': true}) // For initializing sync
|
63
|
-
#
|
63
|
+
#
|
64
64
|
# Stack.sync({'init': true, 'locale': 'en-us'}) //For initializing sync with entries of a specific locale
|
65
|
-
#
|
65
|
+
#
|
66
66
|
# Stack.sync({'init': true, 'start_date': '2018-10-22'}) //For initializing sync with entries published after a specific date
|
67
|
-
#
|
67
|
+
#
|
68
68
|
# Stack.sync({'init': true, 'content_type_uid': 'session'}) //For initializing sync with entries of a specific content type
|
69
|
-
#
|
69
|
+
#
|
70
70
|
# Stack.sync({'init': true, 'type': 'entry_published'}) // Use the type parameter to get a specific type of content.Supports 'asset_published', 'entry_published', 'asset_unpublished', 'entry_unpublished', 'asset_deleted', 'entry_deleted', 'content_type_deleted'.
|
71
|
-
#
|
71
|
+
#
|
72
72
|
# Stack.sync({'pagination_token': '<pagination>'}) // For fetching the next batch of entries using pagination token
|
73
|
-
#
|
73
|
+
#
|
74
74
|
# Stack.sync({'sync_token': '<sync>'}) // For performing subsequent sync after initial sync
|
75
75
|
#
|
76
76
|
# @param params [Hash] params is an object that supports ‘locale’, ‘start_date’, ‘content_type_uid’, and ‘type’ queries.
|
@@ -91,6 +91,8 @@ module Contentstack
|
|
91
91
|
host = "#{Contentstack::Host::PROTOCOL}azure-na-cdn.#{Contentstack::Host::HOST}"
|
92
92
|
when "azure-eu"
|
93
93
|
host = "#{Contentstack::Host::PROTOCOL}azure-eu-cdn.#{Contentstack::Host::HOST}"
|
94
|
+
when "gcp-na"
|
95
|
+
host = "#{Contentstack::Host::PROTOCOL}gcp-na-cdn.#{Contentstack::Host::HOST}"
|
94
96
|
end
|
95
97
|
host
|
96
98
|
end
|
@@ -109,15 +111,17 @@ module Contentstack
|
|
109
111
|
host = "#{Contentstack::Host::PROTOCOL}azure-na-cdn.#{custom_host}"
|
110
112
|
when "azure-eu"
|
111
113
|
host = "#{Contentstack::Host::PROTOCOL}azure-eu-cdn.#{custom_host}"
|
114
|
+
when "gcp-na"
|
115
|
+
host = "#{Contentstack::Host::PROTOCOL}gcp-na-cdn.#{custom_host}"
|
112
116
|
end
|
113
117
|
elsif options[:host].present? && region.empty?
|
114
118
|
custom_host = options[:host]
|
115
119
|
host = "#{Contentstack::Host::PROTOCOL}cdn.#{custom_host}"
|
116
120
|
else
|
117
|
-
host = "#{Contentstack::Host::PROTOCOL}#{Contentstack::Host::DEFAULT_HOST}" #set default host if region and host is empty
|
121
|
+
host = "#{Contentstack::Host::PROTOCOL}#{Contentstack::Host::DEFAULT_HOST}" #set default host if region and host is empty
|
118
122
|
end
|
119
123
|
host
|
120
124
|
end
|
121
125
|
|
122
126
|
end
|
123
|
-
end
|
127
|
+
end
|
data/lib/contentstack/region.rb
CHANGED
data/lib/contentstack/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Contentstack
|
2
|
-
VERSION = "0.
|
3
|
-
end
|
2
|
+
VERSION = "0.8.0"
|
3
|
+
end
|
data/spec/contentstack_spec.rb
CHANGED
@@ -9,6 +9,7 @@ describe Contentstack do
|
|
9
9
|
let(:custom_host_eu_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {host: "contentstack.com", region: Contentstack::Region::EU}) }
|
10
10
|
let(:custom_host_azure_eu_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {host: "contentstack.com", region: Contentstack::Region::AZURE_EU}) }
|
11
11
|
let(:custom_host_azure_na_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {host: "contentstack.com", region: Contentstack::Region::AZURE_NA}) }
|
12
|
+
let(:custom_host_gcp_na_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {host: "contentstack.com", region: Contentstack::Region::GCP_NA}) }
|
12
13
|
|
13
14
|
it "has a version number" do
|
14
15
|
expect(Contentstack::VERSION).not_to be nil
|
@@ -23,42 +24,46 @@ describe Contentstack do
|
|
23
24
|
|
24
25
|
it "has default host and region" do
|
25
26
|
expect(client.region).to eq Contentstack::Region::US
|
26
|
-
expect(client.host).to eq 'https://cdn.contentstack.io'
|
27
|
+
expect(client.host).to eq 'https://cdn.contentstack.io'
|
27
28
|
end
|
28
29
|
|
29
30
|
it "has custom region with region host" do
|
30
31
|
expect(eu_client.region).to eq Contentstack::Region::EU
|
31
|
-
expect(eu_client.host).to eq 'https://eu-cdn.contentstack.com'
|
32
|
+
expect(eu_client.host).to eq 'https://eu-cdn.contentstack.com'
|
32
33
|
end
|
33
34
|
|
34
35
|
it "has custom region with region host" do
|
35
36
|
expect(azure_na_client.region).to eq Contentstack::Region::AZURE_NA
|
36
|
-
expect(azure_na_client.host).to eq 'https://azure-na-cdn.contentstack.com'
|
37
|
+
expect(azure_na_client.host).to eq 'https://azure-na-cdn.contentstack.com'
|
37
38
|
end
|
38
39
|
|
39
40
|
it "has custom region with region host" do
|
40
41
|
expect(azure_eu_client.region).to eq Contentstack::Region::AZURE_EU
|
41
|
-
expect(azure_eu_client.host).to eq 'https://azure-eu-cdn.contentstack.com'
|
42
|
+
expect(azure_eu_client.host).to eq 'https://azure-eu-cdn.contentstack.com'
|
42
43
|
end
|
43
44
|
|
44
45
|
it "has custom host and eu region" do
|
45
|
-
expect(custom_host_eu_client.host).to eq 'https://eu-cdn.contentstack.com'
|
46
|
+
expect(custom_host_eu_client.host).to eq 'https://eu-cdn.contentstack.com'
|
46
47
|
end
|
47
48
|
|
48
49
|
it "has custom host and azure-eu region" do
|
49
|
-
expect(custom_host_azure_eu_client.host).to eq 'https://azure-eu-cdn.contentstack.com'
|
50
|
+
expect(custom_host_azure_eu_client.host).to eq 'https://azure-eu-cdn.contentstack.com'
|
50
51
|
end
|
51
52
|
|
52
53
|
it "has custom host and azure-na region" do
|
53
|
-
expect(custom_host_azure_na_client.host).to eq 'https://azure-na-cdn.contentstack.com'
|
54
|
+
expect(custom_host_azure_na_client.host).to eq 'https://azure-na-cdn.contentstack.com'
|
55
|
+
end
|
56
|
+
|
57
|
+
it "has custom host and gcp-na region" do
|
58
|
+
expect(custom_host_gcp_na_client.host).to eq 'https://gcp-na-cdn.contentstack.com'
|
54
59
|
end
|
55
60
|
|
56
61
|
|
57
62
|
it "JSON to HTML" do
|
58
|
-
expect(Contentstack::json_to_html({}, ContentstackUtils::Model::Options.new())).to eq ''
|
63
|
+
expect(Contentstack::json_to_html({}, ContentstackUtils::Model::Options.new())).to eq ''
|
59
64
|
end
|
60
65
|
|
61
66
|
it "JSON to HTML" do
|
62
|
-
expect(Contentstack::render_content('', ContentstackUtils::Model::Options.new())).to eq ''
|
67
|
+
expect(Contentstack::render_content('', ContentstackUtils::Model::Options.new())).to eq ''
|
63
68
|
end
|
64
|
-
end
|
69
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contentstack
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -105,9 +105,7 @@ files:
|
|
105
105
|
- ".github/workflows/codeql-analysis.yml"
|
106
106
|
- ".github/workflows/jira.yml"
|
107
107
|
- ".github/workflows/release-gem.yml"
|
108
|
-
- ".github/workflows/sast-scan.yml"
|
109
108
|
- ".github/workflows/sca-scan.yml"
|
110
|
-
- ".github/workflows/secrets-scan.yml"
|
111
109
|
- ".gitignore"
|
112
110
|
- ".talismanrc"
|
113
111
|
- ".yardopts"
|
@@ -158,7 +156,7 @@ homepage: https://github.com/contentstack/contentstack-ruby
|
|
158
156
|
licenses:
|
159
157
|
- MIT
|
160
158
|
metadata: {}
|
161
|
-
post_install_message:
|
159
|
+
post_install_message:
|
162
160
|
rdoc_options: []
|
163
161
|
require_paths:
|
164
162
|
- lib
|
@@ -174,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
172
|
version: '0'
|
175
173
|
requirements: []
|
176
174
|
rubygems_version: 3.1.6
|
177
|
-
signing_key:
|
175
|
+
signing_key:
|
178
176
|
specification_version: 4
|
179
177
|
summary: Contentstack Ruby client for the Content Delivery API
|
180
178
|
test_files: []
|
@@ -1,11 +0,0 @@
|
|
1
|
-
name: SAST Scan
|
2
|
-
on:
|
3
|
-
pull_request:
|
4
|
-
types: [opened, synchronize, reopened]
|
5
|
-
jobs:
|
6
|
-
security:
|
7
|
-
runs-on: ubuntu-latest
|
8
|
-
steps:
|
9
|
-
- uses: actions/checkout@v2
|
10
|
-
- name: Horusec Scan
|
11
|
-
run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/src horuszup/horusec-cli:latest horusec start -p /src -P $(pwd)
|