source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/pro/send_gift.rb
Ruby
apache-2.0
187
the-future
253
module Pro class SendGift < Action parameter :from, load: User, required: true parameter :to, load: User, required: true parameter :tier, required: true parameter :message def call ProGift.create!(context) end end end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/pro/validate_gift.rb
Ruby
apache-2.0
187
the-future
1,000
module Pro class ValidateGift < Action parameter :from, load: User, required: true parameter :to, load: User, required: true parameter :tier, required: true parameter :message # Validates the gift and raises an exception if it's not valid # @raise [ActiveRecord::RecordNotFound] the recipient ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/pro/set_discord.rb
Ruby
apache-2.0
187
the-future
382
module Pro class SetDiscord < Action parameter :user, load: User, required: true parameter :discord, required: true validates :discord, format: { with: /\A.*\#\d+\z/, message: 'must be a proper Discord Tag (Name#1234)' } def call raise NotAuthorizedError unless user.patron? ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/pro/set_message.rb
Ruby
apache-2.0
187
the-future
385
module Pro class SetMessage < Action parameter :user, load: User, required: true parameter :message, required: true validates :message, length: { maximum: 120 } def call raise NotAuthorizedError unless can_set_message? user.update!(pro_message: message) end def can_set_message?...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/pro/cancel_subscription.rb
Ruby
apache-2.0
187
the-future
300
module Pro class CancelSubscription < Action parameter :subscription, required: true delegate :user, to: :subscription def call ProMailer.cancellation_email(user, subscription.tier).deliver_later subscription.cancel! { subscription: subscription } end end end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/pro/subscribe_with_stripe.rb
Ruby
apache-2.0
187
the-future
540
module Pro class SubscribeWithStripe < Action parameter :user, required: true, load: User parameter :tier, required: true parameter :token, required: true # Only allow subscribing to pro or patron tiers validates :tier, inclusion: { in: %w[pro patron] } def call user.pro_subscription&....
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/pro/unsubscribe.rb
Ruby
apache-2.0
187
the-future
482
module Pro class Unsubscribe < Action parameter :user, required: true, load: User parameter :reason, required: false delegate :pro_subscription, to: :user validate :validate_is_subscribed def call pro_subscription.cancel! # Returns the expiration time for the subscription { ex...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/accounts/send_confirmation_email.rb
Ruby
apache-2.0
187
the-future
305
module Accounts class SendConfirmationEmail < Action parameter :user, load: User, required: true def call message = UserMailer.confirmation(user).deliver_now { message: message } rescue MailSendError::HardBounce user.update(email_status: :email_bounced) end end end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/accounts/prevalidate_email.rb
Ruby
apache-2.0
187
the-future
1,539
# frozen_string_literal: true module Accounts class PrevalidateEmail < Action class EmailableError < StandardError; end HTTP_TIMEOUT = 10.seconds API_KEY = ENV.fetch('EMAILABLE_API_KEY', nil) URL = 'https://api.emailable.com/v1/verify' URL_TEMPLATE = Addressable::Template.new("#{URL}?api_key=#{A...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/accounts/send_password_reset.rb
Ruby
apache-2.0
187
the-future
381
module Accounts class SendPasswordReset < Action parameter :email, required: true def call UserMailer.password_reset(user).deliver_later { email: email } end private def conflict_detector @conflict_detector ||= Zorro::UserConflictDetector.new(email: email) end def us...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/accounts/generate_nolt_token.rb
Ruby
apache-2.0
187
the-future
404
module Accounts class GenerateNoltToken < Action NOLT_SSO_SECRET = ENV['NOLT_SSO_SECRET'] parameter :user, load: User, required: true def call payload = { id: user.id, email: user.email, name: user.name, imageUrl: user.avatar(:large)&.url } token = JWT....
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/billing/update_stripe_source.rb
Ruby
apache-2.0
187
the-future
256
module Billing class UpdateStripeSource < Action parameter :user, required: true, load: User parameter :token, required: true def call customer = user.stripe_customer customer.source = token customer.save end end end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/actions/billing/stripe_charge.rb
Ruby
apache-2.0
187
the-future
502
module Billing class StripeCharge < Action # Stripe uses integer cents for the transaction amount parameter :amount, required: true, cast: ->(dec) { (dec * 100).to_i } parameter :token, required: true parameter :description, required: false parameter :metadata, required: false def call ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/validators/country_code_validator.rb
Ruby
apache-2.0
187
the-future
552
class CountryCodeValidator < ActiveModel::EachValidator def validate_each(record, attr, value) if value.respond_to?(:each) value.each do |v| error = validate_value(v) record.errors.add(attr, message: error) if error end else error = validate_value(value) record.errors.a...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/validators/active_ama_validator.rb
Ruby
apache-2.0
187
the-future
478
class ActiveAMAValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) ama = if value.respond_to?(:post) AMA.for_original_post(value.post).first elsif value.is_a?(Post) AMA.for_original_post(value).first else value end ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/validators/multi_presence_validator.rb
Ruby
apache-2.0
187
the-future
582
class MultiPresenceValidator < ActiveModel::Validator attr_reader :attrs, :minimum def initialize(options) super @attrs = options[:over] @minimum = options[:minimum] || 1 end def validate(record) values = attrs.map { |a| [a, record.public_send(a)] }.to_h present = values.select { |_, v| v....
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/validators/exclusivity_validator.rb
Ruby
apache-2.0
187
the-future
564
class ExclusivityValidator < ActiveModel::Validator attr_reader :attrs, :limit def initialize(options) super @attrs = options[:over] @limit = options[:limit] || 1 end def validate(record) values = attrs.map { |a| [a, record.public_send(a)] }.to_h present = values.select { |_, v| v.present?...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/validators/polymorphism_validator.rb
Ruby
apache-2.0
187
the-future
307
class PolymorphismValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) valid_types = [options[:type]].flatten unless valid_types.any? { |type| value.is_a?(type) } record.errors.add(attribute, message: (options[:message] || "disallowed type")) end end end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/validators/image_dimensions_validator.rb
Ruby
apache-2.0
187
the-future
1,077
class ImageDimensionsValidator < ActiveModel::EachValidator def validate_each(record, attr, value) return if value.blank? actual = dimensions_for(value) return unless actual height = options[:height] width = options[:width] aspect = options[:aspect_ratio] errors = [ validate_value...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/validators/language_code_validator.rb
Ruby
apache-2.0
187
the-future
512
class LanguageCodeValidator < ActiveModel::EachValidator def validate_each(record, attr, value) if value.respond_to?(:each) value.each do |v| error = validate_value(v) record.errors.add(attr, message: error) if error end else error = validate_value(value) record.errors....
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/validators/real_email_validator.rb
Ruby
apache-2.0
187
the-future
385
# This is a validator which uses emailable.com to validate an email address before saving class RealEmailValidator < ActiveModel::EachValidator def validate_each(record, attr, value) return if value.blank? response = Accounts::PrevalidateEmail.call(email: value) record.errors.add(attr, message: 'could n...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/mailers/pro_mailer.rb
Ruby
apache-2.0
187
the-future
748
class ProMailer < ApplicationMailer def gift_email(gift) @gift = gift mail( to: gift.to.email, subject: default_i18n_subject(name: gift.user.name, tier: gift.tier.titleize) ) end def cancellation_email(user, tier, reason = nil) @user = user @tier = tier @reason = reason ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/mailers/user_mailer.rb
Ruby
apache-2.0
187
the-future
1,503
class UserMailer < ApplicationMailer include Roadie::Rails::Automatic def confirmation(user) return nil if user.blank? @user = user @token = token_for(user, :email_confirm, expires_in: 7.days) @confirm_link = client_url_for("/confirm-email?token=#{@token.token}") mail to: user.email, subject: '...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/mailers/application_mailer.rb
Ruby
apache-2.0
187
the-future
722
class ApplicationMailer < ActionMailer::Base SMTP_SOFT_BOUNCES = [ Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, EOFError, Net::ProtocolError, SocketError, IOError, Timeout::Error, Postmark::HttpClientError, Postmark::InternalServerError, Postmark::TimeoutError ]...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/formatters/shrine_attachment_value_formatter.rb
Ruby
apache-2.0
187
the-future
844
# frozen_string_literal: true class ShrineAttachmentValueFormatter < JSONAPI::ValueFormatter def self.format(value) return nil if value.blank? raise 'Invalid attachment field' unless value.is_a? Shrine::Attacher return nil if value.file.blank? Sentry.with_child_span(op: 'jsonapi.format_value', ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/kitsu_schema.rb
Ruby
apache-2.0
187
the-future
531
# frozen_string_literal: true class KitsuSchema < GraphQL::Schema include ApolloFederation::Schema federation version: '2.0' import_directives %w[tag key shareable] default_max_page_size 2000 mutation Types::MutationType query Types::QueryType use GraphQL::Schema::Warden use GraphQL::Batch tracer ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/sentry_tracing.rb
Ruby
apache-2.0
187
the-future
650
# frozen_string_literal: true class SentryTracing def self.trace(key, data) if key.start_with?('execute_query') # Set the transaction name based on the operation type and name selected_op = data[:query].selected_operation if selected_op op_type = selected_op.operation_type op_na...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/profile_stats.rb
Ruby
apache-2.0
187
the-future
1,571
class Types::ProfileStats < Types::BaseObject description 'The different types of user stats that we calculate.' OPTIONS = { anime_amount_consumed: 'Stat::AnimeAmountConsumed', manga_amount_consumed: 'Stat::MangaAmountConsumed', anime_category_breakdown: 'Stat::AnimeCategoryBreakdown', manga_catego...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/character.rb
Ruby
apache-2.0
187
the-future
1,296
# frozen_string_literal: true class Types::Character < Types::BaseObject implements Types::Interface::WithTimestamps description 'Information about a Character in the Kitsu database' key fields: %w[id] def self.resolve_reference(reference, _context) Loaders::UnscopedRecordLoader.for(::Character).load(re...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/localized_string.rb
Ruby
apache-2.0
187
the-future
246
class Types::LocalizedString < Types::BaseObject field :locale, String, null: false, description: 'The IETF/BCP 47 locale tag for this string' field :text, String, null: false, description: 'The text value of this string' end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/library_entry.rb
Ruby
apache-2.0
187
the-future
2,934
class Types::LibraryEntry < Types::BaseObject implements Types::Interface::WithTimestamps description 'Information about a specific media entry for a user' field :id, ID, null: false field :user, Types::Profile, null: false, description: 'The user who created this library entry.' field :media, Typ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/query_type.rb
Ruby
apache-2.0
187
the-future
14,839
# frozen_string_literal: true class Types::QueryType < GraphQL::Schema::Object connection_type_class(Types::BaseConnection) field :current_account, Types::Account, null: true do description 'Kitsu account details. You must supply an Authorization token in header.' end def current_account User.current...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/comment.rb
Ruby
apache-2.0
187
the-future
1,816
# frozen_string_literal: true class Types::Comment < Types::BaseObject implements Types::Interface::WithTimestamps implements Types::Interface::Holdable description 'A comment on a post' field :id, ID, null: false field :post, Types::Post, null: false, description: 'The post that this comment is a...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/chapter.rb
Ruby
apache-2.0
187
the-future
776
# frozen_string_literal: true class Types::Chapter < Types::BaseObject implements Types::Interface::Unit implements Types::Interface::WithTimestamps description 'A single chapter of a manga' key fields: %w[id] def self.resolve_reference(reference, _context) Loaders::UnscopedRecordLoader.for(::Chapter)...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/profile_link_site.rb
Ruby
apache-2.0
187
the-future
522
class Types::ProfileLinkSite < Types::BaseObject implements Types::Interface::WithTimestamps description 'An external site that can be linked to a user.' field :id, ID, null: false field :name, String, null: false, description: 'Name of the external profile website.' field :validate_find, String, ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/episode.rb
Ruby
apache-2.0
187
the-future
678
# frozen_string_literal: true class Types::Episode < Types::BaseObject implements Types::Interface::Unit implements Types::Interface::WithTimestamps description 'An Episode of a Media' key fields: %w[id] def self.resolve_reference(reference, _context) Loaders::UnscopedRecordLoader.for(::Episode).load(...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/character_voice.rb
Ruby
apache-2.0
187
the-future
830
class Types::CharacterVoice < Types::BaseObject implements Types::Interface::WithTimestamps description 'Information about a VA (Person) voicing a Character in a Media' field :id, ID, null: false field :media_character, Types::MediaCharacter, null: false, description: 'The MediaCharacter node' fie...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/video.rb
Ruby
apache-2.0
187
the-future
373
class Types::Video < Types::BaseObject implements Types::Interface::Streamable implements Types::Interface::WithTimestamps description 'The media video.' field :id, ID, null: false field :url, String, null: false, description: 'The url of the video.' field :episode, Types::Episode, null: fal...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/image.rb
Ruby
apache-2.0
187
the-future
947
class Types::Image < Types::BaseObject field :original, Types::ImageView, null: false, description: 'The original image' def original return nil unless object.file { name: 'original', url: object.file.url, width: object.file.width, height: object.file.height } end f...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/category.rb
Ruby
apache-2.0
187
the-future
1,366
# frozen_string_literal: true class Types::Category < Types::BaseObject implements Types::Interface::WithTimestamps description 'Information about a specific Category' field :id, ID, null: false field :title, resolver: Resolvers::LocalizedField.from(:titles), null: false, description: 'The name ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/wiki_submission.rb
Ruby
apache-2.0
187
the-future
1,284
class Types::WikiSubmission < Types::BaseObject implements Types::Interface::WithTimestamps description <<~DESCRIPTION.squish A Wiki Submission is used to either create or edit existing data in our database. This will allow a simple and convient way for users to submit issues/corrections without all th...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/site_link.rb
Ruby
apache-2.0
187
the-future
665
class Types::SiteLink < Types::BaseObject implements Types::Interface::WithTimestamps description "A link to a user's profile on an external site." field :id, ID, null: false field :site, Types::ProfileLinkSite, null: false, description: 'The actual linked website.' def site Loaders::RecordLoa...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/account.rb
Ruby
apache-2.0
187
the-future
2,338
# frozen_string_literal: true class Types::Account < Types::BaseObject implements Types::Interface::WithTimestamps description 'A user account on Kitsu' key fields: %w[id] def self.resolve_reference(reference, context) # Only resolve the user if the ID matches the current user return nil if context[...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/post.rb
Ruby
apache-2.0
187
the-future
3,048
# frozen_string_literal: true class Types::Post < Types::BaseObject implements Types::Interface::WithTimestamps implements Types::Interface::Holdable description 'A post that is visible to your followers and globally in the news-feed.' key fields: %w[id] def self.resolve_reference(reference, context) ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/favorite.rb
Ruby
apache-2.0
187
the-future
402
class Types::Favorite < Types::BaseObject implements Types::Interface::WithTimestamps description 'Favorite media, characters, and people for a user' field :id, ID, null: false field :item, Types::Union::FavoriteItem, null: false, description: 'The kitsu object that is mapped' field :user, Types::...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/anime.rb
Ruby
apache-2.0
187
the-future
957
# frozen_string_literal: true class Types::Anime < Types::BaseObject implements Types::Interface::Media implements Types::Interface::Episodic implements Types::Interface::WithTimestamps key fields: %w[id] def self.resolve_reference(reference, _context) Loaders::UnscopedRecordLoader.for(::Anime).load(re...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/review.rb
Ruby
apache-2.0
187
the-future
1,730
# frozen_string_literal: true class Types::Review < Types::BaseObject implements Types::Interface::WithTimestamps description 'A media review made by a user' key fields: %w[id] def self.resolve_reference(reference, context) Loaders::RecordLoader.for(::Review, token: context[:token]).load(reference[:id])...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/media_relationship.rb
Ruby
apache-2.0
187
the-future
843
# frozen_string_literal: true class Types::MediaRelationship < Types::BaseObject implements Types::Interface::WithTimestamps description 'A relationship from one media to another' field :source, Types::Interface::Media, null: false, description: 'The source media' def source Loaders::RecordLoade...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/base_connection.rb
Ruby
apache-2.0
187
the-future
389
class Types::BaseConnection < GraphQL::Types::Relay::BaseConnection field :total_count, Integer, null: false, description: 'The total amount of nodes.' # NOTE: In graphql 1.11.6 object.nodes was not limited by first. Now we use AR directly. def total_count if object.respond_to?(:total_count) ob...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/image_view.rb
Ruby
apache-2.0
187
the-future
404
class Types::ImageView < Types::BaseObject field :name, String, null: false, description: 'The name of this view of the image' field :url, String, null: false, description: 'The URL of this view of the image' field :width, Integer, null: true, description: 'The width of the image' fie...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/producer.rb
Ruby
apache-2.0
187
the-future
492
# frozen_string_literal: true class Types::Producer < Types::BaseObject implements Types::Interface::WithTimestamps description 'A company involved in the creation or localization of media' key fields: %w[id] def self.resolve_reference(reference, _context) Loaders::UnscopedRecordLoader.for(::Producer).l...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/library_event.rb
Ruby
apache-2.0
187
the-future
839
class Types::LibraryEvent < Types::BaseObject implements Types::Interface::WithTimestamps description 'History of user actions for a library entry.' field :id, ID, null: false field :library_entry, Types::LibraryEntry, null: false, description: 'The library entry related to this library event.' fi...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/franchise.rb
Ruby
apache-2.0
187
the-future
1,086
# frozen_string_literal: true class Types::Franchise < Types::BaseObject implements Types::Interface::WithTimestamps description 'Related media grouped together' key fields: %w[id] def self.resolve_reference(reference, _context) Loaders::UnscopedRecordLoader.for(::Franchise).load(reference[:id]) end ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/streaming_link.rb
Ruby
apache-2.0
187
the-future
409
class Types::StreamingLink < Types::BaseObject implements Types::Interface::Streamable implements Types::Interface::WithTimestamps description 'The stream link.' field :id, ID, null: false field :media, Types::Interface::Media, null: false, description: 'The media being streamed' field :url, Str...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/mutation_type.rb
Ruby
apache-2.0
187
the-future
1,224
# frozen_string_literal: true class Types::MutationType < Types::BaseObject def self.fancy_mutation( klass, name: klass.name.split('::')[1..].join.camelize(:lower) ) field name, mutation: klass end fancy_mutation Mutations::Account::Create field :pro, Mutations::Pro, null: false field :account...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/installment.rb
Ruby
apache-2.0
187
the-future
1,246
class Types::Installment < Types::BaseObject implements Types::Interface::WithTimestamps description 'Individual media that belongs to a franchise' field :id, ID, null: false field :release_order, Integer, null: true, description: 'Order based by date released' # Try preloaded rank first, fall bac...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/block.rb
Ruby
apache-2.0
187
the-future
517
class Types::Block < Types::BaseObject implements Types::Interface::WithTimestamps description 'A blocked user entry of an Account.' field :id, ID, null: false field :user, Types::Profile, null: false, description: 'User who blocked.' def user Loaders::RecordLoader.for(User).load(object.user_i...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/streamer.rb
Ruby
apache-2.0
187
the-future
742
class Types::Streamer < Types::BaseObject implements Types::Interface::WithTimestamps description 'The streaming company.' field :id, ID, null: false field :site_name, String, null: false, description: 'The name of the site that is streaming this media.' field :streaming_links, Types::StreamingLin...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/base_object.rb
Ruby
apache-2.0
187
the-future
358
# frozen_string_literal: true class Types::BaseObject < GraphQL::Schema::Object include HasImageField include ApolloFederation::Object connection_type_class Types::BaseConnection field_class Types::BaseField underscore_reference_keys true private def current_user context[:user] end def curren...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/library.rb
Ruby
apache-2.0
187
the-future
3,128
class Types::Library < Types::BaseObject description 'The user library' field :random_media, Types::Interface::Media, null: true do description 'Random anime or manga from this library' argument :media_type, Types::Enum::MediaType, required: true argument :status, [Types::Enum::LibraryEntryStatus], re...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/media_production.rb
Ruby
apache-2.0
187
the-future
529
class Types::MediaProduction < Types::BaseObject implements Types::Interface::WithTimestamps description 'The role a company played in the creation or localization of a media' # Identifiers field :id, ID, null: false field :role, Types::Enum::MediaProductionRole, null: false, description: 'The role...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/quote.rb
Ruby
apache-2.0
187
the-future
695
# frozen_string_literal: true class Types::Quote < Types::BaseObject implements Types::Interface::WithTimestamps description 'A quote from a media' key fields: %w[id] def self.resolve_reference(reference, _context) Loaders::UnscopedRecordLoader.for(::Quote).load(reference[:id]) end # Identifiers ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/session.rb
Ruby
apache-2.0
187
the-future
709
class Types::Session < Types::BaseObject description 'Information about a user session' field :account, Types::Account, null: true, description: 'The account associated with this session' def account object unless object.blank? end field :profile, Types::Profile, null: true, description...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/media_staff.rb
Ruby
apache-2.0
187
the-future
675
class Types::MediaStaff < Types::BaseObject implements Types::Interface::WithTimestamps description 'Information about a person working on an anime' # Identifiers field :id, ID, null: false field :role, String, null: false, description: 'The role this person had in the creation of this media' fi...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/date.rb
Ruby
apache-2.0
187
the-future
426
class Types::Date < Types::BaseScalar description 'A date, expressed as an ISO8601 string' def self.coerce_input(input_value, _context) Date.strptime(input_value, '%F') rescue ArgumentError raise GraphQL::CoercionError, "#{input_value.inspect} is not a valid date" end def self.coerce_result(ruby_val...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/titles_list.rb
Ruby
apache-2.0
187
the-future
1,640
# frozen_string_literal: true class Types::TitlesList < Types::BaseObject field :localized, resolver: Resolvers::LocalizedField, description: 'The list of localized titles keyed by locale' field :alternatives, [String], null: true, description: 'A list of additional, alternative, abbreviated, ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/volume.rb
Ruby
apache-2.0
187
the-future
1,038
# frozen_string_literal: true class Types::Volume < Types::BaseObject implements Types::Interface::Unit implements Types::Interface::WithTimestamps description 'A manga volume which can contain multiple chapters.' key fields: %w[id] def self.resolve_reference(reference, _context) Loaders::UnscopedReco...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/person.rb
Ruby
apache-2.0
187
the-future
1,734
# frozen_string_literal: true class Types::Person < Types::BaseObject implements Types::Interface::WithTimestamps description <<~DESCRIPTION.squish A Voice Actor, Director, Animator, or other person who works in the creation and localization of media DESCRIPTION key fields: %w[id] def self.resolve...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/media_reaction.rb
Ruby
apache-2.0
187
the-future
2,542
# frozen_string_literal: true class Types::MediaReaction < Types::BaseObject implements Types::Interface::WithTimestamps implements Types::Interface::Holdable description 'A simple review that is 140 characters long expressing how you felt about a media' key fields: %w[id] def self.resolve_reference(refer...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/report.rb
Ruby
apache-2.0
187
the-future
1,227
class Types::Report < Types::BaseObject implements Types::Interface::WithTimestamps description 'A report made by a user' field :id, ID, null: false field :reason, Types::Enum::ReportReason, null: false, description: 'The reason for why the report was made' field :status, Types::Enum::ReportStatus...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/quote_line.rb
Ruby
apache-2.0
187
the-future
558
class Types::QuoteLine < Types::BaseObject implements Types::Interface::WithTimestamps description 'A line in a quote' # Identifiers field :id, ID, null: false field :quote, Types::Quote, null: false, description: 'The quote this line is in' field :character, Types::Character, null: false, ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/media_character.rb
Ruby
apache-2.0
187
the-future
1,195
class Types::MediaCharacter < Types::BaseObject implements Types::Interface::WithTimestamps description 'Information about a Character starring in a Media' # Identifiers field :id, ID, null: false field :role, Types::Enum::CharacterRole, null: false, description: 'The role this character had in the...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/pro_subscription.rb
Ruby
apache-2.0
187
the-future
530
class Types::ProSubscription < Types::BaseObject implements Types::Interface::WithTimestamps description 'A subscription to Kitsu PRO' field :account, Types::Account, null: false, description: 'The account which is subscribed to Pro benefits' field :tier, Types::Enum::ProTier, null: false, de...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/map.rb
Ruby
apache-2.0
187
the-future
237
class Types::Map < Types::BaseScalar description 'A loose key-value map in GraphQL' def self.coerce_input(input_value, _context) input_value end def self.coerce_result(ruby_value, _context) ruby_value.as_json end end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/manga.rb
Ruby
apache-2.0
187
the-future
1,811
# frozen_string_literal: true class Types::Manga < Types::BaseObject implements Types::Interface::Media implements Types::Interface::WithTimestamps key fields: %w[id] def self.resolve_reference(reference, _context) Loaders::UnscopedRecordLoader.for(::Manga).load(reference[:id]) end field :subtype, T...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/profile.rb
Ruby
apache-2.0
187
the-future
6,638
# frozen_string_literal: true class Types::Profile < Types::BaseObject implements Types::Interface::WithTimestamps description 'A user profile on Kitsu' key fields: %w[id] def self.resolve_reference(reference, context) Loaders::RecordLoader.for(::User, token: context[:token]).load(reference[:id]) end ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/mapping.rb
Ruby
apache-2.0
187
the-future
580
class Types::Mapping < Types::BaseObject implements Types::Interface::WithTimestamps description 'Media Mappings from External Sites (MAL, Anilist, etc..) to Kitsu.' field :id, ID, null: false field :external_site, Types::Enum::MappingExternalSite, null: false, description: 'The name of the site whic...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/union/mapping_item.rb
Ruby
apache-2.0
187
the-future
232
class Types::Union::MappingItem < Types::Union::Base description 'Objects which are Mappable' possible_types Types::Anime, Types::Manga, Types::Category, Types::Character, Types::Episode, Types::Person, Types::Producer end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/media_type.rb
Ruby
apache-2.0
187
the-future
202
class Types::Enum::MediaType < Types::Enum::Base description 'これはアニメやマンガです' graphql_name 'MediaTypeEnum' value 'ANIME', value: 'Anime' value 'MANGA', value: 'Manga' end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/report_reason.rb
Ruby
apache-2.0
187
the-future
312
class Types::Enum::ReportReason < Types::Enum::Base value 'NSFW', 'Not Safe For Work', value: 'nsfw' value 'OFFENSIVE', '', value: 'offensive' value 'SPOILER', '', value: 'spoiler' value 'BULLYING', 'No bulli!', value: 'bullying' value 'SPAM', '', value: 'spam' value 'OTHER', '', value: 'other' end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/pro_tier.rb
Ruby
apache-2.0
187
the-future
409
class Types::Enum::ProTier < Types::Enum::Base value 'AO_PRO', 'Aozora Pro (only hides ads)', deprecation_reason: 'No longer for sale', value: 'ao_pro' value 'AO_PRO_PLUS', 'Aozora Pro+ (only hides ads)', deprecation_reason: 'No longer for sale', value: 'ao_pro' value 'PRO', 'Basic tier of Kitsu P...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/media_production_role.rb
Ruby
apache-2.0
187
the-future
221
class Types::Enum::MediaProductionRole < Types::Enum::Base value 'PRODUCER', value: 'producer' value 'LICENSOR', value: 'licensor' value 'STUDIO', value: 'studio' value 'SERIALIZATION', value: 'serialization' end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/recurring_billing_service.rb
Ruby
apache-2.0
187
the-future
360
class Types::Enum::RecurringBillingService < Types::Enum::Base value 'STRIPE', 'Bill a credit card via Stripe', value: 'stripe' value 'PAYPAL', 'Bill a PayPal account', value: 'paypal' value 'APPLE', 'Billed through Apple In-App Subscription', value: 'apple_ios' value 'GOOGLE_PLAY', 'Billed through Google Play ...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/profile_links_sites.rb
Ruby
apache-2.0
187
the-future
928
# frozen_string_literal: true class Types::Enum::ProfileLinksSites < Types::Enum::Base value 'TWITTER', value: 1 value 'FACEBOOK', value: 2 value 'YOUTUBE', value: 3 value 'GOOGLE', value: 4 value 'INSTAGRAM', value: 5 value 'TWITCH', value: 6 value 'VIMEO', value: 7 value 'GITHUB', value: 8 value '...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/manga_subtype.rb
Ruby
apache-2.0
187
the-future
517
# frozen_string_literal: true class Types::Enum::MangaSubtype < Types::Enum::Base MANHUA = 'Chinese comics produced in China and in the Greater China region.' value 'MANGA', value: 'manga' value 'NOVEL', value: 'novel' value 'MANHUA', MANHUA, value: 'manhua' value 'ONESHOT', value: 'oneshot' value 'DOUJIN...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/library_event_kind.rb
Ruby
apache-2.0
187
the-future
424
class Types::Enum::LibraryEventKind < Types::Enum::Base value 'PROGRESSED', 'Progress or Time Spent was added/updated.', value: 'progressed' value 'UPDATED', 'Status or Reconsuming was added/updated.', value: 'updated' value 'REACTED', 'Reaction was added/updated.', value: 'reacted' value 'RATED', 'Rating was a...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/held_reason.rb
Ruby
apache-2.0
187
the-future
301
# frozen_string_literal: true class Types::Enum::HeldReason < Types::Enum::Base description 'The reason a record is held for manual moderator approval.' value 'SPAMFILTER', 'Caught by a spam filter.', value: 'spamfilter' value 'WORDFILTER', 'Caught by a word filter.', value: 'wordfilter' end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/anime_subtype.rb
Ruby
apache-2.0
187
the-future
376
# frozen_string_literal: true class Types::Enum::AnimeSubtype < Types::Enum::Base value 'TV' value 'SPECIAL', 'Spinoffs or Extras of the original.', value: 'special' value 'OVA', 'Original Video Animation. Anime directly released to video market.' value 'ONA', 'Original Net Animation (Web Anime).' value 'MOV...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/rating_system.rb
Ruby
apache-2.0
187
the-future
468
# frozen_string_literal: true class Types::Enum::RatingSystem < Types::Enum::Base SIMPLE = '1-20 displayed as 4 smileys - Awful (1), Meh (8), Good (14) and Great (20)' REGULAR = '1-20 in increments of 2 displayed as 5 stars in 0.5 star increments' ADVANCED = '1-20 in increments of 1 displayed as 1-10 in 0.5 incr...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/installment_tag.rb
Ruby
apache-2.0
187
the-future
880
# frozen_string_literal: true class Types::Enum::InstallmentTag < Types::Enum::Base MAIN_STORY = 'The main story.' SIDE_STORY = 'Takes place sometime during the main storyline.' SPINOFF = 'Uses characters of a different series, but is not an alternate setting or story.' CROSSOVER = 'Characters from different m...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/mapping_item.rb
Ruby
apache-2.0
187
the-future
305
class Types::Enum::MappingItem < Types::Enum::Base value 'ANIME', value: 'Anime' value 'MANGA', value: 'Manga' value 'CATEGORY', value: 'Category' value 'CHARACTER', value: 'Character' value 'EPISODE', value: 'Episode' value 'PERSON', value: 'Person' value 'PRODUCER', value: 'Producer' end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/sfw_filter_preference.rb
Ruby
apache-2.0
187
the-future
274
class Types::Enum::SfwFilterPreference < Types::Enum::Base value 'SFW', 'Hide All Adult Content', value: 'sfw' value 'NSFW_SOMETIMES', 'Limit to Following Feed', value: 'nsfw_sometimes' value 'NSFW_EVERYWHERE', 'Adult Content Everywhere', value: 'nsfw_everywhere' end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/release_season.rb
Ruby
apache-2.0
187
the-future
331
class Types::Enum::ReleaseSeason < Types::Enum::Base value 'WINTER', 'Released during the Winter season', value: :winter value 'SPRING', 'Released during the Spring season', value: :spring value 'SUMMER', 'Released during the Summer season', value: :summer value 'FALL', 'Released during the Fall season', value:...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/base.rb
Ruby
apache-2.0
187
the-future
217
# frozen_string_literal: true class Types::Enum::Base < GraphQL::Schema::Enum include ApolloFederation::Enum enum_value_class Types::Enum::BaseValue def self.default_graphql_name "#{super}Enum" end end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/media_relationship_kind.rb
Ruby
apache-2.0
187
the-future
673
# frozen_string_literal: true class Types::Enum::MediaRelationshipKind < Types::Enum::Base description 'The relationship kind from one media entry to another' value 'SEQUEL', value: 'sequel' value 'PREQUEL', value: 'prequel' value 'ALTERNATIVE_SETTING', value: 'alternative_setting' value 'ALTERNATIVE_VERSIO...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/character_role.rb
Ruby
apache-2.0
187
the-future
523
class Types::Enum::CharacterRole < Types::Enum::Base value 'MAIN', 'A character who appears throughout a series and is a focal point of the media', value: 'main' value 'RECURRING', 'A character who appears in multiple episodes but is not a main character', value: 'recurring' value 'BACKGROUND', 'A backgro...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/site_permission.rb
Ruby
apache-2.0
187
the-future
297
class Types::Enum::SitePermission < Types::Enum::Base value 'ADMIN', 'Administrator/staff member of Kitsu', value: :admin value 'COMMUNITY_MOD', 'Moderator of community behavior', value: :community_mod value 'DATABASE_MOD', 'Maintainer of the Kitsu media database', value: :database_mod end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/mapping_external_site.rb
Ruby
apache-2.0
187
the-future
913
class Types::Enum::MappingExternalSite < Types::Enum::Base value 'MYANIMELIST_ANIME', value: 'myanimelist/anime' value 'MYANIMELIST_MANGA', value: 'myanimelist/manga' value 'MYANIMELIST_CHARACTERS', value: 'myanimelist/character' value 'MYANIMELIST_PEOPLE', value: 'myanimelist/people' value 'MYANIMELIST_PRODU...
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/title_language_preference.rb
Ruby
apache-2.0
187
the-future
316
class Types::Enum::TitleLanguagePreference < Types::Enum::Base value 'CANONICAL', 'Prefer the most commonly-used title for media', value: 'canonical' value 'ROMANIZED', 'Prefer the romanized title for media', value: 'romanized' value 'LOCALIZED', 'Prefer the localized title for media', value: 'localized' end
github
hummingbird-me/kitsu-server
https://github.com/hummingbird-me/kitsu-server
app/graphql/types/enum/age_rating.rb
Ruby
apache-2.0
187
the-future
341
class Types::Enum::AgeRating < Types::Enum::Base value 'G', 'Acceptable for all ages' value 'PG', 'Parental guidance suggested; should be safe for preteens and older' value 'R', 'Possible lewd or intense themes; should be safe for teens and older' value 'R18', 'Contains adult content or themes; should only be v...