# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# General
GET  /                                 hydro.controllers.StandardActions.index
GET  /app/                             hydro.controllers.StandardActions.reactAppRoot
GET  /app/*anyString                   hydro.controllers.StandardActions.reactApp(anyString)
GET  /appwithoutcreds/                 hydro.controllers.StandardActions.reactAppWithoutCredentials

# Javscript files
GET  /localDatabaseWebWorker.js        hydro.controllers.JavascriptFiles.localDatabaseWebWorker
GET  /serviceWorker.js                 hydro.controllers.JavascriptFiles.serviceWorker
GET  /manifest.webmanifest             app.controllers.Webmanifest.webmanifest

# Internal API
POST /scalajsapi/*path                 hydro.controllers.InternalApi.scalaJsApiPost(path: String)
GET  /scalajsapi/*path                 hydro.controllers.InternalApi.scalaJsApiGet(path: String)
GET  /websocket/hydropush/:updateToken/  hydro.controllers.InternalApi.hydroPushSocketWebsocket(updateToken)

# External API
GET  /externalapi/healthcheck/         hydro.controllers.StandardActions.healthCheck
GET  /externalapi/dbschema/:appSecret/  hydro.controllers.StandardActions.databaseSchema(appSecret)
GET  /externalapi/clearoldentitymodifications/:dryOrWet/:appSecret/  hydro.controllers.StandardActions.clearOldEntityModifications(dryOrWet, appSecret)
GET  /externalapi/share/:docId/:loginName/:appSecret/  app.controllers.ExternalApi.shareDocument(docId, loginName, appSecret)
# Inserts a task. It is recommended to provide `content` in the form of "base64:<base64 encoded Markdown content>"
GET  /externalapi/inserttask/:docId/$parentTag<[^/]+>/:appSecret/*content  app.controllers.ExternalApi.insertTask(docId, parentTag, content, appSecret)
GET  /externalapi/gettasksasjson/:docId/$parentTag<[^/]+>/:appSecret/ app.controllers.ExternalApi.getTasksAsJson(docId, parentTag, appSecret)
GET  /externalapi/regenordertokens/:dryOrWet/:appSecret/  app.controllers.ExternalApi.regenerateOrderTokens(dryOrWet, appSecret)

# Interactive shortcuts
GET  /interactive/done  app.controllers.ExternalApi.interactiveDone()
# Inserts a task. It is recommended to provide `content` in the form of "base64:<base64 encoded Markdown content>"
GET  /interactive/inserttask/:docId/$parentTag<[^/]+>/*content  app.controllers.ExternalApi.interactiveInsertTask(docId, parentTag, content)

# Auth
GET  /login/                           hydro.controllers.Auth.login(returnTo ?= "/")
POST /login/                           hydro.controllers.Auth.authenticate(returnTo ?= "/")
GET  /logout/                          hydro.controllers.Auth.logout
GET  /loggedin/                        hydro.controllers.Auth.amILoggedIn

# Map static resources from the /public folder to the /assets URL path
GET  /assets/*file                     controllers.Assets.versioned(path="/public", file: Asset)
