From 8ec7ea27944bab44074b5b345140161bbfc57286 Mon Sep 17 00:00:00 2001 From: Avram Walden Date: Wed, 2 Oct 2024 09:28:56 -0700 Subject: [PATCH] fix: updating controllers to use class methods --- app/controllers/api/api_controller.rb | 9 ++++++- app/controllers/api/commands_controller.rb | 4 ++- app/controllers/api/controls_controller.rb | 2 ++ app/controllers/api/protocols_controller.rb | 6 ++++- app/controllers/api/servers_controller.rb | 2 ++ app/controllers/api/smtps_controller.rb | 5 ++-- app/controllers/api/users_controller.rb | 10 +++---- app/controllers/commands_controller.rb | 16 +++++------ app/controllers/concerns/searchable.rb | 4 +++ app/controllers/controls_controller.rb | 14 +++------- app/controllers/protocols_controller.rb | 21 +++++---------- app/controllers/screens_controller.rb | 20 +++++--------- app/controllers/servers_controller.rb | 14 +++------- .../settings/appearance_controller.rb | 8 ++---- app/controllers/settings/smtps_controller.rb | 8 ++---- app/controllers/users_controller.rb | 13 +++------ app/frontend/types/serializers/Command.d.ts | 20 -------------- .../types/serializers/CommandValue.d.ts | 14 ---------- .../serializers/CommandValues/Options.d.ts | 14 ---------- .../types/serializers/Commands/Edit.d.ts | 22 --------------- .../types/serializers/Commands/FormData.d.ts | 20 -------------- .../types/serializers/Commands/Index.d.ts | 22 --------------- .../types/serializers/Commands/Options.d.ts | 19 ------------- .../types/serializers/Commands/Protocol.d.ts | 24 ----------------- .../types/serializers/Commands/Show.d.ts | 26 ------------------ app/frontend/types/serializers/Control.d.ts | 25 ----------------- .../types/serializers/Controls/Edit.d.ts | 27 ------------------- .../types/serializers/Controls/FormData.d.ts | 25 ----------------- .../types/serializers/Controls/Index.d.ts | 27 ------------------- .../types/serializers/Controls/Options.d.ts | 22 --------------- .../types/serializers/Controls/Show.d.ts | 27 ------------------- app/frontend/types/serializers/Protocol.d.ts | 15 ----------- .../types/serializers/Protocols/Commands.d.ts | 25 ----------------- .../types/serializers/Protocols/Edit.d.ts | 18 ------------- .../types/serializers/Protocols/FormData.d.ts | 18 ------------- .../types/serializers/Protocols/Index.d.ts | 18 ------------- .../types/serializers/Protocols/Options.d.ts | 15 ----------- .../types/serializers/Protocols/Show.d.ts | 16 ----------- .../types/serializers/ProtocolsCommand.d.ts | 19 ------------- .../serializers/ProtocolsCommands/Edit.d.ts | 21 --------------- .../ProtocolsCommands/FormData.d.ts | 20 -------------- .../serializers/ProtocolsCommands/Index.d.ts | 21 --------------- .../serializers/ProtocolsCommands/Show.d.ts | 21 --------------- app/frontend/types/serializers/Role.d.ts | 18 ------------- app/frontend/types/serializers/Screen.d.ts | 15 ----------- .../types/serializers/Screens/Edit.d.ts | 18 ------------- .../types/serializers/Screens/FormData.d.ts | 15 ----------- .../types/serializers/Screens/Index.d.ts | 17 ------------ .../types/serializers/Screens/Options.d.ts | 15 ----------- .../types/serializers/Screens/Show.d.ts | 18 ------------- app/frontend/types/serializers/Server.d.ts | 17 ------------ .../types/serializers/Servers/Edit.d.ts | 19 ------------- .../types/serializers/Servers/FormData.d.ts | 17 ------------ .../types/serializers/Servers/Index.d.ts | 19 ------------- .../types/serializers/Servers/Options.d.ts | 14 ---------- .../types/serializers/Servers/Reference.d.ts | 19 ------------- .../types/serializers/Servers/Show.d.ts | 19 ------------- app/frontend/types/serializers/User.d.ts | 14 ---------- .../types/serializers/Users/Edit.d.ts | 17 ------------ .../types/serializers/Users/FormData.d.ts | 14 ---------- .../types/serializers/Users/Index.d.ts | 19 ------------- .../types/serializers/Users/Share.d.ts | 21 --------------- .../types/serializers/Users/Show.d.ts | 19 ------------- app/policies/command_policy.rb | 2 +- app/policies/control_policy.rb | 2 +- app/policies/protocol_policy.rb | 2 +- app/policies/screen_policy.rb | 2 +- app/policies/server_policy.rb | 2 +- app/policies/user_policy.rb | 2 +- .../scaffold_controller/api_controller.rb.tt | 4 +-- .../scaffold_controller/controller.rb.tt | 2 +- 71 files changed, 72 insertions(+), 1007 deletions(-) delete mode 100644 app/frontend/types/serializers/Command.d.ts delete mode 100644 app/frontend/types/serializers/CommandValue.d.ts delete mode 100644 app/frontend/types/serializers/CommandValues/Options.d.ts delete mode 100644 app/frontend/types/serializers/Commands/Edit.d.ts delete mode 100644 app/frontend/types/serializers/Commands/FormData.d.ts delete mode 100644 app/frontend/types/serializers/Commands/Index.d.ts delete mode 100644 app/frontend/types/serializers/Commands/Options.d.ts delete mode 100644 app/frontend/types/serializers/Commands/Protocol.d.ts delete mode 100644 app/frontend/types/serializers/Commands/Show.d.ts delete mode 100644 app/frontend/types/serializers/Control.d.ts delete mode 100644 app/frontend/types/serializers/Controls/Edit.d.ts delete mode 100644 app/frontend/types/serializers/Controls/FormData.d.ts delete mode 100644 app/frontend/types/serializers/Controls/Index.d.ts delete mode 100644 app/frontend/types/serializers/Controls/Options.d.ts delete mode 100644 app/frontend/types/serializers/Controls/Show.d.ts delete mode 100644 app/frontend/types/serializers/Protocol.d.ts delete mode 100644 app/frontend/types/serializers/Protocols/Commands.d.ts delete mode 100644 app/frontend/types/serializers/Protocols/Edit.d.ts delete mode 100644 app/frontend/types/serializers/Protocols/FormData.d.ts delete mode 100644 app/frontend/types/serializers/Protocols/Index.d.ts delete mode 100644 app/frontend/types/serializers/Protocols/Options.d.ts delete mode 100644 app/frontend/types/serializers/Protocols/Show.d.ts delete mode 100644 app/frontend/types/serializers/ProtocolsCommand.d.ts delete mode 100644 app/frontend/types/serializers/ProtocolsCommands/Edit.d.ts delete mode 100644 app/frontend/types/serializers/ProtocolsCommands/FormData.d.ts delete mode 100644 app/frontend/types/serializers/ProtocolsCommands/Index.d.ts delete mode 100644 app/frontend/types/serializers/ProtocolsCommands/Show.d.ts delete mode 100644 app/frontend/types/serializers/Role.d.ts delete mode 100644 app/frontend/types/serializers/Screen.d.ts delete mode 100644 app/frontend/types/serializers/Screens/Edit.d.ts delete mode 100644 app/frontend/types/serializers/Screens/FormData.d.ts delete mode 100644 app/frontend/types/serializers/Screens/Index.d.ts delete mode 100644 app/frontend/types/serializers/Screens/Options.d.ts delete mode 100644 app/frontend/types/serializers/Screens/Show.d.ts delete mode 100644 app/frontend/types/serializers/Server.d.ts delete mode 100644 app/frontend/types/serializers/Servers/Edit.d.ts delete mode 100644 app/frontend/types/serializers/Servers/FormData.d.ts delete mode 100644 app/frontend/types/serializers/Servers/Index.d.ts delete mode 100644 app/frontend/types/serializers/Servers/Options.d.ts delete mode 100644 app/frontend/types/serializers/Servers/Reference.d.ts delete mode 100644 app/frontend/types/serializers/Servers/Show.d.ts delete mode 100644 app/frontend/types/serializers/User.d.ts delete mode 100644 app/frontend/types/serializers/Users/Edit.d.ts delete mode 100644 app/frontend/types/serializers/Users/FormData.d.ts delete mode 100644 app/frontend/types/serializers/Users/Index.d.ts delete mode 100644 app/frontend/types/serializers/Users/Share.d.ts delete mode 100644 app/frontend/types/serializers/Users/Show.d.ts diff --git a/app/controllers/api/api_controller.rb b/app/controllers/api/api_controller.rb index b2d6400..414f9f4 100644 --- a/app/controllers/api/api_controller.rb +++ b/app/controllers/api/api_controller.rb @@ -1,5 +1,12 @@ module Api - class ApiController < ApplicationController + class ApiController < ActionController::Base + include Authentication + include Authorization + include Localization + include PublicActivity::StoreController + include Searchable + include StrongParams + skip_before_action :verify_authenticity_token end end diff --git a/app/controllers/api/commands_controller.rb b/app/controllers/api/commands_controller.rb index 1691e8c..436717f 100644 --- a/app/controllers/api/commands_controller.rb +++ b/app/controllers/api/commands_controller.rb @@ -1,8 +1,10 @@ class Api::CommandsController < ApplicationController + skip_before_action :authenticate_user!, only: [:execute] + expose :commands, -> { Command.all } expose :command, id: -> { params[:slug] }, scope: -> { Command.includes_associated }, find_by: :slug - skip_before_action :authenticate_user!, only: [:execute] + strong_params :command, permit: [:title, :address, :payload_type, :allow_custom_value, :description, :server_id, command_values_attributes: [:id, :label, :value, :_destroy]] # @route GET /api/commands (api_commands) def index diff --git a/app/controllers/api/controls_controller.rb b/app/controllers/api/controls_controller.rb index e7148d2..bc4c6b8 100644 --- a/app/controllers/api/controls_controller.rb +++ b/app/controllers/api/controls_controller.rb @@ -2,6 +2,8 @@ class Api::ControlsController < ApplicationController expose :control expose :controls, -> { Control.all } + strong_params :control, permit: [:title, :control_type, :order, :color, :screen_id, :min_value, :max_value, :value, :protocol_id] + # @route GET /api/options/controls (api_controls_options) def options authorize controls diff --git a/app/controllers/api/protocols_controller.rb b/app/controllers/api/protocols_controller.rb index 89239e3..f83c77e 100644 --- a/app/controllers/api/protocols_controller.rb +++ b/app/controllers/api/protocols_controller.rb @@ -1,8 +1,12 @@ class Api::ProtocolsController < ApplicationController + skip_before_action :authenticate_user!, only: [:execute] + expose :protocols, -> { Protocol.includes_associated.all } expose :protocol, id: -> { params[:slug] }, find_by: :slug - skip_before_action :authenticate_user!, only: [:execute] + strong_params :protocol, permit: [:title, :description, protocols_commands_attributes: [ + :id, :protocol_id, :command_id, :command_value_id, :value, :delay, :order + ]] # @route GET /api/protocols/:slug (api_protocol) def show diff --git a/app/controllers/api/servers_controller.rb b/app/controllers/api/servers_controller.rb index b006030..efadade 100644 --- a/app/controllers/api/servers_controller.rb +++ b/app/controllers/api/servers_controller.rb @@ -2,6 +2,8 @@ class Api::ServersController < ApplicationController expose :server expose :servers, -> { Server.all } + strong_params :server, permit: [:title, :hostname, :port, :description] + # @route GET /api/servers (api_servers) def index render json: servers.render(view: :options), staus: :ok diff --git a/app/controllers/api/smtps_controller.rb b/app/controllers/api/smtps_controller.rb index 5968894..48a44a5 100644 --- a/app/controllers/api/smtps_controller.rb +++ b/app/controllers/api/smtps_controller.rb @@ -1,6 +1,8 @@ require 'net/smtp' class Api::SmtpsController < Api::ApiController + strong_params :smtp, permit: [:name, :host, :domain, :port, :security, :username, :password, :address, :notes] + # @route POST /api/smtp/test (api_smtp_test) def test render json: test_smtp_auth(Smtp.new(smtp_params)), status: :ok @@ -21,7 +23,4 @@ def test_smtp_auth(smtp) { success: false, message: "An error occurred: #{e.message}" } end - def smtp_params - params.require(:smtp).permit(:name, :host, :domain, :port, :security, :username, :password, :address, :notes) - end end diff --git a/app/controllers/api/users_controller.rb b/app/controllers/api/users_controller.rb index 30cde8c..4156db0 100644 --- a/app/controllers/api/users_controller.rb +++ b/app/controllers/api/users_controller.rb @@ -1,6 +1,8 @@ class Api::UsersController < Api::ApiController expose :user + strong_params :user, permit: [:email, :password, :active, :first_name, :last_name, :number, :table_preferences, :user_preferences] + # @route PATCH /api/users/:id (api_user) # @route PUT /api/users/:id (api_user) def update @@ -16,7 +18,7 @@ def update def update_table_preferences authorize user if user.update( - table_preferences: current_user.table_preferences.deep_merge(request.params[:user][:table_preferences]), + table_preferences: current_user.table_preferences.deep_merge(user_params[:table_preferences]), ) head :ok, content_type: "text/html" end @@ -32,10 +34,4 @@ def update_user_preferences end end - private - - def user_params - params.require(:user).permit(:email, :password, :active_company_id, :active, person: [:first_name, :last_name], company: [:name], user_preferences: [:colorScheme]) - end - end diff --git a/app/controllers/commands_controller.rb b/app/controllers/commands_controller.rb index c093dc7..1dbfb89 100644 --- a/app/controllers/commands_controller.rb +++ b/app/controllers/commands_controller.rb @@ -2,10 +2,15 @@ class CommandsController < ApplicationController expose :commands, -> { search(Command.includes_associated, sortable_fields) } expose :command, id: -> { params[:slug] }, scope: -> { Command.includes_associated }, find_by: :slug + sortable_fields %w(title address payload_type) + + strong_params :command, permit: [:title, :address, :payload_type, :allow_custom_value, :description, :server_id, command_values_attributes: [:id, :label, :value, :_destroy]] + # @route GET /commands (commands) def index authorize commands - paginated_commands = commands.page(params[:page] || 1) + + paginated_commands = paginate(commands, :commands) render inertia: "Commands/Index", props: { commands: paginated_commands.render, @@ -68,13 +73,4 @@ def destroy redirect_to commands_url, notice: "Command was successfully destroyed." end - private - - def sortable_fields - %w(title address payload_type).freeze - end - - def command_params - params.require(:command).permit(:title, :address, :payload_type, :allow_custom_value, :description, :server_id, command_values_attributes: [:id, :label, :value, :_destroy]) - end end diff --git a/app/controllers/concerns/searchable.rb b/app/controllers/concerns/searchable.rb index d374b9c..3b64f5a 100644 --- a/app/controllers/concerns/searchable.rb +++ b/app/controllers/concerns/searchable.rb @@ -20,7 +20,11 @@ def search(model, sortable_fields = []) sort(search_by_params(model), model, sortable_fields) end + ## # Apply defaults to the paginate method + # resource: ActiveRecord object to call `page` on + # key: Per user defined key stored in User model for persisted pagination limits + ## def paginate(resource, key) resource.page(params[:page] || 1).per(key ? current_user.limit(key) : nil) end diff --git a/app/controllers/controls_controller.rb b/app/controllers/controls_controller.rb index f6dae9f..f4b8e49 100644 --- a/app/controllers/controls_controller.rb +++ b/app/controllers/controls_controller.rb @@ -2,6 +2,10 @@ class ControlsController < ApplicationController expose :controls, -> { search(Control.includes_associated, sortable_fields) } expose :control, find: ->(id, scope) { scope.includes_associated.find(id) } + sortable_fields %w(title type screen_id min_value max_value value protocol_id) + + strong_params :control, permit: [:title, :control_type, :order, :color, :screen_id, :min_value, :max_value, :value, :protocol_id] + # @route POST /controls (controls) def create authorize Control.new @@ -31,14 +35,4 @@ def destroy control.destroy! redirect_to controls_url, notice: "Control was successfully destroyed." end - - private - - def sortable_fields - %w(title type screen_id min_value max_value value protocol_id).freeze - end - - def control_params - params.require(:control).permit(:title, :control_type, :order, :color, :screen_id, :min_value, :max_value, :value, :protocol_id) - end end diff --git a/app/controllers/protocols_controller.rb b/app/controllers/protocols_controller.rb index 93e7b15..f553e1d 100644 --- a/app/controllers/protocols_controller.rb +++ b/app/controllers/protocols_controller.rb @@ -2,6 +2,12 @@ class ProtocolsController < ApplicationController expose :protocols, -> { search(Protocol, sortable_fields) } expose :protocol, id: -> { params[:slug] }, scope: -> { Protocol.includes_associated }, find_by: :slug + sortable_fields %w(title) + + strong_params :protocol, permit: [:title, :description, protocols_commands_attributes: [ + :id, :protocol_id, :command_id, :command_value_id, :value, :delay, :order + ]] + # @route GET /protocols (protocols) def index authorize protocols @@ -72,19 +78,4 @@ def destroy redirect_to protocols_url, notice: "Protocol was successfully destroyed." end - private - - def sortable_fields - %w(title).freeze - end - - def protocol_params - params.require(:protocol).permit( - :title, - :description, - protocols_commands_attributes: [ - :id, :protocol_id, :command_id, :command_value_id, :value, :delay, :order - ], - ) - end end diff --git a/app/controllers/screens_controller.rb b/app/controllers/screens_controller.rb index 706dc67..199069e 100644 --- a/app/controllers/screens_controller.rb +++ b/app/controllers/screens_controller.rb @@ -1,9 +1,15 @@ class ScreensController < ApplicationController + skip_before_action :authenticate_user!, only: [:index, :show] + expose :screens, -> { Screen.includes_associated } expose :screen, id: -> { params[:slug] }, scope: -> { Screen.includes_associated }, find_by: :slug expose :main_screen, -> { Screen.order(:order).first } - skip_before_action :authenticate_user!, only: [:index, :show] + sortable_fields %w(title order) + + strong_params :screen, permit: [:title, :order, controls_attributes: [ + :id, :title, :order + ]] # @route GET / (root) # @route GET /screens (screens) @@ -70,16 +76,4 @@ def destroy screen.destroy! redirect_to edit_screens_path, notice: "Screen was successfully destroyed." end - - private - - def sortable_fields - %w(title order).freeze - end - - def screen_params - params.require(:screen).permit(:title, :order, controls_attributes: [ - :id, :title, :order - ],) - end end diff --git a/app/controllers/servers_controller.rb b/app/controllers/servers_controller.rb index 5e22b1d..cd41e10 100644 --- a/app/controllers/servers_controller.rb +++ b/app/controllers/servers_controller.rb @@ -2,6 +2,10 @@ class ServersController < ApplicationController expose :servers, -> { search(Server.includes_associated, sortable_fields) } expose :server, id: -> { params[:slug] }, scope: -> { Server.includes_associated }, find_by: :slug + sortable_fields %w(title hostname port description) + + strong_params :server, permit: [:title, :hostname, :port, :description] + # @route GET /servers (servers) def index authorize servers @@ -64,14 +68,4 @@ def destroy server.destroy! redirect_to servers_url, notice: "Server was successfully destroyed." end - - private - - def sortable_fields - %w(title hostname port description).freeze - end - - def server_params - params.require(:server).permit(:title, :hostname, :port, :description) - end end diff --git a/app/controllers/settings/appearance_controller.rb b/app/controllers/settings/appearance_controller.rb index 4d9717c..abe5f1b 100644 --- a/app/controllers/settings/appearance_controller.rb +++ b/app/controllers/settings/appearance_controller.rb @@ -1,5 +1,7 @@ module Admin class Settings::AppearanceController < ApplicationController + strong_params :settings, permit: [:primary_color] + # @route GET /settings/appearance (settings_appearance) def index render inertia: "Settings/Appearance/Index", props: { @@ -17,11 +19,5 @@ def update # redirect_to settings_appearance_index_path, inertia: { errors: @active_company.errors } # end end - - private - - def settings_params - params.require(:settings).permit(:primary_color) - end end end diff --git a/app/controllers/settings/smtps_controller.rb b/app/controllers/settings/smtps_controller.rb index 0916d1f..87a21ea 100644 --- a/app/controllers/settings/smtps_controller.rb +++ b/app/controllers/settings/smtps_controller.rb @@ -3,6 +3,8 @@ class Settings::SmtpsController < ApplicationController expose :smtps, -> { @active_company.smtps } expose :smtp + strong_params :smtp, permit: [:name, :host, :domain, :port, :security, :username, :password, :address, :notes] + # GET /settings/mail def index render inertia: "Settings/Mail/Index", props: { @@ -54,11 +56,5 @@ def update def destroy end - private - - def smtp_params - params.require(:smtp).permit(:name, :host, :domain, :port, :security, :username, :password, :address, :notes) - end - end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index fdd4b90..33e3c46 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2,6 +2,10 @@ class UsersController < ApplicationController expose :users, -> { search(User.all.includes_associated, sortable_fields) } expose :user, id: -> { params[:slug] }, scope: -> { Circle.includes_associated }, find_by: :slug + sortable_fields %w(email active first_name last_name number) + + strong_params :user, permit: [:email, :password, :active, :first_name, :last_name, :number] + # @route GET /users (users) def index authorize users @@ -77,13 +81,4 @@ def destroy end end - private - - def sortable_fields - %w(email active first_name last_name number).freeze - end - - def user_params - params.require(:user).permit(:email, :password, :active, :first_name, :last_name, :number) - end end diff --git a/app/frontend/types/serializers/Command.d.ts b/app/frontend/types/serializers/Command.d.ts deleted file mode 100644 index d655740..0000000 --- a/app/frontend/types/serializers/Command.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// TypesFromSerializers CacheKey 3dcb034764d4532e633f2e19b6f20f2d -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from './CommandValue' - -declare global { - namespace Schema { - interface Command { - id?: number - slug?: string - address?: string - allow_custom_value: boolean - command_values: CommandValue[] - description?: string - payload_type?: number - server_id: number - title: string - } - } -} diff --git a/app/frontend/types/serializers/CommandValue.d.ts b/app/frontend/types/serializers/CommandValue.d.ts deleted file mode 100644 index 6322f40..0000000 --- a/app/frontend/types/serializers/CommandValue.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// TypesFromSerializers CacheKey 0b7184925c4ab890a57d51528e320abe -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface CommandValue { - id?: number - label?: string - value: string - } - } -} diff --git a/app/frontend/types/serializers/CommandValues/Options.d.ts b/app/frontend/types/serializers/CommandValues/Options.d.ts deleted file mode 100644 index cddf63b..0000000 --- a/app/frontend/types/serializers/CommandValues/Options.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// TypesFromSerializers CacheKey a810479b2bafabececc736a6c7864af0 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface CommandValuesOptions { - id: number - label?: string - value: string - } - } -} diff --git a/app/frontend/types/serializers/Commands/Edit.d.ts b/app/frontend/types/serializers/Commands/Edit.d.ts deleted file mode 100644 index d25ad60..0000000 --- a/app/frontend/types/serializers/Commands/Edit.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -// TypesFromSerializers CacheKey 964305504a6d0c6640d028b00e843419 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from '../CommandValue' - -declare global { - namespace Schema { - interface CommandsEdit { - id: number - address?: string - allow_custom_value: boolean - command_values: CommandValue[] - created_at: string | Date - description?: string - payload_type?: number - server_id: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Commands/FormData.d.ts b/app/frontend/types/serializers/Commands/FormData.d.ts deleted file mode 100644 index a39bccd..0000000 --- a/app/frontend/types/serializers/Commands/FormData.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// TypesFromSerializers CacheKey 76b0d235bc793b507e89d60ba25f4596 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from '../CommandValue' - -declare global { - namespace Schema { - interface CommandsFormData { - id?: number - slug?: string - address?: string - allow_custom_value: boolean - command_values: CommandValue[] - description?: string - payload_type?: number - server_id: number - title: string - } - } -} diff --git a/app/frontend/types/serializers/Commands/Index.d.ts b/app/frontend/types/serializers/Commands/Index.d.ts deleted file mode 100644 index 6ecaedb..0000000 --- a/app/frontend/types/serializers/Commands/Index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -// TypesFromSerializers CacheKey edbfeedd4c762e9cdcdc18b3f28c1dac -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from '../CommandValue' - -declare global { - namespace Schema { - interface CommandsIndex { - id: number - address?: string - allow_custom_value: boolean - command_values: CommandValue[] - created_at: string | Date - description?: string - payload_type?: number - server_id: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Commands/Options.d.ts b/app/frontend/types/serializers/Commands/Options.d.ts deleted file mode 100644 index 1c1fd99..0000000 --- a/app/frontend/types/serializers/Commands/Options.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// TypesFromSerializers CacheKey b152bb165613d3ca4dec4f03a2c3dfe8 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface CommandsOptions { - id: number - address?: string - allow_custom_value: boolean - description?: string - payload_type?: number - server_id: number - slug: string - title: string - } - } -} diff --git a/app/frontend/types/serializers/Commands/Protocol.d.ts b/app/frontend/types/serializers/Commands/Protocol.d.ts deleted file mode 100644 index 46a8fee..0000000 --- a/app/frontend/types/serializers/Commands/Protocol.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -// TypesFromSerializers CacheKey 984172fd23b3b324e30e26556a794ae5 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from '../CommandValue' -import type ServersReference from '../Servers/Reference' - -declare global { - namespace Schema { - interface CommandsProtocol { - id: number - address?: string - allow_custom_value: boolean - command_values: CommandValue[] - created_at: string | Date - description?: string - payload_type?: number - server: ServersReference - server_id: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Commands/Show.d.ts b/app/frontend/types/serializers/Commands/Show.d.ts deleted file mode 100644 index ed10d65..0000000 --- a/app/frontend/types/serializers/Commands/Show.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// TypesFromSerializers CacheKey 5d92b6e8e95b9d137243f8e46c1d3c32 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from '../CommandValue' -import type ProtocolsOptions from '../Protocols/Options' -import type ServersReference from '../Servers/Reference' - -declare global { - namespace Schema { - interface CommandsShow { - id: number - address?: string - allow_custom_value: boolean - command_values: CommandValue[] - created_at: string | Date - description?: string - payload_type?: number - protocols: ProtocolsOptions[] - server: ServersReference - server_id: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Control.d.ts b/app/frontend/types/serializers/Control.d.ts deleted file mode 100644 index 3b31397..0000000 --- a/app/frontend/types/serializers/Control.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// TypesFromSerializers CacheKey cf1da5ebe45ddaa053070962da988ee9 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type Command from './Command' -import type Protocol from './Protocol' - -declare global { - namespace Schema { - interface Control { - id?: number - color?: string - command: Command - command_id?: number - control_type: string - max_value?: number - min_value?: number - order: number - protocol: Protocol - protocol_id?: number - screen_id: number - title: string - value?: number - } - } -} diff --git a/app/frontend/types/serializers/Controls/Edit.d.ts b/app/frontend/types/serializers/Controls/Edit.d.ts deleted file mode 100644 index 175e86e..0000000 --- a/app/frontend/types/serializers/Controls/Edit.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -// TypesFromSerializers CacheKey 3c0e8191e2fdca39c2ae682788d866ea -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type Command from '../Command' -import type ProtocolsEdit from '../Protocols/Edit' - -declare global { - namespace Schema { - interface ControlsEdit { - id: number - color?: string - command: Command - command_id?: number - control_type: string - created_at: string | Date - max_value?: number - min_value?: number - order: number - protocol: ProtocolsEdit - protocol_id?: number - screen_id: number - title: string - updated_at: string | Date - value?: number - } - } -} diff --git a/app/frontend/types/serializers/Controls/FormData.d.ts b/app/frontend/types/serializers/Controls/FormData.d.ts deleted file mode 100644 index 53c1ac1..0000000 --- a/app/frontend/types/serializers/Controls/FormData.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// TypesFromSerializers CacheKey 1a6493a68726871d47b91a6149c3783f -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandsFormData from '../Commands/FormData' -import type ProtocolsFormData from '../Protocols/FormData' - -declare global { - namespace Schema { - interface ControlsFormData { - id?: number - color?: string - command?: CommandsFormData - command_id?: number - control_type: string - max_value?: number - min_value?: number - order: number - protocol?: ProtocolsFormData - protocol_id?: number - screen_id: number - title: string - value?: number - } - } -} diff --git a/app/frontend/types/serializers/Controls/Index.d.ts b/app/frontend/types/serializers/Controls/Index.d.ts deleted file mode 100644 index f34b1f1..0000000 --- a/app/frontend/types/serializers/Controls/Index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -// TypesFromSerializers CacheKey 7f2c91ef05cd284b49726efbaad7d48a -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type Command from '../Command' -import type Protocol from '../Protocol' - -declare global { - namespace Schema { - interface ControlsIndex { - id: number - color?: string - command: Command - command_id?: number - control_type: string - created_at: string | Date - max_value?: number - min_value?: number - order: number - protocol: Protocol - protocol_id?: number - screen_id: number - title: string - updated_at: string | Date - value?: number - } - } -} diff --git a/app/frontend/types/serializers/Controls/Options.d.ts b/app/frontend/types/serializers/Controls/Options.d.ts deleted file mode 100644 index dae0214..0000000 --- a/app/frontend/types/serializers/Controls/Options.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -// TypesFromSerializers CacheKey ac40fd3d0326778555f4f2b5dc521ed3 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ControlsOptions { - id: number - color?: string - command_id?: number - control_type: string - max_value?: number - min_value?: number - order: number - protocol_id?: number - screen_id: number - title: string - value?: number - } - } -} diff --git a/app/frontend/types/serializers/Controls/Show.d.ts b/app/frontend/types/serializers/Controls/Show.d.ts deleted file mode 100644 index fa29c53..0000000 --- a/app/frontend/types/serializers/Controls/Show.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -// TypesFromSerializers CacheKey 4de7eaf6c6907eb3f9bef18741e4d438 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandsShow from '../Commands/Show' -import type ProtocolsShow from '../Protocols/Show' - -declare global { - namespace Schema { - interface ControlsShow { - id: number - color?: string - command: CommandsShow - command_id?: number - control_type: string - created_at: string | Date - max_value?: number - min_value?: number - order: number - protocol: ProtocolsShow - protocol_id?: number - screen_id: number - title: string - updated_at: string | Date - value?: number - } - } -} diff --git a/app/frontend/types/serializers/Protocol.d.ts b/app/frontend/types/serializers/Protocol.d.ts deleted file mode 100644 index 4ac5bcf..0000000 --- a/app/frontend/types/serializers/Protocol.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// TypesFromSerializers CacheKey 9082178d44774d43add5d89e03a3a994 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface Protocol { - id?: number - slug?: string - description?: string - title: string - } - } -} diff --git a/app/frontend/types/serializers/Protocols/Commands.d.ts b/app/frontend/types/serializers/Protocols/Commands.d.ts deleted file mode 100644 index 1bf65fc..0000000 --- a/app/frontend/types/serializers/Protocols/Commands.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// TypesFromSerializers CacheKey 30ea254e6dd4f98dbe837107c6153244 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from '../CommandValue' -import type ServersReference from '../Servers/Reference' - -declare global { - namespace Schema { - interface ProtocolsCommands { - id: number - address?: string - allow_custom_value: boolean - command_value_id: number - command_values: CommandValue[] - description?: string - order: unknown - payload_type?: number - server: ServersReference - server_id: number - slug: string - title: string - value: string - } - } -} diff --git a/app/frontend/types/serializers/Protocols/Edit.d.ts b/app/frontend/types/serializers/Protocols/Edit.d.ts deleted file mode 100644 index 0b7d3ae..0000000 --- a/app/frontend/types/serializers/Protocols/Edit.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// TypesFromSerializers CacheKey 0bd8d5845e33f82ef98f3902ba585932 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandsFormData from '../Commands/FormData' -import type ProtocolsCommandsFormData from '../ProtocolsCommands/FormData' - -declare global { - namespace Schema { - interface ProtocolsEdit { - id: number - commands: CommandsFormData[] - description?: string - protocols_commands: ProtocolsCommandsFormData[] - slug: string - title: string - } - } -} diff --git a/app/frontend/types/serializers/Protocols/FormData.d.ts b/app/frontend/types/serializers/Protocols/FormData.d.ts deleted file mode 100644 index 4cf628e..0000000 --- a/app/frontend/types/serializers/Protocols/FormData.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// TypesFromSerializers CacheKey fd881ef458a837091ae319e47c7268f4 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandsFormData from '../Commands/FormData' -import type ProtocolsCommandsFormData from '../ProtocolsCommands/FormData' - -declare global { - namespace Schema { - interface ProtocolsFormData { - id?: number - slug?: string - commands: CommandsFormData[] - description?: string - protocols_commands: ProtocolsCommandsFormData[] - title: string - } - } -} diff --git a/app/frontend/types/serializers/Protocols/Index.d.ts b/app/frontend/types/serializers/Protocols/Index.d.ts deleted file mode 100644 index 1474868..0000000 --- a/app/frontend/types/serializers/Protocols/Index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// TypesFromSerializers CacheKey 226dd0c53a183690d3ddf3dad35b557d -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandsProtocol from '../Commands/Protocol' - -declare global { - namespace Schema { - interface ProtocolsIndex { - id: number - commands: CommandsProtocol[] - created_at: string | Date - description?: string - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Protocols/Options.d.ts b/app/frontend/types/serializers/Protocols/Options.d.ts deleted file mode 100644 index a996351..0000000 --- a/app/frontend/types/serializers/Protocols/Options.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// TypesFromSerializers CacheKey 10d6f1938d464a3f03c195a29766a289 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ProtocolsOptions { - id: number - description?: string - slug: string - title: string - } - } -} diff --git a/app/frontend/types/serializers/Protocols/Show.d.ts b/app/frontend/types/serializers/Protocols/Show.d.ts deleted file mode 100644 index bb6f19b..0000000 --- a/app/frontend/types/serializers/Protocols/Show.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// TypesFromSerializers CacheKey 51d92a1c0febda98424763bb16972478 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type ProtocolsCommands from './Commands' - -declare global { - namespace Schema { - interface ProtocolsShow { - id: number - commands: ProtocolsCommands[] - description?: string - slug: string - title: string - } - } -} diff --git a/app/frontend/types/serializers/ProtocolsCommand.d.ts b/app/frontend/types/serializers/ProtocolsCommand.d.ts deleted file mode 100644 index 98e2cba..0000000 --- a/app/frontend/types/serializers/ProtocolsCommand.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// TypesFromSerializers CacheKey 6ef2ce1bfe31bdf1de600971fe94191e -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from './CommandValue' - -declare global { - namespace Schema { - interface ProtocolsCommand { - id?: number - command_id: number - command_value: CommandValue - command_value_id?: number - delay?: number - order: number - protocol_id: number - value?: string - } - } -} diff --git a/app/frontend/types/serializers/ProtocolsCommands/Edit.d.ts b/app/frontend/types/serializers/ProtocolsCommands/Edit.d.ts deleted file mode 100644 index 704d0e5..0000000 --- a/app/frontend/types/serializers/ProtocolsCommands/Edit.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// TypesFromSerializers CacheKey 1f1cd7ff0859d9b091bf2e29585701e6 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from '../CommandValue' - -declare global { - namespace Schema { - interface ProtocolsCommandsEdit { - id: number - command_id: number - command_value: CommandValue - command_value_id?: number - created_at: string | Date - delay?: number - order: number - protocol_id: number - updated_at: string | Date - value?: string - } - } -} diff --git a/app/frontend/types/serializers/ProtocolsCommands/FormData.d.ts b/app/frontend/types/serializers/ProtocolsCommands/FormData.d.ts deleted file mode 100644 index 86fae5a..0000000 --- a/app/frontend/types/serializers/ProtocolsCommands/FormData.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// TypesFromSerializers CacheKey 5b0e4b31070fef4df4f7f9e255b5a2e8 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from '../CommandValue' - -declare global { - namespace Schema { - interface ProtocolsCommandsFormData { - id?: number - command_id: number - command_value: CommandValue - command_value_id?: number - delay?: number - key: unknown - order: number - protocol_id: number - value?: string - } - } -} diff --git a/app/frontend/types/serializers/ProtocolsCommands/Index.d.ts b/app/frontend/types/serializers/ProtocolsCommands/Index.d.ts deleted file mode 100644 index 79f2561..0000000 --- a/app/frontend/types/serializers/ProtocolsCommands/Index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// TypesFromSerializers CacheKey 4cb3aeeb87f65bf9b59517b30ae16365 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from '../CommandValue' - -declare global { - namespace Schema { - interface ProtocolsCommandsIndex { - id: number - command_id: number - command_value: CommandValue - command_value_id?: number - created_at: string | Date - delay?: number - order: number - protocol_id: number - updated_at: string | Date - value?: string - } - } -} diff --git a/app/frontend/types/serializers/ProtocolsCommands/Show.d.ts b/app/frontend/types/serializers/ProtocolsCommands/Show.d.ts deleted file mode 100644 index 89ad2da..0000000 --- a/app/frontend/types/serializers/ProtocolsCommands/Show.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// TypesFromSerializers CacheKey 667843e03b6448df9d74c8d728d57c0f -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type CommandValue from '../CommandValue' - -declare global { - namespace Schema { - interface ProtocolsCommandsShow { - id: number - command_id: number - command_value: CommandValue - command_value_id?: number - created_at: string | Date - delay?: number - order: number - protocol_id: number - updated_at: string | Date - value?: string - } - } -} diff --git a/app/frontend/types/serializers/Role.d.ts b/app/frontend/types/serializers/Role.d.ts deleted file mode 100644 index 4728048..0000000 --- a/app/frontend/types/serializers/Role.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// TypesFromSerializers CacheKey 635505325774f17218367514ca046a12 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type User from './User' - -declare global { - namespace Schema { - interface Role { - id?: number - created_at: string | Date - name?: string - resource_id?: number - resource_type?: string - updated_at: string | Date - users: User[] - } - } -} diff --git a/app/frontend/types/serializers/Screen.d.ts b/app/frontend/types/serializers/Screen.d.ts deleted file mode 100644 index ffa69c1..0000000 --- a/app/frontend/types/serializers/Screen.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// TypesFromSerializers CacheKey d0bd91c8898d25950b0278c2298a0a57 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface Screen { - id?: number - slug?: string - order: number - title: string - } - } -} diff --git a/app/frontend/types/serializers/Screens/Edit.d.ts b/app/frontend/types/serializers/Screens/Edit.d.ts deleted file mode 100644 index 62cd27f..0000000 --- a/app/frontend/types/serializers/Screens/Edit.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// TypesFromSerializers CacheKey 019376dd495ab7941ed4a2901fbcd780 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type ControlsEdit from '../Controls/Edit' - -declare global { - namespace Schema { - interface ScreensEdit { - id: number - controls: ControlsEdit[] - created_at: string | Date - order: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Screens/FormData.d.ts b/app/frontend/types/serializers/Screens/FormData.d.ts deleted file mode 100644 index d93120a..0000000 --- a/app/frontend/types/serializers/Screens/FormData.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// TypesFromSerializers CacheKey de355dee18b22d5aec9e0d7b835f373e -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ScreensFormData { - id?: number - slug?: string - order: number - title: string - } - } -} diff --git a/app/frontend/types/serializers/Screens/Index.d.ts b/app/frontend/types/serializers/Screens/Index.d.ts deleted file mode 100644 index c9ed970..0000000 --- a/app/frontend/types/serializers/Screens/Index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// TypesFromSerializers CacheKey b2a4396d0b8234e92a0007321119f276 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ScreensIndex { - id: number - created_at: string | Date - order: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Screens/Options.d.ts b/app/frontend/types/serializers/Screens/Options.d.ts deleted file mode 100644 index 56dac88..0000000 --- a/app/frontend/types/serializers/Screens/Options.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// TypesFromSerializers CacheKey 7200c9fc6bd5c1bc62422383980ebb6c -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ScreensOptions { - id?: number - order: number - slug: string - title: string - } - } -} diff --git a/app/frontend/types/serializers/Screens/Show.d.ts b/app/frontend/types/serializers/Screens/Show.d.ts deleted file mode 100644 index f3502ba..0000000 --- a/app/frontend/types/serializers/Screens/Show.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// TypesFromSerializers CacheKey 969da6b34a7d5fd14e9680af2812e5aa -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type ControlsShow from '../Controls/Show' - -declare global { - namespace Schema { - interface ScreensShow { - id: number - controls: ControlsShow[] - created_at: string | Date - order: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Server.d.ts b/app/frontend/types/serializers/Server.d.ts deleted file mode 100644 index 7e8829a..0000000 --- a/app/frontend/types/serializers/Server.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// TypesFromSerializers CacheKey 1d0ebd771dfaa1616c2b8cc2815f3579 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface Server { - id?: number - slug?: string - description?: string - hostname?: string - port?: number - title: string - } - } -} diff --git a/app/frontend/types/serializers/Servers/Edit.d.ts b/app/frontend/types/serializers/Servers/Edit.d.ts deleted file mode 100644 index 98e3564..0000000 --- a/app/frontend/types/serializers/Servers/Edit.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// TypesFromSerializers CacheKey f339f7c6ee20beabffa34c27dd8b94d5 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ServersEdit { - id: number - created_at: string | Date - description?: string - hostname?: string - port?: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Servers/FormData.d.ts b/app/frontend/types/serializers/Servers/FormData.d.ts deleted file mode 100644 index 7c9c49a..0000000 --- a/app/frontend/types/serializers/Servers/FormData.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// TypesFromSerializers CacheKey 84d128d8fe827615484a2b15377c8951 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ServersFormData { - id?: number - slug?: string - description?: string - hostname?: string - port?: number - title: string - } - } -} diff --git a/app/frontend/types/serializers/Servers/Index.d.ts b/app/frontend/types/serializers/Servers/Index.d.ts deleted file mode 100644 index 848e806..0000000 --- a/app/frontend/types/serializers/Servers/Index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// TypesFromSerializers CacheKey 716bc833e9c693f93d1559387bf54345 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ServersIndex { - id: number - created_at: string | Date - description?: string - hostname?: string - port?: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Servers/Options.d.ts b/app/frontend/types/serializers/Servers/Options.d.ts deleted file mode 100644 index 19c03db..0000000 --- a/app/frontend/types/serializers/Servers/Options.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// TypesFromSerializers CacheKey 0d57d612e5af2c5c1cd9770f8851f247 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ServersOptions { - id: number - slug: string - title: string - } - } -} diff --git a/app/frontend/types/serializers/Servers/Reference.d.ts b/app/frontend/types/serializers/Servers/Reference.d.ts deleted file mode 100644 index 62c5e15..0000000 --- a/app/frontend/types/serializers/Servers/Reference.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// TypesFromSerializers CacheKey 94c79fec6d06b1a04c3b467c3f749357 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ServersReference { - id: number - created_at: string | Date - description?: string - hostname?: string - port?: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Servers/Show.d.ts b/app/frontend/types/serializers/Servers/Show.d.ts deleted file mode 100644 index d0a73a6..0000000 --- a/app/frontend/types/serializers/Servers/Show.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// TypesFromSerializers CacheKey 1265f32fcf64780e057802ccf4bb49ae -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface ServersShow { - id: number - created_at: string | Date - description?: string - hostname?: string - port?: number - slug: string - title: string - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/User.d.ts b/app/frontend/types/serializers/User.d.ts deleted file mode 100644 index f50f978..0000000 --- a/app/frontend/types/serializers/User.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// TypesFromSerializers CacheKey ebc9b839bbfdcd288e7397ed0c5645b1 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface User { - id?: number - active: boolean - email: string - } - } -} diff --git a/app/frontend/types/serializers/Users/Edit.d.ts b/app/frontend/types/serializers/Users/Edit.d.ts deleted file mode 100644 index 0635a09..0000000 --- a/app/frontend/types/serializers/Users/Edit.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// TypesFromSerializers CacheKey d824050cc029c9a7ac8cee20d61b7a05 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type Role from '../Role' - -declare global { - namespace Schema { - interface UsersEdit { - id: number - active: boolean - created_at: string | Date - email: string - roles: Role[] - updated_at: string | Date - } - } -} diff --git a/app/frontend/types/serializers/Users/FormData.d.ts b/app/frontend/types/serializers/Users/FormData.d.ts deleted file mode 100644 index bac6606..0000000 --- a/app/frontend/types/serializers/Users/FormData.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// TypesFromSerializers CacheKey 562af8bcf3f33ae367e572a3b9b2674c -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -export {} - -declare global { - namespace Schema { - interface UsersFormData { - id?: number - active: boolean - email: string - } - } -} diff --git a/app/frontend/types/serializers/Users/Index.d.ts b/app/frontend/types/serializers/Users/Index.d.ts deleted file mode 100644 index 198f1f7..0000000 --- a/app/frontend/types/serializers/Users/Index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// TypesFromSerializers CacheKey 1c9066f3858be681676c2ca283b48f0d -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type IUserPreferences from '../../IUserPreferences' -import type Role from '../Role' - -declare global { - namespace Schema { - interface UsersIndex { - id: number - active: boolean - created_at: string | Date - email: string - roles: Role[] - updated_at: string | Date - user_preferences: IUserPreferences - } - } -} diff --git a/app/frontend/types/serializers/Users/Share.d.ts b/app/frontend/types/serializers/Users/Share.d.ts deleted file mode 100644 index 77ddee0..0000000 --- a/app/frontend/types/serializers/Users/Share.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// TypesFromSerializers CacheKey b0991620a5e40270101b1633daa15471 -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type ITablePreferences from '../../ITablePreferences' -import type IUserPreferences from '../../IUserPreferences' -import type Role from '../Role' - -declare global { - namespace Schema { - interface UsersShare { - id: number - active: boolean - created_at: string | Date - email: string - roles: Role[] - table_preferences: ITablePreferences - updated_at: string | Date - user_preferences: IUserPreferences - } - } -} diff --git a/app/frontend/types/serializers/Users/Show.d.ts b/app/frontend/types/serializers/Users/Show.d.ts deleted file mode 100644 index 2fe0c2c..0000000 --- a/app/frontend/types/serializers/Users/Show.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// TypesFromSerializers CacheKey d3e826a4728e0f4016952ab574def02c -// -// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers. -import type IUserPreferences from '../../IUserPreferences' -import type Role from '../Role' - -declare global { - namespace Schema { - interface UsersShow { - id: number - active: boolean - created_at: string | Date - email: string - roles: Role[] - updated_at: string | Date - user_preferences: IUserPreferences - } - } -} diff --git a/app/policies/command_policy.rb b/app/policies/command_policy.rb index 5fbbd3f..6489bb1 100644 --- a/app/policies/command_policy.rb +++ b/app/policies/command_policy.rb @@ -1,5 +1,5 @@ class CommandPolicy < ApplicationPolicy - class Scope < Scope + class Scope < ApplicationPolicy::Scope end def execute? diff --git a/app/policies/control_policy.rb b/app/policies/control_policy.rb index 97c63e8..6d69f6b 100644 --- a/app/policies/control_policy.rb +++ b/app/policies/control_policy.rb @@ -1,4 +1,4 @@ class ControlPolicy < ApplicationPolicy - class Scope < Scope + class Scope < ApplicationPolicy::Scope end end diff --git a/app/policies/protocol_policy.rb b/app/policies/protocol_policy.rb index 72d44de..fcc38c1 100644 --- a/app/policies/protocol_policy.rb +++ b/app/policies/protocol_policy.rb @@ -1,5 +1,5 @@ class ProtocolPolicy < ApplicationPolicy - class Scope < Scope + class Scope < ApplicationPolicy::Scope end def options? diff --git a/app/policies/screen_policy.rb b/app/policies/screen_policy.rb index 689795e..27a8c49 100644 --- a/app/policies/screen_policy.rb +++ b/app/policies/screen_policy.rb @@ -1,4 +1,4 @@ class ScreenPolicy < ApplicationPolicy - class Scope < Scope + class Scope < ApplicationPolicy::Scope end end diff --git a/app/policies/server_policy.rb b/app/policies/server_policy.rb index bb5ea9b..f4cd317 100644 --- a/app/policies/server_policy.rb +++ b/app/policies/server_policy.rb @@ -1,4 +1,4 @@ class ServerPolicy < ApplicationPolicy - class Scope < Scope + class Scope < ApplicationPolicy::Scope end end diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb index da52975..176c008 100644 --- a/app/policies/user_policy.rb +++ b/app/policies/user_policy.rb @@ -1,5 +1,5 @@ class UserPolicy < ApplicationPolicy - class Scope < Scope + class Scope < ApplicationPolicy::Scope end def update_table_preferences? diff --git a/lib/templates/rails/scaffold_controller/api_controller.rb.tt b/lib/templates/rails/scaffold_controller/api_controller.rb.tt index fb6afba..7888326 100644 --- a/lib/templates/rails/scaffold_controller/api_controller.rb.tt +++ b/lib/templates/rails/scaffold_controller/api_controller.rb.tt @@ -3,7 +3,7 @@ class Api::<%= controller_class_name %>Controller < ApiController expose :<%= plural_table_name %> expose :<%= singular_table_name %> - strong_params :<%= singular_table_name %>, <%= permitted_params %> + strong_params :<%= singular_table_name %>, permit: <%= permitted_params %> def index render json: <%= plural_table_name %>.render(view: :index) @@ -33,7 +33,5 @@ class Api::<%= controller_class_name %>Controller < ApiController render json: <%= orm_instance.destroy %> end - private - end <% end -%> \ No newline at end of file diff --git a/lib/templates/rails/scaffold_controller/controller.rb.tt b/lib/templates/rails/scaffold_controller/controller.rb.tt index 668f0bc..b083601 100644 --- a/lib/templates/rails/scaffold_controller/controller.rb.tt +++ b/lib/templates/rails/scaffold_controller/controller.rb.tt @@ -9,7 +9,7 @@ class <%= controller_class_name %>Controller < ApplicationController expose :<%= singular_table_name %>, find: ->(id, scope){ scope.includes_associated.find(id) } <% end -%> - strong_params :<%= singular_table_name %>, <%= permitted_params %> + strong_params :<%= singular_table_name %>, permit: <%= permitted_params %> def index authorize <%= plural_table_name %>