contentstack_utils 1.2.1 → 1.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 057734a6dc4a0d4c83fd080fa38d3b48c3a3f6238450d08c36195426a6621fdc
4
- data.tar.gz: a42094278201b9d4c330a3632c5ca7eb3326d8a81053afeae2bd1a9310484fd2
3
+ metadata.gz: 6c890b9256db072f365989b682e85e392b8a9276156bdeba326ed7e33dc13168
4
+ data.tar.gz: 0f1baccb3a59f74b9ddb187cd0685a26ca11ca25ab9c0f2ff7c59831f124e2a8
5
5
  SHA512:
6
- metadata.gz: 9ade378488cd299eb26c7aa800b77a3effc1a44b9ff46ffa1f677437d28a618e4db81bee3219125c8504f421b7bacafd2496b51637c542d33a38fd74b2e68c35
7
- data.tar.gz: afaa54c6991caf5e8bbd84ac00b94494229fcc7317cf00be8feac538a4b1775b6be56e7008c17b89067e641448d3724f6cee3de0f236022336c4e062356fd650
6
+ metadata.gz: 0475ed7cd2e7def609f51a30b538610176a636734ba1887209a48b4a6cb9447dbed84573dd06114e60965b730860696a3dd756bab1c162ff5a946baf23bd2df4
7
+ data.tar.gz: c6197cd38a03cdd3aaba36ccd49947701f1cd10e7c6475240064d2378a02843d8c861d68a35ad1327106a0bf7a6a320853ff49a77908f83778b7de89a768bd04
@@ -8,13 +8,13 @@ jobs:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
10
  - name: Comment PR
11
- if: github.base_ref == 'master' && github.head_ref != 'next'
11
+ if: github.base_ref == 'master' && github.head_ref != 'staging'
12
12
  uses: thollander/actions-comment-pull-request@v2
13
13
  with:
14
14
  message: |
15
15
  We regret to inform you that you are currently not able to merge your changes into the master branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the next branch. Our team will then review the changes and work with you to ensure a successful merge into the master branch.
16
16
  - name: Check branch
17
- if: github.base_ref == 'master' && github.head_ref != 'next'
17
+ if: github.base_ref == 'master' && github.head_ref != 'staging'
18
18
  run: |
19
19
  echo "ERROR: We regret to inform you that you are currently not able to merge your changes into the master branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the next branch. Our team will then review the changes and work with you to ensure a successful merge into the master branch."
20
20
  exit 1
@@ -0,0 +1,31 @@
1
+ name: Create Jira Ticket for Github Issue
2
+
3
+ on:
4
+ issues:
5
+ types: [opened]
6
+
7
+ jobs:
8
+ issue-jira:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+
12
+ - name: Login to Jira
13
+ uses: atlassian/gajira-login@master
14
+ env:
15
+ JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
16
+ JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
17
+ JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
18
+
19
+ - name: Create Jira Issue
20
+ id: create_jira
21
+ uses: atlassian/gajira-create@master
22
+ with:
23
+ project: ${{ secrets.JIRA_PROJECT }}
24
+ issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
25
+ summary: Github | Issue | ${{ github.event.repository.name }} | ${{ github.event.issue.title }}
26
+ description: |
27
+ *GitHub Issue:* ${{ github.event.issue.html_url }}
28
+
29
+ *Description:*
30
+ ${{ github.event.issue.body }}
31
+ fields: "${{ secrets.ISSUES_JIRA_FIELDS }}"
@@ -0,0 +1,46 @@
1
+ name: Checks the security policy and configurations
2
+ on:
3
+ pull_request:
4
+ types: [opened, synchronize, reopened]
5
+ jobs:
6
+ security-policy:
7
+ if: github.event.repository.visibility == 'public'
8
+ runs-on: ubuntu-latest
9
+ defaults:
10
+ run:
11
+ shell: bash
12
+ steps:
13
+ - uses: actions/checkout@master
14
+ - name: Checks for SECURITY.md policy file
15
+ run: |
16
+ if ! [[ -f "SECURITY.md" || -f ".github/SECURITY.md" ]]; then exit 1; fi
17
+ security-license:
18
+ if: github.event.repository.visibility == 'public'
19
+ runs-on: ubuntu-latest
20
+ defaults:
21
+ run:
22
+ shell: bash
23
+ steps:
24
+ - uses: actions/checkout@master
25
+ - name: Checks for License file
26
+ run: |
27
+ expected_license_files=("LICENSE" "LICENSE.txt" "LICENSE.md" "License.txt")
28
+ license_file_found=false
29
+ current_year=$(date +"%Y")
30
+
31
+ for license_file in "${expected_license_files[@]}"; do
32
+ if [ -f "$license_file" ]; then
33
+ license_file_found=true
34
+ # check the license file for the current year, if not exists, exit with error
35
+ if ! grep -q "$current_year" "$license_file"; then
36
+ echo "License file $license_file does not contain the current year."
37
+ exit 2
38
+ fi
39
+ break
40
+ fi
41
+ done
42
+
43
+ if [ "$license_file_found" = false ]; then
44
+ echo "No license file found. Please add a license file to the repository."
45
+ exit 1
46
+ fi
@@ -3,7 +3,7 @@ on:
3
3
  pull_request:
4
4
  types: [opened, synchronize, reopened]
5
5
  jobs:
6
- security:
6
+ security-sca:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
9
  - uses: actions/checkout@master
data/.talismanrc ADDED
@@ -0,0 +1,5 @@
1
+ fileignoreconfig:
2
+ - filename: .github/workflows/secrets-scan.yml
3
+ ignore_detectors:
4
+ - filecontent
5
+ version: "1.0"
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
  # Changelog
2
+
3
+ ## [1.2.3](https://github.com/contentstack/contentstack-utils-ruby/tree/v1.2.3) (2026-03-30)
4
+ - Fixed GQL JSON test helper parsing for hash-based fixtures by serializing Ruby hashes to JSON.
5
+ - Normalized non-doc fragment list fixtures into doc-root shape to keep nested list fragment specs stable.
6
+
7
+ ## [1.2.2](https://github.com/contentstack/contentstack-utils-ruby/tree/v1.2.2) (2026-01-05)
8
+ - Fixed snyk security issues
2
9
  ## [1.2.1](https://github.com/contentstack/contentstack-utils-ruby/tree/v1.2.1) (2024-02-27)
3
10
  - Support for JSON RTE with fragment in nested list
4
11
  ## [1.2.0](https://github.com/contentstack/contentstack-utils-ruby/tree/v1.2.0) (2023-06-20)
data/CODEOWNERS CHANGED
@@ -1 +1,11 @@
1
- * @contentstack/security-admin
1
+ * @contentstack/devex-pr-reviewers
2
+
3
+ .github/workflows/sca-scan.yml @contentstack/security-admin
4
+
5
+ .github/workflows/codeql-anaylsis.yml @contentstack/security-admin
6
+
7
+ **/.snyk @contentstack/security-admin
8
+
9
+ .github/workflows/policy-scan.yml @contentstack/security-admin
10
+
11
+ .github/workflows/issues-jira.yml @contentstack/security-admin
data/Gemfile.lock CHANGED
@@ -1,75 +1,85 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- contentstack_utils (1.2.1)
5
- activesupport (>= 7.0)
6
- nokogiri (>= 1.11)
4
+ contentstack_utils (1.2.3)
5
+ activesupport (>= 8.0)
6
+ nokogiri (>= 1.19)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.1.3.2)
11
+ activesupport (8.1.3)
12
12
  base64
13
13
  bigdecimal
14
- concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ concurrent-ruby (~> 1.0, >= 1.3.1)
15
15
  connection_pool (>= 2.2.5)
16
16
  drb
17
17
  i18n (>= 1.6, < 2)
18
+ json
19
+ logger (>= 1.4.2)
18
20
  minitest (>= 5.1)
19
- mutex_m
20
- tzinfo (~> 2.0)
21
- addressable (2.8.6)
22
- public_suffix (>= 2.0.2, < 6.0)
23
- base64 (0.2.0)
24
- bigdecimal (3.1.6)
25
- concurrent-ruby (1.2.3)
26
- connection_pool (2.4.1)
27
- crack (1.0.0)
21
+ securerandom (>= 0.3)
22
+ tzinfo (~> 2.0, >= 2.0.5)
23
+ uri (>= 0.13.1)
24
+ addressable (2.8.9)
25
+ public_suffix (>= 2.0.2, < 8.0)
26
+ base64 (0.3.0)
27
+ bigdecimal (4.0.1)
28
+ concurrent-ruby (1.3.6)
29
+ connection_pool (3.0.2)
30
+ crack (1.0.1)
28
31
  bigdecimal
29
32
  rexml
30
- diff-lcs (1.5.1)
31
- docile (1.4.0)
32
- drb (2.2.1)
33
- hashdiff (1.1.0)
34
- i18n (1.14.1)
33
+ diff-lcs (1.6.2)
34
+ docile (1.4.1)
35
+ drb (2.2.3)
36
+ hashdiff (1.2.1)
37
+ i18n (1.14.8)
35
38
  concurrent-ruby (~> 1.0)
36
- minitest (5.22.2)
37
- mutex_m (0.2.0)
38
- nokogiri (1.16.2-arm64-darwin)
39
+ json (2.19.3)
40
+ logger (1.7.0)
41
+ minitest (6.0.2)
42
+ drb (~> 2.0)
43
+ prism (~> 1.5)
44
+ nokogiri (1.19.2-arm64-darwin)
39
45
  racc (~> 1.4)
40
- public_suffix (5.0.4)
41
- racc (1.7.3)
42
- rake (13.1.0)
43
- rexml (3.2.6)
44
- rspec (3.13.0)
46
+ prism (1.9.0)
47
+ public_suffix (7.0.5)
48
+ racc (1.8.1)
49
+ rake (13.3.1)
50
+ rexml (3.4.4)
51
+ rspec (3.13.2)
45
52
  rspec-core (~> 3.13.0)
46
53
  rspec-expectations (~> 3.13.0)
47
54
  rspec-mocks (~> 3.13.0)
48
- rspec-core (3.13.0)
55
+ rspec-core (3.13.6)
49
56
  rspec-support (~> 3.13.0)
50
- rspec-expectations (3.13.0)
57
+ rspec-expectations (3.13.5)
51
58
  diff-lcs (>= 1.2.0, < 2.0)
52
59
  rspec-support (~> 3.13.0)
53
- rspec-mocks (3.13.0)
60
+ rspec-mocks (3.13.8)
54
61
  diff-lcs (>= 1.2.0, < 2.0)
55
62
  rspec-support (~> 3.13.0)
56
- rspec-support (3.13.1)
63
+ rspec-support (3.13.7)
64
+ securerandom (0.4.1)
57
65
  simplecov (0.22.0)
58
66
  docile (~> 1.1)
59
67
  simplecov-html (~> 0.11)
60
68
  simplecov_json_formatter (~> 0.1)
61
- simplecov-html (0.12.3)
69
+ simplecov-html (0.13.2)
62
70
  simplecov_json_formatter (0.1.4)
63
71
  tzinfo (2.0.6)
64
72
  concurrent-ruby (~> 1.0)
65
- webmock (3.23.0)
73
+ uri (1.1.1)
74
+ webmock (3.26.2)
66
75
  addressable (>= 2.8.0)
67
76
  crack (>= 0.3.2)
68
77
  hashdiff (>= 0.4.0, < 2.0.0)
69
- yard (0.9.36)
78
+ yard (0.9.38)
70
79
 
71
80
  PLATFORMS
72
81
  arm64-darwin-22
82
+ arm64-darwin-25
73
83
 
74
84
  DEPENDENCIES
75
85
  contentstack_utils!
@@ -77,7 +87,7 @@ DEPENDENCIES
77
87
  rspec (~> 3.13)
78
88
  simplecov (~> 0.22)
79
89
  webmock (~> 3.23)
80
- yard (~> 0.9.36)
90
+ yard (~> 0.9.38)
81
91
 
82
92
  BUNDLED WITH
83
93
  2.3.26
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2012-2024 Contentstack. All Rights Reserved
3
+ Copyright (c) 2012-2026 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
@@ -21,12 +21,12 @@ Gem::Specification.new do |s|
21
21
  s.test_files = s.files.grep(%r{^spec/})
22
22
  s.require_paths = ["lib"]
23
23
 
24
- s.add_dependency 'activesupport', '>= 7.0'
25
- s.add_dependency 'nokogiri', '>= 1.11'
24
+ s.add_dependency 'activesupport', '>= 8.0'
25
+ s.add_dependency 'nokogiri', '>= 1.19'
26
26
 
27
27
  s.add_development_dependency 'rake', '~> 13.0'
28
28
  s.add_development_dependency 'rspec', '~> 3.13'
29
29
  s.add_development_dependency 'webmock', '~> 3.23'
30
30
  s.add_development_dependency 'simplecov', '~> 0.22'
31
- s.add_development_dependency 'yard', '~> 0.9.36'
31
+ s.add_development_dependency 'yard', '~> 0.9.38'
32
32
  end
@@ -1,3 +1,3 @@
1
1
  module ContentstackUtils
2
- VERSION = "1.2.1"
3
- end
2
+ VERSION = "1.2.3"
3
+ end
@@ -17,14 +17,22 @@ def getJson(text)
17
17
  end
18
18
 
19
19
  def getGQLJSONRTE(node, item = '""')
20
+ normalized_node = node
21
+ if node.is_a?(Hash) && node["type"] != "doc" && node[:type] != "doc"
22
+ normalized_node = { "type" => "doc", "children" => [node] }
23
+ end
24
+
25
+ node_payload = normalized_node.is_a?(String) ? normalized_node : JSON.generate(normalized_node)
26
+ item_payload = item.is_a?(String) ? item : JSON.generate(item)
27
+
20
28
  entry = "{
21
29
  \"single_rte\": {
22
- \"json\": #{node},
23
- \"embedded_itemsConnection\": #{item}
30
+ \"json\": #{node_payload},
31
+ \"embedded_itemsConnection\": #{item_payload}
24
32
  },
25
33
  \"multiple_rte\": {
26
- \"json\": [#{node}],
27
- \"embedded_itemsConnection\": #{item}
34
+ \"json\": [#{node_payload}],
35
+ \"embedded_itemsConnection\": #{item_payload}
28
36
  }
29
37
  }"
30
38
  getJson(entry)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentstack_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentstack
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-08 00:00:00.000000000 Z
11
+ date: 2026-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '7.0'
19
+ version: '8.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '7.0'
26
+ version: '8.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.11'
33
+ version: '1.19'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.11'
40
+ version: '1.19'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.9.36
103
+ version: 0.9.38
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.9.36
110
+ version: 0.9.38
111
111
  description: Contentstack Ruby client for the Content Delivery API
112
112
  email:
113
113
  - support@contentstack.com
@@ -117,11 +117,13 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - ".github/workflows/check-branch.yml"
119
119
  - ".github/workflows/codeql-analysis.yml"
120
- - ".github/workflows/jira.yml"
120
+ - ".github/workflows/issues-jira.yml"
121
+ - ".github/workflows/policy-scan.yml"
121
122
  - ".github/workflows/release-gem.yml"
122
123
  - ".github/workflows/sca-scan.yml"
123
124
  - ".gitignore"
124
125
  - ".ruby-version"
126
+ - ".talismanrc"
125
127
  - ".yardopts"
126
128
  - CHANGELOG.md
127
129
  - CODEOWNERS
@@ -152,7 +154,7 @@ homepage: https://github.com/contentstack/contentstack-utils-ruby
152
154
  licenses:
153
155
  - MIT
154
156
  metadata: {}
155
- post_install_message:
157
+ post_install_message:
156
158
  rdoc_options: []
157
159
  require_paths:
158
160
  - lib
@@ -168,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
170
  version: '0'
169
171
  requirements: []
170
172
  rubygems_version: 3.1.6
171
- signing_key:
173
+ signing_key:
172
174
  specification_version: 4
173
175
  summary: Contentstack Ruby Utils for
174
176
  test_files:
@@ -1,28 +0,0 @@
1
- name: Create JIRA ISSUE
2
- on:
3
- pull_request:
4
- types: [opened]
5
- jobs:
6
- security:
7
- if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'snyk-bot' || contains(github.event.pull_request.head.ref, 'snyk-fix-') || contains(github.event.pull_request.head.ref, 'snyk-upgrade-')}}
8
- runs-on: ubuntu-latest
9
- steps:
10
- - uses: actions/checkout@v2
11
- - name: Login into JIRA
12
- uses: atlassian/gajira-login@master
13
- env:
14
- JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
15
- JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
16
- JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
17
- - name: Create a JIRA Issue
18
- id: create
19
- uses: atlassian/gajira-create@master
20
- with:
21
- project: ${{ secrets.JIRA_PROJECT }}
22
- issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
23
- summary: |
24
- ${{ github.event.pull_request.title }}
25
- description: |
26
- PR: ${{ github.event.pull_request.html_url }}
27
-
28
- fields: "${{ secrets.JIRA_FIELDS }}"