Skip to content

Releases: octet-stream/dinky

2.0.0-beta.4

08 Jun 00:00
Compare
Choose a tag to compare

Update

  • Rewrite documentation.

Add

  • Implement classes for every search type: SearchImages, SearchComments, SearchTags, SearchGalleries, SearchPosts. All of these extend abstract Search class;

    import {SearchImages, SearchComments, SearchTags, SearchGalleries, SearchPosts} from "dinky.js"
  • Add shortcuts for all entities and search types.

    Entities shortcuts:

    import {images, comments, filters, images, profiles, tags} from "dinky.js"

    Search shortcuts:

    import {search} from "dinky.js"
    
    search.images() // Creates instance for `SearchImages`
    search.comments() // Creates instance for `SearchComments`
    search.tags() // Creates instance for `SearchTags`
    search.galleries() // Creates instance for `SearchGalleries`
    search.posts() // Creates instance for `SearchPosts`

    In addition to these shortcuts, search object has reverse method. That way you can send images reverse-search query:

    import {search} from "dinky.js"
    
    // Same as `new SearchImage().reverse(...)`
    await search.reverse("https://derpicdn.net/img/2019/12/24/2228439/full.jpg")

Remove

  • Most of the Search class methods moved to SearchImages.

All changes: v2.0.0-beta.3...v2.0.0-beta.4

2.0.0-beta.3

31 May 00:29
Compare
Choose a tag to compare
2.0.0-beta.3 Pre-release
Pre-release

Update

  • Fix link options merge.

All changes: v2.0.0-beta.2...v2.0.0-beta.3

2.0.0-beta.2

30 May 23:50
Compare
Choose a tag to compare
2.0.0-beta.2 Pre-release
Pre-release

Breaking

  • Set minimal required Node.js version to v14.17;

Add

  • Expose callable version for every entity class and for Search. You can now create request similarly to v1.x:
import {tags} from "dinky.js"

await tags.getById("artist-colon-rainbow")

dinky.js exposes functions for these types of requests: search, tags, comments, images, profiles and filters. More will be added in next releases!

Update

  • Improve url normalization. It will also enforce https protocol for custom URLs:
import {images} from "dinky.js"

images({url: "furbooru.org"}) // will add https protocol -> https://furbooru.org/api/v1/json/images
images({url: "http://furbooru.org"}) // will replace http protocol with https  -> https://furbooru.org/api/v1/json/images
  • Replace cross-fetch with node-fetch. Starting from this version dinky.js will try globalThis.fetch first, so you can use polyfills or just rely on the environment. If fetch is not defined on globalThis object and on the linkOptions.fetch option, dinky.js will use node-fetch as default fallback;
  • Replace fetch-mock with nock for tests, because fetch-mock does not support ESM. Note that nock relies on Node.js' http module to operate, so requests from alternative http clients (like native Node.js' fetch implementation, which is based on undici) will not be handled by nock.

All changes: v2.0.0-beta.1...v2.0.0-beta.2

2.0.0-beta.1

09 Aug 20:29
Compare
Choose a tag to compare
2.0.0-beta.1 Pre-release
Pre-release

Highlights

  • [BREAKING] This package is ESM only from now on!
  • [BREAKING] Minimal required version is 12.20

Add

  • Add Search#reverse() method allows to perform reverse search against Philomena API:
import {Search} from "dinky.js"

const search = new Search()

await search.reverse("https://derpicdn.net/img/2019/12/24/2228439/full.jpg")
  • Add Filters class that helps to get a list of system or user filters;

Update

  • Various improvements for typings.
  • Minimal required Node.js version is 12.4 for not. This might change before the actual 2.x release came out because I am thinking to keep this package ESM only since v2.
  • Replace isomorphic-fetch with cross-fetch

All changes: v2.0.0-beta.0...v2.0.0-beta.1

v2.0.0-beta.0

26 Mar 15:02
Compare
Choose a tag to compare
v2.0.0-beta.0 Pre-release
Pre-release

This is the first pre-relase update for Dinky.js on its way to 2.x major update

Breaking

  1. Codebase has been rewritten from the ground up on TypeScript.

  2. The package comes with improved ESM support, while it still has CommonJS version of its modules.

  3. From now on, the public API has separated class for each of Dinky entity:

import {Search, Images, Comments, Tags} from "dinky.js" // Etc
  1. Every class constructor now takes an options arguments, allowing you to configure custom URL for requests, set request parameters for link and even use your own link or fetch function to perform API requests!
import fetch from "node-fetch"

import {Search} from "dinky.js"

// Custom base URL usage
new Search({url: "https://furbooru.org"})

// Custom fetch usage
new Search({linkOptions: {fetch}})

// ...link API is not stable yet, I will add docs for it later...

Add

  1. A new Profiles entity to handle requests to /api/json/profiles endpoint

Remove

  1. Lists class

All changes: v1.1.0...v2.0.0-beta.0

1.1.0

30 Sep 22:30
Compare
Choose a tag to compare

Add

  • TypeScript typings support, thanks to @Veetaha (#7)

All changes: v1.0.0...v1.1.0

1.0.0

27 Mar 22:35
Compare
Choose a tag to compare

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

0.8.1

02 Nov 20:44
Compare
Choose a tag to compare

Update

  • Bump dependencies

Add

  • Node 13 support

All changes: v0.8.0...v0.8.1

0.8.0

10 Aug 21:01
Compare
Choose a tag to compare

Remove

  • Request#{ascending,descending}() methods. Use Search#{ascending,descending}() instead.

Update

  • Drop Node 11 support (because of AVA).

All changes: v0.7.2...v0.8.0

0.7.2

07 Jul 12:41
Compare
Choose a tag to compare

Update

  • Search#tags() will consider empty arrays as no tags:

    import dinky from "dinky.js"
    
    // Empty array will be considered the same way as "undefined".
    // So, the * wildcard will be used for this request:
    // https://derpibooru.org/search.json?q=*&random_image=true
    dinky().search([]).random()
      .then(console.log)
    
    // And this request will not set any tags:
    dinky().search([])
      .catch(console.error) // This request will crash because of no tags

All changes: v0.7.1...v0.7.2