diff --git a/app/api/repp/api.rb b/app/api/repp/api.rb index 9e6e1426f..f80c0dc5b 100644 --- a/app/api/repp/api.rb +++ b/app/api/repp/api.rb @@ -12,5 +12,6 @@ module Repp end mount Repp::DomainV1 + mount Repp::ContactV1 end end diff --git a/app/api/repp/contact_v1.rb b/app/api/repp/contact_v1.rb new file mode 100644 index 000000000..26c06796a --- /dev/null +++ b/app/api/repp/contact_v1.rb @@ -0,0 +1,16 @@ +module Repp + class ContactV1 < Grape::API + version 'v1', using: :path + + resource :contacts do + desc 'Return list of contact' + get '/' do + contacts = current_user.registrar.contacts.page(params[:page]) + { + contacts: contacts, + total_pages: contacts.total_pages + } + end + end + end +end diff --git a/config/application.rb b/config/application.rb index 8a04a0355..8de7bca3d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -30,8 +30,9 @@ module Registry config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb') config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')] - # Active Record used to suppresses errors raised within `after_rollback`/`after_commit` callbacks - # and only printed them to the logs. In the next version, these errors will no longer be suppressed. + # Active Record used to suppresses errors raised within + # `after_rollback`/`after_commit` callbacks and only printed them to the logs. + # In the next version, these errors will no longer be suppressed. # Instead, the errors will propagate normally just like in other Active Record callbacks. config.active_record.raise_in_transactional_callbacks = true diff --git a/config/initializers/reload_api.rb b/config/initializers/reload_api.rb new file mode 100644 index 000000000..17e8bddc6 --- /dev/null +++ b/config/initializers/reload_api.rb @@ -0,0 +1,11 @@ +if Rails.env.development? + ActiveSupport::Dependencies.explicitly_unloadable_constants << 'Repp::API' + + api_files = Dir[Rails.root.join('app', 'api', '**', '*.rb')] + api_reloader = ActiveSupport::FileUpdateChecker.new(api_files) do + Rails.application.reload_routes! + end + ActionDispatch::Callbacks.to_prepare do + api_reloader.execute_if_updated + end +end diff --git a/config/schedule.rb b/config/schedule.rb index 68d484da2..3af205c71 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -5,7 +5,7 @@ # rbenv support rbenv = 'export PATH="$HOME/.rbenv/bin:$PATH";eval "$(rbenv init -)";' -path = Whenever.path.sub(%r(\/releases\/.*), '/current') +path = Whenever.path.sub(%r{\/releases\/.*}, '/current') set :job_template, "/bin/bash -l -c '#{rbenv} :job'" job_type :runner, "cd #{path} && bin/rails r -e :environment \":task\" :output" diff --git a/doc/epp/README.md b/doc/epp/README.md new file mode 100644 index 000000000..a862868b2 --- /dev/null +++ b/doc/epp/README.md @@ -0,0 +1,8 @@ +EPP integration specification for Estonian Internet Foundation +=== + +Introduction +--- + +Domains +--- diff --git a/doc/epp_request_examples.xml b/doc/epp_request_examples.xml deleted file mode 100644 index f84917611..000000000 --- a/doc/epp_request_examples.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - example.ee - 1 - - ns1.example.net - ns2.example.net - - jd1234 - sh8013 - sh8013 - sh801333 - - 2fooBAR - - - - ABC-12345 - - - - - - - - - - example.ee - 1 - - - ns1.example.net - 192.0.2.2 - 1080:0:0:0:8:800:200C:417A - - - ns2.example.net - - - jd1234 - sh8013 - sh8013 - sh801333 - - 2fooBAR - - - - ABC-12345 - - - - - - - - - - example.ee - - 2fooBAR - - - - ABC-12345 - - - - - - - - - - example.ee - 2014-08-07 - 1 - - - ABC-12345 - - - - - - - - - - example.ee - - - ABC-12345 - - - - - - - - - - example.ee - - - ABC-12345 - - - - - - - - - - sh8013 - - Sillius Soddus - Example Inc. - - 123 Example Dr. - Suite 100 - - Megaton - F3 - 201-33 - EE - - - +372.1234567 - 123123 - example@test.example - 37605030299 - - Aas34fq - - - - ABC-12345 - - - - - - - - - - check-1234 - check-4321 - - - ABC-12345 - -