Giter Club home page Giter Club logo

Comments (6)

amccloud avatar amccloud commented on July 23, 2024 2

@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.

tommoor avatar tommoor commented on July 23, 2024 1

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.

igorsheg-wix avatar igorsheg-wix commented on July 23, 2024

@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.

tommoor avatar tommoor commented on July 23, 2024

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.

tommoor avatar tommoor commented on July 23, 2024

you should also be able to pass sha: "latest" in the descriptor

Ah, of course πŸ™ˆ – should have mentioned that too.

from abstract-sdk.

igorsheg-wix avatar igorsheg-wix commented on July 23, 2024

@tommoor @amccloud Thanks guys ;)

from abstract-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.