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: add support for adding new VTuber via GraphQL mutation #14

Closed noaione closed 3 years ago

noaione commented 3 years ago

As title said, this will admin to add new VTuber to the database.

Schema:

"""
ihateani.me API Mutation
"""
type Mutation {
    """
    Add a VTuber channel to the database
    """
    VTuberAdd(
        "Channel ID"
        id: String!
        "Channel group association"
        group: String!
        "Romanized/English channel name"
        name: String!
        "Platform name"
        platform: PlatformName!
    ): ChannelObject!
}

Admin need to provide a Authorization Header that contains the secure_password value defined in config and prepending password

Example:

{
    "Authorization": "password my_super_secret_password"
}

If the admin doesn't provide it, it will fail.

codecov[bot] commented 3 years ago

Codecov Report

Merging #14 (5f92650) into master (97db9ce) will decrease coverage by 2.10%. The diff coverage is n/a.

:exclamation: Current head 5f92650 differs from pull request most recent head a301fc6. Consider uploading reports for the commit a301fc6 to get more accurate results Impacted file tree graph

@@             Coverage Diff             @@
##            master      #14      +/-   ##
===========================================
- Coverage   100.00%   97.89%   -2.11%     
===========================================
  Files            2        2              
  Lines          163      190      +27     
  Branches        49       50       +1     
===========================================
+ Hits           163      186      +23     
- Misses           0        4       +4     
Flag Coverage Δ
unittests 97.89% <ø> (-2.11%) :arrow_down:

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

Impacted Files Coverage Δ
src/utils/swissknife.ts 97.81% <ø> (-2.19%) :arrow_down:

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 97db9ce...a301fc6. Read the comment docs.