ihateani-me / ihaapi-ts

api.ihateani.me but written in TypeScript | Mirror: https://git.ihateani.me/ihateani-me/ihaapi-ts
https://api.ihateani.me
MIT License
1 stars 1 forks source link

feat: Image Booru Support #11

Closed noaione closed 3 years ago

noaione commented 3 years ago

Create an API handler for multiple Image Booru

Supported Website:

Will be added to v2 Endpoint (GraphQL)

Current Schemas (might be changed)

"""
The board type or the image board name
"""
enum BoardEngine {
    "danbooru.donmai.us"
    danbooru
    "danbooru.donmai.us with rating:safe"
    safebooru
    "konachan.net"
    konachan
    "gelbooru.net"
    gelbooru
}

type ImageInfo {
    "The image width"
    w: Int
    "The image height"
    h: Int
    "The image extension"
    e: String
    "The image size in bytes (If available)"
    s: Int
}

"""
The result of the search params on the selected Image board.
"""
type ImageBoardResult {
    "The image ID"
    id: ID!
    "The image title"
    title: String!
    "The image tags"
    tags: [String]
    "The image meta tags (If available)"
    meta: [String]
    "The image artist tags (If available)"
    artist: [String]
    "The image source (If available)"
    source: String
    "The image thumbnail"
    thumbnail: String!
    "The image URL"
    image_url: String!
    "Image metadata information"
    image_info: ImageInfo
    "Extras data that might be omitted by the selected engine"
    extras: JSON
    "The board engine or type used for the image"
    engine: BoardEngine!
}

type ImageBoardResults {
    results: [ImageBoardResult]!
    total: Int!
}
codecov[bot] commented 3 years ago

Codecov Report

Merging #11 (bdd7cc7) into master (5576b7b) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #11   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          123       134   +11     
  Branches        35        43    +8     
=========================================
+ Hits           123       134   +11     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/utils/swissknife.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d1b8b37...b50c805. Read the comment docs.

noaione commented 3 years ago

Basic implementation is done. Current supported status are:

Will add more soon™ Code already tested locally and working as intended, including the custom mapping parser which is shit lol.

noaione commented 3 years ago

Should be enough for now, merging and will add more board support in future™