Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,40 @@ on:
- 'stl-preview-base/**'

jobs:
build:
timeout-minutes: 10
name: build
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/imagekit-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
github.repository == 'stainless-sdks/imagekit-ruby' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork)
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
- run: |-
bundle install

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/imagekit-ruby'
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Build and upload gem artifacts
if: github.repository == 'stainless-sdks/imagekit-ruby'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
PACKAGE_NAME: imagekitio
run: ./scripts/utils/upload-artifact.sh
lint:
timeout-minutes: 10
name: lint
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.2.0"
".": "4.3.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 47
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-13fc3d7cafdea492f62eef7c1d63424d6d9d8adbff74b9f6ca6fd3fc12a36840.yml
openapi_spec_hash: a1fe6fa48207791657a1ea2d60a6dfcc
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-83a7f3659a437113f2a79e1e72794be19eff00ec232fd0206198c80364ccfebf.yml
openapi_spec_hash: b327552548ab641eb4ea3b45e643dfce
config_hash: 47cb702ee2cb52c58d803ae39ade9b44
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## 4.3.0 (2026-03-05)

Full Changelog: [v4.2.0...v4.3.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.2.0...v4.3.0)

### Features

* **api:** dpr type update ([650aa0f](https://github.com/imagekit-developer/imagekit-ruby/commit/650aa0f905b4a586c036ae2f019bd7cfb7775d40))
* **api:** revert dpr breaking change ([525e6a8](https://github.com/imagekit-developer/imagekit-ruby/commit/525e6a8a59f0f4a17ab17468aebc4b8ccdce182c))


### Bug Fixes

* **client:** add types for path params, and update structure of unions nested in params ([dd1e1ec](https://github.com/imagekit-developer/imagekit-ruby/commit/dd1e1ec791f563877bc2262b0aea91f4df9b2ced))
* **client:** always add content-length to post body, even when empty ([e156b70](https://github.com/imagekit-developer/imagekit-ruby/commit/e156b70c82c9b38de49307218fb3f687f651aa5b))
* **client:** loosen json header parsing ([9fc1fc6](https://github.com/imagekit-developer/imagekit-ruby/commit/9fc1fc60c60173f92f1f99fabe38f9ec826d940d))
* **client:** serialize query parameters properly ([bbfc6e0](https://github.com/imagekit-developer/imagekit-ruby/commit/bbfc6e0d80da5661600a888e8c915d336919fe36))
* properly mock time in ruby ci tests ([8f0a0a9](https://github.com/imagekit-developer/imagekit-ruby/commit/8f0a0a93ebc66d8d56d5e47950607f8d67f37514))


### Chores

* **ci:** add build step ([c213724](https://github.com/imagekit-developer/imagekit-ruby/commit/c213724d793c735b09c784a5a285cf394f79d528))
* **docs:** remove www prefix ([a4b9610](https://github.com/imagekit-developer/imagekit-ruby/commit/a4b961058ac8967dcfef109421dbca9ee3eedf0b))
* **internal:** remove mock server code ([c8aa3b8](https://github.com/imagekit-developer/imagekit-ruby/commit/c8aa3b8c2320102d8e29941f78f1f1ade06cab00))
* update mock server docs ([1e5ed9e](https://github.com/imagekit-developer/imagekit-ruby/commit/1e5ed9ea31388b76995c292fc22f9ed773ad6f40))

## 4.2.0 (2026-02-02)

Full Changelog: [v4.1.2...v4.2.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.1.2...v4.2.0)
Expand Down
10 changes: 2 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ If you’d like to use the repository from source, you can either install from g
To install via git in your `Gemfile`:

```ruby
gem "imagekitio", git: "https://www.github.com/imagekit-developer/imagekit-ruby"
gem "imagekitio", git: "https://github.com/imagekit-developer/imagekit-ruby"
```

Alternatively, reference local copy of the repo:

```bash
$ git clone -- 'https://www.github.com/imagekit-developer/imagekit-ruby' '<path-to-repo>'
$ git clone -- 'https://github.com/imagekit-developer/imagekit-ruby' '<path-to-repo>'
```

```ruby
Expand All @@ -66,12 +66,6 @@ $ bundle exec rake

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```bash
$ npx prism mock path/to/your/openapi.yml
```

```bash
$ bundle exec rake test
```
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
imagekitio (4.2.0)
imagekitio (4.3.0)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "imagekitio", "~> 4.2.0"
gem "imagekitio", "~> 4.3.0"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion lib/imagekitio/internal/transport/pooled_net_requester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def build_request(request, &blk)

case body
in nil
nil
req["content-length"] ||= 0 unless req["transfer-encoding"]
in String
req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
req.body_stream = Imagekitio::Internal::Util::ReadIOAdapter.new(body, &blk)
Expand Down
33 changes: 32 additions & 1 deletion lib/imagekitio/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,42 @@ def writable_enum(&blk)
end

# @type [Regexp]
JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}
JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}
# @type [Regexp]
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}

class << self
# @api private
#
# @param query [Hash{Symbol=>Object}]
#
# @return [Hash{Symbol=>Object}]
def encode_query_params(query)
out = {}
query.each { write_query_param_element!(out, _1, _2) }
out
end

# @api private
#
# @param collection [Hash{Symbol=>Object}]
# @param key [String]
# @param element [Object]
#
# @return [nil]
private def write_query_param_element!(collection, key, element)
case element
in Hash
element.each do |name, value|
write_query_param_element!(collection, "#{key}[#{name}]", value)
end
in Array
collection[key] = element.map(&:to_s).join(",")
else
collection[key] = element.to_s
end
end

# @api private
#
# @param y [Enumerator::Yielder]
Expand Down
10 changes: 1 addition & 9 deletions lib/imagekitio/models/accounts/origin_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@ class OriginCreateParams < Imagekitio::Internal::Type::BaseModel
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!attribute origin_request
# Schema for origin request resources.
#
# @return [Imagekitio::Models::Accounts::OriginRequest::S3, Imagekitio::Models::Accounts::OriginRequest::S3Compatible, Imagekitio::Models::Accounts::OriginRequest::CloudinaryBackup, Imagekitio::Models::Accounts::OriginRequest::WebFolder, Imagekitio::Models::Accounts::OriginRequest::WebProxy, Imagekitio::Models::Accounts::OriginRequest::Gcs, Imagekitio::Models::Accounts::OriginRequest::AzureBlob, Imagekitio::Models::Accounts::OriginRequest::AkeneoPim]
required :origin_request, union: -> { Imagekitio::Accounts::OriginRequest }

# @!method initialize(origin_request:, request_options: {})
# @param origin_request [Imagekitio::Models::Accounts::OriginRequest::S3, Imagekitio::Models::Accounts::OriginRequest::S3Compatible, Imagekitio::Models::Accounts::OriginRequest::CloudinaryBackup, Imagekitio::Models::Accounts::OriginRequest::WebFolder, Imagekitio::Models::Accounts::OriginRequest::WebProxy, Imagekitio::Models::Accounts::OriginRequest::Gcs, Imagekitio::Models::Accounts::OriginRequest::AzureBlob, Imagekitio::Models::Accounts::OriginRequest::AkeneoPim] Schema for origin request resources.
#
# @!method initialize(request_options: {})
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
14 changes: 13 additions & 1 deletion lib/imagekitio/models/accounts/origin_delete_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ class OriginDeleteParams < Imagekitio::Internal::Type::BaseModel
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute id
# Unique identifier for the origin. This is generated by ImageKit when you create
# a new origin.
#
# @return [String]
required :id, String

# @!method initialize(id:, request_options: {})
# Some parameter documentations has been truncated, see
# {Imagekitio::Models::Accounts::OriginDeleteParams} for more details.
#
# @param id [String] Unique identifier for the origin. This is generated by ImageKit when you create
#
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
14 changes: 13 additions & 1 deletion lib/imagekitio/models/accounts/origin_get_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ class OriginGetParams < Imagekitio::Internal::Type::BaseModel
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute id
# Unique identifier for the origin. This is generated by ImageKit when you create
# a new origin.
#
# @return [String]
required :id, String

# @!method initialize(id:, request_options: {})
# Some parameter documentations has been truncated, see
# {Imagekitio::Models::Accounts::OriginGetParams} for more details.
#
# @param id [String] Unique identifier for the origin. This is generated by ImageKit when you create
#
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
16 changes: 10 additions & 6 deletions lib/imagekitio/models/accounts/origin_update_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ class OriginUpdateParams < Imagekitio::Internal::Type::BaseModel
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!attribute origin_request
# Schema for origin request resources.
# @!attribute id
# Unique identifier for the origin. This is generated by ImageKit when you create
# a new origin.
#
# @return [Imagekitio::Models::Accounts::OriginRequest::S3, Imagekitio::Models::Accounts::OriginRequest::S3Compatible, Imagekitio::Models::Accounts::OriginRequest::CloudinaryBackup, Imagekitio::Models::Accounts::OriginRequest::WebFolder, Imagekitio::Models::Accounts::OriginRequest::WebProxy, Imagekitio::Models::Accounts::OriginRequest::Gcs, Imagekitio::Models::Accounts::OriginRequest::AzureBlob, Imagekitio::Models::Accounts::OriginRequest::AkeneoPim]
required :origin_request, union: -> { Imagekitio::Accounts::OriginRequest }
# @return [String]
required :id, String

# @!method initialize(origin_request:, request_options: {})
# @param origin_request [Imagekitio::Models::Accounts::OriginRequest::S3, Imagekitio::Models::Accounts::OriginRequest::S3Compatible, Imagekitio::Models::Accounts::OriginRequest::CloudinaryBackup, Imagekitio::Models::Accounts::OriginRequest::WebFolder, Imagekitio::Models::Accounts::OriginRequest::WebProxy, Imagekitio::Models::Accounts::OriginRequest::Gcs, Imagekitio::Models::Accounts::OriginRequest::AzureBlob, Imagekitio::Models::Accounts::OriginRequest::AkeneoPim] Schema for origin request resources.
# @!method initialize(id:, request_options: {})
# Some parameter documentations has been truncated, see
# {Imagekitio::Models::Accounts::OriginUpdateParams} for more details.
#
# @param id [String] Unique identifier for the origin. This is generated by ImageKit when you create
#
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
end
Expand Down
15 changes: 14 additions & 1 deletion lib/imagekitio/models/accounts/url_endpoint_delete_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ class URLEndpointDeleteParams < Imagekitio::Internal::Type::BaseModel
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute id
# Unique identifier for the URL-endpoint. This is generated by ImageKit when you
# create a new URL-endpoint. For the default URL-endpoint, this is always
# `default`.
#
# @return [String]
required :id, String

# @!method initialize(id:, request_options: {})
# Some parameter documentations has been truncated, see
# {Imagekitio::Models::Accounts::URLEndpointDeleteParams} for more details.
#
# @param id [String] Unique identifier for the URL-endpoint. This is generated by ImageKit when you c
#
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
15 changes: 14 additions & 1 deletion lib/imagekitio/models/accounts/url_endpoint_get_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ class URLEndpointGetParams < Imagekitio::Internal::Type::BaseModel
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute id
# Unique identifier for the URL-endpoint. This is generated by ImageKit when you
# create a new URL-endpoint. For the default URL-endpoint, this is always
# `default`.
#
# @return [String]
required :id, String

# @!method initialize(id:, request_options: {})
# Some parameter documentations has been truncated, see
# {Imagekitio::Models::Accounts::URLEndpointGetParams} for more details.
#
# @param id [String] Unique identifier for the URL-endpoint. This is generated by ImageKit when you c
#
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
15 changes: 14 additions & 1 deletion lib/imagekitio/models/accounts/url_endpoint_update_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ class URLEndpointUpdateParams < Imagekitio::Models::Accounts::URLEndpointRequest
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute id
# Unique identifier for the URL-endpoint. This is generated by ImageKit when you
# create a new URL-endpoint. For the default URL-endpoint, this is always
# `default`.
#
# @return [String]
required :id, String

# @!method initialize(id:, request_options: {})
# Some parameter documentations has been truncated, see
# {Imagekitio::Models::Accounts::URLEndpointUpdateParams} for more details.
#
# @param id [String] Unique identifier for the URL-endpoint. This is generated by ImageKit when you c
#
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
8 changes: 7 additions & 1 deletion lib/imagekitio/models/cache/invalidation_get_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ class InvalidationGetParams < Imagekitio::Internal::Type::BaseModel
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute request_id
#
# @return [String]
required :request_id, String

# @!method initialize(request_id:, request_options: {})
# @param request_id [String]
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
8 changes: 7 additions & 1 deletion lib/imagekitio/models/custom_metadata_field_delete_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class CustomMetadataFieldDeleteParams < Imagekitio::Internal::Type::BaseModel
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute id
#
# @return [String]
required :id, String

# @!method initialize(id:, request_options: {})
# @param id [String]
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
9 changes: 8 additions & 1 deletion lib/imagekitio/models/custom_metadata_field_update_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class CustomMetadataFieldUpdateParams < Imagekitio::Internal::Type::BaseModel
extend Imagekitio::Internal::Type::RequestParameters::Converter
include Imagekitio::Internal::Type::RequestParameters

# @!attribute id
#
# @return [String]
required :id, String

# @!attribute label
# Human readable name of the custom metadata field. This should be unique across
# all non deleted custom metadata fields. This name is displayed as form field
Expand All @@ -25,10 +30,12 @@ class CustomMetadataFieldUpdateParams < Imagekitio::Internal::Type::BaseModel
# @return [Imagekitio::Models::CustomMetadataFieldUpdateParams::Schema, nil]
optional :schema, -> { Imagekitio::CustomMetadataFieldUpdateParams::Schema }

# @!method initialize(label: nil, schema: nil, request_options: {})
# @!method initialize(id:, label: nil, schema: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {Imagekitio::Models::CustomMetadataFieldUpdateParams} for more details.
#
# @param id [String]
#
# @param label [String] Human readable name of the custom metadata field. This should be unique across a
#
# @param schema [Imagekitio::Models::CustomMetadataFieldUpdateParams::Schema] An object that describes the rules for the custom metadata key. This parameter i
Expand Down
Loading
Loading