runapi-recraft 0.2.7 → 0.2.8

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: 2c2b2912ab879d8963f9509e01b310536fdc90a037c93d6cd015ae73cde2cf10
4
+ data.tar.gz: be332c3935373d34ce7f75a7ae56e0c5737b3ef1598512baa4366e26ef1afbe4
5
5
  SHA512:
6
- metadata.gz: 2ef6f4ecaafd2a69e537fd2acdbabde0b2fb5623b2d12ce8dc589b196019b8626a0c3c60df77a07b32c14563f9b5dda7603d4380bcd13457013ded2463cf711a
7
- data.tar.gz: fb15f2bd59d56d4316095e2e1e29a71e3be9fa80bc791a69d0fa8358aaacaf6eb1dc769c5b707357bccf8e2718e092d1ac6ee0a8c979c660785e91e46b204125
6
+ metadata.gz: a77247d24f83011ed6f68409d824803f51761047e7c782ec026f623eb0124fae7d273514e051bcff302eefbc4b4e294b5732bf7b206d59c8767da12cecdd3ab5
7
+ data.tar.gz: 27ee47c83816546c004fb2a2829d27baa9efec25f3b0ce075c3a650fa66295ff3143af107c0238d3b0be632d34099d9adcedea4dc0502c1104318d6ec47a98a5
data/README.md CHANGED
@@ -13,7 +13,7 @@ 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(
@@ -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.8
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.3.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.3.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
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []
70
- rubygems_version: 4.0.10
70
+ rubygems_version: 4.0.17
71
71
  specification_version: 4
72
72
  summary: Recraft Ruby SDK for RunAPI
73
73
  test_files: []