contentstack 0.8.3 → 0.8.4

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: 88426b0abac8a7569724d6e382a2c2d602fded747c52f6e9464fa69517fc52b8
4
- data.tar.gz: 36f5e31ca7ecfb36746c58c04c3ed570eee40472bae9ab441d92e1eab57f395a
3
+ metadata.gz: b496abfa2bddd87690df60b5271eedbbe2b3803e888ee9de01cd2dbdf28b3f4f
4
+ data.tar.gz: e156a8022a32343d42ab8b28ebf48a9e48cbc31bf2d188eca936059443d703cc
5
5
  SHA512:
6
- metadata.gz: 444aa9aa0fa377b1ecd7f0387b8c3a9d739e22fa8d94c3021aa10c32caefa7900660b716c4fe55cceff18c1d472ed27d0fb8ed49b9a9ee609b4b2219433c63ae
7
- data.tar.gz: 603f45c2edea5b7106449beb2873ff5916ebc343c470926682cfdf85eb1fa4ddbfd1befd5e0bb49c11cf458535b0359f319b27630e9dd47c58ba5b3815105380
6
+ metadata.gz: 1aec5d7f59a1a56903a7d31d59671f0dc6daaf52dec83d8fe52b2c9653e40b1341b03cbf2f52f60761e26e4a0ffaa50387f5c8f529a6011afe35ead5ba17d434
7
+ data.tar.gz: 6994156034d105442de60df1091d3b26aa7eae02c7ce9cfaf68315bfd868710626c3cfba08f3e69cc83dd4944695b8ad40cbb5761feac2fb52097f1a05bb3464
@@ -0,0 +1,5 @@
1
+ # Cursor (optional)
2
+
3
+ **Cursor** users: start at **[AGENTS.md](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.
4
+
5
+ This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.
data/AGENTS.md ADDED
@@ -0,0 +1,51 @@
1
+ # Contentstack Ruby SDK – Agent guide
2
+
3
+ **Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**.
4
+
5
+ ## What this repo is
6
+
7
+ | Field | Detail |
8
+ | --- | --- |
9
+ | **Name:** | [contentstack/contentstack-ruby](https://github.com/contentstack/contentstack-ruby) (Ruby gem `contentstack`) |
10
+ | **Purpose:** | Ruby client for the Contentstack Content Delivery API (CDA): stack client, content types, entries, assets, queries, sync, and live preview. |
11
+ | **Out of scope (if any):** | Management / write APIs and app-specific business logic live outside this gem. Rich-text rendering delegates to the `contentstack_utils` gem. |
12
+
13
+ ## Tech stack (at a glance)
14
+
15
+ | Area | Details |
16
+ | --- | --- |
17
+ | Language | Ruby **≥ 3.3** (see `contentstack.gemspec` and `.ruby-version`; team uses **3.3.x** locally). |
18
+ | Build | **Bundler** + **`contentstack.gemspec`**; `Gemfile` pulls the gemspec. |
19
+ | Tests | **RSpec 3** under `spec/**/*_spec.rb`; **`spec/spec_helper.rb`** loads WebMock and SimpleCov. |
20
+ | Lint / coverage | **SimpleCov** (via `spec_helper.rb`); HTML under `coverage/`. No RuboCop in this repo. **YARD** for API docs (see `rakefile.rb`, `.yardopts`). |
21
+ | Runtime deps | `activesupport`, `contentstack_utils` (~> 1.2); `Gemfile` pins **nokogiri** for security alignment. |
22
+
23
+ ## Commands (quick reference)
24
+
25
+ | Command type | Command |
26
+ | --- | --- |
27
+ | Install deps | `bundle install` |
28
+ | Build gem | `gem build contentstack.gemspec` |
29
+ | Test | `bundle exec rspec` |
30
+ | Single file | `bundle exec rspec spec/path/to_spec.rb` |
31
+ | Lint / format | No RuboCop or formatter in-repo; match existing `lib/` and `spec/` style. |
32
+ | Docs (YARD) | `bundle exec rake yard` |
33
+
34
+ **CI / automation:** `.github/workflows/check-branch.yml` (PR branch rules toward `master`), `.github/workflows/release-gem.yml` (publish on release), plus `codeql-analysis.yml`, `sca-scan.yml`, `policy-scan.yml`, `issues-jira.yml`. There is no dedicated “run RSpec on every PR” workflow in-repo—run tests locally before opening a PR.
35
+
36
+ ## Where the documentation lives: skills
37
+
38
+ | Skill | Path | What it covers |
39
+ | --- | --- | --- |
40
+ | Dev workflow | `skills/dev-workflow/SKILL.md` | Branches, bundler, commands, release notes alignment. |
41
+ | Ruby SDK (CDA) | `skills/contentstack-ruby-sdk/SKILL.md` | Public API, modules, errors, versioning, integration with `contentstack_utils`. |
42
+ | Ruby style & layout | `skills/ruby-style/SKILL.md` | File layout, idioms, and conventions for this codebase. |
43
+ | Testing | `skills/testing/SKILL.md` | RSpec, WebMock, fixtures, env vars, coverage. |
44
+ | Code review | `skills/code-review/SKILL.md` | PR checklist and review expectations. |
45
+ | Framework & packaging | `skills/framework/SKILL.md` | Bundler/gem packaging, HTTP stack (`Net::HTTP`), retries, optional proxy. |
46
+
47
+ An index with “when to use” hints is in `skills/README.md`.
48
+
49
+ ## Using Cursor (optional)
50
+
51
+ If you use **Cursor**, `.cursor/rules/README.md` only points to **`AGENTS.md`**—same docs as everyone else.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ## Version 0.8.4
4
+ ### Date: 15th-April-2026
5
+ ### Security and Compatibility
6
+ - Fixed reported security vulnerability.
7
+
3
8
  ## Version 0.8.3
4
9
  ### Date: 27th-March-2026
5
10
  ### Security and Compatibility
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- contentstack (0.8.3)
4
+ contentstack (0.8.4)
5
5
  activesupport (>= 3.2)
6
6
  contentstack_utils (~> 1.2)
7
7
 
@@ -21,15 +21,15 @@ GEM
21
21
  securerandom (>= 0.3)
22
22
  tzinfo (~> 2.0, >= 2.0.5)
23
23
  uri (>= 0.13.1)
24
- addressable (2.8.9)
24
+ addressable (2.9.0)
25
25
  public_suffix (>= 2.0.2, < 8.0)
26
26
  base64 (0.3.0)
27
- bigdecimal (4.0.1)
27
+ bigdecimal (4.1.1)
28
28
  concurrent-ruby (1.3.6)
29
29
  connection_pool (3.0.2)
30
- contentstack_utils (1.2.2)
31
- activesupport (>= 7.0)
32
- nokogiri (>= 1.11)
30
+ contentstack_utils (1.2.3)
31
+ activesupport (>= 8.0)
32
+ nokogiri (>= 1.19)
33
33
  crack (1.0.1)
34
34
  bigdecimal
35
35
  rexml
@@ -41,7 +41,7 @@ GEM
41
41
  concurrent-ruby (~> 1.0)
42
42
  json (2.19.3)
43
43
  logger (1.7.0)
44
- minitest (6.0.2)
44
+ minitest (6.0.4)
45
45
  drb (~> 2.0)
46
46
  prism (~> 1.5)
47
47
  nokogiri (1.19.2-arm64-darwin)
@@ -77,7 +77,7 @@ GEM
77
77
  addressable (>= 2.8.0)
78
78
  crack (>= 0.3.2)
79
79
  hashdiff (>= 0.4.0, < 2.0.0)
80
- yard (0.9.38)
80
+ yard (0.9.41)
81
81
 
82
82
  PLATFORMS
83
83
  arm64-darwin-22
@@ -1,3 +1,3 @@
1
1
  module Contentstack
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.4"
3
3
  end
data/skills/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # Skills – Contentstack Ruby SDK
2
+
3
+ Source of truth for detailed guidance. Read **AGENTS.md** first, then open the skill that matches your task.
4
+
5
+ ## When to use which skill
6
+
7
+ | Skill folder | Use when |
8
+ | --- | --- |
9
+ | `dev-workflow` | Setting up the repo, running build/test/docs, branching, or preparing a release-oriented change. |
10
+ | `contentstack-ruby-sdk` | Changing or extending the public CDA client API, errors, or how the gem integrates with Contentstack and `contentstack_utils`. |
11
+ | `ruby-style` | Naming, file layout, Ruby idioms, and keeping changes consistent with existing `lib/` and `spec/` code. |
12
+ | `testing` | Adding or changing specs, fixtures, WebMock stubs, SimpleCov, or test-only helpers. |
13
+ | `code-review` | Reviewing or authoring a PR; scope, docs, and risk checklist. |
14
+ | `framework` | Dependencies, gemspec, HTTP/retry/proxy behavior, or gem build/install mechanics. |
15
+
16
+ Each folder contains **SKILL.md** with YAML frontmatter (`name`, `description`).
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: code-review
3
+ description: Use when authoring or reviewing a pull request for contentstack-ruby—scope, tests, API stability, and documentation.
4
+ ---
5
+
6
+ # Code review – Contentstack Ruby SDK
7
+
8
+ ## When to use
9
+
10
+ - Opening a PR against **`development`** (or the team’s active integration branch)
11
+ - Reviewing a colleague’s change for risk, API impact, or test gaps
12
+ - Deciding whether a change needs **CHANGELOG** / version bump / **README** updates
13
+
14
+ ## Instructions
15
+
16
+ ### Blocker (must fix before merge)
17
+
18
+ - **Tests:** New or changed behavior lacks **`spec`** coverage where feasible, or **`bundle exec rspec`** would fail.
19
+ - **Security / secrets:** No real API keys, tokens, or stack data committed; tests use fixtures and WebMock.
20
+ - **Breaking changes:** Public method signatures or documented behavior changed without version strategy and **CHANGELOG** / **README** updates as appropriate.
21
+
22
+ ### Major (strongly prefer fixing)
23
+
24
+ - **WebMock:** New HTTP paths or hosts not stubbed in **`spec/spec_helper.rb`**, causing flaky or network-dependent specs.
25
+ - **Error handling:** New failure modes do not use **`Contentstack::Error`** / **`ErrorMessages`** consistently with the rest of the client.
26
+ - **Dependencies:** **`contentstack.gemspec`** or **`Gemfile`** changes without a clear reason (security pins are documented in comments—preserve that intent).
27
+
28
+ ### Minor (nice to have)
29
+
30
+ - YARD or **README** examples for new public options
31
+ - Clear commit messages and PR description linking to internal tickets if applicable
32
+
33
+ ### Process notes
34
+
35
+ - **`master`** is protected by **`.github/workflows/check-branch.yml`**; follow team flow (**`staging`** → **`master`**) for production promotion.
36
+ - Run **`bundle exec rspec`** locally; CI may not run the full suite on every PR in this repository.
37
+
38
+ ## References
39
+
40
+ - `skills/dev-workflow/SKILL.md` — branches and commands
41
+ - `skills/testing/SKILL.md` — fixtures and stubs
42
+ - `skills/contentstack-ruby-sdk/SKILL.md` — API surface
43
+ - [Reference PR pattern (Cursor rules + skills)](https://github.com/contentstack/contentstack-utils-swift/pull/36)
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: dev-workflow
3
+ description: Use when setting up the repo, running tests or docs, choosing branches, or aligning with release and CI expectations for contentstack-ruby.
4
+ ---
5
+
6
+ # Dev workflow – Contentstack Ruby SDK
7
+
8
+ ## When to use
9
+
10
+ - First-time setup or refreshing dependencies
11
+ - Running the test suite or generating YARD docs before a PR
12
+ - Choosing a base branch or understanding merge restrictions
13
+ - Bumping version or coordinating with gem release (see also `skills/framework/SKILL.md`)
14
+
15
+ ## Instructions
16
+
17
+ ### Environment
18
+
19
+ - Use Ruby **≥ 3.3**; match **`.ruby-version`** when using rbenv/asdf/chruby.
20
+ - From the repo root: `bundle install` (respects `Gemfile` + `contentstack.gemspec`).
21
+
22
+ ### Everyday commands
23
+
24
+ - Full test suite: `bundle exec rspec`
25
+ - One file: `bundle exec rspec spec/<name>_spec.rb`
26
+ - API docs: `bundle exec rake yard` (task defined in `rakefile.rb`; options in `.yardopts`)
27
+ - Build the gem locally: `gem build contentstack.gemspec`
28
+
29
+ ### Branches and PRs
30
+
31
+ - Default integration branch is typically **`development`** (confirm on GitHub). **`master`** merges are restricted: `.github/workflows/check-branch.yml` blocks PRs into `master` unless the head branch is **`staging`**—follow org process for promotion.
32
+ - Keep PRs focused; mention breaking API or Ruby version requirement changes in the description.
33
+
34
+ ### Before you push
35
+
36
+ - Run **`bundle exec rspec`**; ensure new behavior has specs and existing stubs in `spec/spec_helper.rb` stay consistent with CDN host patterns you use.
37
+
38
+ ## References
39
+
40
+ - `AGENTS.md` — stack summary and command table
41
+ - `skills/testing/SKILL.md` — RSpec and fixtures
42
+ - `skills/framework/SKILL.md` — gemspec, Bundler, HTTP concerns
43
+ - [contentstack/contentstack-ruby](https://github.com/contentstack/contentstack-ruby)
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: framework
3
+ description: Use when changing Bundler setup, gemspec, gem build/release, or HTTP/retry/proxy behavior in the CDA client.
4
+ ---
5
+
6
+ # Framework & packaging – Contentstack Ruby SDK
7
+
8
+ ## When to use
9
+
10
+ - Editing **`Gemfile`**, **`contentstack.gemspec`**, or **`Gemfile.lock`** (via `bundle install`)
11
+ - Changing **`Contentstack::API`** request sending, timeouts, retries, or proxy support
12
+ - Preparing **`gem build`** / release alignment with **`.github/workflows/release-gem.yml`**
13
+
14
+ ## Instructions
15
+
16
+ ### Bundler and gemspec
17
+
18
+ - **`contentstack.gemspec`**: declares **`required_ruby_version >= 3.3`**, runtime deps **`activesupport`**, **`contentstack_utils`** (~> 1.2), and dev deps **rspec**, **webmock**, **simplecov**, **yard**.
19
+ - **`Gemfile`**: `gemspec` plus **nokogiri** pin for transitive security alignment (see comment in file)—do not remove without verifying **`contentstack_utils`** / **nokogiri** constraints.
20
+
21
+ ### HTTP stack
22
+
23
+ - CDA calls are implemented in **`lib/contentstack/api.rb`** using **`Net::HTTP`**, **`URI`**, **ActiveSupport JSON**, with retry logic in **`fetch_retry`** and configurable **`timeout`**, **`retryDelay`**, **`retryLimit`**, **`errorRetry`** from **`Contentstack::Client`** options.
24
+ - **Live preview** and **proxy** paths are configured on the client and passed into **`API.init_api`**—keep option keys backward compatible.
25
+
26
+ ### Release automation
27
+
28
+ - **`.github/workflows/release-gem.yml`** runs on **GitHub release created**; it uses **`ruby/setup-ruby`** (workflow currently pins Ruby **2.7** for publish—aligning that pin with **`required_ruby_version`** is an org/infrastructure concern; do not change release secrets from the skill docs).
29
+
30
+ ### Local validation
31
+
32
+ - **`gem build contentstack.gemspec`** should succeed after dependency and require-path changes.
33
+ - After changing **`lib/`** load order or new files, run **`bundle exec rspec`** and smoke-require in **`irb -r contentstack`** if needed.
34
+
35
+ ## References
36
+
37
+ - `skills/contentstack-ruby-sdk/SKILL.md` — client options and public API
38
+ - `skills/dev-workflow/SKILL.md` — everyday commands
39
+ - `skills/testing/SKILL.md` — stubbing HTTP for tests
40
+ - [RubyGems guides](https://guides.rubygems.org/)
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: ruby-style
3
+ description: Use when editing Ruby in lib/ or spec/ and you need layout, naming, and idioms consistent with this gem.
4
+ ---
5
+
6
+ # Ruby style & layout – Contentstack Ruby SDK
7
+
8
+ ## When to use
9
+
10
+ - Adding new files under **`lib/contentstack/`** or **`spec/`**
11
+ - Refactoring while keeping style aligned with existing code
12
+ - Choosing where to place helpers (e.g. `lib/util.rb` vs. domain classes)
13
+
14
+ ## Instructions
15
+
16
+ ### Layout
17
+
18
+ - **`lib/contentstack.rb`**: top-level module, YARD overview, delegates to **`contentstack_utils`** for render helpers.
19
+ - **`lib/contentstack/*.rb`**: one main concept per file (`client`, `api`, `query`, etc.).
20
+ - **`lib/util.rb`**: refinements / utilities consumed via `using Utility` where already established—follow existing patterns before introducing new global monkey patches.
21
+ - **`spec/*_spec.rb`**: mirror behavior under test; shared setup belongs in **`spec/spec_helper.rb`** only when it is truly global (WebMock, SimpleCov, default stubs).
22
+
23
+ ### Conventions observed in this repo
24
+
25
+ - Prefer explicit validation in **`Contentstack::Client#initialize`** with **`Contentstack::Error`** for invalid configuration.
26
+ - Use **`ActiveSupport`** patterns (e.g. `present?`) where already used in **`Contentstack::API`** and client code—stay consistent within a file.
27
+ - Keep public method names stable; breaking renames require a major version strategy and **README** / **CHANGELOG** updates.
28
+
29
+ ### Naming
30
+
31
+ - Match existing spellings in public APIs (e.g. `retryDelay`, `retryLimit`) for backward compatibility even if Ruby style guides suggest snake_case for new APIs—when adding **new** options, prefer **snake_case** unless extending an existing options hash that is documented with camelCase keys.
32
+
33
+ ## References
34
+
35
+ - `skills/contentstack-ruby-sdk/SKILL.md` — public API boundaries
36
+ - `skills/testing/SKILL.md` — spec patterns
37
+ - `CHANGELOG.md` — record user-visible behavior changes
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: testing
3
+ description: Use when writing or fixing RSpec examples, WebMock stubs, JSON fixtures, SimpleCov, or env-based test helpers.
4
+ ---
5
+
6
+ # Testing – Contentstack Ruby SDK
7
+
8
+ ## When to use
9
+
10
+ - Adding specs under **`spec/`**
11
+ - Changing CDN hosts, paths, or headers used in **`Contentstack::API`**
12
+ - Updating global **`WebMock`** stubs in **`spec/spec_helper.rb`**
13
+ - Interpreting **SimpleCov** output under **`coverage/`**
14
+
15
+ ## Instructions
16
+
17
+ ### Runner and config
18
+
19
+ - Run **`bundle exec rspec`** from the repo root.
20
+ - **`spec/spec_helper.rb`** requires **WebMock/RSpec**, disables real network (`WebMock.disable_net_connect!(allow_localhost: true)`), starts **SimpleCov**, and requires **`contentstack`**.
21
+
22
+ ### Stubbing HTTP
23
+
24
+ - Default stubs live in **`config.before(:each)`** in **`spec/spec_helper.rb`** for hosts such as **`cdn.contentstack.io`**, **`eu-cdn.contentstack.com`**, **`custom-cdn.contentstack.com`**, and **`preview.contentstack.io`**.
25
+ - When adding endpoints or hosts, add matching **`stub_request`** entries and JSON fixtures under **`spec/fixtures/`** (reuse shape of real CDA responses where possible).
26
+
27
+ ### Fixtures
28
+
29
+ - Store static JSON under **`spec/fixtures/*.json`**; load with **`File.read`** relative to **`__dir__`** or **`File.dirname(__FILE__)`** as existing specs do.
30
+
31
+ ### Helpers
32
+
33
+ - **`create_client`** and **`create_preview_client`** in **`spec_helper`** build clients using **`ENV['API_KEY']`**, **`ENV['DELIVERY_TOKEN']`**, **`ENV['ENVIRONMENT']`** — tests should not rely on real credentials; stubs supply responses.
34
+
35
+ ### Coverage
36
+
37
+ - **SimpleCov** runs on every **`rspec`** invocation; review **`coverage/index.html`** after substantive **`lib/`** changes.
38
+
39
+ ## References
40
+
41
+ - `skills/contentstack-ruby-sdk/SKILL.md` — which classes own behavior under test
42
+ - `skills/dev-workflow/SKILL.md` — commands
43
+ - [RSpec](https://rspec.info/), [WebMock](https://github.com/bblimke/webmock)
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.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentstack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-06 00:00:00.000000000 Z
11
+ date: 2026-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -101,6 +101,7 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
+ - ".cursor/rules/README.md"
104
105
  - ".github/workflows/check-branch.yml"
105
106
  - ".github/workflows/codeql-analysis.yml"
106
107
  - ".github/workflows/issues-jira.yml"
@@ -110,6 +111,7 @@ files:
110
111
  - ".gitignore"
111
112
  - ".talismanrc"
112
113
  - ".yardopts"
114
+ - AGENTS.md
113
115
  - CHANGELOG.md
114
116
  - CODEOWNERS
115
117
  - CODE_OF_CONDUCT.md
@@ -134,6 +136,12 @@ files:
134
136
  - lib/contentstack/version.rb
135
137
  - lib/util.rb
136
138
  - rakefile.rb
139
+ - skills/README.md
140
+ - skills/code-review/SKILL.md
141
+ - skills/dev-workflow/SKILL.md
142
+ - skills/framework/SKILL.md
143
+ - skills/ruby-style/SKILL.md
144
+ - skills/testing/SKILL.md
137
145
  - spec/asset_collection_spec.rb
138
146
  - spec/asset_spec.rb
139
147
  - spec/content_type_spec.rb