diff --git a/frontend-reactive/app/components/auth/post-registration-form.hbs b/frontend-reactive/app/components/auth/post-registration-form.hbs index 3f67e49..67bdad7 100644 --- a/frontend-reactive/app/components/auth/post-registration-form.hbs +++ b/frontend-reactive/app/components/auth/post-registration-form.hbs @@ -18,6 +18,7 @@ />
+ {{! TODO: Split into entry form on the left and live preview on the right }} diff --git a/frontend-reactive/app/components/auth/post-registration-form.ts b/frontend-reactive/app/components/auth/post-registration-form.ts index 8cd271b..ef98987 100644 --- a/frontend-reactive/app/components/auth/post-registration-form.ts +++ b/frontend-reactive/app/components/auth/post-registration-form.ts @@ -1,29 +1,29 @@ -import { action } from '@ember/object'; -import Component from '@glimmer/component'; -import { tracked } from '@glimmer/tracking'; -import isValidMail from 'frontend-reactive/helpers/is-valid-mail'; +import { action } from '@ember/object' +import Component from '@glimmer/component' +import { tracked } from '@glimmer/tracking' +import isValidMail from 'frontend-reactive/helpers/is-valid-mail' export interface AuthPostRegistrationFormSignature { // The arguments accepted by the component Args: { - username: string; - }; + username: string + } // Any blocks yielded by the component Blocks: { - default: []; - }; + default: [] + } // The element to which `...attributes` is applied in the component template - Element: null; + Element: null } export default class AuthPostRegistrationForm extends Component { - @tracked displayname: string = this.args.username; - @tracked description: string = ''; - @tracked gender: Array<{ value: string }> = []; + @tracked displayname: string = this.args.username + @tracked description: string = '' + @tracked gender: Array<{ value: string }> = [] @tracked beingTypes: Array<{ - name: string; - checked: boolean; - description: string; + name: string + checked: boolean + description: string }> = [ { name: 'Human', @@ -55,22 +55,22 @@ export default class AuthPostRegistrationForm extends Component = []; - @tracked indexable: boolean = true; - @tracked mail = { mail: '', valid: false }; + ] + @tracked defaultpostmode: string = 'Public' + @tracked followapproval: boolean = false + @tracked customProperties: Array<{ key: string; value: string }> = [] + @tracked indexable: boolean = true + @tracked mail = { mail: '', valid: false } + @tracked enableBlueskyIntegration = false genderAddedHandler(newIndex: number) { - console.log('gender added'); + console.log('gender added') } genderRemovedHandler(removedIndex: number) { - console.log('gender removed'); + console.log('gender removed') } @action test() { - console.log(this.mail); + console.log(this.mail) } } diff --git a/go.mod b/go.mod index e643d2b..8bce771 100644 --- a/go.mod +++ b/go.mod @@ -55,6 +55,8 @@ require ( github.com/go-webauthn/x v0.1.14 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/google/go-tpm v0.9.1 // indirect + github.com/google/jsonapi v1.0.0 // indirect + github.com/gorilla/websocket v1.5.3 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/pgx/v5 v5.4.3 // indirect diff --git a/go.sum b/go.sum index eb7bec7..f362bf2 100644 --- a/go.sum +++ b/go.sum @@ -162,6 +162,8 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-tpm v0.9.1 h1:0pGc4X//bAlmZzMKf8iz6IsDo1nYTbYJ6FZN/rg4zdM= github.com/google/go-tpm v0.9.1/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/jsonapi v1.0.0 h1:qIGgO5Smu3yJmSs+QlvhQnrscdZfFhiV6S8ryJAglqU= +github.com/google/jsonapi v1.0.0/go.mod h1:YYHiRPJT8ARXGER8In9VuLv4qvLfDmA9ULQqptbLE4s= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -176,6 +178,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= diff --git a/server/apiFrontendAccounts.go b/server/apiFrontendAccounts.go deleted file mode 100644 index abb4e43..0000000 --- a/server/apiFrontendAccounts.go +++ /dev/null @@ -1 +0,0 @@ -package server diff --git a/server/apiFrontendNotes.go b/server/apiFrontendNotes.go deleted file mode 100644 index 9f225ce..0000000 --- a/server/apiFrontendNotes.go +++ /dev/null @@ -1,5 +0,0 @@ -package server - -import "net/http" - -func getLinstromNote(w http.ResponseWriter, r *http.Request) {} diff --git a/server/apiFrontendRouter.go b/server/apiFrontendRouter.go deleted file mode 100644 index 4bbca6b..0000000 --- a/server/apiFrontendRouter.go +++ /dev/null @@ -1,8 +0,0 @@ -package server - -import "net/http" - -func setupApiFrontendRouter() http.Handler { - router := http.NewServeMux() - return router -} diff --git a/server/apiLinstrom.go b/server/apiLinstrom.go new file mode 100644 index 0000000..b17d36a --- /dev/null +++ b/server/apiLinstrom.go @@ -0,0 +1,36 @@ +package server + +import "net/http" + +func setupLinstromApiRouter() http.Handler { + router := http.NewServeMux() + router.Handle("/v1/", http.StripPrefix("/v1", setupLinstromApiV1Router())) + + return router +} + +func setupLinstromApiV1Router() http.Handler { + router := http.NewServeMux() + // Notes + router.HandleFunc("GET /note/{noteId}", linstromGetNote) + router.HandleFunc("POST /note", linstromNewNote) + router.HandleFunc("PUT /note/{noteId}", linstromUpdateNote) + router.HandleFunc("DELETE /note/{noteId}", linstromDeleteNote) + // Reactions + router.HandleFunc("GET /note/{noteId}/reactions", linstromGetReactions) + router.HandleFunc("POST /note/{noteId}/reactions", linstromAddReaction) + router.HandleFunc("PUT /note/{noteId}/reactions", linstromUpdateReaction) + router.HandleFunc("DELETE /note/{noteId}/reactions", linstromDeleteReaction) + // Boosts + router.HandleFunc("GET /note/{noteId}/boosts", linstromGetBoosts) + router.HandleFunc("POST /note/{noteId}/boosts", linstromAddBoost) + router.HandleFunc("DELETE /note/{noteId}/boosts", linstromRemoveBoost) + // Quotes + router.HandleFunc("GET /note/{noteId}/quotes", linstromGetQuotes) + router.HandleFunc("POST /note/{noteId}/quotes", linstromAddQuote) + // Pinning + router.HandleFunc("POST /note/{noteId}/pin", linstromPinNote) + router.HandleFunc("DELETE /note/{noteId}/pin", linstromUnpinNote) + + return router +} diff --git a/server/apiLinstromNotes.go b/server/apiLinstromNotes.go new file mode 100644 index 0000000..d1495e7 --- /dev/null +++ b/server/apiLinstromNotes.go @@ -0,0 +1,29 @@ +package server + +import "net/http" + +// Notes +func linstromGetNote(w http.ResponseWriter, r *http.Request) {} +func linstromUpdateNote(w http.ResponseWriter, r *http.Request) {} +func linstromNewNote(w http.ResponseWriter, r *http.Request) {} +func linstromDeleteNote(w http.ResponseWriter, r *http.Request) {} + +// Reactions +func linstromGetReactions(w http.ResponseWriter, r *http.Request) {} +func linstromAddReaction(w http.ResponseWriter, r *http.Request) {} +func linstromDeleteReaction(w http.ResponseWriter, r *http.Request) {} +func linstromUpdateReaction(w http.ResponseWriter, r *http.Request) {} + +// Boosts +func linstromGetBoosts(w http.ResponseWriter, r *http.Request) {} +func linstromAddBoost(w http.ResponseWriter, r *http.Request) {} +func linstromRemoveBoost(w http.ResponseWriter, r *http.Request) {} + +// Quotes +func linstromGetQuotes(w http.ResponseWriter, r *http.Request) {} +func linstromAddQuote(w http.ResponseWriter, r *http.Request) {} + +// No delete quote since quotes are their own notes with an extra attribute + +func linstromPinNote(w http.ResponseWriter, r *http.Request) {} +func linstromUnpinNote(w http.ResponseWriter, r *http.Request) {} diff --git a/server/apiLinstromStreams.go b/server/apiLinstromStreams.go new file mode 100644 index 0000000..5fc3b8b --- /dev/null +++ b/server/apiLinstromStreams.go @@ -0,0 +1,5 @@ +package server + +// TODO: Decide where to put data stream handlers + +// Entrypoint for a new stream will be in here at least diff --git a/server/apiRouter.go b/server/apiRouter.go index 74bd5fe..8745fcf 100644 --- a/server/apiRouter.go +++ b/server/apiRouter.go @@ -5,6 +5,7 @@ import "net/http" // Mounted at /api func setupApiRouter() http.Handler { router := http.NewServeMux() + router.Handle("/linstrom/", setupLinstromApiRouter()) // Section MastoApi router.HandleFunc("GET /oauth/authorize", placeholderEndpoint)