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 +4 -4
- data/README.md +9 -6
- data/lib/superslice/client.rb +5 -4
- data/lib/superslice/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25d982d1d1d45e2686e7ce3a6ca56fdc69dd170343673c340fe669e90fae8d46
|
|
4
|
+
data.tar.gz: 97420351869fe94288b59ea50da10bf4c2c2d981b765ce2ff34391de82b5e0ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
-
|
|
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",
|
|
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:
|
data/lib/superslice/client.rb
CHANGED
|
@@ -205,7 +205,8 @@ module Superslice
|
|
|
205
205
|
end
|
|
206
206
|
|
|
207
207
|
class Engines < Resource
|
|
208
|
-
|
|
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",
|
|
255
|
-
def update(slicer, mode:,
|
|
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[:
|
|
258
|
+
body[:versions] = versions if versions
|
|
258
259
|
@client.request(:put, "/v1/slicers/#{enc(slicer)}", json: body)
|
|
259
260
|
end
|
|
260
261
|
end
|
data/lib/superslice/version.rb
CHANGED