refactor!: add missing fields and docs

This commit is contained in:
DevMiner 2024-08-22 23:03:38 +02:00
parent 61891d891a
commit 6e59386f60
73 changed files with 726 additions and 580 deletions

View file

@ -1,14 +1,13 @@
package schema
import (
"net/url"
"time"
"entgo.io/ent"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/mixin"
"github.com/google/uuid"
"github.com/lysand-org/versia-go/pkg/lysand"
"github.com/lysand-org/versia-go/pkg/versia"
"net/url"
"time"
)
type LysandEntityMixin struct{ mixin.Schema }
@ -23,7 +22,7 @@ func (LysandEntityMixin) Fields() []ent.Field {
field.Bool("isRemote"),
field.String("uri").Validate(ValidateURI),
field.JSON("extensions", lysand.Extensions{}).Default(lysand.Extensions{}),
field.JSON("extensions", versia.Extensions{}).Default(versia.Extensions{}),
field.Time("created_at").
Immutable().

View file

@ -1,13 +1,12 @@
package schema
import (
"errors"
"regexp"
"entgo.io/ent"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"github.com/lysand-org/versia-go/pkg/lysand"
"errors"
"github.com/lysand-org/versia-go/pkg/versia"
"regexp"
)
var (
@ -45,7 +44,7 @@ func (User) Fields() []ent.Field {
Values("public", "restricted", "private").
Default("public"),
field.JSON("fields", []lysand.Field{}).Default([]lysand.Field{}),
field.JSON("fields", []versia.UserField{}).Default([]versia.UserField{}),
field.String("inbox").Validate(ValidateURI),