2023-05-21 17:59:36 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
Rails.application.routes.draw do
|
|
|
|
|
mount LetterOpenerWeb::Engine, at: '/letter_opener' if Rails.env.development?
|
2023-07-14 23:06:23 +03:00
|
|
|
mount Sidekiq::Web => '/sidekiq' if defined?(Sidekiq)
|
2023-05-21 17:59:36 +03:00
|
|
|
|
|
|
|
|
root 'dashboard#index'
|
|
|
|
|
|
2023-12-29 19:29:13 +02:00
|
|
|
get 'up' => 'rails/health#show'
|
|
|
|
|
|
2023-07-14 22:33:42 +03:00
|
|
|
devise_for :users,
|
|
|
|
|
path: '/', only: %i[sessions passwords omniauth_callbacks],
|
|
|
|
|
controllers: begin
|
2023-10-21 17:44:04 +03:00
|
|
|
options = { sessions: 'sessions', passwords: 'passwords' }
|
2023-12-14 21:22:26 +02:00
|
|
|
options[:omniauth_callbacks] = 'omniauth_callbacks' if User.devise_modules.include?(:omniauthable)
|
2023-07-14 22:33:42 +03:00
|
|
|
options
|
|
|
|
|
end
|
2023-05-21 17:59:36 +03:00
|
|
|
|
|
|
|
|
devise_scope :user do
|
2023-06-30 20:31:17 +03:00
|
|
|
if Docuseal.multitenant?
|
2023-08-26 01:24:14 +03:00
|
|
|
resource :registration, only: %i[show], path: 'sign_up'
|
2023-08-25 23:54:55 +03:00
|
|
|
unauthenticated do
|
|
|
|
|
resource :registration, only: %i[create], path: 'new' do
|
|
|
|
|
get '' => :new, as: :new
|
|
|
|
|
end
|
2023-05-21 17:59:36 +03:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
resource :invitation, only: %i[update] do
|
|
|
|
|
get '' => :edit
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2023-08-04 00:40:13 +03:00
|
|
|
namespace :api, defaults: { format: :json } do
|
2023-05-21 17:59:36 +03:00
|
|
|
resources :attachments, only: %i[create]
|
2023-09-20 02:00:00 +03:00
|
|
|
resources :submitters_autocomplete, only: %i[index]
|
2023-09-22 02:20:38 +03:00
|
|
|
resources :template_folders_autocomplete, only: %i[index]
|
2023-09-10 12:55:41 +03:00
|
|
|
resources :submitter_email_clicks, only: %i[create]
|
|
|
|
|
resources :submitter_form_views, only: %i[create]
|
2023-12-17 18:39:10 +02:00
|
|
|
resources :submitters, only: %i[index show update]
|
2023-10-01 01:57:47 +03:00
|
|
|
resources :submissions, only: %i[index show create destroy] do
|
|
|
|
|
collection do
|
|
|
|
|
resources :emails, only: %i[create], controller: 'submissions', as: :submissions_emails
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
resources :templates, only: %i[update show index destroy] do
|
2023-12-06 11:29:55 +02:00
|
|
|
resources :clone, only: %i[create], controller: 'templates_clone'
|
2023-10-01 01:57:47 +03:00
|
|
|
resources :submissions, only: %i[index create]
|
2023-08-19 21:05:54 +03:00
|
|
|
resources :documents, only: %i[create], controller: 'templates_documents'
|
2023-05-21 17:59:36 +03:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2023-08-31 01:12:24 +03:00
|
|
|
resources :verify_pdf_signature, only: %i[create]
|
2023-12-02 01:50:54 +02:00
|
|
|
resource :mfa_setup, only: %i[show new edit create destroy], controller: 'mfa_setup'
|
2023-12-02 16:26:34 +02:00
|
|
|
resources :account_configs, only: %i[create]
|
2024-02-12 12:26:22 +02:00
|
|
|
resources :encrypted_user_configs, only: %i[destroy]
|
2023-12-02 18:14:33 +02:00
|
|
|
resources :timestamp_server, only: %i[create]
|
2023-05-21 17:59:36 +03:00
|
|
|
resources :dashboard, only: %i[index]
|
|
|
|
|
resources :setup, only: %i[index create]
|
2023-07-01 13:43:46 +03:00
|
|
|
resource :newsletter, only: %i[show update]
|
2023-10-21 15:33:10 +03:00
|
|
|
resources :enquiries, only: %i[create]
|
2023-05-21 17:59:36 +03:00
|
|
|
resources :users, only: %i[new create edit update destroy]
|
2024-01-05 22:48:55 +02:00
|
|
|
resource :user_signature, only: %i[edit update destroy]
|
2023-05-21 17:59:36 +03:00
|
|
|
resources :submissions, only: %i[show destroy]
|
2023-08-05 11:02:00 +03:00
|
|
|
resources :console_redirect, only: %i[index]
|
2024-01-20 23:53:14 +02:00
|
|
|
resource :testing_account, only: %i[show destroy]
|
|
|
|
|
resources :testing_api_settings, only: %i[index]
|
2023-09-14 01:43:08 +03:00
|
|
|
resource :templates_upload, only: %i[create]
|
2023-10-28 23:07:18 +03:00
|
|
|
authenticated do
|
|
|
|
|
resource :templates_upload, only: %i[show], path: 'new'
|
|
|
|
|
end
|
2023-09-15 00:42:51 +03:00
|
|
|
resources :templates_archived, only: %i[index], path: 'archived'
|
2023-09-22 02:20:38 +03:00
|
|
|
resources :folders, only: %i[show edit update destroy], controller: 'template_folders'
|
2024-02-03 22:37:17 +02:00
|
|
|
resources :template_sharings_testing, only: %i[create]
|
2023-06-28 00:22:34 +03:00
|
|
|
resources :templates, only: %i[new create edit show destroy] do
|
2023-09-15 00:42:51 +03:00
|
|
|
resources :restore, only: %i[create], controller: 'templates_restore'
|
2023-09-17 00:45:57 +03:00
|
|
|
resources :archived, only: %i[index], controller: 'templates_archived_submissions'
|
2023-06-28 00:22:34 +03:00
|
|
|
resources :submissions, only: %i[new create]
|
2023-09-22 02:20:38 +03:00
|
|
|
resource :folder, only: %i[edit update], controller: 'templates_folders'
|
2024-02-03 22:37:17 +02:00
|
|
|
resource :preview, only: %i[show], controller: 'templates_preview'
|
|
|
|
|
resource :code_modal, only: %i[show], controller: 'templates_code_modal'
|
2023-08-20 15:18:15 +03:00
|
|
|
resources :submissions_export, only: %i[index new]
|
2023-05-21 17:59:36 +03:00
|
|
|
end
|
2023-10-22 01:54:20 +03:00
|
|
|
resources :preview_document_page, only: %i[show], path: '/preview/:attachment_uuid'
|
2023-05-21 17:59:36 +03:00
|
|
|
|
2023-06-20 00:24:39 +03:00
|
|
|
resources :start_form, only: %i[show update], path: 'd', param: 'slug' do
|
2023-05-21 17:59:36 +03:00
|
|
|
get :completed
|
|
|
|
|
end
|
|
|
|
|
|
2024-01-14 12:11:13 +02:00
|
|
|
resources :submit_form, only: %i[], path: '' do
|
|
|
|
|
get :success, on: :collection
|
|
|
|
|
end
|
|
|
|
|
|
2023-06-13 00:29:07 +03:00
|
|
|
resources :submit_form, only: %i[show update], path: 's', param: 'slug' do
|
2023-05-21 17:59:36 +03:00
|
|
|
get :completed
|
|
|
|
|
end
|
|
|
|
|
|
2023-11-20 00:52:05 +02:00
|
|
|
resources :submissions_preview, only: %i[show], path: 'e', param: 'slug'
|
|
|
|
|
|
2023-05-21 17:59:36 +03:00
|
|
|
resources :send_submission_email, only: %i[create] do
|
|
|
|
|
get :success, on: :collection
|
|
|
|
|
end
|
|
|
|
|
|
2023-06-13 00:29:07 +03:00
|
|
|
resources :submitters, only: %i[], param: 'slug' do
|
2023-05-21 17:59:36 +03:00
|
|
|
resources :download, only: %i[index], controller: 'submissions_download'
|
2023-09-03 14:05:31 +03:00
|
|
|
resources :send_email, only: %i[create], controller: 'submitters_send_email'
|
2023-06-26 00:46:01 +03:00
|
|
|
resources :debug, only: %i[index], controller: 'submissions_debug' if Rails.env.development?
|
2023-05-21 17:59:36 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scope '/settings', as: :settings do
|
2023-06-30 20:31:17 +03:00
|
|
|
unless Docuseal.multitenant?
|
|
|
|
|
resources :storage, only: %i[index create], controller: 'storage_settings'
|
2023-09-17 20:38:09 +03:00
|
|
|
resources :email, only: %i[index create], controller: 'email_smtp_settings'
|
2023-09-03 14:05:31 +03:00
|
|
|
resources :sms, only: %i[index], controller: 'sms_settings'
|
2023-10-29 13:36:06 +02:00
|
|
|
resources :sso, only: %i[index], controller: 'sso_settings'
|
2023-06-30 20:31:17 +03:00
|
|
|
end
|
2023-09-17 20:38:09 +03:00
|
|
|
resources :notifications, only: %i[index create], controller: 'notifications_settings'
|
2023-08-31 01:12:24 +03:00
|
|
|
resource :esign, only: %i[show create new update destroy], controller: 'esign_settings'
|
2023-05-21 17:59:36 +03:00
|
|
|
resources :users, only: %i[index]
|
2023-08-16 22:57:59 +03:00
|
|
|
resource :personalization, only: %i[show create], controller: 'personalization_settings'
|
2024-01-20 23:53:14 +02:00
|
|
|
resources :api, only: %i[index create], controller: 'api_settings'
|
|
|
|
|
resource :webhooks, only: %i[show create update], controller: 'webhook_settings'
|
2024-01-29 01:13:41 +02:00
|
|
|
resource :account, only: %i[show update destroy]
|
2023-06-07 12:04:11 +03:00
|
|
|
resources :profile, only: %i[index] do
|
2023-06-07 01:36:47 +03:00
|
|
|
collection do
|
2023-06-07 12:04:11 +03:00
|
|
|
patch :update_contact
|
|
|
|
|
patch :update_password
|
2023-06-20 23:42:56 +03:00
|
|
|
patch :update_app_url
|
2023-06-07 01:36:47 +03:00
|
|
|
end
|
|
|
|
|
end
|
2023-05-21 17:59:36 +03:00
|
|
|
end
|
2023-08-12 12:34:02 +03:00
|
|
|
|
|
|
|
|
ActiveSupport.run_load_hooks(:routes, self)
|
2023-05-21 17:59:36 +03:00
|
|
|
end
|