mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 09:09:01 +00:00
Upgrade grats
This commit is contained in:
parent
c53ad16ba5
commit
d2c8cf872d
17 changed files with 588 additions and 1074 deletions
|
|
@ -21,7 +21,12 @@ export type ApiAction =
|
|||
| { type: "CLASSIC_SKIN_UPLOADED"; md5: string }
|
||||
| { type: "MODERN_SKIN_UPLOADED"; md5: string }
|
||||
| { type: "SKIN_UPLOAD_ERROR"; uploadId: string; message: string }
|
||||
| { type: "GOT_FEEDBACK"; message: string; email?: string; url?: string }
|
||||
| {
|
||||
type: "GOT_FEEDBACK";
|
||||
message: string;
|
||||
email?: string | null;
|
||||
url?: string | null;
|
||||
}
|
||||
| { type: "SYNCED_TO_ARCHIVE"; successes: number; errors: number }
|
||||
| { type: "STARTED_SYNC_TO_ARCHIVE"; count: number }
|
||||
| {
|
||||
|
|
@ -181,7 +186,7 @@ const allowList = [
|
|||
/http:\/\/localhost:3000/,
|
||||
/http:\/\/localhost:3001/,
|
||||
/netlify.app/,
|
||||
/https:\/\/dustinbrett.com/
|
||||
/https:\/\/dustinbrett.com/,
|
||||
];
|
||||
|
||||
const corsOptions: CorsOptions = {
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ export async function modern_skins(
|
|||
first = 10,
|
||||
offset = 0,
|
||||
}: {
|
||||
first?: Int;
|
||||
offset?: Int;
|
||||
first: Int;
|
||||
offset: Int;
|
||||
}
|
||||
): Promise<ModernSkinsConnection> {
|
||||
if (first > 1000) {
|
||||
|
|
|
|||
|
|
@ -45,9 +45,14 @@ async function getSkinMuseumPageFromCache(first: number, offset: number) {
|
|||
export default class SkinsConnection {
|
||||
_first: number;
|
||||
_offset: number;
|
||||
_sort?: string;
|
||||
_filter?: string;
|
||||
constructor(first: number, offset: number, sort?: string, filter?: string) {
|
||||
_sort?: string | null;
|
||||
_filter?: string | null;
|
||||
constructor(
|
||||
first: number,
|
||||
offset: number,
|
||||
sort?: string | null,
|
||||
filter?: string | null
|
||||
) {
|
||||
this._first = first;
|
||||
this._offset = offset;
|
||||
this._filter = filter;
|
||||
|
|
@ -137,10 +142,10 @@ export function skins(
|
|||
sort,
|
||||
filter,
|
||||
}: {
|
||||
first?: Int;
|
||||
offset?: Int;
|
||||
sort?: SkinsSortOption;
|
||||
filter?: SkinsFilterOption;
|
||||
first: Int;
|
||||
offset: Int;
|
||||
sort?: SkinsSortOption | null;
|
||||
filter?: SkinsFilterOption | null;
|
||||
}
|
||||
): SkinsConnection {
|
||||
if (first > 1000) {
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ import { GqlCtx } from "./GqlCtx";
|
|||
export type TweetsSortOption = "LIKES" | "RETWEETS";
|
||||
|
||||
/**
|
||||
* A collection of tweets made by the @winampskins bot
|
||||
* A collection of tweets made by the `@winampskins` bot
|
||||
* @gqlType
|
||||
*/
|
||||
export default class TweetsConnection {
|
||||
_first: number;
|
||||
_offset: number;
|
||||
_sort?: TweetsSortOption;
|
||||
constructor(first: number, offset: number, sort?: TweetsSortOption) {
|
||||
_sort?: TweetsSortOption | null;
|
||||
constructor(first: number, offset: number, sort?: TweetsSortOption | null) {
|
||||
this._first = first;
|
||||
this._offset = offset;
|
||||
this._sort = sort;
|
||||
|
|
@ -61,7 +61,7 @@ export default class TweetsConnection {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tweets tweeted by @winampskins
|
||||
* Tweets tweeted by `@winampskins`
|
||||
* @gqlField
|
||||
*/
|
||||
export async function tweets(
|
||||
|
|
@ -71,9 +71,9 @@ export async function tweets(
|
|||
offset = 0,
|
||||
sort,
|
||||
}: {
|
||||
first?: Int;
|
||||
offset?: Int;
|
||||
sort?: TweetsSortOption;
|
||||
first: Int;
|
||||
offset: Int;
|
||||
sort?: TweetsSortOption | null;
|
||||
}
|
||||
): Promise<TweetsConnection> {
|
||||
if (first > 1000) {
|
||||
|
|
|
|||
|
|
@ -1,497 +0,0 @@
|
|||
schema {
|
||||
query: Query
|
||||
mutation: Mutation
|
||||
}
|
||||
|
||||
directive @exported(filename: String!, functionName: String!) on FIELD_DEFINITION
|
||||
|
||||
directive @methodName(name: String!) on FIELD_DEFINITION
|
||||
|
||||
"""A file found within a Winamp Skin's .wsz archive"""
|
||||
type ArchiveFile {
|
||||
"""
|
||||
The date on the file inside the archive. Given in simplified extended ISO
|
||||
format (ISO 8601).
|
||||
"""
|
||||
date: String
|
||||
"""The md5 hash of the file within the archive"""
|
||||
file_md5: String
|
||||
"""Filename of the file within the archive"""
|
||||
filename: String
|
||||
"""Is the file a directory?"""
|
||||
is_directory: Boolean
|
||||
"""
|
||||
The uncompressed size of the file in bytes.
|
||||
|
||||
**Note:** Will be `null` for directories
|
||||
"""
|
||||
size: Int
|
||||
"""The skin in which this file was found"""
|
||||
skin: Skin
|
||||
"""The content of the file, if it's a text file"""
|
||||
text_content: String
|
||||
"""
|
||||
A URL to download the file. **Note:** This is powered by a little
|
||||
serverless Cloudflare function which tries to exctact the file on the fly.
|
||||
It may not work for all files.
|
||||
"""
|
||||
url: String
|
||||
}
|
||||
|
||||
"""A classic Winamp skin"""
|
||||
type ClassicSkin implements Node & Skin {
|
||||
"""List of files contained within the skin's .wsz archive"""
|
||||
archive_files: [ArchiveFile]
|
||||
"""String representation (rgb usually) of the skin's average color"""
|
||||
average_color: String
|
||||
"""URL to download the skin"""
|
||||
download_url: String
|
||||
"""
|
||||
Filename of skin when uploaded to the Museum. Note: In some cases a skin
|
||||
has been uploaded under multiple names. Here we just pick one.
|
||||
"""
|
||||
filename(
|
||||
"""
|
||||
If true, the the correct file extension (.wsz or .wal) will be .
|
||||
Otherwise, the original user-uploaded file extension will be used.
|
||||
"""
|
||||
normalize_extension: Boolean = false
|
||||
): String
|
||||
"""Does the skin include sprite sheets for the media library?"""
|
||||
has_media_library: Boolean
|
||||
"""GraphQL ID of the skin"""
|
||||
id: ID!
|
||||
"""The skin's "item" at archive.org"""
|
||||
internet_archive_item: InternetArchiveItem
|
||||
"""
|
||||
The date on which this skin was last updated in the Algolia search index.
|
||||
Given in simplified extended ISO format (ISO 8601).
|
||||
"""
|
||||
last_algolia_index_update_date: String
|
||||
"""MD5 hash of the skin's file"""
|
||||
md5: String
|
||||
"""URL of the skin on the Winamp Skin Museum"""
|
||||
museum_url: String
|
||||
"""Has the skin been flagged as "not safe for wrok"?"""
|
||||
nsfw: Boolean
|
||||
"""Text of the readme file extracted from the skin"""
|
||||
readme_text: String
|
||||
"""
|
||||
Times that the skin has been reviewed either on the Museum's Tinder-style
|
||||
reivew page, or via the Discord bot.
|
||||
"""
|
||||
reviews: [Review]
|
||||
"""URL of a screenshot of the skin"""
|
||||
screenshot_url: String
|
||||
"""The number of transparent pixels rendered by the skin."""
|
||||
transparent_pixels: Int
|
||||
"""Has the skin been tweeted?"""
|
||||
tweeted: Boolean
|
||||
"""List of @winampskins tweets that mentioned the skin."""
|
||||
tweets: [Tweet]
|
||||
"""URL of webamp.org with the skin loaded"""
|
||||
webamp_url: String
|
||||
}
|
||||
|
||||
"""Statistics about the contents of the Museum's database."""
|
||||
type DatabaseStatistics {
|
||||
"""
|
||||
The number of skins that have been approved for tweeting. This includes both
|
||||
tweeted and untweeted skins.
|
||||
|
||||
**Note:** Skins can be both approved and rejected by different users.
|
||||
"""
|
||||
approved_skins_count: Int
|
||||
"""
|
||||
The number of skins that have been marked as NSFW.
|
||||
|
||||
**Note:** Skins can be approved and rejected by different users.
|
||||
**Note:** Generally skins that have been marked NSFW are also marked as rejected.
|
||||
"""
|
||||
nsfw_skins_count: Int
|
||||
"""
|
||||
The number of skins that have been rejected for tweeting.
|
||||
|
||||
**Note:** Skins can be both approved and rejected by different users.
|
||||
**Note:** Generally skins that have been marked NSFW are also marked as rejected.
|
||||
"""
|
||||
rejected_skins_count: Int
|
||||
"""
|
||||
The number of skins that have been approved for tweeting, but not yet tweeted.
|
||||
"""
|
||||
tweetable_skins_count: Int
|
||||
"""
|
||||
The number of skins in the Museum that have been tweeted by @winampskins
|
||||
"""
|
||||
tweeted_skins_count: Int
|
||||
"""The total number of classic skins in the Museum's database"""
|
||||
unique_classic_skins_count: Int
|
||||
"""The number of skins that have never been reviewed."""
|
||||
unreviewed_skins_count: Int
|
||||
"""Skins uploads that have errored during processing."""
|
||||
uploads_in_error_state_count: Int
|
||||
"""
|
||||
Skins uplaods awaiting processing. This can happen when there are a large
|
||||
number of skin uplaods at the same time, or when the skin uploading processing
|
||||
pipeline gets stuck.
|
||||
"""
|
||||
uploads_pending_processing_count: Int
|
||||
"""
|
||||
Number of skins that have been uploaded to the Museum via the web interface.
|
||||
"""
|
||||
web_uploads_count: Int
|
||||
}
|
||||
|
||||
type InternetArchiveItem {
|
||||
"""The Internet Archive's unique identifier for this item"""
|
||||
identifier: String
|
||||
"""
|
||||
The date and time that we last scraped this item's metadata.
|
||||
**Note:** This field is temporary and will be removed in the future.
|
||||
The date format is just what we get from the database, and it's ambiguous.
|
||||
"""
|
||||
last_metadata_scrape_date_UNSTABLE: String
|
||||
"""URL to get the Internet Archive's metadata for this item in JSON form."""
|
||||
metadata_url: String
|
||||
"""
|
||||
Our cached version of the metadata avaliable at \`metadata_url\` (above)
|
||||
"""
|
||||
raw_metadata_json: String
|
||||
"""The skin that this item contains"""
|
||||
skin: Skin
|
||||
"""The URL where this item can be viewed on the Internet Archive"""
|
||||
url: String
|
||||
}
|
||||
|
||||
"""
|
||||
A "modern" Winamp skin. These skins use the `.wal` file extension and are free-form.
|
||||
|
||||
Most functionality in the Winamp Skin Museum is centered around "classic" skins,
|
||||
which are currently called just `Skin` in this schema.
|
||||
"""
|
||||
type ModernSkin implements Node & Skin {
|
||||
"""List of files contained within the skin's .wsz archive"""
|
||||
archive_files: [ArchiveFile]
|
||||
average_color: String @deprecated(reason: "Needed for migration")
|
||||
"""URL to download the skin"""
|
||||
download_url: String
|
||||
"""
|
||||
Filename of skin when uploaded to the Museum. Note: In some cases a skin
|
||||
has been uploaded under multiple names. Here we just pick one.
|
||||
"""
|
||||
filename(
|
||||
"""
|
||||
If true, the the correct file extension (.wsz or .wal) will be .
|
||||
Otherwise, the original user-uploaded file extension will be used.
|
||||
"""
|
||||
normalize_extension: Boolean = false
|
||||
): String
|
||||
"""GraphQL ID of the skin"""
|
||||
id: ID!
|
||||
"""The skin's "item" at archive.org"""
|
||||
internet_archive_item: InternetArchiveItem
|
||||
"""MD5 hash of the skin's file"""
|
||||
md5: String
|
||||
museum_url: String @deprecated(reason: "Needed for migration")
|
||||
nsfw: Boolean @deprecated(reason: "Needed for migration")
|
||||
readme_text: String @deprecated(reason: "Needed for migration")
|
||||
"""
|
||||
Times that the skin has been reviewed either on the Museum's Tinder-style
|
||||
reivew page, or via the Discord bot.
|
||||
"""
|
||||
reviews: [Review]
|
||||
screenshot_url: String @deprecated(reason: "Needed for migration")
|
||||
"""Has the skin been tweeted?"""
|
||||
tweeted: Boolean
|
||||
"""List of @winampskins tweets that mentioned the skin."""
|
||||
tweets: [Tweet]
|
||||
webamp_url: String @deprecated(reason: "Needed for migration")
|
||||
}
|
||||
|
||||
"""A collection of "modern" Winamp skins"""
|
||||
type ModernSkinsConnection {
|
||||
"""The total number of skins matching the filter"""
|
||||
count: Int
|
||||
"""The list of skins"""
|
||||
nodes: [ModernSkin]
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
"""
|
||||
Approve skin for tweeting
|
||||
|
||||
**Note:** Requires being logged in
|
||||
"""
|
||||
approve_skin(md5: String!): Boolean
|
||||
"""
|
||||
Mark a skin as NSFW
|
||||
|
||||
**Note:** Requires being logged in
|
||||
"""
|
||||
mark_skin_nsfw(md5: String!): Boolean
|
||||
"""
|
||||
Reject skin for tweeting
|
||||
|
||||
**Note:** Requires being logged in
|
||||
"""
|
||||
reject_skin(md5: String!): Boolean
|
||||
"""
|
||||
Request that an admin check if this skin is NSFW.
|
||||
Unlike other review mutaiton endpoints, this one does not require being logged
|
||||
in.
|
||||
"""
|
||||
request_nsfw_review_for_skin(md5: String!): Boolean
|
||||
"""
|
||||
Send a message to the admin of the site. Currently this appears in Discord.
|
||||
"""
|
||||
send_feedback(email: String, message: String!, url: String): Boolean
|
||||
"""Mutations for the upload flow"""
|
||||
upload: UploadMutations
|
||||
}
|
||||
|
||||
"""
|
||||
A globally unique object. The `id` here is intended only for use within
|
||||
GraphQL.
|
||||
https://graphql.org/learn/global-object-identification/
|
||||
"""
|
||||
interface Node {
|
||||
id: ID!
|
||||
}
|
||||
|
||||
type Query {
|
||||
"""
|
||||
Fetch archive file by it's MD5 hash
|
||||
|
||||
Get information about a file found within a skin's wsz/wal/zip archive.
|
||||
"""
|
||||
fetch_archive_file_by_md5(md5: String!): ArchiveFile
|
||||
"""
|
||||
Get an archive.org item by its identifier. You can find this in the URL:
|
||||
|
||||
https://archive.org/details/<identifier>/
|
||||
"""
|
||||
fetch_internet_archive_item_by_identifier(identifier: String!): InternetArchiveItem
|
||||
"""Get a skin by its MD5 hash"""
|
||||
fetch_skin_by_md5(md5: String!): Skin
|
||||
"""Get a tweet by its URL"""
|
||||
fetch_tweet_by_url(url: String!): Tweet
|
||||
"""The currently authenticated user, if any."""
|
||||
me: User
|
||||
"""All modern skins in the database"""
|
||||
modern_skins(first: Int = 10, offset: Int = 0): ModernSkinsConnection
|
||||
"""
|
||||
Get a globally unique object by its ID.
|
||||
|
||||
https://graphql.org/learn/global-object-identification/
|
||||
"""
|
||||
node(id: ID!): Node
|
||||
"""
|
||||
Search the database using the Algolia search index used by the Museum.
|
||||
|
||||
Useful for locating a particular skin.
|
||||
"""
|
||||
search_skins(first: Int = 10, offset: Int = 0, query: String!): [Skin]
|
||||
"""A random skin that needs to be reviewed"""
|
||||
skin_to_review: Skin
|
||||
"""
|
||||
All classic skins in the database
|
||||
|
||||
**Note:** We don't currently support combining sorting and filtering.
|
||||
"""
|
||||
skins(filter: SkinsFilterOption, first: Int = 10, offset: Int = 0, sort: SkinsSortOption): SkinsConnection
|
||||
"""A namespace for statistics about the database"""
|
||||
statistics: DatabaseStatistics
|
||||
"""Tweets tweeted by @winampskins"""
|
||||
tweets(first: Int = 10, offset: Int = 0, sort: TweetsSortOption): TweetsConnection
|
||||
"""Get the status of a batch of uploads by ids"""
|
||||
upload_statuses(ids: [String!]!): [SkinUpload]
|
||||
"""Get the status of a batch of uploads by md5s"""
|
||||
upload_statuses_by_md5(md5s: [String!]!): [SkinUpload] @deprecated(reason: "Prefer `upload_statuses` instead, were we operate on ids.")
|
||||
}
|
||||
|
||||
"""The judgement made about a skin by a moderator"""
|
||||
enum Rating {
|
||||
APPROVED
|
||||
NSFW
|
||||
REJECTED
|
||||
}
|
||||
|
||||
"""
|
||||
A review of a skin. Done either on the Museum's Tinder-style
|
||||
reivew page, or via the Discord bot.
|
||||
"""
|
||||
type Review {
|
||||
"""The rating that the user gave the skin"""
|
||||
rating: Rating
|
||||
"""
|
||||
The user who made the review (if known). **Note:** In the early days we didn't
|
||||
track this, so many will be null.
|
||||
"""
|
||||
reviewer: String
|
||||
"""The skin that was reviewed"""
|
||||
skin: Skin
|
||||
}
|
||||
|
||||
"""
|
||||
A Winamp skin. Could be modern or classic.
|
||||
|
||||
**Note**: At some point in the future, this might be renamed to `Skin`.
|
||||
"""
|
||||
interface Skin {
|
||||
"""List of files contained within the skin's .wsz archive"""
|
||||
archive_files: [ArchiveFile]
|
||||
average_color: String @deprecated(reason: "Needed for migration")
|
||||
"""URL to download the skin"""
|
||||
download_url: String
|
||||
"""
|
||||
Filename of skin when uploaded to the Museum. Note: In some cases a skin
|
||||
has been uploaded under multiple names. Here we just pick one.
|
||||
"""
|
||||
filename(
|
||||
"""
|
||||
If true, the the correct file extension (.wsz or .wal) will be .
|
||||
Otherwise, the original user-uploaded file extension will be used.
|
||||
"""
|
||||
normalize_extension: Boolean = false
|
||||
): String
|
||||
"""GraphQL ID of the skin"""
|
||||
id: ID!
|
||||
"""The skin's "item" at archive.org"""
|
||||
internet_archive_item: InternetArchiveItem
|
||||
"""MD5 hash of the skin's file"""
|
||||
md5: String
|
||||
museum_url: String @deprecated(reason: "Needed for migration")
|
||||
nsfw: Boolean @deprecated(reason: "Needed for migration")
|
||||
readme_text: String @deprecated(reason: "Needed for migration")
|
||||
"""
|
||||
Times that the skin has been reviewed either on the Museum's Tinder-style
|
||||
reivew page, or via the Discord bot.
|
||||
"""
|
||||
reviews: [Review]
|
||||
screenshot_url: String @deprecated(reason: "Needed for migration")
|
||||
"""Has the skin been tweeted?"""
|
||||
tweeted: Boolean
|
||||
"""List of @winampskins tweets that mentioned the skin."""
|
||||
tweets: [Tweet]
|
||||
webamp_url: String @deprecated(reason: "Needed for migration")
|
||||
}
|
||||
|
||||
"""Information about an attempt to upload a skin to the Museum."""
|
||||
type SkinUpload {
|
||||
id: String
|
||||
"""
|
||||
Skin that was uploaded. **Note:** This is null if the skin has not yet been
|
||||
fully processed. (status == ARCHIVED)
|
||||
"""
|
||||
skin: Skin
|
||||
status: SkinUploadStatus
|
||||
"""Md5 hash given when requesting the upload URL."""
|
||||
upload_md5: String
|
||||
}
|
||||
|
||||
"""
|
||||
The current status of a pending upload.
|
||||
|
||||
**Note:** Expect more values here as we try to be more transparent about
|
||||
the status of a pending uploads.
|
||||
"""
|
||||
enum SkinUploadStatus {
|
||||
ARCHIVED
|
||||
DELAYED
|
||||
ERRORED
|
||||
UPLOAD_REPORTED
|
||||
URL_REQUESTED
|
||||
}
|
||||
|
||||
"""A collection of classic Winamp skins"""
|
||||
type SkinsConnection {
|
||||
"""The total number of skins matching the filter"""
|
||||
count: Int
|
||||
"""The list of skins"""
|
||||
nodes: [Skin]
|
||||
}
|
||||
|
||||
enum SkinsFilterOption {
|
||||
APPROVED
|
||||
NSFW
|
||||
REJECTED
|
||||
TWEETED
|
||||
}
|
||||
|
||||
enum SkinsSortOption {
|
||||
MUSEUM
|
||||
}
|
||||
|
||||
"""A tweet made by @winampskins mentioning a Winamp skin"""
|
||||
type Tweet {
|
||||
"""
|
||||
Number of likes the tweet has received. Updated nightly. (Note: Recent likes on older tweets may not be reflected here)
|
||||
"""
|
||||
likes: Int
|
||||
"""
|
||||
Number of retweets the tweet has received. Updated nightly. (Note: Recent retweets on older tweets may not be reflected here)
|
||||
"""
|
||||
retweets: Int
|
||||
"""The skin featured in this Tweet"""
|
||||
skin: Skin
|
||||
"""
|
||||
URL of the tweet. **Note:** Early on in the bot's life we just recorded
|
||||
_which_ skins were tweeted, not any info about the actual tweet. This means we
|
||||
don't always know the URL of the tweet.
|
||||
"""
|
||||
url: String
|
||||
}
|
||||
|
||||
"""A collection of tweets made by the @winampskins bot"""
|
||||
type TweetsConnection {
|
||||
"""The total number of tweets"""
|
||||
count: Int
|
||||
"""The list of tweets"""
|
||||
nodes: [Tweet]
|
||||
}
|
||||
|
||||
enum TweetsSortOption {
|
||||
LIKES
|
||||
RETWEETS
|
||||
}
|
||||
|
||||
"""
|
||||
Mutations for the upload flow
|
||||
|
||||
1. The user finds the md5 hash of their local files.
|
||||
2. (`get_upload_urls`) The user requests upload URLs for each of their files.
|
||||
3. The server returns upload URLs for each of their files which are not already in the collection.
|
||||
4. The user uploads each of their files to the URLs returned in step 3.
|
||||
5. (`report_skin_uploaded`) The user notifies the server that they're done uploading.
|
||||
6. (TODO) The user polls for the status of their uploads.
|
||||
"""
|
||||
type UploadMutations {
|
||||
"""
|
||||
Get a (possibly incompelte) list of UploadUrls for each of the files. If an
|
||||
UploadUrl is not returned for a given hash, it means the file is already in
|
||||
the collection.
|
||||
"""
|
||||
get_upload_urls(files: [UploadUrlRequest!]!): [UploadUrl]
|
||||
"""Notify the server that the user is done uploading."""
|
||||
report_skin_uploaded(id: String!, md5: String!): Boolean
|
||||
}
|
||||
|
||||
"""
|
||||
A URL that the client can use to upload a skin to S3, and then notify the server
|
||||
when they're done.
|
||||
"""
|
||||
type UploadUrl {
|
||||
id: String
|
||||
md5: String
|
||||
url: String
|
||||
}
|
||||
|
||||
"""Input object used for a user to request an UploadUrl"""
|
||||
input UploadUrlRequest {
|
||||
filename: String!
|
||||
md5: String!
|
||||
}
|
||||
|
||||
type User {
|
||||
username: String
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ export default class ClassicSkinResolver
|
|||
}: {
|
||||
/** If true, the the correct file extension (.wsz or .wal) will be .
|
||||
Otherwise, the original user-uploaded file extension will be used. */
|
||||
normalize_extension?: boolean;
|
||||
normalize_extension?: boolean | null;
|
||||
}): Promise<string> {
|
||||
const filename = await this._model.getFileName();
|
||||
if (normalize_extension) {
|
||||
|
|
@ -61,7 +61,7 @@ export default class ClassicSkinResolver
|
|||
}
|
||||
|
||||
/**
|
||||
* List of @winampskins tweets that mentioned the skin.
|
||||
* List of `@winampskins` tweets that mentioned the skin.
|
||||
* @gqlField */
|
||||
tweets(): Promise<Array<TweetResolver | null>> {
|
||||
return super.tweets();
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export interface ISkin {
|
|||
* If true, the the correct file extension (.wsz or .wal) will be .
|
||||
* Otherwise, the original user-uploaded file extension will be used.
|
||||
*/
|
||||
normalize_extension?: boolean;
|
||||
normalize_extension?: boolean | null;
|
||||
}): Promise<string>;
|
||||
|
||||
/**
|
||||
|
|
@ -54,7 +54,7 @@ export interface ISkin {
|
|||
tweeted(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* List of @winampskins tweets that mentioned the skin.
|
||||
* List of `@winampskins` tweets that mentioned the skin.
|
||||
* @gqlField
|
||||
*/
|
||||
tweets(): Promise<Array<TweetResolver | null>>;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export default class DatabaseStatisticsResolver {
|
|||
return Skins.getClassicSkinCount();
|
||||
}
|
||||
/**
|
||||
* The number of skins in the Museum that have been tweeted by @winampskins
|
||||
* The number of skins in the Museum that have been tweeted by `@winampskins`
|
||||
* @gqlField
|
||||
*/
|
||||
tweeted_skins_count(): Promise<Int> {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export default class ModernSkinResolver
|
|||
}: {
|
||||
/** If true, the the correct file extension (.wsz or .wal) will be .
|
||||
Otherwise, the original user-uploaded file extension will be used. */
|
||||
normalize_extension?: boolean;
|
||||
normalize_extension?: boolean | null;
|
||||
}): Promise<string> {
|
||||
const filename = await this._model.getFileName();
|
||||
if (normalize_extension) {
|
||||
|
|
@ -72,7 +72,7 @@ export default class ModernSkinResolver
|
|||
return super.tweeted();
|
||||
}
|
||||
/**
|
||||
* List of @winampskins tweets that mentioned the skin.
|
||||
* List of `@winampskins` tweets that mentioned the skin.
|
||||
* @gqlField */
|
||||
async tweets(): Promise<Array<TweetResolver | null>> {
|
||||
return super.tweets();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@ export type MutationResolver = unknown;
|
|||
* @gqlField */
|
||||
export async function send_feedback(
|
||||
_: MutationResolver,
|
||||
{ message, email, url }: { message: string; email?: string; url?: string },
|
||||
{
|
||||
message,
|
||||
email,
|
||||
url,
|
||||
}: { message: string; email?: string | null; url?: string | null },
|
||||
req: GqlCtx
|
||||
): Promise<boolean> {
|
||||
req.notify({
|
||||
|
|
|
|||
|
|
@ -43,11 +43,7 @@ export default class SkinResolver {
|
|||
*/
|
||||
export async function search_skins(
|
||||
_: RootResolver,
|
||||
{
|
||||
query,
|
||||
first = 10,
|
||||
offset = 0,
|
||||
}: { query: string; first?: Int; offset?: Int },
|
||||
{ query, first = 10, offset = 0 }: { query: string; first: Int; offset: Int },
|
||||
{ ctx }: GqlCtx
|
||||
): Promise<Array<ISkin | null>> {
|
||||
if (first > 1000) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import RootResolver from "./RootResolver";
|
|||
import { GqlCtx } from "../GqlCtx";
|
||||
|
||||
/**
|
||||
* A tweet made by @winampskins mentioning a Winamp skin
|
||||
* A tweet made by `@winampskins` mentioning a Winamp skin
|
||||
* @gqlType Tweet
|
||||
*/
|
||||
export default class TweetResolver {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
# Schema generated by Grats (https://grats.capt.dev)
|
||||
# Do not manually edit. Regenerate by running `npx grats`.
|
||||
# @generated
|
||||
"""A file found within a Winamp Skin's .wsz archive"""
|
||||
type ArchiveFile {
|
||||
"""
|
||||
|
|
@ -104,7 +103,7 @@ type ClassicSkin implements Node & Skin {
|
|||
"""Has the skin been tweeted?"""
|
||||
tweeted: Boolean
|
||||
|
||||
"""List of @winampskins tweets that mentioned the skin."""
|
||||
"""List of `@winampskins` tweets that mentioned the skin."""
|
||||
tweets: [Tweet]
|
||||
|
||||
"""URL of webamp.org with the skin loaded"""
|
||||
|
|
@ -143,7 +142,7 @@ type DatabaseStatistics {
|
|||
tweetable_skins_count: Int
|
||||
|
||||
"""
|
||||
The number of skins in the Museum that have been tweeted by @winampskins
|
||||
The number of skins in the Museum that have been tweeted by `@winampskins`
|
||||
"""
|
||||
tweeted_skins_count: Int
|
||||
|
||||
|
|
@ -243,7 +242,7 @@ type ModernSkin implements Node & Skin {
|
|||
"""Has the skin been tweeted?"""
|
||||
tweeted: Boolean
|
||||
|
||||
"""List of @winampskins tweets that mentioned the skin."""
|
||||
"""List of `@winampskins` tweets that mentioned the skin."""
|
||||
tweets: [Tweet]
|
||||
webamp_url: String @deprecated(reason: "Needed for migration")
|
||||
}
|
||||
|
|
@ -329,7 +328,7 @@ type Query {
|
|||
me: User
|
||||
|
||||
"""All modern skins in the database"""
|
||||
modern_skins(first: Int = 10, offset: Int = 0): ModernSkinsConnection
|
||||
modern_skins(first: Int! = 10, offset: Int! = 0): ModernSkinsConnection
|
||||
|
||||
"""
|
||||
Get a globally unique object by its ID.
|
||||
|
|
@ -343,7 +342,7 @@ type Query {
|
|||
|
||||
Useful for locating a particular skin.
|
||||
"""
|
||||
search_skins(first: Int = 10, offset: Int = 0, query: String!): [Skin]
|
||||
search_skins(first: Int! = 10, offset: Int! = 0, query: String!): [Skin]
|
||||
|
||||
"""A random skin that needs to be reviewed"""
|
||||
skin_to_review: Skin
|
||||
|
|
@ -353,13 +352,13 @@ type Query {
|
|||
|
||||
**Note:** We don't currently support combining sorting and filtering.
|
||||
"""
|
||||
skins(filter: SkinsFilterOption, first: Int = 10, offset: Int = 0, sort: SkinsSortOption): SkinsConnection
|
||||
skins(filter: SkinsFilterOption, first: Int! = 10, offset: Int! = 0, sort: SkinsSortOption): SkinsConnection
|
||||
|
||||
"""A namespace for statistics about the database"""
|
||||
statistics: DatabaseStatistics
|
||||
|
||||
"""Tweets tweeted by @winampskins"""
|
||||
tweets(first: Int = 10, offset: Int = 0, sort: TweetsSortOption): TweetsConnection
|
||||
"""Tweets tweeted by `@winampskins`"""
|
||||
tweets(first: Int! = 10, offset: Int! = 0, sort: TweetsSortOption): TweetsConnection
|
||||
|
||||
"""Get the status of a batch of uploads by ids"""
|
||||
upload_statuses(ids: [String!]!): [SkinUpload]
|
||||
|
|
@ -440,7 +439,7 @@ interface Skin {
|
|||
"""Has the skin been tweeted?"""
|
||||
tweeted: Boolean
|
||||
|
||||
"""List of @winampskins tweets that mentioned the skin."""
|
||||
"""List of `@winampskins` tweets that mentioned the skin."""
|
||||
tweets: [Tweet]
|
||||
webamp_url: String @deprecated(reason: "Needed for migration")
|
||||
}
|
||||
|
|
@ -494,7 +493,7 @@ enum SkinsSortOption {
|
|||
MUSEUM
|
||||
}
|
||||
|
||||
"""A tweet made by @winampskins mentioning a Winamp skin"""
|
||||
"""A tweet made by `@winampskins` mentioning a Winamp skin"""
|
||||
type Tweet {
|
||||
"""
|
||||
Number of likes the tweet has received. Updated nightly. (Note: Recent likes on older tweets may not be reflected here)
|
||||
|
|
@ -517,7 +516,7 @@ type Tweet {
|
|||
url: String
|
||||
}
|
||||
|
||||
"""A collection of tweets made by the @winampskins bot"""
|
||||
"""A collection of tweets made by the `@winampskins` bot"""
|
||||
type TweetsConnection {
|
||||
"""The total number of tweets"""
|
||||
count: Int
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -56,7 +56,7 @@
|
|||
"cli": "ts-node --transpile-only ./cli.ts",
|
||||
"sync": "ts-node --transpile-only ./tasks/syncWithArchive.ts",
|
||||
"migrate": "knex migrate:latest",
|
||||
"grats": "grats --output=./api/graphql/schema.graphql"
|
||||
"grats": "grats"
|
||||
},
|
||||
"prettier": {},
|
||||
"devDependencies": {
|
||||
|
|
@ -64,11 +64,11 @@
|
|||
"@types/supertest": "^2.0.10",
|
||||
"@typescript-eslint/eslint-plugin": "^5.15.0",
|
||||
"@typescript-eslint/parser": "^5.15.0",
|
||||
"grats": "0.0.0-main-bfb182a3",
|
||||
"supertest": "^6.0.1",
|
||||
"typescript": "^3.8.3"
|
||||
"typescript": "^3.8.3",
|
||||
"grats": "0.0.0-main-d4d43d4b"
|
||||
},
|
||||
"resolutions": {
|
||||
"graphql": "15.3.0"
|
||||
"graphql": "16.6.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"grats": {
|
||||
"nullableByDefault": true,
|
||||
"EXPERIMENTAL_codegenPath": "./api/graphql/schema.ts"
|
||||
"tsSchema": "./api/graphql/schema.ts",
|
||||
"graphqlSchema": "./api/graphql/schema.graphql"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
|
|
|
|||
29
yarn.lock
29
yarn.lock
|
|
@ -2912,14 +2912,6 @@
|
|||
dependencies:
|
||||
tslib "^2.4.0"
|
||||
|
||||
"@graphql-tools/utils@^9.2.1":
|
||||
version "9.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-9.2.1.tgz#1b3df0ef166cfa3eae706e3518b17d5922721c57"
|
||||
integrity sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==
|
||||
dependencies:
|
||||
"@graphql-typed-document-node/core" "^3.1.1"
|
||||
tslib "^2.4.0"
|
||||
|
||||
"@graphql-tools/wrap@9.2.1":
|
||||
version "9.2.1"
|
||||
resolved "https://registry.npmjs.org/@graphql-tools/wrap/-/wrap-9.2.1.tgz"
|
||||
|
|
@ -2931,11 +2923,6 @@
|
|||
tslib "^2.4.0"
|
||||
value-or-promise "1.0.11"
|
||||
|
||||
"@graphql-typed-document-node/core@^3.1.1":
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861"
|
||||
integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==
|
||||
|
||||
"@hapi/hoek@^9.0.0":
|
||||
version "9.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb"
|
||||
|
|
@ -14788,15 +14775,14 @@ graphql@^16.6.0:
|
|||
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07"
|
||||
integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==
|
||||
|
||||
grats@0.0.0-main-bfb182a3:
|
||||
version "0.0.0-main-bfb182a3"
|
||||
resolved "https://registry.yarnpkg.com/grats/-/grats-0.0.0-main-bfb182a3.tgz#c566889fce58016d24b976c3274d0dda143366c6"
|
||||
integrity sha512-cFsUXkmqo5TsbV51danyyH3pFLWduTMSg6RNwskEOofgV/+GiKFdbmaLWsgI2B5/RcBkzPjdDGRN5B8u99pR7g==
|
||||
grats@0.0.0-main-d4d43d4b:
|
||||
version "0.0.0-main-d4d43d4b"
|
||||
resolved "https://registry.yarnpkg.com/grats/-/grats-0.0.0-main-d4d43d4b.tgz#5e81c5558568251b9e026aeb77782198a8647a6d"
|
||||
integrity sha512-SvxKQ5VV5W4tcxPHWutt5JSt2MUFbeWydKuiloPIIhzibiMMwNdCoPIO1E8YnQN//tCEsRdFqeV29zu/tENQeQ==
|
||||
dependencies:
|
||||
"@graphql-tools/utils" "^9.2.1"
|
||||
commander "^10.0.0"
|
||||
graphql "^16.6.0"
|
||||
typescript "^4.9.5"
|
||||
typescript "^5.0.2"
|
||||
|
||||
gulp-eslint@^3.0.1:
|
||||
version "3.0.1"
|
||||
|
|
@ -26063,6 +26049,11 @@ typescript@^4.9.5:
|
|||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
||||
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
||||
|
||||
typescript@^5.0.2:
|
||||
version "5.3.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37"
|
||||
integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==
|
||||
|
||||
uid-safe@2.1.5:
|
||||
version "2.1.5"
|
||||
resolved "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue