runapi-recraft 0.2.7 → 0.2.9

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: 477bd23affda1ef60acfcd9d9add3cbfb216c0e8fe9ecaca17bfa053077cd144
4
- data.tar.gz: d754513ee14f79f3af3e94658994b5d5128f9775dabbbc9f57b1e75ac18a20e0
3
+ metadata.gz: c0de6780c71acb3d1f9cb0d4ba7d1a8d3a87eaf1d051efd323e04a73e97e7c8a
4
+ data.tar.gz: 6922a6a0244ce55970020ecc60117f7d81e95d8cc92f9005beb391063697f46d
5
5
  SHA512:
6
- metadata.gz: 2ef6f4ecaafd2a69e537fd2acdbabde0b2fb5623b2d12ce8dc589b196019b8626a0c3c60df77a07b32c14563f9b5dda7603d4380bcd13457013ded2463cf711a
7
- data.tar.gz: fb15f2bd59d56d4316095e2e1e29a71e3be9fa80bc791a69d0fa8358aaacaf6eb1dc769c5b707357bccf8e2718e092d1ac6ee0a8c979c660785e91e46b204125
6
+ metadata.gz: 7319d34e546f4068bb543ca24cd1df4e5e7c85f52fe2543f40396249e038464e989707a1cbb9e94f2484ffd91e443378555fd1f953de927c2d932080c24ec904
7
+ data.tar.gz: 85eb1b3fb5910cb2536b3327a2055baffede377dae6e64f69edd4dd84873330f57b423eef0194bf5d2cdcc445de9f0503fcec0a145f2689a733dcdef80c09e71
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The Recraft Ruby SDK is the language-specific package for Recraft on RunAPI. Use this package for image generation, image editing, and creative production workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in Ruby.
4
4
 
5
- This README is the Ruby package guide inside the public `recraft-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/recraft; for API reference, use https://runapi.ai/docs#recraft; for SDK docs, use https://runapi.ai/docs#sdk-recraft.
5
+ This README is the Ruby package guide inside the public `recraft-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/recraft; for API reference, use https://runapi.ai/docs/api/recraft/remove-background; for SDK docs, use https://runapi.ai/docs/resources/sdks.
6
6
 
7
7
  ## Install
8
8
 
@@ -13,11 +13,11 @@ gem install runapi-recraft
13
13
  ## Quick start
14
14
 
15
15
  ```ruby
16
- require "runapi-recraft"
16
+ require "runapi/recraft"
17
17
 
18
18
  client = RunApi::Recraft::Client.new
19
19
  task = client.upscale_image.create(
20
- # Pass the Recraft JSON request body from https://runapi.ai/docs#recraft.
20
+ # Pass the Recraft JSON request body from https://runapi.ai/docs/api/recraft/remove-background.
21
21
  )
22
22
  status = client.upscale_image.get(task.id)
23
23
  ```
@@ -33,8 +33,8 @@ Use Ruby keyword arguments and the `RunApi::Recraft` error classes when building
33
33
  ## Links
34
34
 
35
35
  - Model page: https://runapi.ai/models/recraft
36
- - SDK docs: https://runapi.ai/docs#sdk-recraft
37
- - Product docs: https://runapi.ai/docs#recraft
36
+ - SDK docs: https://runapi.ai/docs/resources/sdks
37
+ - Product docs: https://runapi.ai/docs/api/recraft/remove-background
38
38
  - Pricing and rate limits: https://runapi.ai/models/recraft/crisp-upscale
39
39
  - Provider comparison: https://runapi.ai/providers/recraft
40
40
  - Full catalog: https://runapi.ai/models
@@ -17,19 +17,19 @@ module RunApi
17
17
  @http = http
18
18
  end
19
19
 
20
- def run(**params)
21
- task = create(**params)
22
- poll_until_complete { get(task.id) }
20
+ def run(options: nil, **params)
21
+ task = create(options: options, **params)
22
+ poll_until_complete { get(task.id, options: options) }
23
23
  end
24
24
 
25
- def create(**params)
25
+ def create(options: nil, **params)
26
26
  params = compact_params(params)
27
27
  validate_contract!(CONTRACT["remove-background"], params)
28
- request(:post, ENDPOINT, body: params)
28
+ request(:post, ENDPOINT, body: params, options: options)
29
29
  end
30
30
 
31
- def get(id)
32
- request(:get, "#{ENDPOINT}/#{id}")
31
+ def get(id, options: nil)
32
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
33
33
  end
34
34
  end
35
35
  end
@@ -17,19 +17,19 @@ module RunApi
17
17
  @http = http
18
18
  end
19
19
 
20
- def run(**params)
21
- task = create(**params)
22
- poll_until_complete { get(task.id) }
20
+ def run(options: nil, **params)
21
+ task = create(options: options, **params)
22
+ poll_until_complete { get(task.id, options: options) }
23
23
  end
24
24
 
25
- def create(**params)
25
+ def create(options: nil, **params)
26
26
  params = compact_params(params)
27
27
  validate_contract!(CONTRACT["upscale-image"], params)
28
- request(:post, ENDPOINT, body: params)
28
+ request(:post, ENDPOINT, body: params, options: options)
29
29
  end
30
30
 
31
- def get(id)
32
- request(:get, "#{ENDPOINT}/#{id}")
31
+ def get(id, options: nil)
32
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
33
33
  end
34
34
  end
35
35
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "runapi/core"
3
4
  require_relative "recraft/types"
4
5
  require_relative "recraft/contract_gen"
5
6
  require_relative "recraft/resources/upscale_image"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-recraft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.7
18
+ version: 0.4.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.2.7
25
+ version: 0.4.0
26
26
  description: The Recraft Ruby SDK is the language-specific package for Recraft on
27
27
  RunAPI. Use this package for image generation, image editing, and creative production
28
28
  workflows when your application needs request bodies, task status lookup, and consistent