Skip to content

1.0.0

Compare
Choose a tag to compare
@octet-stream octet-stream released this 27 Mar 22:35

Remove

  • Drop Node 8 support. The minimal required version is 10.
  • Lists class now contains only shortcuts. The Lists#last() method has been removed.

Update

  • Breaking: Images#id() method has been renamed to Images#getById()

  • Breaking: Search#tags() method has been renamed to Search#query()

  • Breaking: Search#random() method is no more executes a request to take a random image.
    Instead, it adds sf=random param to the request, so if you want to keep previous behaviour,
    you have to call .limit() method with 1 as its value, then execute your query:

    import dinky from "dinky.js"
    
    // Don't forget that a reesponse will always contain an array of images.
    dinky().search(["pinkie pie", "safe"]).random().limit(1)
      .then(console.log)

    It also means that you can search for more than just one random image at the same time.

Add

  • Casting for fields that contains dates.

  • The Search request has a few types to seatch on. Use the those methods to set the request type to search on:
    Search#{comments,galleries,posts,tags,images}()

  • New classes: Comments and Tags and Dinky#{comments,tags}() methods to access them.
    Both of those classes the following methods:

    • .getById() – returrns an entity by its ID on Derpibooru

      import dinky from "dinky.js"
      
      // Will create a request to
      // https://derpibooru.org/api/v1/json/images/0
      dinky().images().getById(0)
        .then(console.log)
    • .search(query) – returns a Search query with the type of entity on which the method has been called.

      import dinky from "dinky.js"
      
      // Will create a Search request to
      // https://derpibooru.org/api/v1/json/search/images
      dinky().images().search(["amending fences", "minuette", "safe"])
        .then(console.log)
  • Images#featured() – returns a featured image.


All changes: v0.8.1...v1.0.0