Remove RBS for now
This is too much and we need to find the right solution
This commit is contained in:
parent
b1e81dde44
commit
b9b515820a
16 changed files with 0 additions and 624 deletions
|
|
@ -1,111 +0,0 @@
|
|||
module Api
|
||||
module V1
|
||||
class PartiesController < Api::V1::ApiController
|
||||
@parties: ActiveRecord::Relation[Party]
|
||||
|
||||
MAX_CHARACTERS: Integer
|
||||
MAX_SUMMONS: Integer
|
||||
MAX_WEAPONS: Integer
|
||||
DEFAULT_MIN_CHARACTERS: Integer
|
||||
DEFAULT_MIN_SUMMONS: Integer
|
||||
DEFAULT_MIN_WEAPONS: Integer
|
||||
DEFAULT_MAX_CLEAR_TIME: Integer
|
||||
|
||||
def create: () -> void
|
||||
|
||||
def show: () -> void
|
||||
|
||||
def update: () -> void
|
||||
|
||||
def destroy: () -> void
|
||||
|
||||
def remix: () -> void
|
||||
|
||||
def index: () -> void
|
||||
|
||||
def favorites: () -> void
|
||||
|
||||
def preview: () -> void
|
||||
|
||||
def preview_status: () -> void
|
||||
|
||||
def regenerate_preview: () -> void
|
||||
|
||||
private
|
||||
|
||||
def authorize: () -> void
|
||||
|
||||
def grid_table_and_object_table: (String) -> [String?, String?]
|
||||
|
||||
def not_owner: () -> bool
|
||||
|
||||
def schedule_preview_generation: () -> void
|
||||
|
||||
def apply_filters: (ActiveRecord::Relation[Party]) -> ActiveRecord::Relation[Party]
|
||||
|
||||
def apply_privacy_settings: (ActiveRecord::Relation[Party]) -> ActiveRecord::Relation[Party]
|
||||
|
||||
def apply_includes: (ActiveRecord::Relation[Party], String) -> ActiveRecord::Relation[Party]
|
||||
|
||||
def apply_excludes: (ActiveRecord::Relation[Party], String) -> ActiveRecord::Relation[Party]
|
||||
|
||||
def build_filters: () -> Hash[Symbol, untyped]
|
||||
|
||||
def build_date_range: () -> Range[DateTime]?
|
||||
|
||||
def build_start_time: (String?) -> DateTime?
|
||||
|
||||
def build_count: (String?, Integer) -> Integer
|
||||
|
||||
def build_max_clear_time: (String?) -> Integer
|
||||
|
||||
def build_element: (String?) -> Integer?
|
||||
|
||||
def build_option: (String?) -> Integer?
|
||||
|
||||
def build_query: (Hash[Symbol, untyped], bool) -> ActiveRecord::Relation[Party]
|
||||
|
||||
def fetch_parties: (ActiveRecord::Relation[Party]) -> ActiveRecord::Relation[Party]
|
||||
|
||||
def calculate_count: (ActiveRecord::Relation[Party]) -> Integer
|
||||
|
||||
def calculate_total_pages: (Integer) -> Integer
|
||||
|
||||
def paginate_parties: (
|
||||
ActiveRecord::Relation[Party],
|
||||
?page: Integer?,
|
||||
?per_page: Integer
|
||||
) -> ActiveRecord::Relation[Party]
|
||||
|
||||
def excluded_characters: () -> ActiveRecord::Relation[GridCharacter]?
|
||||
|
||||
def excluded_summons: () -> ActiveRecord::Relation[GridSummon]?
|
||||
|
||||
def excluded_weapons: () -> ActiveRecord::Relation[GridWeapon]?
|
||||
|
||||
def render_party_json: (ActiveRecord::Relation[Party]) -> void
|
||||
|
||||
def privacy: (?favorites: bool) -> String?
|
||||
|
||||
def user_quality: () -> String?
|
||||
|
||||
def name_quality: () -> String?
|
||||
|
||||
def original: () -> String?
|
||||
|
||||
def includes: (String) -> String
|
||||
|
||||
def excludes: (String) -> String
|
||||
|
||||
def id_to_table: (String) -> String
|
||||
|
||||
def remixed_name: (String) -> String
|
||||
|
||||
def set_from_slug: () -> void
|
||||
|
||||
def set: () -> void
|
||||
|
||||
def party_params: () -> Hash[Symbol, untyped]?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
class AwsService
|
||||
class ConfigurationError < StandardError
|
||||
end
|
||||
|
||||
attr_reader bucket: String
|
||||
attr_reader s3_client: Aws::S3::Client
|
||||
|
||||
def initialize: () -> void
|
||||
|
||||
def upload_stream: (IO io, String key) -> Aws::S3::Types::PutObjectOutput
|
||||
|
||||
def file_exists?: (String key) -> bool
|
||||
|
||||
private
|
||||
|
||||
def credentials: () -> Hash[Symbol, String]
|
||||
|
||||
def validate_credentials!: () -> void
|
||||
end
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
module Granblue
|
||||
module Downloaders
|
||||
class BaseDownloader
|
||||
SIZES: Array[String]
|
||||
|
||||
# Define allowed storage types
|
||||
type storage = :local | :s3 | :both
|
||||
|
||||
@id: String
|
||||
@base_url: String
|
||||
@test_mode: bool
|
||||
@verbose: bool
|
||||
@storage: storage
|
||||
@aws_service: AwsService
|
||||
|
||||
def initialize: (String id, ?test_mode: bool, ?verbose: bool, ?storage: storage) -> void
|
||||
|
||||
def download: -> void
|
||||
|
||||
private
|
||||
|
||||
def process_download: (String url, String size, String path, ?last: bool) -> void
|
||||
|
||||
def download_to_local: (String url, String download_uri) -> void
|
||||
|
||||
def stream_to_s3: (String url, String s3_key) -> void
|
||||
|
||||
def download_to_both: (String url, String download_uri, String s3_key) -> void
|
||||
|
||||
def should_download?: (String local_path, String s3_key) -> bool
|
||||
|
||||
def ensure_directories_exist: -> void
|
||||
|
||||
def store_locally?: -> bool
|
||||
|
||||
def download_path: (String size) -> String
|
||||
|
||||
def build_s3_key: (String size, String filename) -> String
|
||||
|
||||
def log_info: (String message) -> void
|
||||
|
||||
def download_elemental_image: (String url, String size, String path, String filename) -> void
|
||||
|
||||
def object_type: -> String
|
||||
|
||||
def base_url: -> String
|
||||
|
||||
def directory_for_size: (String size) -> String
|
||||
|
||||
def build_url: (String size) -> String
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
module Granblue
|
||||
module Downloaders
|
||||
class CharacterDownloader < BaseDownloader
|
||||
private
|
||||
|
||||
def download_variants: (Character character) -> void
|
||||
|
||||
def download_variant: (String variant_id) -> void
|
||||
|
||||
def build_variant_url: (String variant_id, String size) -> String
|
||||
|
||||
def object_type: -> String
|
||||
|
||||
def base_url: -> String
|
||||
|
||||
def directory_for_size: (String size) -> String
|
||||
|
||||
private
|
||||
|
||||
@id: String
|
||||
@base_url: String
|
||||
@test_mode: bool
|
||||
@verbose: bool
|
||||
@storage: Symbol
|
||||
@aws_service: AwsService
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
module Granblue
|
||||
module Downloaders
|
||||
class DownloadManager
|
||||
def self.download_for_object: (
|
||||
String type,
|
||||
String granblue_id,
|
||||
?test_mode: bool,
|
||||
?verbose: bool,
|
||||
?storage: Symbol
|
||||
) -> void
|
||||
|
||||
private
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
module Granblue
|
||||
module Downloaders
|
||||
class SummonDownloader < BaseDownloader
|
||||
def download: -> void
|
||||
|
||||
private
|
||||
|
||||
def download_variants: (Summon summon) -> void
|
||||
|
||||
def download_variant: (String variant_id) -> void
|
||||
|
||||
def build_variant_url: (String variant_id, String size) -> String
|
||||
|
||||
def object_type: -> String
|
||||
|
||||
def base_url: -> String
|
||||
|
||||
def directory_for_size: (String size) -> String
|
||||
|
||||
private
|
||||
|
||||
@id: String
|
||||
@base_url: String
|
||||
@test_mode: bool
|
||||
@verbose: bool
|
||||
@storage: Symbol
|
||||
@aws_service: AwsService
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
module Granblue
|
||||
module Downloaders
|
||||
class WeaponDownloader < BaseDownloader
|
||||
def download: -> void
|
||||
|
||||
private
|
||||
|
||||
def download_variants: (Weapon weapon) -> void
|
||||
|
||||
def download_variant: (String variant_id) -> void
|
||||
|
||||
def build_variant_url: (String variant_id, String size) -> String
|
||||
|
||||
def object_type: -> String
|
||||
|
||||
def base_url: -> String
|
||||
|
||||
def directory_for_size: (String size) -> String
|
||||
|
||||
def build_url_for_id: (String id, String size) -> String
|
||||
|
||||
# Track progress of elemental weapon downloads
|
||||
def progress_reporter: (count: Integer, total: Integer, result: String, ?bar_len: Integer) -> void
|
||||
|
||||
private
|
||||
|
||||
@id: String
|
||||
@base_url: String
|
||||
@test_mode: bool
|
||||
@verbose: bool
|
||||
@storage: Symbol
|
||||
@aws_service: AwsService
|
||||
end
|
||||
|
||||
# Special downloader for handling elemental weapon variants
|
||||
class ElementalWeaponDownloader < WeaponDownloader
|
||||
SUFFIXES: Array[Integer]
|
||||
|
||||
def initialize: (Integer id_base) -> void
|
||||
|
||||
def download: -> void
|
||||
|
||||
private
|
||||
|
||||
@id_base: Integer
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
module Granblue
|
||||
module Importers
|
||||
class BaseImporter
|
||||
attr_reader new_records: Hash[String, Array[Hash[Symbol, untyped]]]
|
||||
attr_reader updated_records: Hash[String, Array[Hash[Symbol, untyped]]]
|
||||
|
||||
def initialize: (
|
||||
String file_path,
|
||||
?test_mode: bool,
|
||||
?verbose: bool,
|
||||
?logger: untyped
|
||||
) -> void
|
||||
|
||||
def import: -> Hash[Symbol, Hash[String, Array[Hash[Symbol, untyped]]]]
|
||||
|
||||
def simulate_import: -> Hash[Symbol, Hash[String, Array[Hash[Symbol, untyped]]]]
|
||||
|
||||
private
|
||||
|
||||
def import_row: (CSV::Row row) -> void
|
||||
|
||||
def find_or_create_record: (Hash[Symbol, untyped] attributes) -> [untyped, bool]?
|
||||
|
||||
def simulate_create: (
|
||||
Hash[Symbol, untyped] attributes,
|
||||
Hash[String, Array[Hash[Symbol, untyped]]] simulated_new,
|
||||
String type
|
||||
) -> void
|
||||
|
||||
def simulate_update: (
|
||||
untyped existing_record,
|
||||
Hash[Symbol, untyped] attributes,
|
||||
Hash[String, Array[Hash[Symbol, untyped]]] simulated_updated,
|
||||
String type
|
||||
) -> void
|
||||
|
||||
def validate_required_attributes: (Hash[Symbol, untyped] attributes) -> void
|
||||
|
||||
def validate_update_attributes: (Hash[Symbol, untyped] update_attributes) -> void
|
||||
|
||||
def validate_record: (untyped record) -> void
|
||||
|
||||
def track_record: ([untyped, bool] result) -> void
|
||||
|
||||
def format_attributes: (Hash[Symbol, untyped] attributes) -> String
|
||||
|
||||
def log_test_update: (untyped record, Hash[Symbol, untyped] attributes) -> void
|
||||
|
||||
def log_test_creation: (Hash[Symbol, untyped] attributes) -> void
|
||||
|
||||
def log_new_record: (untyped record) -> void
|
||||
|
||||
def log_updated_record: (untyped record) -> void
|
||||
|
||||
def parse_value: (String? value) -> String?
|
||||
|
||||
def parse_integer: (String? value) -> Integer?
|
||||
|
||||
def parse_float: (String? value) -> Float?
|
||||
|
||||
def parse_boolean: (String? value) -> bool?
|
||||
|
||||
def parse_date: (String? date_str) -> Date?
|
||||
|
||||
def parse_array: (String? array_str) -> Array[String]
|
||||
|
||||
def parse_integer_array: (String? array_str) -> Array[Integer]
|
||||
|
||||
def model_class: -> singleton(ActiveRecord::Base)
|
||||
|
||||
def build_attributes: (CSV::Row row) -> Hash[Symbol, untyped]
|
||||
|
||||
def handle_error: (StandardError error) -> void
|
||||
|
||||
def format_validation_error: (ActiveRecord::RecordInvalid error) -> String
|
||||
|
||||
def format_standard_error: (StandardError error) -> String
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Granblue
|
||||
module Importers
|
||||
class ImportError
|
||||
attr_reader file_name: String
|
||||
attr_reader details: String
|
||||
|
||||
def initialize: (file_name: String, details: String) -> void
|
||||
|
||||
private
|
||||
|
||||
def build_message: () -> String
|
||||
end
|
||||
|
||||
def format_attributes: (
|
||||
attributes: Hash[Symbol, String | Integer | Float | Boolean | Array[untyped] | nil]
|
||||
) -> String
|
||||
end
|
||||
end
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
module Granblue
|
||||
module Transformers
|
||||
class TransformerError < StandardError
|
||||
attr_reader details: untyped
|
||||
|
||||
def initialize: (String message, ?untyped details) -> void
|
||||
end
|
||||
|
||||
class BaseTransformer
|
||||
ELEMENT_MAPPING: Hash[Integer, Integer?]
|
||||
|
||||
@data: untyped
|
||||
@options: Hash[Symbol, untyped]
|
||||
@language: String
|
||||
|
||||
attr_reader data: untyped
|
||||
attr_reader options: Hash[Symbol, untyped]
|
||||
attr_reader language: String
|
||||
|
||||
def initialize: (untyped data, ?Hash[Symbol, untyped] options) -> void
|
||||
|
||||
def transform: -> untyped
|
||||
|
||||
def validate_data: -> bool
|
||||
|
||||
def get_master_param: (Hash[String, untyped] obj) -> [Hash[String, untyped]?, Hash[String, untyped]?]
|
||||
|
||||
def log_debug: (String message) -> void
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
module Granblue
|
||||
module Transformers
|
||||
class SummonTransformer < BaseTransformer
|
||||
TRANSCENDENCE_LEVELS: Array[Integer]
|
||||
|
||||
@quick_summon_id: String?
|
||||
|
||||
def initialize: (untyped data, ?String? quick_summon_id, ?Hash[Symbol, untyped] options) -> void
|
||||
|
||||
def transform: -> Array[Hash[Symbol, untyped]]
|
||||
|
||||
private
|
||||
|
||||
def calculate_transcendence_level: (Integer? level) -> Integer
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
module Granblue
|
||||
module Transformers
|
||||
class WeaponTransformer < BaseTransformer
|
||||
# Constants for level calculations
|
||||
UNCAP_LEVELS: Array[Integer]
|
||||
TRANSCENDENCE_LEVELS: Array[Integer]
|
||||
MULTIELEMENT_SERIES: Array[Integer]
|
||||
|
||||
# Implements abstract method from BaseTransformer
|
||||
def transform: -> Array[Hash[Symbol, untyped]]
|
||||
|
||||
private
|
||||
|
||||
def transform_base_attributes: (Hash[String, untyped] master, Hash[String, untyped] param) -> Hash[Symbol, untyped]
|
||||
|
||||
def transform_awakening: (Hash[String, untyped] param) -> Hash[Symbol, Hash[Symbol, untyped]]
|
||||
|
||||
def transform_ax_skills: (Hash[String, untyped] param) -> Hash[Symbol, Array[Hash[Symbol, untyped]]]
|
||||
|
||||
def transform_weapon_keys: (Hash[String, untyped] weapon_data) -> Hash[Symbol, Array[String]]
|
||||
|
||||
def calculate_uncap_level: (Integer? level) -> Integer
|
||||
|
||||
def calculate_transcendence_level: (Integer? level) -> Integer
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
module PreviewService
|
||||
class Canvas
|
||||
PREVIEW_WIDTH: Integer
|
||||
PREVIEW_HEIGHT: Integer
|
||||
DEFAULT_BACKGROUND_COLOR: String
|
||||
|
||||
def create_blank_canvas: (
|
||||
?width: Integer,
|
||||
?height: Integer,
|
||||
?color: String
|
||||
) -> Tempfile
|
||||
|
||||
def add_text: (
|
||||
MiniMagick::Image image,
|
||||
String text,
|
||||
?x: Integer,
|
||||
?y: Integer,
|
||||
?size: String,
|
||||
?color: String,
|
||||
?font: String
|
||||
) -> MiniMagick::Image
|
||||
end
|
||||
end
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
# sig/services/preview_service/coordinator.rbs
|
||||
|
||||
module PreviewService
|
||||
class Coordinator
|
||||
PREVIEW_FOLDER: String
|
||||
PREVIEW_WIDTH: Integer
|
||||
PREVIEW_HEIGHT: Integer
|
||||
PREVIEW_EXPIRY: ActiveSupport::Duration
|
||||
GENERATION_TIMEOUT: ActiveSupport::Duration
|
||||
LOCAL_STORAGE_PATH: Pathname
|
||||
|
||||
@party: Party
|
||||
@image_fetcher: ImageFetcherService
|
||||
@grid_service: Grid
|
||||
@canvas_service: Canvas
|
||||
@aws_service: AwsService
|
||||
|
||||
def initialize: (party: Party) -> void
|
||||
|
||||
def get_s3_object: () -> Aws::S3::Types::GetObjectOutput
|
||||
|
||||
def preview_url: () -> String
|
||||
|
||||
def generate_preview: () -> bool
|
||||
|
||||
def force_regenerate: () -> bool
|
||||
|
||||
def delete_preview: () -> void
|
||||
|
||||
def should_generate?: () -> bool
|
||||
|
||||
def generation_in_progress?: () -> bool
|
||||
|
||||
def create_preview_image: () -> MiniMagick::Image
|
||||
|
||||
private
|
||||
|
||||
def setup_storage: () -> void
|
||||
|
||||
def add_job_icon: (image: MiniMagick::Image, job_icon: MiniMagick::Image) -> MiniMagick::Image
|
||||
|
||||
def organize_and_draw_weapons: (image: MiniMagick::Image, grid_layout: Hash[Symbol, untyped]) -> MiniMagick::Image
|
||||
|
||||
def draw_mainhand_weapon: (image: MiniMagick::Image, weapon_image: MiniMagick::Image) -> MiniMagick::Image
|
||||
|
||||
def save_preview: (image: MiniMagick::Image) -> void
|
||||
|
||||
def upload_to_s3: (image: MiniMagick::Image) -> void
|
||||
|
||||
def save_to_local_storage: (image: MiniMagick::Image) -> void
|
||||
|
||||
def preview_filename: () -> String
|
||||
|
||||
def local_preview_path: () -> Pathname
|
||||
|
||||
def local_preview_url: () -> String
|
||||
|
||||
def preview_key: () -> String
|
||||
|
||||
def preview_exists?: () -> bool
|
||||
|
||||
def generate_s3_url: () -> String
|
||||
|
||||
def set_generation_in_progress: () -> void
|
||||
|
||||
def clear_generation_in_progress: () -> void
|
||||
|
||||
def schedule_generation: () -> void
|
||||
|
||||
def default_preview_url: () -> String
|
||||
|
||||
def delete_s3_preview: () -> void
|
||||
|
||||
def delete_local_previews: () -> void
|
||||
|
||||
def handle_preview_generation_error: (error: Exception) -> void
|
||||
end
|
||||
end
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
module PreviewService
|
||||
class Grid
|
||||
GRID_MARGIN: Integer
|
||||
GRID_CELL_SIZE: Integer
|
||||
GRID_START_X: Integer
|
||||
GRID_START_Y: Integer
|
||||
|
||||
def grid_position: (String type, Integer idx) -> { x: Integer, y: Integer }
|
||||
|
||||
def draw_grid_item: (
|
||||
MiniMagick::Image image,
|
||||
MiniMagick::Image item_image,
|
||||
String type,
|
||||
Integer idx,
|
||||
?resize_to: Integer
|
||||
) -> MiniMagick::Image
|
||||
end
|
||||
end
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
module PreviewService
|
||||
class ImageFetcherService
|
||||
@aws_service: AwsService
|
||||
@tempfiles: Array[Tempfile]
|
||||
|
||||
def initialize: (AwsService aws_service) -> void
|
||||
|
||||
def fetch_s3_image: (String key, ?String folder) -> MiniMagick::Image?
|
||||
|
||||
def fetch_job_icon: (String job_name) -> MiniMagick::Image?
|
||||
|
||||
def fetch_weapon_image: (Weapon weapon, ?mainhand: bool) -> MiniMagick::Image?
|
||||
|
||||
def cleanup: -> void
|
||||
|
||||
private
|
||||
|
||||
def create_temp_file: -> Tempfile
|
||||
|
||||
def download_from_s3: (String key, Tempfile temp_file) -> void
|
||||
|
||||
def create_mini_magick_image: (Tempfile temp_file) -> MiniMagick::Image
|
||||
|
||||
def handle_fetch_error: (Exception error, String key) -> nil
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue