1.0.0
Remove
- Drop Node 8 support. The minimal required version is 10.
Lists
class now contains only shortcuts. TheLists#last()
method has been removed.
Update
-
Breaking:
Images#id()
method has been renamed toImages#getById()
-
Breaking:
Search#tags()
method has been renamed toSearch#query()
-
Breaking:
Search#random()
method is no more executes a request to take a random image.
Instead, it addssf=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
andTags
andDinky#{comments,tags}()
methods to access them.
Both of those classes the following methods:-
.getById()
– returrns an entity by its ID on Derpibooruimport 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