Comments (6)
@igorsheg-wix you should also be able to pass sha: "latest"
in the descriptor:
previews.raw({...layerDescriptor, sha: "latest"})
https://sdk.goabstract.com/docs/reference/#retrieve-a-preview
@tommoor this is really only documented in a code comment in the docs. I want to add a "Retrieve the latest preview" section to the docs but it would also be nice to have place to generally surface the concept of "latest" across all objects
from abstract-sdk.
Hey Igor, short answer is β use previews.raw
to get the data and save it somewhere. The previews service requires authentication with a token which would have to be saved with the URL.
We're looking into how this can be improved (perhaps with a previews specific short-lived token) as we realize it's not as developer friendly as it should be.
from abstract-sdk.
@tommoor Hey Tom, can you tell me why some preview.raw
do return an array buffer, and some request return Error: Received status "404", expected 2XX [1] at AbstractAPI.fetch (/Users/igors/Development/ux-feed/node_modules/abstract-sdk/lib/AbstractAPI/index.js:294:13) [1] at process._tickCallback (internal/process/next_tick.js:68:7) [1] undefined
Thanks a lot.
from abstract-sdk.
If you're receiving a 404 it means that the preview does not exist on the server.
There isn't a preview on the server for every commit, for efficiency we only store previews on commit where a layer has changed⦠so you may need to query the layer.info, and then use layer.lastChangedAtSha
to find the last commit where the layer was altered β there should reliably be a preview for these commits.
from abstract-sdk.
you should also be able to pass sha: "latest" in the descriptor
Ah, of course
from abstract-sdk.
@tommoor @amccloud Thanks guys ;)
from abstract-sdk.
Related Issues (20)
- Improve asset scaling in iframe when embedding a design HOT 1
- Update to the latest core-js version? HOT 3
- ReferenceError: performance is not defined HOT 1
- Sample project? HOT 1
- supporting react-native HOT 1
- abstract-cli could not be accessed at the expected path HOT 2
- Do not throw MultiError unless necessary HOT 1
- Investigating on Webhook and User types HOT 6
- resolveCLIBinary: abstract-cli could not be accessed at the expected path: [] HOT 3
- How to perform a commit using SDK? HOT 2
- Split running into timeouts away from FileExportError
- ### `\abstract-sdk\dist\endpoints\Endpoint.js` can not find` abstract-cli.exe `in Windows 10 64bit HOT 2
- Enable CORS for Previews API endpoints HOT 11
- Missing `invariant` dependency HOT 1
- Exporting a file using public API abstract.files.raw fails with BadRequest HOT 3
- v8 'List all files' API throws NotFoundError HOT 4
- Unable to make API requests through proxy HOT 1
- Can't create layer embed to correct layer HOT 2
- Client not working on Win10 64bit HOT 1
- Object URL access with `HTTPError: Response code 404` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abstract-sdk.