diff --git a/cmd/front/main.go b/cmd/front/main.go index 38374be..0536f0c 100644 --- a/cmd/front/main.go +++ b/cmd/front/main.go @@ -4,9 +4,9 @@ package main import ( + "github.com/sonr-io/motr/config" "github.com/sonr-io/motr/controller" - "github.com/sonr-io/motr/internal/config" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" "github.com/sonr-io/motr/routes" ) diff --git a/cmd/vault/main.go b/cmd/vault/main.go index 38374be..0536f0c 100644 --- a/cmd/vault/main.go +++ b/cmd/vault/main.go @@ -4,9 +4,9 @@ package main import ( + "github.com/sonr-io/motr/config" "github.com/sonr-io/motr/controller" - "github.com/sonr-io/motr/internal/config" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" "github.com/sonr-io/motr/routes" ) diff --git a/internal/config/config.go b/config/config.go similarity index 98% rename from internal/config/config.go rename to config/config.go index 6b39944..c946170 100644 --- a/internal/config/config.go +++ b/config/config.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" "github.com/syumai/workers/cloudflare" _ "github.com/syumai/workers/cloudflare/d1" "github.com/syumai/workers/cloudflare/kv" diff --git a/internal/config/errors.go b/config/errors.go similarity index 100% rename from internal/config/errors.go rename to config/errors.go diff --git a/internal/config/server.go b/config/server.go similarity index 100% rename from internal/config/server.go rename to config/server.go diff --git a/controller/account/card.templ b/controller/account/card.templ index 08abcaa..8e7efb6 100644 --- a/controller/account/card.templ +++ b/controller/account/card.templ @@ -1,6 +1,6 @@ package account -import "github.com/sonr-io/motr/internal/sink/models" +import "github.com/sonr-io/motr/sink/models" templ cardComponent(handle, addr, block, name string) {
diff --git a/controller/account/card_templ.go b/controller/account/card_templ.go index d1db7b5..fe7006a 100644 --- a/controller/account/card_templ.go +++ b/controller/account/card_templ.go @@ -8,7 +8,7 @@ package account import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import "github.com/sonr-io/motr/internal/sink/models" +import "github.com/sonr-io/motr/sink/models" func cardComponent(handle, addr, block, name string) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { @@ -38,7 +38,7 @@ func cardComponent(handle, addr, block, name string) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(handle) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/account/card.templ`, Line: 11, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/account/card.templ`, Line: 11, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -51,7 +51,7 @@ func cardComponent(handle, addr, block, name string) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(addr) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/account/card.templ`, Line: 18, Col: 42} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/account/card.templ`, Line: 18, Col: 42} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -64,7 +64,7 @@ func cardComponent(handle, addr, block, name string) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(block) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/account/card.templ`, Line: 23, Col: 47} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/account/card.templ`, Line: 23, Col: 47} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -77,7 +77,7 @@ func cardComponent(handle, addr, block, name string) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/account/card.templ`, Line: 27, Col: 32} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/account/card.templ`, Line: 27, Col: 32} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -120,7 +120,7 @@ func optionComponent(account models.Account) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(account.Address) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/account/card.templ`, Line: 37, Col: 19} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/account/card.templ`, Line: 37, Col: 19} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -163,7 +163,7 @@ func rowComponent(account models.Account) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(account.Address) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/account/card.templ`, Line: 45, Col: 19} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/account/card.templ`, Line: 45, Col: 19} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { diff --git a/controller/account/entity.go b/controller/account/entity.go index 185c7af..4f18603 100644 --- a/controller/account/entity.go +++ b/controller/account/entity.go @@ -4,7 +4,7 @@ import ( "strconv" "github.com/a-h/templ" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type AccountEntity interface { diff --git a/controller/account/queries.go b/controller/account/queries.go index 491e50e..1aece17 100644 --- a/controller/account/queries.go +++ b/controller/account/queries.go @@ -3,7 +3,7 @@ package account import ( "context" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type Queries interface { diff --git a/controller/activity/card.templ b/controller/activity/card.templ index 686394a..678b66e 100644 --- a/controller/activity/card.templ +++ b/controller/activity/card.templ @@ -1,6 +1,6 @@ package activity -import "github.com/sonr-io/motr/internal/sink/models" +import "github.com/sonr-io/motr/sink/models" templ cardComponent(handle, addr, block, name string) {
diff --git a/controller/activity/card_templ.go b/controller/activity/card_templ.go index 745c10a..637d04e 100644 --- a/controller/activity/card_templ.go +++ b/controller/activity/card_templ.go @@ -8,7 +8,7 @@ package activity import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import "github.com/sonr-io/motr/internal/sink/models" +import "github.com/sonr-io/motr/sink/models" func cardComponent(handle, addr, block, name string) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { @@ -38,7 +38,7 @@ func cardComponent(handle, addr, block, name string) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(handle) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/activity/card.templ`, Line: 11, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/activity/card.templ`, Line: 11, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -51,7 +51,7 @@ func cardComponent(handle, addr, block, name string) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(addr) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/activity/card.templ`, Line: 18, Col: 42} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/activity/card.templ`, Line: 18, Col: 42} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -64,7 +64,7 @@ func cardComponent(handle, addr, block, name string) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(block) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/activity/card.templ`, Line: 23, Col: 47} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/activity/card.templ`, Line: 23, Col: 47} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -77,7 +77,7 @@ func cardComponent(handle, addr, block, name string) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/activity/card.templ`, Line: 27, Col: 32} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/activity/card.templ`, Line: 27, Col: 32} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -120,7 +120,7 @@ func optionComponent(account models.Activity) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(account.Status) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/activity/card.templ`, Line: 37, Col: 18} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/activity/card.templ`, Line: 37, Col: 18} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -163,7 +163,7 @@ func rowComponent(account models.Activity) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(account.Status) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `controllers/activity/card.templ`, Line: 45, Col: 18} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `controller/activity/card.templ`, Line: 45, Col: 18} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { diff --git a/controller/activity/entity.go b/controller/activity/entity.go index 180810f..38113b6 100644 --- a/controller/activity/entity.go +++ b/controller/activity/entity.go @@ -2,7 +2,7 @@ package activity import ( "github.com/a-h/templ" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type ActivityEntity interface { diff --git a/controller/activity/queries.go b/controller/activity/queries.go index c530cd5..5e1104a 100644 --- a/controller/activity/queries.go +++ b/controller/activity/queries.go @@ -4,7 +4,7 @@ import ( "context" "database/sql" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type Queries interface { diff --git a/controller/asset/entity.go b/controller/asset/entity.go index ddb1c65..a6292e6 100644 --- a/controller/asset/entity.go +++ b/controller/asset/entity.go @@ -2,7 +2,7 @@ package asset import ( "github.com/a-h/templ" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type AssetEntity interface { diff --git a/controller/asset/queries.go b/controller/asset/queries.go index 0c7ebbd..317c212 100644 --- a/controller/asset/queries.go +++ b/controller/asset/queries.go @@ -3,7 +3,7 @@ package asset import ( "context" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type Queries interface { diff --git a/controller/blockchain/entity.go b/controller/blockchain/entity.go index 44b4eac..a50f15b 100644 --- a/controller/blockchain/entity.go +++ b/controller/blockchain/entity.go @@ -2,7 +2,7 @@ package blockchain import ( "github.com/a-h/templ" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type BlockchainEntity interface { diff --git a/controller/blockchain/queries.go b/controller/blockchain/queries.go index 28b1568..b9bfb5b 100644 --- a/controller/blockchain/queries.go +++ b/controller/blockchain/queries.go @@ -4,7 +4,7 @@ import ( "context" "database/sql" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type Queries interface { diff --git a/controller/controller.go b/controller/controller.go index e4f9543..0721606 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -4,8 +4,8 @@ package controller import ( - "github.com/sonr-io/motr/internal/config" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/config" + "github.com/sonr-io/motr/sink/models" "github.com/syumai/workers/cloudflare/kv" ) diff --git a/controller/credential/descriptor.go b/controller/credential/descriptor.go index 5043894..0cd5360 100644 --- a/controller/credential/descriptor.go +++ b/controller/credential/descriptor.go @@ -1,6 +1,6 @@ package credential -import "github.com/sonr-io/motr/internal/sink/models" +import "github.com/sonr-io/motr/sink/models" // Define the credential structure matching our frontend data type CredentialDescriptor struct { diff --git a/controller/credential/entity.go b/controller/credential/entity.go index 7e63164..173154c 100644 --- a/controller/credential/entity.go +++ b/controller/credential/entity.go @@ -2,7 +2,7 @@ package credential import ( "github.com/a-h/templ" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type CredentialEntity interface { diff --git a/controller/credential/queries.go b/controller/credential/queries.go index bcefdc8..26501b9 100644 --- a/controller/credential/queries.go +++ b/controller/credential/queries.go @@ -3,7 +3,7 @@ package credential import ( "context" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type Queries interface { diff --git a/controller/health/entity.go b/controller/health/entity.go index 844de99..11c3bb4 100644 --- a/controller/health/entity.go +++ b/controller/health/entity.go @@ -2,7 +2,7 @@ package health import ( "github.com/a-h/templ" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type HealthEntity interface { diff --git a/controller/health/queries.go b/controller/health/queries.go index 57c3916..9ca565c 100644 --- a/controller/health/queries.go +++ b/controller/health/queries.go @@ -3,7 +3,7 @@ package health import ( "context" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type Queries interface { diff --git a/controller/prices/entity.go b/controller/prices/entity.go index 759d073..53bd021 100644 --- a/controller/prices/entity.go +++ b/controller/prices/entity.go @@ -2,7 +2,7 @@ package prices import ( "github.com/a-h/templ" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type PriceEntity interface { diff --git a/controller/prices/queries.go b/controller/prices/queries.go index b5881b6..b2e017c 100644 --- a/controller/prices/queries.go +++ b/controller/prices/queries.go @@ -3,7 +3,7 @@ package prices import ( "context" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type Queries interface { diff --git a/controller/profile/entity.go b/controller/profile/entity.go index 8480886..73eaea2 100644 --- a/controller/profile/entity.go +++ b/controller/profile/entity.go @@ -2,7 +2,7 @@ package profile import ( "github.com/a-h/templ" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type ProfileEntity interface { diff --git a/controller/profile/queries.go b/controller/profile/queries.go index 751f031..cc22ec1 100644 --- a/controller/profile/queries.go +++ b/controller/profile/queries.go @@ -3,7 +3,7 @@ package profile import ( "context" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type Queries interface { diff --git a/controller/service/entity.go b/controller/service/entity.go index c1d0637..535cc2c 100644 --- a/controller/service/entity.go +++ b/controller/service/entity.go @@ -2,7 +2,7 @@ package service import ( "github.com/a-h/templ" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type ServiceEntity interface { diff --git a/controller/service/queries.go b/controller/service/queries.go index 691ad33..15767c5 100644 --- a/controller/service/queries.go +++ b/controller/service/queries.go @@ -3,7 +3,7 @@ package service import ( "context" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type Queries interface { diff --git a/controller/vault/entity.go b/controller/vault/entity.go index 3707dc9..6d0275d 100644 --- a/controller/vault/entity.go +++ b/controller/vault/entity.go @@ -1,7 +1,7 @@ package vault import ( - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type VaultEntity interface { diff --git a/controller/vault/queries.go b/controller/vault/queries.go index 6503410..0a848e2 100644 --- a/controller/vault/queries.go +++ b/controller/vault/queries.go @@ -3,7 +3,7 @@ package vault import ( "context" - "github.com/sonr-io/motr/internal/sink/models" + "github.com/sonr-io/motr/sink/models" ) type Queries interface { diff --git a/handlers/auth/controller.go b/handlers/auth/controller.go deleted file mode 100644 index 5d3cda1..0000000 --- a/handlers/auth/controller.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package auth - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/go-webauthn/webauthn/webauthn" - "github.com/labstack/echo/v4" - "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/config" - "github.com/sonr-io/motr/internal/middleware" - "github.com/sonr-io/motr/internal/sink/models" - "github.com/syumai/workers/cloudflare/kv" -) - -// ╭───────────────────────────────────────────────────────────╮ -// │ Auth Handler │ -// ╰───────────────────────────────────────────────────────────╯ - -func Register(cfg config.Config, s *config.Server) error { - q, err := cfg.DB.GetQuerier() - if err != nil { - return err - } - hkv, err := cfg.KV.GetHandles() - if err != nil { - return err - } - skv, err := cfg.KV.GetSessions() - if err != nil { - return err - } - - h := NewAuthHandler(q, hkv, skv) - h.SetupRoutes(s) - return nil -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Auth Handler │ -// ╰───────────────────────────────────────────────────────────╯ - -// AuthHandler is the auth handler. -type AuthHandler struct { - DB models.Querier - Handles *kv.Namespace - Sessions *kv.Namespace -} - -func NewAuthHandler(q models.Querier, hkv *kv.Namespace, skv *kv.Namespace) *AuthHandler { - return &AuthHandler{DB: q, Handles: hkv, Sessions: skv} -} - -// SetupRoutes sets up the routes for the auth handler. -func (h *AuthHandler) SetupRoutes(s *config.Server) { - s.GET("/login", h.HandleLoginInitial) - s.GET("/login/:handle", h.HandleLoginStart) - s.POST("/login/:handle/check", h.HandleLoginUsernameCheck) - s.POST("/login/:handle/finish", h.HandleLoginFinish) - - s.GET("/register", h.HandleRegisterInitial) - s.GET("/register/:handle", h.HandleRegisterStart) - s.POST("/register/:handle/check", h.HandleRegisterUsernameCheck) - s.POST("/register/:handle/finish", h.HandleRegisterFinish) -} - -func (c *AuthHandler) VerifyHandle(handle string, target bool) bool { - _, err := c.Handles.GetString(handle, nil) - if err != nil { - return !target - } - res, err := c.DB.CheckHandleExists(context.Background(), handle) - if err != nil { - return false - } - return res == target -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Login Handlers (/login) │ -// ╰───────────────────────────────────────────────────────────╯ - -// HandleLoginFinish handles the finish login request. -func (h *AuthHandler) HandleLoginFinish(c echo.Context) error { - return middleware.Render(c, views.LoginView()) -} - -// HandleLoginStart handles the start login request. -func (h *AuthHandler) HandleLoginStart(c echo.Context) error { - return middleware.Render(c, views.LoginView()) -} - -func (h *AuthHandler) HandleLoginInitial(c echo.Context) error { - return middleware.Render(c, views.LoginView()) -} - -// HandleSubmitCredentialLogin handles the submit credential login request. -func (h *AuthHandler) HandleSubmitCredentialLogin(c echo.Context) error { - return middleware.Render(c, views.RegisterView()) -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Profile Handlers (/login) │ -// ╰───────────────────────────────────────────────────────────╯ - -// HandleRegisterUsernameCheck handles the username check request. -func (h *AuthHandler) HandleRegisterUsernameCheck(c echo.Context) error { - handle := c.FormValue("handle") - ok := h.VerifyHandle(handle, false) - if ok { - return middleware.Render(c, views.RegisterView()) - } - return middleware.Render(c, views.RegisterView()) -} - -// HandleLoginUsernameCheck handles the username check request. -func (h *AuthHandler) HandleLoginUsernameCheck(c echo.Context) error { - handle := c.FormValue("handle") - ok := h.VerifyHandle(handle, true) - if ok { - return middleware.Render(c, views.RegisterView()) - } - return middleware.Render(c, views.RegisterView()) -} - -func (h *AuthHandler) HandleSubmitUsernameClaim(c echo.Context) error { - return middleware.Render(c, views.RegisterView()) -} - -func (h *AuthHandler) HandleSubmitProfile(c echo.Context) error { - return middleware.Render(c, views.RegisterView()) -} - -// ╭────────────────────────────────────────────────────────╮ -// │ Register Init (/register) │ -// ╰────────────────────────────────────────────────────────╯ - -// HandleRegisterInitial handles the initial register request. -func (h *AuthHandler) HandleRegisterInitial(c echo.Context) error { - return middleware.Render(c, views.RegisterView()) -} - -// HandleRegisterStart handles the start register request. -func (h *AuthHandler) HandleRegisterStart(c echo.Context) error { - return middleware.Render(c, views.RegisterView()) -} - -// HandleRegisterFinish handles the finish register request. -func (h *AuthHandler) HandleRegisterFinish(c echo.Context) error { - return middleware.Render(c, views.RegisterView()) -} - -// HandleSubmitCredentialRegister handles the submit credential register request. -func (h *AuthHandler) HandleSubmitCredentialRegister(c echo.Context) error { - credJSON := c.FormValue("credentialJSON") - if credJSON == "" { - return middleware.Render(c, views.RegisterView()) - } - cred := webauthn.Credential{} - err := json.Unmarshal([]byte(credJSON), &cred) - if err != nil { - return middleware.Render(c, views.RegisterView()) - } - fmt.Println(cred) - - return middleware.Render(c, views.RegisterView()) -} diff --git a/handlers/default_expired.go b/handlers/default_expired.go index 8ce72c1..2cd0c62 100644 --- a/handlers/default_expired.go +++ b/handlers/default_expired.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleDefaultExpired(c echo.Context) error { diff --git a/handlers/default_initial.go b/handlers/default_initial.go index b683ad0..ef6bcdb 100644 --- a/handlers/default_initial.go +++ b/handlers/default_initial.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleDefaultInitial(c echo.Context) error { diff --git a/handlers/default_valid.go b/handlers/default_valid.go index 3c7dada..aabf62b 100644 --- a/handlers/default_valid.go +++ b/handlers/default_valid.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleDefaultValid(c echo.Context) error { diff --git a/handlers/landing/controller.go b/handlers/landing/controller.go deleted file mode 100644 index dbb90e2..0000000 --- a/handlers/landing/controller.go +++ /dev/null @@ -1,52 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package landing - -import ( - "github.com/labstack/echo/v4" - "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/config" - "github.com/sonr-io/motr/internal/middleware" - "github.com/sonr-io/motr/internal/sink/models" - "github.com/syumai/workers/cloudflare/kv" -) - -func Register(cfg config.Config, s *config.Server) error { - q, err := cfg.DB.GetQuerier() - if err != nil { - return err - } - hkv, err := cfg.KV.GetHandles() - if err != nil { - return err - } - skv, err := cfg.KV.GetSessions() - if err != nil { - return err - } - h := New(q, hkv, skv) - h.SetupRoutes(s) - return nil -} - -type LandingHandler struct { - DB models.Querier - Handles *kv.Namespace - Sessions *kv.Namespace -} - -func New(q models.Querier, hkv *kv.Namespace, skv *kv.Namespace) *LandingHandler { - return &LandingHandler{DB: q, Handles: hkv, Sessions: skv} -} - -func (h *LandingHandler) SetupRoutes(s *config.Server) { - s.GET("/", h.HandleIndex) -} - -func (h *LandingHandler) HandleIndex(c echo.Context) error { - if err := middleware.GetSession(c).SaveStatus(h.Sessions); err != nil { - return err - } - return middleware.Render(c, views.HomeView()) -} diff --git a/handlers/login_check.go b/handlers/login_check.go index c159b71..2ca27df 100644 --- a/handlers/login_check.go +++ b/handlers/login_check.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleLoginCheck(c echo.Context) error { diff --git a/handlers/login_finish.go b/handlers/login_finish.go index 50dd16e..be56ab8 100644 --- a/handlers/login_finish.go +++ b/handlers/login_finish.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleLoginFinish(c echo.Context) error { diff --git a/handlers/login_initial.go b/handlers/login_initial.go index 97cf6be..ab1142d 100644 --- a/handlers/login_initial.go +++ b/handlers/login_initial.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleLoginInitial(c echo.Context) error { diff --git a/handlers/login_start.go b/handlers/login_start.go index 05478f7..17c1464 100644 --- a/handlers/login_start.go +++ b/handlers/login_start.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleLoginStart(c echo.Context) error { diff --git a/handlers/register_check.go b/handlers/register_check.go index 25cddf0..c9ed655 100644 --- a/handlers/register_check.go +++ b/handlers/register_check.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleRegisterCheck(c echo.Context) error { diff --git a/handlers/register_finish.go b/handlers/register_finish.go index b98c612..86f72b1 100644 --- a/handlers/register_finish.go +++ b/handlers/register_finish.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleRegisterFinish(c echo.Context) error { diff --git a/handlers/register_initial.go b/handlers/register_initial.go index f94b4d1..6057916 100644 --- a/handlers/register_initial.go +++ b/handlers/register_initial.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleRegisterInitial(c echo.Context) error { diff --git a/handlers/register_start.go b/handlers/register_start.go index f7d6be3..8a22dbb 100644 --- a/handlers/register_start.go +++ b/handlers/register_start.go @@ -3,7 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/sonr-io/motr/components/views" - "github.com/sonr-io/motr/internal/middleware" + "github.com/sonr-io/motr/middleware" ) func HandleRegisterStart(c echo.Context) error { diff --git a/internal/middleware/cache.go b/middleware/cache.go similarity index 99% rename from internal/middleware/cache.go rename to middleware/cache.go index dcb2efd..a97a669 100644 --- a/internal/middleware/cache.go +++ b/middleware/cache.go @@ -10,7 +10,7 @@ import ( "strconv" "github.com/labstack/echo/v4" - "github.com/sonr-io/motr/internal/config" + "github.com/sonr-io/motr/config" "github.com/syumai/workers/cloudflare" "github.com/syumai/workers/cloudflare/cache" ) diff --git a/internal/middleware/context.go b/middleware/context.go similarity index 94% rename from internal/middleware/context.go rename to middleware/context.go index 99bbfb5..6be0ebc 100644 --- a/internal/middleware/context.go +++ b/middleware/context.go @@ -8,8 +8,8 @@ import ( "github.com/labstack/echo/v4" "github.com/segmentio/ksuid" - "github.com/sonr-io/motr/internal/config" - "github.com/sonr-io/motr/internal/sink" + "github.com/sonr-io/motr/config" + "github.com/sonr-io/motr/sink" ) type SessionContext struct { diff --git a/internal/middleware/cookies.go b/middleware/cookies.go similarity index 100% rename from internal/middleware/cookies.go rename to middleware/cookies.go diff --git a/internal/middleware/headers.go b/middleware/headers.go similarity index 100% rename from internal/middleware/headers.go rename to middleware/headers.go diff --git a/internal/middleware/middleware.go b/middleware/middleware.go similarity index 89% rename from internal/middleware/middleware.go rename to middleware/middleware.go index a6c1e27..eca5a6a 100644 --- a/internal/middleware/middleware.go +++ b/middleware/middleware.go @@ -5,7 +5,7 @@ package middleware import ( "github.com/labstack/echo/v4" - "github.com/sonr-io/motr/internal/config" + "github.com/sonr-io/motr/config" ) // UseSession is a middleware that adds a new key to the context diff --git a/internal/middleware/render.go b/middleware/render.go similarity index 100% rename from internal/middleware/render.go rename to middleware/render.go diff --git a/internal/middleware/state.go b/middleware/state.go similarity index 94% rename from internal/middleware/state.go rename to middleware/state.go index 9069d7c..95ea5f6 100644 --- a/internal/middleware/state.go +++ b/middleware/state.go @@ -4,7 +4,7 @@ package middleware import ( - "github.com/sonr-io/motr/internal/sink" + "github.com/sonr-io/motr/sink" "github.com/syumai/workers/cloudflare/kv" ) diff --git a/internal/sink/metadata.go b/sink/metadata.go similarity index 100% rename from internal/sink/metadata.go rename to sink/metadata.go diff --git a/internal/sink/models/db.go b/sink/models/db.go similarity index 100% rename from internal/sink/models/db.go rename to sink/models/db.go diff --git a/internal/sink/models/models.go b/sink/models/models.go similarity index 100% rename from internal/sink/models/models.go rename to sink/models/models.go diff --git a/internal/sink/models/querier.go b/sink/models/querier.go similarity index 100% rename from internal/sink/models/querier.go rename to sink/models/querier.go diff --git a/internal/sink/models/query.sql.go b/sink/models/query.sql.go similarity index 100% rename from internal/sink/models/query.sql.go rename to sink/models/query.sql.go diff --git a/internal/sink/state.go b/sink/state.go similarity index 100% rename from internal/sink/state.go rename to sink/state.go diff --git a/internal/ui/base.templ b/ui/base.templ similarity index 100% rename from internal/ui/base.templ rename to ui/base.templ diff --git a/internal/ui/base_templ.go b/ui/base_templ.go similarity index 100% rename from internal/ui/base_templ.go rename to ui/base_templ.go diff --git a/internal/ui/imports.templ b/ui/imports.templ similarity index 100% rename from internal/ui/imports.templ rename to ui/imports.templ diff --git a/internal/ui/imports_templ.go b/ui/imports_templ.go similarity index 95% rename from internal/ui/imports_templ.go rename to ui/imports_templ.go index f924d4d..d2592d2 100644 --- a/internal/ui/imports_templ.go +++ b/ui/imports_templ.go @@ -107,7 +107,7 @@ func Dexie() templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("dexie", "4.0.10", "dist/dexie.min.js")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/imports.templ`, Line: 25, Col: 67} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/imports.templ`, Line: 25, Col: 67} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -120,7 +120,7 @@ func Dexie() templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("dexie-export-import", "4.1.4", "dist/dexie-export-import.min.js")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/imports.templ`, Line: 26, Col: 94} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/imports.templ`, Line: 26, Col: 94} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -276,7 +276,7 @@ func Htmx() templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("htmx.org", "1.9.12", "dist/htmx.min.js")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/imports.templ`, Line: 130, Col: 69} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/imports.templ`, Line: 130, Col: 69} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { @@ -289,7 +289,7 @@ func Htmx() templ.Component { var templ_7745c5c3_Var14 string templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("htmx-ext-include-vals", "2.0.0", "include-vals.min.js")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/imports.templ`, Line: 131, Col: 84} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/imports.templ`, Line: 131, Col: 84} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { @@ -302,7 +302,7 @@ func Htmx() templ.Component { var templ_7745c5c3_Var15 string templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("htmx-ext-path-params", "2.0.0", "path-params.min.js")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/imports.templ`, Line: 132, Col: 82} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/imports.templ`, Line: 132, Col: 82} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { @@ -315,7 +315,7 @@ func Htmx() templ.Component { var templ_7745c5c3_Var16 string templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("htmx-ext-alpine-morph", "2.0.0", "alpine-morph.min.js")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/imports.templ`, Line: 133, Col: 84} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/imports.templ`, Line: 133, Col: 84} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { @@ -328,7 +328,7 @@ func Htmx() templ.Component { var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("htmx-ext-sse", "2.2.2", "sse.min.js")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/imports.templ`, Line: 134, Col: 66} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/imports.templ`, Line: 134, Col: 66} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { @@ -341,7 +341,7 @@ func Htmx() templ.Component { var templ_7745c5c3_Var18 string templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("htmx-ext-ws", "2.0.2", "ws.min.js")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/imports.templ`, Line: 135, Col: 64} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/imports.templ`, Line: 135, Col: 64} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) if templ_7745c5c3_Err != nil { diff --git a/internal/ui/layout.templ b/ui/layout.templ similarity index 100% rename from internal/ui/layout.templ rename to ui/layout.templ diff --git a/internal/ui/layout_templ.go b/ui/layout_templ.go similarity index 96% rename from internal/ui/layout_templ.go rename to ui/layout_templ.go index 8df8187..4fd38ea 100644 --- a/internal/ui/layout_templ.go +++ b/ui/layout_templ.go @@ -148,7 +148,7 @@ func NavCTA(href string, text string) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(href) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/layout.templ`, Line: 29, Col: 38} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/layout.templ`, Line: 29, Col: 38} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -161,7 +161,7 @@ func NavCTA(href string, text string) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/layout.templ`, Line: 29, Col: 47} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/layout.templ`, Line: 29, Col: 47} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -203,7 +203,7 @@ func NavItem(href string, text string) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(href) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/layout.templ`, Line: 33, Col: 35} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/layout.templ`, Line: 33, Col: 35} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -216,7 +216,7 @@ func NavItem(href string, text string) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/layout.templ`, Line: 33, Col: 44} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/layout.templ`, Line: 33, Col: 44} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -266,7 +266,7 @@ func NavLogo(title string) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/layout.templ`, Line: 39, Col: 41} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/layout.templ`, Line: 39, Col: 41} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -420,7 +420,7 @@ func Separator(text string) templ.Component { var templ_7745c5c3_Var16 string templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/layout.templ`, Line: 66, Col: 45} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/layout.templ`, Line: 66, Col: 45} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { diff --git a/internal/ui/meta.templ b/ui/meta.templ similarity index 100% rename from internal/ui/meta.templ rename to ui/meta.templ diff --git a/internal/ui/meta_templ.go b/ui/meta_templ.go similarity index 85% rename from internal/ui/meta_templ.go rename to ui/meta_templ.go index 91f8a01..a327ba6 100644 --- a/internal/ui/meta_templ.go +++ b/ui/meta_templ.go @@ -38,7 +38,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(m.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 6, Col: 17} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 6, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -51,7 +51,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(m.Favicon) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 7, Col: 51} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 7, Col: 51} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -64,7 +64,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(m.Description) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 8, Col: 49} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 8, Col: 49} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -77,7 +77,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(m.Keywords) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 9, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 9, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -90,7 +90,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(m.Author) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 10, Col: 39} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 10, Col: 39} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -103,7 +103,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(m.Robots) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 11, Col: 39} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 11, Col: 39} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -116,7 +116,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(m.Googlebot) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 12, Col: 45} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 12, Col: 45} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -129,7 +129,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(m.Google) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 13, Col: 39} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 13, Col: 39} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -142,7 +142,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(m.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 14, Col: 44} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 14, Col: 44} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -155,7 +155,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(m.Description) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 15, Col: 56} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 15, Col: 56} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -168,7 +168,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var12 string templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(m.OGImage) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 16, Col: 46} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 16, Col: 46} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) if templ_7745c5c3_Err != nil { @@ -181,7 +181,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(m.OGURL) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 17, Col: 42} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 17, Col: 42} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { @@ -194,7 +194,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var14 string templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(m.OGSiteName) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 18, Col: 53} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 18, Col: 53} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { @@ -207,7 +207,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var15 string templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(m.TwitterSite) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 22, Col: 50} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 22, Col: 50} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { @@ -220,7 +220,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var16 string templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(m.TwitterCreator) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 23, Col: 56} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 23, Col: 56} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { @@ -233,7 +233,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(m.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 24, Col: 45} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 24, Col: 45} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { @@ -246,7 +246,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var18 string templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(m.Description) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 25, Col: 57} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 25, Col: 57} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) if templ_7745c5c3_Err != nil { @@ -259,7 +259,7 @@ func MetaComponent(m sink.Metadata) templ.Component { var templ_7745c5c3_Var19 string templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(m.TwitterImage) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/ui/meta.templ`, Line: 26, Col: 52} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/meta.templ`, Line: 26, Col: 52} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) if templ_7745c5c3_Err != nil { diff --git a/internal/ui/style.templ b/ui/style.templ similarity index 100% rename from internal/ui/style.templ rename to ui/style.templ diff --git a/internal/ui/style_templ.go b/ui/style_templ.go similarity index 100% rename from internal/ui/style_templ.go rename to ui/style_templ.go