superslice 0.1.0 → 1.1.0

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: d99c6031fcf11cce156a24395cb3c667bd2f1953e8e612bd7370887efbdbcfcb
4
- data.tar.gz: b7e2391c2609b48f629443ab4c7cc13f376d4dc3af26991558d321e65ba85dd3
3
+ metadata.gz: 25d982d1d1d45e2686e7ce3a6ca56fdc69dd170343673c340fe669e90fae8d46
4
+ data.tar.gz: 97420351869fe94288b59ea50da10bf4c2c2d981b765ce2ff34391de82b5e0ce
5
5
  SHA512:
6
- metadata.gz: 66a39a214f95283ec6addc2c15dd4e272d9a4135572151e810aaea666367e18ac7a1bf27c7a73062974ef84f7fed56864bc32d91376bcaa8eddbad75db9d5042
7
- data.tar.gz: 1a7a6edfe0961426477ddb57a370284c06538fc11f064dff4b567d1921d903e958747ffb8e6b88830fc192015369cf8e3320fdd3c87cbc022187293c12705cb7
6
+ metadata.gz: 89a9f7ee5a039d14fe3fa9d8cd83d101f77d59016e1d4a19ad011f3d566a55a6e7699c37f3ea154655fa8b71ea75b78f45cc69ce3a01010b3571380abf23c17a
7
+ data.tar.gz: 42b73bb402fec93d5a434cd6e2a98d14965b804d46918a639b364250a944d93ec34e916d91f2d0a40307ed2715cfe5fe65ed8f0eef21be9f3ba638c83e072127
data/README.md CHANGED
@@ -21,13 +21,11 @@ Superslice is a slicing API for 3D print quotes: send a model and get print time
21
21
 
22
22
  ## Install
23
23
 
24
- The gem is not yet published to RubyGems. Until it is, install from GitHub. In your Gemfile:
25
-
26
- ```ruby
27
- gem "superslice", git: "https://github.com/superslice-co/superslice-ruby.git"
24
+ ```sh
25
+ gem install superslice
28
26
  ```
29
27
 
30
- Once published: `gem install superslice`. Needs Ruby 3.0 or newer. No runtime dependencies.
28
+ Or in your Gemfile: `gem "superslice"`. Needs Ruby 3.0 or newer. No runtime dependencies.
31
29
 
32
30
  ## Quickstart
33
31
 
@@ -98,9 +96,14 @@ client.pricing.set({ enabled: true, currency: "USD", minimum: "2.00", lines: []
98
96
  client.pricing.delete
99
97
 
100
98
  client.slicers.list
101
- client.slicers.update("bambu-studio", mode: "pick", engine_releases: ["bambu-studio@02.09.02.62+02.09.00.89"])
99
+ client.slicers.update("bambu-studio", mode: "pick", versions: [
100
+ { app_version: "02.09.01.70", presets: "latest" }, # follow new presets
101
+ { app_version: "02.08.00.67", presets: "02.08.00.60" } # stay on these presets
102
+ ])
102
103
  ```
103
104
 
105
+ `client.engines.list(status: "all")` also returns retired releases, with their dates and the vendor's change notes. A slice's `engine_release` also accepts a bare app version such as `"02.09.02.62"`.
106
+
104
107
  ## Idempotency
105
108
 
106
109
  Pass an idempotency key so a repeated request returns the same slice instead of slicing twice:
@@ -205,7 +205,8 @@ module Superslice
205
205
  end
206
206
 
207
207
  class Engines < Resource
208
- def list = @client.request(:get, "/v1/engines")
208
+ # list(status: "all") also returns retired releases
209
+ def list(status: nil) = @client.request(:get, "/v1/engines", query: { status: status })
209
210
 
210
211
  def printers(release) = @client.request(:get, "/v1/engines/#{enc(release)}/printers")
211
212
 
@@ -251,10 +252,10 @@ module Superslice
251
252
  class Slicers < Resource
252
253
  def list = @client.request(:get, "/v1/slicers")
253
254
 
254
- # update("bambu-studio", mode: "pick", engine_releases: ["..."])
255
- def update(slicer, mode:, engine_releases: nil)
255
+ # update("bambu-studio", mode: "pick", versions: [{ app_version: "02.09.01.70", presets: "latest" }])
256
+ def update(slicer, mode:, versions: nil)
256
257
  body = { mode: mode }
257
- body[:engine_releases] = engine_releases if engine_releases
258
+ body[:versions] = versions if versions
258
259
  @client.request(:put, "/v1/slicers/#{enc(slicer)}", json: body)
259
260
  end
260
261
  end
@@ -1,3 +1,3 @@
1
1
  module Superslice
2
- VERSION = "0.1.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superslice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Superslice