From db099b19a17f8173e322166a1e23a97407374c8a Mon Sep 17 00:00:00 2001 From: DevMiner Date: Wed, 28 Aug 2024 00:25:25 +0200 Subject: [PATCH] chore: rename everything to versia --- .github/workflows/docker.yml | 2 +- README.md | 2 +- chart/values.yaml | 2 +- ent/attachment.go | 6 +- ent/attachment/attachment.go | 2 +- ent/attachment/where.go | 2 +- ent/attachment_create.go | 6 +- ent/attachment_delete.go | 4 +- ent/attachment_query.go | 6 +- ent/attachment_update.go | 8 +- ent/client.go | 14 +- ent/ent.go | 12 +- ent/enttest/enttest.go | 6 +- ent/follow.go | 6 +- ent/follow/follow.go | 2 +- ent/follow/where.go | 2 +- ent/follow_create.go | 6 +- ent/follow_delete.go | 4 +- ent/follow_query.go | 6 +- ent/follow_update.go | 8 +- ent/hook/hook.go | 2 +- ent/image.go | 2 +- ent/image/where.go | 2 +- ent/image_create.go | 2 +- ent/image_delete.go | 4 +- ent/image_query.go | 4 +- ent/image_update.go | 4 +- ent/instancemetadata.go | 4 +- ent/instancemetadata/instancemetadata.go | 2 +- ent/instancemetadata/where.go | 2 +- ent/instancemetadata_create.go | 6 +- ent/instancemetadata_delete.go | 4 +- ent/instancemetadata_query.go | 6 +- ent/instancemetadata_update.go | 8 +- ent/internal/schema.go | 2 +- ent/mutation.go | 16 +- ent/note.go | 6 +- ent/note/note.go | 2 +- ent/note/where.go | 2 +- ent/note_create.go | 8 +- ent/note_delete.go | 4 +- ent/note_query.go | 8 +- ent/note_update.go | 10 +- ent/runtime.go | 16 +- ent/runtime/runtime.go | 2 +- ent/schema/lysand_entity.go | 2 +- ent/schema/user.go | 2 +- ent/user.go | 6 +- ent/user/user.go | 2 +- ent/user/where.go | 2 +- ent/user_create.go | 10 +- ent/user_delete.go | 4 +- ent/user_query.go | 10 +- ent/user_update.go | 12 +- fiber_error_handler.go | 2 +- go.mod | 2 +- internal/api_schema/notes.go | 9 +- internal/api_schema/users.go | 2 +- internal/database/transaction.go | 2 +- internal/entity/follow.go | 6 +- internal/entity/note.go | 20 +-- internal/entity/server_metadata.go | 12 +- internal/entity/user.go | 26 +-- internal/handlers/follow_handler/handler.go | 6 +- .../follow_handler/versia_follow_get.go | 2 +- internal/handlers/meta_handler/handler.go | 6 +- .../handlers/note_handler/app_note_create.go | 2 +- .../handlers/note_handler/app_note_get.go | 2 +- internal/handlers/note_handler/handler.go | 8 +- .../handlers/user_handler/app_user_create.go | 4 +- .../handlers/user_handler/app_user_get.go | 2 +- .../handlers/user_handler/app_user_search.go | 4 +- internal/handlers/user_handler/handler.go | 4 +- .../handlers/user_handler/versia_inbox.go | 6 +- .../handlers/user_handler/versia_user_get.go | 2 +- .../handlers/user_handler/versia_webfinger.go | 8 +- internal/helpers/ptr.go | 4 + .../repo_impls/follow_repository_impl.go | 14 +- .../instance_metadata_repository_impl.go | 12 +- internal/repository/repo_impls/manager.go | 6 +- .../repo_impls/note_repository_impl.go | 12 +- .../repo_impls/user_repository_impl.go | 22 +-- internal/repository/repository.go | 6 +- internal/service/service.go | 14 +- .../service/svc_impls/Inbox_service_impl.go | 14 +- .../svc_impls/federation_service_impl.go | 14 +- .../service/svc_impls/follow_service_impl.go | 8 +- .../instance_metadata_service_impl.go | 10 +- .../service/svc_impls/note_service_impl.go | 12 +- .../service/svc_impls/request_signer_impl.go | 4 +- .../service/svc_impls/task_service_impl.go | 4 +- .../service/svc_impls/user_service_impl.go | 16 +- internal/tasks/federate_note.go | 4 +- internal/tasks/handler.go | 6 +- internal/utils/urls.go | 4 +- .../val_impls/body_validator_impl.go | 6 +- .../val_impls/request_validator_impl.go | 10 +- main.go | 32 ++-- pkg/versia/action_delete.go | 2 +- pkg/versia/action_follow.go | 2 +- pkg/versia/actor_group.go | 2 +- pkg/versia/actor_user.go | 52 +++--- pkg/versia/attachment.go | 25 --- pkg/versia/collection.go | 2 +- pkg/versia/crypto/federation_headers.go | 2 +- pkg/versia/entity.go | 37 ++--- pkg/versia/instance_metadata.go | 18 +-- pkg/versia/note.go | 89 ++++------- pkg/versia/utils/content_map.go | 150 ++++++++++++++++++ pkg/versia/utils/content_types.go | 85 ---------- pkg/versia/utils/errors.go | 22 +++ pkg/webfinger/webfinger.go | 2 +- 112 files changed, 578 insertions(+), 567 deletions(-) delete mode 100644 pkg/versia/attachment.go create mode 100644 pkg/versia/utils/content_map.go delete mode 100644 pkg/versia/utils/content_types.go create mode 100644 pkg/versia/utils/errors.go diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a1cd338..be95e0c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -9,7 +9,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: "lysand-org/versia-go" + IMAGE_NAME: "versia-pub/versia-go" jobs: docker: diff --git a/README.md b/README.md index db9a230..322570c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Go. ### Running ```shell -git clone https://github.com/lysand-org/versia-go.git +git clone https://github.com/versia-pub/versia-go.git cd versia-go docker compose up -d nats diff --git a/chart/values.yaml b/chart/values.yaml index 9173411..7ad2097 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,5 +1,5 @@ image: - repository: ghcr.io/lysand-org/versia-go + repository: ghcr.io/versia-pub/versia-go pullPolicy: IfNotPresent tag: "latest" diff --git a/ent/attachment.go b/ent/attachment.go index c18851d..c006dcc 100644 --- a/ent/attachment.go +++ b/ent/attachment.go @@ -11,9 +11,9 @@ import ( "entgo.io/ent" "entgo.io/ent/dialect/sql" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // Attachment is the model entity for the Attachment schema. diff --git a/ent/attachment/attachment.go b/ent/attachment/attachment.go index 262d167..f16af47 100644 --- a/ent/attachment/attachment.go +++ b/ent/attachment/attachment.go @@ -8,7 +8,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/pkg/versia" ) const ( diff --git a/ent/attachment/where.go b/ent/attachment/where.go index 3d9b50d..0c91ee2 100644 --- a/ent/attachment/where.go +++ b/ent/attachment/where.go @@ -8,7 +8,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/predicate" ) // ID filters vertices based on their ID field. diff --git a/ent/attachment_create.go b/ent/attachment_create.go index 661bcc4..207d0e1 100644 --- a/ent/attachment_create.go +++ b/ent/attachment_create.go @@ -13,9 +13,9 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // AttachmentCreate is the builder for creating a Attachment entity. diff --git a/ent/attachment_delete.go b/ent/attachment_delete.go index e469e0a..45eba9f 100644 --- a/ent/attachment_delete.go +++ b/ent/attachment_delete.go @@ -8,8 +8,8 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/predicate" ) // AttachmentDelete is the builder for deleting a Attachment entity. diff --git a/ent/attachment_query.go b/ent/attachment_query.go index 344a3c2..3eccc05 100644 --- a/ent/attachment_query.go +++ b/ent/attachment_query.go @@ -11,9 +11,9 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" ) // AttachmentQuery is the builder for querying Attachment entities. diff --git a/ent/attachment_update.go b/ent/attachment_update.go index 0af3632..2bfac86 100644 --- a/ent/attachment_update.go +++ b/ent/attachment_update.go @@ -12,10 +12,10 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // AttachmentUpdate is the builder for updating Attachment entities. diff --git a/ent/client.go b/ent/client.go index 692b7f1..fd1491b 100644 --- a/ent/client.go +++ b/ent/client.go @@ -10,18 +10,18 @@ import ( "reflect" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/migrate" + "github.com/versia-pub/versia-go/ent/migrate" "entgo.io/ent" "entgo.io/ent/dialect" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/follow" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/user" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/follow" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/user" ) // Client is the client that holds all ent builders. diff --git a/ent/ent.go b/ent/ent.go index 5cd0aad..5a00383 100644 --- a/ent/ent.go +++ b/ent/ent.go @@ -12,12 +12,12 @@ import ( "entgo.io/ent" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/follow" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/user" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/follow" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/user" ) // ent aliases to avoid import conflicts in user's code. diff --git a/ent/enttest/enttest.go b/ent/enttest/enttest.go index e863f07..150c2d1 100644 --- a/ent/enttest/enttest.go +++ b/ent/enttest/enttest.go @@ -5,12 +5,12 @@ package enttest import ( "context" - "github.com/lysand-org/versia-go/ent" + "github.com/versia-pub/versia-go/ent" // required by schema hooks. - _ "github.com/lysand-org/versia-go/ent/runtime" + _ "github.com/versia-pub/versia-go/ent/runtime" "entgo.io/ent/dialect/sql/schema" - "github.com/lysand-org/versia-go/ent/migrate" + "github.com/versia-pub/versia-go/ent/migrate" ) type ( diff --git a/ent/follow.go b/ent/follow.go index 474ec9e..8e27193 100644 --- a/ent/follow.go +++ b/ent/follow.go @@ -11,9 +11,9 @@ import ( "entgo.io/ent" "entgo.io/ent/dialect/sql" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/follow" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/follow" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // Follow is the model entity for the Follow schema. diff --git a/ent/follow/follow.go b/ent/follow/follow.go index 6934ea8..445dcd7 100644 --- a/ent/follow/follow.go +++ b/ent/follow/follow.go @@ -9,7 +9,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/pkg/versia" ) const ( diff --git a/ent/follow/where.go b/ent/follow/where.go index 197a07b..bc5d73f 100644 --- a/ent/follow/where.go +++ b/ent/follow/where.go @@ -8,7 +8,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/predicate" ) // ID filters vertices based on their ID field. diff --git a/ent/follow_create.go b/ent/follow_create.go index fbc4841..895ec2d 100644 --- a/ent/follow_create.go +++ b/ent/follow_create.go @@ -13,9 +13,9 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/follow" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/follow" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // FollowCreate is the builder for creating a Follow entity. diff --git a/ent/follow_delete.go b/ent/follow_delete.go index d8e451d..4caedc9 100644 --- a/ent/follow_delete.go +++ b/ent/follow_delete.go @@ -8,8 +8,8 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" - "github.com/lysand-org/versia-go/ent/follow" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/follow" + "github.com/versia-pub/versia-go/ent/predicate" ) // FollowDelete is the builder for deleting a Follow entity. diff --git a/ent/follow_query.go b/ent/follow_query.go index 10c9f58..e3e3087 100644 --- a/ent/follow_query.go +++ b/ent/follow_query.go @@ -11,9 +11,9 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/follow" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" + "github.com/versia-pub/versia-go/ent/follow" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" ) // FollowQuery is the builder for querying Follow entities. diff --git a/ent/follow_update.go b/ent/follow_update.go index b270c01..0932bcb 100644 --- a/ent/follow_update.go +++ b/ent/follow_update.go @@ -12,10 +12,10 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/follow" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/follow" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // FollowUpdate is the builder for updating Follow entities. diff --git a/ent/hook/hook.go b/ent/hook/hook.go index 29f372c..f9c68b4 100644 --- a/ent/hook/hook.go +++ b/ent/hook/hook.go @@ -6,7 +6,7 @@ import ( "context" "fmt" - "github.com/lysand-org/versia-go/ent" + "github.com/versia-pub/versia-go/ent" ) // The AttachmentFunc type is an adapter to allow the use of ordinary diff --git a/ent/image.go b/ent/image.go index 9efa102..5c30831 100644 --- a/ent/image.go +++ b/ent/image.go @@ -8,7 +8,7 @@ import ( "entgo.io/ent" "entgo.io/ent/dialect/sql" - "github.com/lysand-org/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/image" ) // Image is the model entity for the Image schema. diff --git a/ent/image/where.go b/ent/image/where.go index 0dc9ea4..5c4f037 100644 --- a/ent/image/where.go +++ b/ent/image/where.go @@ -4,7 +4,7 @@ package image import ( "entgo.io/ent/dialect/sql" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/predicate" ) // ID filters vertices based on their ID field. diff --git a/ent/image_create.go b/ent/image_create.go index 0cdc40a..743fced 100644 --- a/ent/image_create.go +++ b/ent/image_create.go @@ -10,7 +10,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" - "github.com/lysand-org/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/image" ) // ImageCreate is the builder for creating a Image entity. diff --git a/ent/image_delete.go b/ent/image_delete.go index c876e0a..d712382 100644 --- a/ent/image_delete.go +++ b/ent/image_delete.go @@ -8,8 +8,8 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/predicate" ) // ImageDelete is the builder for deleting a Image entity. diff --git a/ent/image_query.go b/ent/image_query.go index a6e4cd2..b5b5f7e 100644 --- a/ent/image_query.go +++ b/ent/image_query.go @@ -10,8 +10,8 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/predicate" ) // ImageQuery is the builder for querying Image entities. diff --git a/ent/image_update.go b/ent/image_update.go index 1bdf3b1..289e0a0 100644 --- a/ent/image_update.go +++ b/ent/image_update.go @@ -10,8 +10,8 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/predicate" ) // ImageUpdate is the builder for updating Image entities. diff --git a/ent/instancemetadata.go b/ent/instancemetadata.go index 5dfdeb6..71908e4 100644 --- a/ent/instancemetadata.go +++ b/ent/instancemetadata.go @@ -11,8 +11,8 @@ import ( "entgo.io/ent" "entgo.io/ent/dialect/sql" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/pkg/versia" ) // InstanceMetadata is the model entity for the InstanceMetadata schema. diff --git a/ent/instancemetadata/instancemetadata.go b/ent/instancemetadata/instancemetadata.go index 752bf10..447e804 100644 --- a/ent/instancemetadata/instancemetadata.go +++ b/ent/instancemetadata/instancemetadata.go @@ -8,7 +8,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/pkg/versia" ) const ( diff --git a/ent/instancemetadata/where.go b/ent/instancemetadata/where.go index cd5651a..53c8b5b 100644 --- a/ent/instancemetadata/where.go +++ b/ent/instancemetadata/where.go @@ -8,7 +8,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/predicate" ) // ID filters vertices based on their ID field. diff --git a/ent/instancemetadata_create.go b/ent/instancemetadata_create.go index ba3975e..efeaaeb 100644 --- a/ent/instancemetadata_create.go +++ b/ent/instancemetadata_create.go @@ -13,9 +13,9 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // InstanceMetadataCreate is the builder for creating a InstanceMetadata entity. diff --git a/ent/instancemetadata_delete.go b/ent/instancemetadata_delete.go index 11b59cd..c2d2f8f 100644 --- a/ent/instancemetadata_delete.go +++ b/ent/instancemetadata_delete.go @@ -8,8 +8,8 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/predicate" ) // InstanceMetadataDelete is the builder for deleting a InstanceMetadata entity. diff --git a/ent/instancemetadata_query.go b/ent/instancemetadata_query.go index 379f0fa..db1e3ec 100644 --- a/ent/instancemetadata_query.go +++ b/ent/instancemetadata_query.go @@ -12,9 +12,9 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" ) // InstanceMetadataQuery is the builder for querying InstanceMetadata entities. diff --git a/ent/instancemetadata_update.go b/ent/instancemetadata_update.go index 61b46c2..873d5a6 100644 --- a/ent/instancemetadata_update.go +++ b/ent/instancemetadata_update.go @@ -13,10 +13,10 @@ import ( "entgo.io/ent/dialect/sql/sqljson" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // InstanceMetadataUpdate is the builder for updating InstanceMetadata entities. diff --git a/ent/internal/schema.go b/ent/internal/schema.go index a058057..192c4bf 100644 --- a/ent/internal/schema.go +++ b/ent/internal/schema.go @@ -6,4 +6,4 @@ // Package internal holds a loadable version of the latest schema. package internal -const Schema = "{\"Schema\":\"github.com/lysand-org/versia-go/ent/schema\",\"Package\":\"github.com/lysand-org/versia-go/ent\",\"Schemas\":[{\"name\":\"Attachment\",\"config\":{\"Table\":\"\"},\"edges\":[{\"name\":\"author\",\"type\":\"User\",\"unique\":true,\"required\":true}],\"fields\":[{\"name\":\"id\",\"type\":{\"Type\":4,\"Ident\":\"uuid.UUID\",\"PkgPath\":\"github.com/google/uuid\",\"PkgName\":\"uuid\",\"Nillable\":false,\"RType\":{\"Name\":\"UUID\",\"Ident\":\"uuid.UUID\",\"Kind\":17,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":{\"ClockSequence\":{\"In\":[],\"Out\":[{\"Name\":\"int\",\"Ident\":\"int\",\"Kind\":2,\"PkgPath\":\"\",\"Methods\":null}]},\"Domain\":{\"In\":[],\"Out\":[{\"Name\":\"Domain\",\"Ident\":\"uuid.Domain\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"ID\":{\"In\":[],\"Out\":[{\"Name\":\"uint32\",\"Ident\":\"uint32\",\"Kind\":10,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalBinary\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalText\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"NodeID\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}]},\"Scan\":{\"In\":[{\"Name\":\"\",\"Ident\":\"interface {}\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"String\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"Time\":{\"In\":[],\"Out\":[{\"Name\":\"Time\",\"Ident\":\"uuid.Time\",\"Kind\":6,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"URN\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalBinary\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalText\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Value\":{\"In\":[],\"Out\":[{\"Name\":\"Value\",\"Ident\":\"driver.Value\",\"Kind\":20,\"PkgPath\":\"database/sql/driver\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Variant\":{\"In\":[],\"Out\":[{\"Name\":\"Variant\",\"Ident\":\"uuid.Variant\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"Version\":{\"In\":[],\"Out\":[{\"Name\":\"Version\",\"Ident\":\"uuid.Version\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]}}}},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":0,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"isRemote\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"uri\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"extensions\",\"type\":{\"Type\":3,\"Ident\":\"versia.Extensions\",\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"Extensions\",\"Ident\":\"versia.Extensions\",\"Kind\":21,\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"Methods\":{}}},\"default\":true,\"default_value\":{},\"default_kind\":21,\"position\":{\"Index\":3,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"created_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":4,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"updated_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"update_default\":true,\"position\":{\"Index\":5,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"description\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"size\":384,\"validators\":1,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"sha256\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"size\",\"type\":{\"Type\":12,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":2,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"blurhash\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":3,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"height\",\"type\":{\"Type\":12,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":4,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"width\",\"type\":{\"Type\":12,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":5,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"fps\",\"type\":{\"Type\":12,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":6,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"mimeType\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":7,\"MixedIn\":false,\"MixinIndex\":0}}]},{\"name\":\"Follow\",\"config\":{\"Table\":\"\"},\"edges\":[{\"name\":\"follower\",\"type\":\"User\",\"unique\":true,\"required\":true},{\"name\":\"followee\",\"type\":\"User\",\"unique\":true,\"required\":true}],\"fields\":[{\"name\":\"id\",\"type\":{\"Type\":4,\"Ident\":\"uuid.UUID\",\"PkgPath\":\"github.com/google/uuid\",\"PkgName\":\"uuid\",\"Nillable\":false,\"RType\":{\"Name\":\"UUID\",\"Ident\":\"uuid.UUID\",\"Kind\":17,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":{\"ClockSequence\":{\"In\":[],\"Out\":[{\"Name\":\"int\",\"Ident\":\"int\",\"Kind\":2,\"PkgPath\":\"\",\"Methods\":null}]},\"Domain\":{\"In\":[],\"Out\":[{\"Name\":\"Domain\",\"Ident\":\"uuid.Domain\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"ID\":{\"In\":[],\"Out\":[{\"Name\":\"uint32\",\"Ident\":\"uint32\",\"Kind\":10,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalBinary\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalText\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"NodeID\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}]},\"Scan\":{\"In\":[{\"Name\":\"\",\"Ident\":\"interface {}\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"String\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"Time\":{\"In\":[],\"Out\":[{\"Name\":\"Time\",\"Ident\":\"uuid.Time\",\"Kind\":6,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"URN\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalBinary\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalText\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Value\":{\"In\":[],\"Out\":[{\"Name\":\"Value\",\"Ident\":\"driver.Value\",\"Kind\":20,\"PkgPath\":\"database/sql/driver\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Variant\":{\"In\":[],\"Out\":[{\"Name\":\"Variant\",\"Ident\":\"uuid.Variant\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"Version\":{\"In\":[],\"Out\":[{\"Name\":\"Version\",\"Ident\":\"uuid.Version\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]}}}},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":0,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"isRemote\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"uri\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"extensions\",\"type\":{\"Type\":3,\"Ident\":\"versia.Extensions\",\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"Extensions\",\"Ident\":\"versia.Extensions\",\"Kind\":21,\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"Methods\":{}}},\"default\":true,\"default_value\":{},\"default_kind\":21,\"position\":{\"Index\":3,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"created_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":4,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"updated_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"update_default\":true,\"position\":{\"Index\":5,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"status\",\"type\":{\"Type\":6,\"Ident\":\"follow.Status\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"enums\":[{\"N\":\"pending\",\"V\":\"pending\"},{\"N\":\"accepted\",\"V\":\"accepted\"}],\"default\":true,\"default_value\":\"pending\",\"default_kind\":24,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}}],\"indexes\":[{\"unique\":true,\"edges\":[\"follower\",\"followee\"]}]},{\"name\":\"Image\",\"config\":{\"Table\":\"\"},\"fields\":[{\"name\":\"url\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"mimeType\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":false,\"MixinIndex\":0}}]},{\"name\":\"InstanceMetadata\",\"config\":{\"Table\":\"\"},\"edges\":[{\"name\":\"users\",\"type\":\"User\"},{\"name\":\"moderators\",\"type\":\"User\"},{\"name\":\"admins\",\"type\":\"User\"}],\"fields\":[{\"name\":\"id\",\"type\":{\"Type\":4,\"Ident\":\"uuid.UUID\",\"PkgPath\":\"github.com/google/uuid\",\"PkgName\":\"uuid\",\"Nillable\":false,\"RType\":{\"Name\":\"UUID\",\"Ident\":\"uuid.UUID\",\"Kind\":17,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":{\"ClockSequence\":{\"In\":[],\"Out\":[{\"Name\":\"int\",\"Ident\":\"int\",\"Kind\":2,\"PkgPath\":\"\",\"Methods\":null}]},\"Domain\":{\"In\":[],\"Out\":[{\"Name\":\"Domain\",\"Ident\":\"uuid.Domain\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"ID\":{\"In\":[],\"Out\":[{\"Name\":\"uint32\",\"Ident\":\"uint32\",\"Kind\":10,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalBinary\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalText\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"NodeID\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}]},\"Scan\":{\"In\":[{\"Name\":\"\",\"Ident\":\"interface {}\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"String\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"Time\":{\"In\":[],\"Out\":[{\"Name\":\"Time\",\"Ident\":\"uuid.Time\",\"Kind\":6,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"URN\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalBinary\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalText\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Value\":{\"In\":[],\"Out\":[{\"Name\":\"Value\",\"Ident\":\"driver.Value\",\"Kind\":20,\"PkgPath\":\"database/sql/driver\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Variant\":{\"In\":[],\"Out\":[{\"Name\":\"Variant\",\"Ident\":\"uuid.Variant\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"Version\":{\"In\":[],\"Out\":[{\"Name\":\"Version\",\"Ident\":\"uuid.Version\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]}}}},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":0,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"isRemote\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"uri\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"extensions\",\"type\":{\"Type\":3,\"Ident\":\"versia.Extensions\",\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"Extensions\",\"Ident\":\"versia.Extensions\",\"Kind\":21,\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"Methods\":{}}},\"default\":true,\"default_value\":{},\"default_kind\":21,\"position\":{\"Index\":3,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"created_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":4,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"updated_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"update_default\":true,\"position\":{\"Index\":5,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"name\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"description\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":1,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"host\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"unique\":true,\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"publicKey\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"position\":{\"Index\":3,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"publicKeyAlgorithm\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":4,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"privateKey\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"optional\":true,\"position\":{\"Index\":5,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"softwareName\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":6,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"softwareVersion\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":7,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"sharedInboxURI\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":8,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"moderatorsURI\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":9,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"adminsURI\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":10,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"logoEndpoint\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":11,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"logoMimeType\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":12,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"bannerEndpoint\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":13,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"bannerMimeType\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":14,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"supportedVersions\",\"type\":{\"Type\":3,\"Ident\":\"[]string\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":{\"Name\":\"\",\"Ident\":\"[]string\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":{}}},\"default\":true,\"default_value\":[],\"default_kind\":23,\"position\":{\"Index\":15,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"supportedExtensions\",\"type\":{\"Type\":3,\"Ident\":\"[]string\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":{\"Name\":\"\",\"Ident\":\"[]string\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":{}}},\"default\":true,\"default_value\":[],\"default_kind\":23,\"position\":{\"Index\":16,\"MixedIn\":false,\"MixinIndex\":0}}]},{\"name\":\"Note\",\"config\":{\"Table\":\"\"},\"edges\":[{\"name\":\"author\",\"type\":\"User\",\"unique\":true,\"required\":true},{\"name\":\"mentions\",\"type\":\"User\"},{\"name\":\"attachments\",\"type\":\"Attachment\"}],\"fields\":[{\"name\":\"id\",\"type\":{\"Type\":4,\"Ident\":\"uuid.UUID\",\"PkgPath\":\"github.com/google/uuid\",\"PkgName\":\"uuid\",\"Nillable\":false,\"RType\":{\"Name\":\"UUID\",\"Ident\":\"uuid.UUID\",\"Kind\":17,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":{\"ClockSequence\":{\"In\":[],\"Out\":[{\"Name\":\"int\",\"Ident\":\"int\",\"Kind\":2,\"PkgPath\":\"\",\"Methods\":null}]},\"Domain\":{\"In\":[],\"Out\":[{\"Name\":\"Domain\",\"Ident\":\"uuid.Domain\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"ID\":{\"In\":[],\"Out\":[{\"Name\":\"uint32\",\"Ident\":\"uint32\",\"Kind\":10,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalBinary\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalText\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"NodeID\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}]},\"Scan\":{\"In\":[{\"Name\":\"\",\"Ident\":\"interface {}\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"String\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"Time\":{\"In\":[],\"Out\":[{\"Name\":\"Time\",\"Ident\":\"uuid.Time\",\"Kind\":6,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"URN\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalBinary\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalText\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Value\":{\"In\":[],\"Out\":[{\"Name\":\"Value\",\"Ident\":\"driver.Value\",\"Kind\":20,\"PkgPath\":\"database/sql/driver\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Variant\":{\"In\":[],\"Out\":[{\"Name\":\"Variant\",\"Ident\":\"uuid.Variant\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"Version\":{\"In\":[],\"Out\":[{\"Name\":\"Version\",\"Ident\":\"uuid.Version\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]}}}},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":0,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"isRemote\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"uri\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"extensions\",\"type\":{\"Type\":3,\"Ident\":\"versia.Extensions\",\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"Extensions\",\"Ident\":\"versia.Extensions\",\"Kind\":21,\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"Methods\":{}}},\"default\":true,\"default_value\":{},\"default_kind\":21,\"position\":{\"Index\":3,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"created_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":4,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"updated_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"update_default\":true,\"position\":{\"Index\":5,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"subject\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"size\":384,\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"content\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"isSensitive\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_value\":false,\"default_kind\":1,\"position\":{\"Index\":2,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"visibility\",\"type\":{\"Type\":6,\"Ident\":\"note.Visibility\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"enums\":[{\"N\":\"public\",\"V\":\"public\"},{\"N\":\"unlisted\",\"V\":\"unlisted\"},{\"N\":\"followers\",\"V\":\"followers\"},{\"N\":\"direct\",\"V\":\"direct\"}],\"default\":true,\"default_value\":\"public\",\"default_kind\":24,\"position\":{\"Index\":3,\"MixedIn\":false,\"MixinIndex\":0}}]},{\"name\":\"User\",\"config\":{\"Table\":\"\"},\"edges\":[{\"name\":\"avatarImage\",\"type\":\"Image\",\"unique\":true},{\"name\":\"headerImage\",\"type\":\"Image\",\"unique\":true},{\"name\":\"authoredNotes\",\"type\":\"Note\",\"ref_name\":\"author\",\"inverse\":true},{\"name\":\"mentionedNotes\",\"type\":\"Note\",\"ref_name\":\"mentions\",\"inverse\":true},{\"name\":\"servers\",\"type\":\"InstanceMetadata\",\"ref_name\":\"users\",\"inverse\":true},{\"name\":\"moderatedServers\",\"type\":\"InstanceMetadata\",\"ref_name\":\"moderators\",\"inverse\":true},{\"name\":\"administeredServers\",\"type\":\"InstanceMetadata\",\"ref_name\":\"admins\",\"inverse\":true}],\"fields\":[{\"name\":\"id\",\"type\":{\"Type\":4,\"Ident\":\"uuid.UUID\",\"PkgPath\":\"github.com/google/uuid\",\"PkgName\":\"uuid\",\"Nillable\":false,\"RType\":{\"Name\":\"UUID\",\"Ident\":\"uuid.UUID\",\"Kind\":17,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":{\"ClockSequence\":{\"In\":[],\"Out\":[{\"Name\":\"int\",\"Ident\":\"int\",\"Kind\":2,\"PkgPath\":\"\",\"Methods\":null}]},\"Domain\":{\"In\":[],\"Out\":[{\"Name\":\"Domain\",\"Ident\":\"uuid.Domain\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"ID\":{\"In\":[],\"Out\":[{\"Name\":\"uint32\",\"Ident\":\"uint32\",\"Kind\":10,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalBinary\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalText\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"NodeID\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}]},\"Scan\":{\"In\":[{\"Name\":\"\",\"Ident\":\"interface {}\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"String\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"Time\":{\"In\":[],\"Out\":[{\"Name\":\"Time\",\"Ident\":\"uuid.Time\",\"Kind\":6,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"URN\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalBinary\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalText\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Value\":{\"In\":[],\"Out\":[{\"Name\":\"Value\",\"Ident\":\"driver.Value\",\"Kind\":20,\"PkgPath\":\"database/sql/driver\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Variant\":{\"In\":[],\"Out\":[{\"Name\":\"Variant\",\"Ident\":\"uuid.Variant\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"Version\":{\"In\":[],\"Out\":[{\"Name\":\"Version\",\"Ident\":\"uuid.Version\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]}}}},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":0,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"isRemote\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"uri\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"extensions\",\"type\":{\"Type\":3,\"Ident\":\"versia.Extensions\",\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"Extensions\",\"Ident\":\"versia.Extensions\",\"Kind\":21,\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"Methods\":{}}},\"default\":true,\"default_value\":{},\"default_kind\":21,\"position\":{\"Index\":3,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"created_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":4,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"updated_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"update_default\":true,\"position\":{\"Index\":5,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"username\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"size\":32,\"unique\":true,\"validators\":2,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"passwordHash\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":1,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"displayName\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"size\":256,\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"biography\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":3,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"publicKey\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"position\":{\"Index\":4,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"publicKeyActor\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":5,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"publicKeyAlgorithm\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":6,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"privateKey\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"optional\":true,\"position\":{\"Index\":7,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"indexable\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_value\":true,\"default_kind\":1,\"position\":{\"Index\":8,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"privacyLevel\",\"type\":{\"Type\":6,\"Ident\":\"user.PrivacyLevel\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"enums\":[{\"N\":\"public\",\"V\":\"public\"},{\"N\":\"restricted\",\"V\":\"restricted\"},{\"N\":\"private\",\"V\":\"private\"}],\"default\":true,\"default_value\":\"public\",\"default_kind\":24,\"position\":{\"Index\":9,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"fields\",\"type\":{\"Type\":3,\"Ident\":\"[]versia.UserField\",\"PkgPath\":\"github.com/lysand-org/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"\",\"Ident\":\"[]versia.UserField\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":{}}},\"default\":true,\"default_value\":[],\"default_kind\":23,\"position\":{\"Index\":10,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"inbox\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":11,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"featured\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":12,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"followers\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":13,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"following\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":14,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"outbox\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":15,\"MixedIn\":false,\"MixinIndex\":0}}]}],\"Features\":[\"schema/snapshot\",\"sql/upsert\"]}" +const Schema = "{\"Schema\":\"github.com/versia-pub/versia-go/ent/schema\",\"Package\":\"github.com/versia-pub/versia-go/ent\",\"Schemas\":[{\"name\":\"Attachment\",\"config\":{\"Table\":\"\"},\"edges\":[{\"name\":\"author\",\"type\":\"User\",\"unique\":true,\"required\":true}],\"fields\":[{\"name\":\"id\",\"type\":{\"Type\":4,\"Ident\":\"uuid.UUID\",\"PkgPath\":\"github.com/google/uuid\",\"PkgName\":\"uuid\",\"Nillable\":false,\"RType\":{\"Name\":\"UUID\",\"Ident\":\"uuid.UUID\",\"Kind\":17,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":{\"ClockSequence\":{\"In\":[],\"Out\":[{\"Name\":\"int\",\"Ident\":\"int\",\"Kind\":2,\"PkgPath\":\"\",\"Methods\":null}]},\"Domain\":{\"In\":[],\"Out\":[{\"Name\":\"Domain\",\"Ident\":\"uuid.Domain\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"ID\":{\"In\":[],\"Out\":[{\"Name\":\"uint32\",\"Ident\":\"uint32\",\"Kind\":10,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalBinary\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalText\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"NodeID\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}]},\"Scan\":{\"In\":[{\"Name\":\"\",\"Ident\":\"interface {}\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"String\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"Time\":{\"In\":[],\"Out\":[{\"Name\":\"Time\",\"Ident\":\"uuid.Time\",\"Kind\":6,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"URN\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalBinary\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalText\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Value\":{\"In\":[],\"Out\":[{\"Name\":\"Value\",\"Ident\":\"driver.Value\",\"Kind\":20,\"PkgPath\":\"database/sql/driver\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Variant\":{\"In\":[],\"Out\":[{\"Name\":\"Variant\",\"Ident\":\"uuid.Variant\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"Version\":{\"In\":[],\"Out\":[{\"Name\":\"Version\",\"Ident\":\"uuid.Version\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]}}}},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":0,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"isRemote\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"uri\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"extensions\",\"type\":{\"Type\":3,\"Ident\":\"versia.Extensions\",\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"Extensions\",\"Ident\":\"versia.Extensions\",\"Kind\":21,\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"Methods\":{}}},\"default\":true,\"default_value\":{},\"default_kind\":21,\"position\":{\"Index\":3,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"created_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":4,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"updated_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"update_default\":true,\"position\":{\"Index\":5,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"description\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"size\":384,\"validators\":1,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"sha256\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"size\",\"type\":{\"Type\":12,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":2,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"blurhash\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":3,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"height\",\"type\":{\"Type\":12,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":4,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"width\",\"type\":{\"Type\":12,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":5,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"fps\",\"type\":{\"Type\":12,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":6,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"mimeType\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":7,\"MixedIn\":false,\"MixinIndex\":0}}]},{\"name\":\"Follow\",\"config\":{\"Table\":\"\"},\"edges\":[{\"name\":\"follower\",\"type\":\"User\",\"unique\":true,\"required\":true},{\"name\":\"followee\",\"type\":\"User\",\"unique\":true,\"required\":true}],\"fields\":[{\"name\":\"id\",\"type\":{\"Type\":4,\"Ident\":\"uuid.UUID\",\"PkgPath\":\"github.com/google/uuid\",\"PkgName\":\"uuid\",\"Nillable\":false,\"RType\":{\"Name\":\"UUID\",\"Ident\":\"uuid.UUID\",\"Kind\":17,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":{\"ClockSequence\":{\"In\":[],\"Out\":[{\"Name\":\"int\",\"Ident\":\"int\",\"Kind\":2,\"PkgPath\":\"\",\"Methods\":null}]},\"Domain\":{\"In\":[],\"Out\":[{\"Name\":\"Domain\",\"Ident\":\"uuid.Domain\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"ID\":{\"In\":[],\"Out\":[{\"Name\":\"uint32\",\"Ident\":\"uint32\",\"Kind\":10,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalBinary\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalText\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"NodeID\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}]},\"Scan\":{\"In\":[{\"Name\":\"\",\"Ident\":\"interface {}\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"String\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"Time\":{\"In\":[],\"Out\":[{\"Name\":\"Time\",\"Ident\":\"uuid.Time\",\"Kind\":6,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"URN\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalBinary\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalText\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Value\":{\"In\":[],\"Out\":[{\"Name\":\"Value\",\"Ident\":\"driver.Value\",\"Kind\":20,\"PkgPath\":\"database/sql/driver\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Variant\":{\"In\":[],\"Out\":[{\"Name\":\"Variant\",\"Ident\":\"uuid.Variant\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"Version\":{\"In\":[],\"Out\":[{\"Name\":\"Version\",\"Ident\":\"uuid.Version\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]}}}},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":0,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"isRemote\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"uri\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"extensions\",\"type\":{\"Type\":3,\"Ident\":\"versia.Extensions\",\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"Extensions\",\"Ident\":\"versia.Extensions\",\"Kind\":21,\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"Methods\":{}}},\"default\":true,\"default_value\":{},\"default_kind\":21,\"position\":{\"Index\":3,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"created_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":4,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"updated_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"update_default\":true,\"position\":{\"Index\":5,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"status\",\"type\":{\"Type\":6,\"Ident\":\"follow.Status\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"enums\":[{\"N\":\"pending\",\"V\":\"pending\"},{\"N\":\"accepted\",\"V\":\"accepted\"}],\"default\":true,\"default_value\":\"pending\",\"default_kind\":24,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}}],\"indexes\":[{\"unique\":true,\"edges\":[\"follower\",\"followee\"]}]},{\"name\":\"Image\",\"config\":{\"Table\":\"\"},\"fields\":[{\"name\":\"url\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"mimeType\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":false,\"MixinIndex\":0}}]},{\"name\":\"InstanceMetadata\",\"config\":{\"Table\":\"\"},\"edges\":[{\"name\":\"users\",\"type\":\"User\"},{\"name\":\"moderators\",\"type\":\"User\"},{\"name\":\"admins\",\"type\":\"User\"}],\"fields\":[{\"name\":\"id\",\"type\":{\"Type\":4,\"Ident\":\"uuid.UUID\",\"PkgPath\":\"github.com/google/uuid\",\"PkgName\":\"uuid\",\"Nillable\":false,\"RType\":{\"Name\":\"UUID\",\"Ident\":\"uuid.UUID\",\"Kind\":17,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":{\"ClockSequence\":{\"In\":[],\"Out\":[{\"Name\":\"int\",\"Ident\":\"int\",\"Kind\":2,\"PkgPath\":\"\",\"Methods\":null}]},\"Domain\":{\"In\":[],\"Out\":[{\"Name\":\"Domain\",\"Ident\":\"uuid.Domain\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"ID\":{\"In\":[],\"Out\":[{\"Name\":\"uint32\",\"Ident\":\"uint32\",\"Kind\":10,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalBinary\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalText\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"NodeID\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}]},\"Scan\":{\"In\":[{\"Name\":\"\",\"Ident\":\"interface {}\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"String\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"Time\":{\"In\":[],\"Out\":[{\"Name\":\"Time\",\"Ident\":\"uuid.Time\",\"Kind\":6,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"URN\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalBinary\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalText\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Value\":{\"In\":[],\"Out\":[{\"Name\":\"Value\",\"Ident\":\"driver.Value\",\"Kind\":20,\"PkgPath\":\"database/sql/driver\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Variant\":{\"In\":[],\"Out\":[{\"Name\":\"Variant\",\"Ident\":\"uuid.Variant\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"Version\":{\"In\":[],\"Out\":[{\"Name\":\"Version\",\"Ident\":\"uuid.Version\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]}}}},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":0,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"isRemote\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"uri\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"extensions\",\"type\":{\"Type\":3,\"Ident\":\"versia.Extensions\",\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"Extensions\",\"Ident\":\"versia.Extensions\",\"Kind\":21,\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"Methods\":{}}},\"default\":true,\"default_value\":{},\"default_kind\":21,\"position\":{\"Index\":3,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"created_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":4,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"updated_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"update_default\":true,\"position\":{\"Index\":5,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"name\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"description\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":1,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"host\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"unique\":true,\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"publicKey\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"position\":{\"Index\":3,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"publicKeyAlgorithm\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":4,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"privateKey\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"optional\":true,\"position\":{\"Index\":5,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"softwareName\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":6,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"softwareVersion\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":7,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"sharedInboxURI\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":8,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"moderatorsURI\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":9,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"adminsURI\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":10,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"logoEndpoint\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":11,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"logoMimeType\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":12,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"bannerEndpoint\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":13,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"bannerMimeType\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":14,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"supportedVersions\",\"type\":{\"Type\":3,\"Ident\":\"[]string\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":{\"Name\":\"\",\"Ident\":\"[]string\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":{}}},\"default\":true,\"default_value\":[],\"default_kind\":23,\"position\":{\"Index\":15,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"supportedExtensions\",\"type\":{\"Type\":3,\"Ident\":\"[]string\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":{\"Name\":\"\",\"Ident\":\"[]string\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":{}}},\"default\":true,\"default_value\":[],\"default_kind\":23,\"position\":{\"Index\":16,\"MixedIn\":false,\"MixinIndex\":0}}]},{\"name\":\"Note\",\"config\":{\"Table\":\"\"},\"edges\":[{\"name\":\"author\",\"type\":\"User\",\"unique\":true,\"required\":true},{\"name\":\"mentions\",\"type\":\"User\"},{\"name\":\"attachments\",\"type\":\"Attachment\"}],\"fields\":[{\"name\":\"id\",\"type\":{\"Type\":4,\"Ident\":\"uuid.UUID\",\"PkgPath\":\"github.com/google/uuid\",\"PkgName\":\"uuid\",\"Nillable\":false,\"RType\":{\"Name\":\"UUID\",\"Ident\":\"uuid.UUID\",\"Kind\":17,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":{\"ClockSequence\":{\"In\":[],\"Out\":[{\"Name\":\"int\",\"Ident\":\"int\",\"Kind\":2,\"PkgPath\":\"\",\"Methods\":null}]},\"Domain\":{\"In\":[],\"Out\":[{\"Name\":\"Domain\",\"Ident\":\"uuid.Domain\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"ID\":{\"In\":[],\"Out\":[{\"Name\":\"uint32\",\"Ident\":\"uint32\",\"Kind\":10,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalBinary\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalText\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"NodeID\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}]},\"Scan\":{\"In\":[{\"Name\":\"\",\"Ident\":\"interface {}\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"String\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"Time\":{\"In\":[],\"Out\":[{\"Name\":\"Time\",\"Ident\":\"uuid.Time\",\"Kind\":6,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"URN\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalBinary\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalText\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Value\":{\"In\":[],\"Out\":[{\"Name\":\"Value\",\"Ident\":\"driver.Value\",\"Kind\":20,\"PkgPath\":\"database/sql/driver\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Variant\":{\"In\":[],\"Out\":[{\"Name\":\"Variant\",\"Ident\":\"uuid.Variant\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"Version\":{\"In\":[],\"Out\":[{\"Name\":\"Version\",\"Ident\":\"uuid.Version\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]}}}},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":0,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"isRemote\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"uri\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"extensions\",\"type\":{\"Type\":3,\"Ident\":\"versia.Extensions\",\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"Extensions\",\"Ident\":\"versia.Extensions\",\"Kind\":21,\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"Methods\":{}}},\"default\":true,\"default_value\":{},\"default_kind\":21,\"position\":{\"Index\":3,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"created_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":4,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"updated_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"update_default\":true,\"position\":{\"Index\":5,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"subject\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"size\":384,\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"content\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"isSensitive\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_value\":false,\"default_kind\":1,\"position\":{\"Index\":2,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"visibility\",\"type\":{\"Type\":6,\"Ident\":\"note.Visibility\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"enums\":[{\"N\":\"public\",\"V\":\"public\"},{\"N\":\"unlisted\",\"V\":\"unlisted\"},{\"N\":\"followers\",\"V\":\"followers\"},{\"N\":\"direct\",\"V\":\"direct\"}],\"default\":true,\"default_value\":\"public\",\"default_kind\":24,\"position\":{\"Index\":3,\"MixedIn\":false,\"MixinIndex\":0}}]},{\"name\":\"User\",\"config\":{\"Table\":\"\"},\"edges\":[{\"name\":\"avatarImage\",\"type\":\"Image\",\"unique\":true},{\"name\":\"headerImage\",\"type\":\"Image\",\"unique\":true},{\"name\":\"authoredNotes\",\"type\":\"Note\",\"ref_name\":\"author\",\"inverse\":true},{\"name\":\"mentionedNotes\",\"type\":\"Note\",\"ref_name\":\"mentions\",\"inverse\":true},{\"name\":\"servers\",\"type\":\"InstanceMetadata\",\"ref_name\":\"users\",\"inverse\":true},{\"name\":\"moderatedServers\",\"type\":\"InstanceMetadata\",\"ref_name\":\"moderators\",\"inverse\":true},{\"name\":\"administeredServers\",\"type\":\"InstanceMetadata\",\"ref_name\":\"admins\",\"inverse\":true}],\"fields\":[{\"name\":\"id\",\"type\":{\"Type\":4,\"Ident\":\"uuid.UUID\",\"PkgPath\":\"github.com/google/uuid\",\"PkgName\":\"uuid\",\"Nillable\":false,\"RType\":{\"Name\":\"UUID\",\"Ident\":\"uuid.UUID\",\"Kind\":17,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":{\"ClockSequence\":{\"In\":[],\"Out\":[{\"Name\":\"int\",\"Ident\":\"int\",\"Kind\":2,\"PkgPath\":\"\",\"Methods\":null}]},\"Domain\":{\"In\":[],\"Out\":[{\"Name\":\"Domain\",\"Ident\":\"uuid.Domain\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"ID\":{\"In\":[],\"Out\":[{\"Name\":\"uint32\",\"Ident\":\"uint32\",\"Kind\":10,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalBinary\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"MarshalText\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"NodeID\":{\"In\":[],\"Out\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}]},\"Scan\":{\"In\":[{\"Name\":\"\",\"Ident\":\"interface {}\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"String\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"Time\":{\"In\":[],\"Out\":[{\"Name\":\"Time\",\"Ident\":\"uuid.Time\",\"Kind\":6,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"URN\":{\"In\":[],\"Out\":[{\"Name\":\"string\",\"Ident\":\"string\",\"Kind\":24,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalBinary\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"UnmarshalText\":{\"In\":[{\"Name\":\"\",\"Ident\":\"[]uint8\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":null}],\"Out\":[{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Value\":{\"In\":[],\"Out\":[{\"Name\":\"Value\",\"Ident\":\"driver.Value\",\"Kind\":20,\"PkgPath\":\"database/sql/driver\",\"Methods\":null},{\"Name\":\"error\",\"Ident\":\"error\",\"Kind\":20,\"PkgPath\":\"\",\"Methods\":null}]},\"Variant\":{\"In\":[],\"Out\":[{\"Name\":\"Variant\",\"Ident\":\"uuid.Variant\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]},\"Version\":{\"In\":[],\"Out\":[{\"Name\":\"Version\",\"Ident\":\"uuid.Version\",\"Kind\":8,\"PkgPath\":\"github.com/google/uuid\",\"Methods\":null}]}}}},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":0,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"isRemote\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":1,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"uri\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"extensions\",\"type\":{\"Type\":3,\"Ident\":\"versia.Extensions\",\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"Extensions\",\"Ident\":\"versia.Extensions\",\"Kind\":21,\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"Methods\":{}}},\"default\":true,\"default_value\":{},\"default_kind\":21,\"position\":{\"Index\":3,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"created_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"immutable\":true,\"position\":{\"Index\":4,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"updated_at\",\"type\":{\"Type\":2,\"Ident\":\"\",\"PkgPath\":\"time\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_kind\":19,\"update_default\":true,\"position\":{\"Index\":5,\"MixedIn\":true,\"MixinIndex\":0}},{\"name\":\"username\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"size\":32,\"unique\":true,\"validators\":2,\"position\":{\"Index\":0,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"passwordHash\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":1,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"displayName\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"size\":256,\"nillable\":true,\"optional\":true,\"validators\":1,\"position\":{\"Index\":2,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"biography\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"nillable\":true,\"optional\":true,\"position\":{\"Index\":3,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"publicKey\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"position\":{\"Index\":4,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"publicKeyActor\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":5,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"publicKeyAlgorithm\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"position\":{\"Index\":6,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"privateKey\",\"type\":{\"Type\":5,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":true,\"RType\":null},\"optional\":true,\"position\":{\"Index\":7,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"indexable\",\"type\":{\"Type\":1,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"default\":true,\"default_value\":true,\"default_kind\":1,\"position\":{\"Index\":8,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"privacyLevel\",\"type\":{\"Type\":6,\"Ident\":\"user.PrivacyLevel\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"enums\":[{\"N\":\"public\",\"V\":\"public\"},{\"N\":\"restricted\",\"V\":\"restricted\"},{\"N\":\"private\",\"V\":\"private\"}],\"default\":true,\"default_value\":\"public\",\"default_kind\":24,\"position\":{\"Index\":9,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"fields\",\"type\":{\"Type\":3,\"Ident\":\"[]versia.UserField\",\"PkgPath\":\"github.com/versia-pub/versia-go/pkg/versia\",\"PkgName\":\"versia\",\"Nillable\":true,\"RType\":{\"Name\":\"\",\"Ident\":\"[]versia.UserField\",\"Kind\":23,\"PkgPath\":\"\",\"Methods\":{}}},\"default\":true,\"default_value\":[],\"default_kind\":23,\"position\":{\"Index\":10,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"inbox\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":11,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"featured\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":12,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"followers\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":13,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"following\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":14,\"MixedIn\":false,\"MixinIndex\":0}},{\"name\":\"outbox\",\"type\":{\"Type\":7,\"Ident\":\"\",\"PkgPath\":\"\",\"PkgName\":\"\",\"Nillable\":false,\"RType\":null},\"validators\":1,\"position\":{\"Index\":15,\"MixedIn\":false,\"MixinIndex\":0}}]}],\"Features\":[\"schema/snapshot\",\"sql/upsert\"]}" diff --git a/ent/mutation.go b/ent/mutation.go index 18858ef..9550d11 100644 --- a/ent/mutation.go +++ b/ent/mutation.go @@ -12,14 +12,14 @@ import ( "entgo.io/ent" "entgo.io/ent/dialect/sql" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/follow" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/follow" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) const ( diff --git a/ent/note.go b/ent/note.go index ee22a7e..1481a8d 100644 --- a/ent/note.go +++ b/ent/note.go @@ -11,9 +11,9 @@ import ( "entgo.io/ent" "entgo.io/ent/dialect/sql" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // Note is the model entity for the Note schema. diff --git a/ent/note/note.go b/ent/note/note.go index be61f80..06b45fb 100644 --- a/ent/note/note.go +++ b/ent/note/note.go @@ -9,7 +9,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/pkg/versia" ) const ( diff --git a/ent/note/where.go b/ent/note/where.go index d408711..2428f3c 100644 --- a/ent/note/where.go +++ b/ent/note/where.go @@ -8,7 +8,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/predicate" ) // ID filters vertices based on their ID field. diff --git a/ent/note_create.go b/ent/note_create.go index 0148907..51e749f 100644 --- a/ent/note_create.go +++ b/ent/note_create.go @@ -13,10 +13,10 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // NoteCreate is the builder for creating a Note entity. diff --git a/ent/note_delete.go b/ent/note_delete.go index 842d6b9..8263979 100644 --- a/ent/note_delete.go +++ b/ent/note_delete.go @@ -8,8 +8,8 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/predicate" ) // NoteDelete is the builder for deleting a Note entity. diff --git a/ent/note_query.go b/ent/note_query.go index f9030ea..8f4f82c 100644 --- a/ent/note_query.go +++ b/ent/note_query.go @@ -12,10 +12,10 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" ) // NoteQuery is the builder for querying Note entities. diff --git a/ent/note_update.go b/ent/note_update.go index 69f7531..35bb92a 100644 --- a/ent/note_update.go +++ b/ent/note_update.go @@ -12,11 +12,11 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // NoteUpdate is the builder for updating Note entities. diff --git a/ent/runtime.go b/ent/runtime.go index 2a47994..945022c 100644 --- a/ent/runtime.go +++ b/ent/runtime.go @@ -6,14 +6,14 @@ import ( "time" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/attachment" - "github.com/lysand-org/versia-go/ent/follow" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/schema" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/attachment" + "github.com/versia-pub/versia-go/ent/follow" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/schema" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // The init function reads all schema descriptors with runtime code diff --git a/ent/runtime/runtime.go b/ent/runtime/runtime.go index dabd245..04aa9a3 100644 --- a/ent/runtime/runtime.go +++ b/ent/runtime/runtime.go @@ -2,7 +2,7 @@ package runtime -// The schema-stitching logic is generated in github.com/lysand-org/versia-go/ent/runtime.go +// The schema-stitching logic is generated in github.com/versia-pub/versia-go/ent/runtime.go const ( Version = "v0.13.1" // Version of ent codegen. diff --git a/ent/schema/lysand_entity.go b/ent/schema/lysand_entity.go index 9be1d17..9533926 100644 --- a/ent/schema/lysand_entity.go +++ b/ent/schema/lysand_entity.go @@ -5,7 +5,7 @@ import ( "entgo.io/ent/schema/field" "entgo.io/ent/schema/mixin" "github.com/google/uuid" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/pkg/versia" "net/url" "time" ) diff --git a/ent/schema/user.go b/ent/schema/user.go index baa5352..4f10bae 100644 --- a/ent/schema/user.go +++ b/ent/schema/user.go @@ -5,7 +5,7 @@ import ( "entgo.io/ent/schema/edge" "entgo.io/ent/schema/field" "errors" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/pkg/versia" "regexp" ) diff --git a/ent/user.go b/ent/user.go index d985b10..6838746 100644 --- a/ent/user.go +++ b/ent/user.go @@ -11,9 +11,9 @@ import ( "entgo.io/ent" "entgo.io/ent/dialect/sql" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // User is the model entity for the User schema. diff --git a/ent/user/user.go b/ent/user/user.go index 2882361..37330aa 100644 --- a/ent/user/user.go +++ b/ent/user/user.go @@ -9,7 +9,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/pkg/versia" ) const ( diff --git a/ent/user/where.go b/ent/user/where.go index ca2cd0d..b400fb9 100644 --- a/ent/user/where.go +++ b/ent/user/where.go @@ -8,7 +8,7 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/predicate" ) // ID filters vertices based on their ID field. diff --git a/ent/user_create.go b/ent/user_create.go index d10129a..942e9e2 100644 --- a/ent/user_create.go +++ b/ent/user_create.go @@ -13,11 +13,11 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // UserCreate is the builder for creating a User entity. diff --git a/ent/user_delete.go b/ent/user_delete.go index 5383f7b..a4298a6 100644 --- a/ent/user_delete.go +++ b/ent/user_delete.go @@ -8,8 +8,8 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" ) // UserDelete is the builder for deleting a User entity. diff --git a/ent/user_query.go b/ent/user_query.go index e5fa2bb..58a5780 100644 --- a/ent/user_query.go +++ b/ent/user_query.go @@ -12,11 +12,11 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" ) // UserQuery is the builder for querying User entities. diff --git a/ent/user_update.go b/ent/user_update.go index 60d4d88..a2972b1 100644 --- a/ent/user_update.go +++ b/ent/user_update.go @@ -13,12 +13,12 @@ import ( "entgo.io/ent/dialect/sql/sqljson" "entgo.io/ent/schema/field" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent/image" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/ent/image" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/pkg/versia" ) // UserUpdate is the builder for updating User entities. diff --git a/fiber_error_handler.go b/fiber_error_handler.go index 5397cd7..dca3921 100644 --- a/fiber_error_handler.go +++ b/fiber_error_handler.go @@ -5,8 +5,8 @@ import ( "git.devminer.xyz/devminer/unitel" "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/internal/api_schema" "github.com/rs/zerolog/log" + "github.com/versia-pub/versia-go/internal/api_schema" ) func fiberErrorHandler(c *fiber.Ctx, err error) error { diff --git a/go.mod b/go.mod index e6c6a15..72c3e9e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/lysand-org/versia-go +module github.com/versia-pub/versia-go go 1.22.5 diff --git a/internal/api_schema/notes.go b/internal/api_schema/notes.go index eb1cb86..08c6fdc 100644 --- a/internal/api_schema/notes.go +++ b/internal/api_schema/notes.go @@ -2,8 +2,7 @@ package api_schema import ( "github.com/google/uuid" - "github.com/lysand-org/versia-go/pkg/versia" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) type Note struct { @@ -13,7 +12,7 @@ type Note struct { type FetchNoteResponse = APIResponse[Note] type CreateNoteRequest struct { - Content string `json:"content" validate:"required,min=1,max=1024"` - Visibility versia.NoteVisibility `json:"visibility" validate:"required,oneof=public unlisted private direct"` - Mentions []versiautils.URL `json:"mentions"` + Content string `json:"content" validate:"required,min=1,max=1024"` + Group string `json:"group" validate:"required"` + Mentions []versiautils.URL `json:"mentions"` } diff --git a/internal/api_schema/users.go b/internal/api_schema/users.go index 651c718..134b752 100644 --- a/internal/api_schema/users.go +++ b/internal/api_schema/users.go @@ -2,7 +2,7 @@ package api_schema import ( "github.com/google/uuid" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/pkg/versia" ) type User struct { diff --git a/internal/database/transaction.go b/internal/database/transaction.go index ca0256b..70688b4 100644 --- a/internal/database/transaction.go +++ b/internal/database/transaction.go @@ -5,7 +5,7 @@ import ( "sync" "git.devminer.xyz/devminer/unitel" - "github.com/lysand-org/versia-go/ent" + "github.com/versia-pub/versia-go/ent" ) func BeginTx(ctx context.Context, db *ent.Client, telemetry *unitel.Telemetry) (*Tx, error) { diff --git a/internal/entity/follow.go b/internal/entity/follow.go index 1946048..deaffed 100644 --- a/internal/entity/follow.go +++ b/internal/entity/follow.go @@ -1,9 +1,9 @@ package entity import ( - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/pkg/versia" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/pkg/versia" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) type Follow struct { diff --git a/internal/entity/note.go b/internal/entity/note.go index e227223..9345579 100644 --- a/internal/entity/note.go +++ b/internal/entity/note.go @@ -1,9 +1,9 @@ package entity import ( - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/pkg/versia" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/pkg/versia" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) type Note struct { @@ -54,18 +54,18 @@ func (n Note) ToVersia() versia.Note { CreatedAt: versiautils.Time(n.CreatedAt), Extensions: n.Extensions, }, - Author: n.Author.URI, - Content: n.Content, - Category: nil, - Device: nil, - Previews: nil, + Author: n.Author.URI, + Content: n.Content, + Category: nil, + Device: nil, + Previews: nil, + // TODO: Get from database Group: nil, Attachments: nil, RepliesTo: nil, - Quoting: nil, + Quotes: nil, Mentions: n.MentionURIs, Subject: n.Subject, IsSensitive: &n.IsSensitive, - Visibility: versia.NoteVisibility(n.Visibility), } } diff --git a/internal/entity/server_metadata.go b/internal/entity/server_metadata.go index ee0e6b5..56ae8b0 100644 --- a/internal/entity/server_metadata.go +++ b/internal/entity/server_metadata.go @@ -1,10 +1,10 @@ package entity import ( - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/pkg/versia" - versiacrypto "github.com/lysand-org/versia-go/pkg/versia/crypto" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/pkg/versia" + versiacrypto "github.com/versia-pub/versia-go/pkg/versia/crypto" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) type InstanceMetadata struct { @@ -20,8 +20,8 @@ type InstanceMetadata struct { PublicKey *versiacrypto.SPKIPublicKey - Logo *versiautils.ImageContentTypeMap - Banner *versiautils.ImageContentTypeMap + Logo *versiautils.ImageContentMap + Banner *versiautils.ImageContentMap } func NewInstanceMetadata(dbData *ent.InstanceMetadata) (*InstanceMetadata, error) { diff --git a/internal/entity/user.go b/internal/entity/user.go index 66cfd7d..e1651ae 100644 --- a/internal/entity/user.go +++ b/internal/entity/user.go @@ -1,14 +1,14 @@ package entity import ( - "github.com/lysand-org/versia-go/internal/helpers" - "github.com/lysand-org/versia-go/pkg/versia" - versiacrypto "github.com/lysand-org/versia-go/pkg/versia/crypto" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/internal/helpers" + "github.com/versia-pub/versia-go/pkg/versia" + versiacrypto "github.com/versia-pub/versia-go/pkg/versia/crypto" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" "net/url" - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/internal/utils" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/internal/utils" ) type User struct { @@ -24,7 +24,7 @@ type User struct { Following *versiautils.URL DisplayName string - Avatar versiautils.ImageContentTypeMap + Avatar versiautils.ImageContentMap Biography versiautils.TextContentTypeMap Signer versiacrypto.Signer } @@ -93,7 +93,7 @@ func (u User) ToVersia() *versia.User { Username: u.Username, Avatar: u.Avatar, Header: imageMap(u.Edges.HeaderImage), - Indexable: u.Indexable, + Indexable: helpers.BoolPtr(u.Indexable), PublicKey: versia.UserPublicKey{ Actor: u.PKActorURI, Algorithm: u.PublicKeyAlgorithm, @@ -112,13 +112,13 @@ func (u User) ToVersia() *versia.User { } } -func userAvatar(u *ent.User) versiautils.ImageContentTypeMap { +func userAvatar(u *ent.User) versiautils.ImageContentMap { if avatar := imageMap(u.Edges.AvatarImage); avatar != nil { return avatar } - return versiautils.ImageContentTypeMap{ - "image/svg+xml": versiautils.ImageContent{ + return versiautils.ImageContentMap{ + "image/svg+xml": versiautils.File{ Content: utils.DefaultAvatarURL(u.ID), }, } @@ -138,7 +138,7 @@ func userBiography(u *ent.User) versiautils.TextContentTypeMap { } } -func imageMap(i *ent.Image) versiautils.ImageContentTypeMap { +func imageMap(i *ent.Image) versiautils.ImageContentMap { if i == nil { return nil } @@ -148,7 +148,7 @@ func imageMap(i *ent.Image) versiautils.ImageContentTypeMap { return nil } - return versiautils.ImageContentTypeMap{ + return versiautils.ImageContentMap{ i.MimeType: { Content: (*versiautils.URL)(u), }, diff --git a/internal/handlers/follow_handler/handler.go b/internal/handlers/follow_handler/handler.go index e1cf132..117be88 100644 --- a/internal/handlers/follow_handler/handler.go +++ b/internal/handlers/follow_handler/handler.go @@ -3,9 +3,9 @@ package follow_handler import ( "github.com/go-logr/logr" "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/config" - "github.com/lysand-org/versia-go/internal/service" - "github.com/lysand-org/versia-go/pkg/webfinger" + "github.com/versia-pub/versia-go/config" + "github.com/versia-pub/versia-go/internal/service" + "github.com/versia-pub/versia-go/pkg/webfinger" ) type Handler struct { diff --git a/internal/handlers/follow_handler/versia_follow_get.go b/internal/handlers/follow_handler/versia_follow_get.go index 01850ff..8fdc4fd 100644 --- a/internal/handlers/follow_handler/versia_follow_get.go +++ b/internal/handlers/follow_handler/versia_follow_get.go @@ -3,7 +3,7 @@ package follow_handler import ( "github.com/gofiber/fiber/v2" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/api_schema" ) func (i *Handler) GetVersiaFollow(c *fiber.Ctx) error { diff --git a/internal/handlers/meta_handler/handler.go b/internal/handlers/meta_handler/handler.go index cb8e685..624f860 100644 --- a/internal/handlers/meta_handler/handler.go +++ b/internal/handlers/meta_handler/handler.go @@ -3,9 +3,9 @@ package meta_handler import ( "github.com/go-logr/logr" "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/config" - "github.com/lysand-org/versia-go/internal/service" - "github.com/lysand-org/versia-go/pkg/webfinger" + "github.com/versia-pub/versia-go/config" + "github.com/versia-pub/versia-go/internal/service" + "github.com/versia-pub/versia-go/pkg/webfinger" ) type Handler struct { diff --git a/internal/handlers/note_handler/app_note_create.go b/internal/handlers/note_handler/app_note_create.go index 41fbe47..27b2576 100644 --- a/internal/handlers/note_handler/app_note_create.go +++ b/internal/handlers/note_handler/app_note_create.go @@ -2,7 +2,7 @@ package note_handler import ( "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/api_schema" ) func (i *Handler) CreateNote(c *fiber.Ctx) error { diff --git a/internal/handlers/note_handler/app_note_get.go b/internal/handlers/note_handler/app_note_get.go index a234e7c..3eb5994 100644 --- a/internal/handlers/note_handler/app_note_get.go +++ b/internal/handlers/note_handler/app_note_get.go @@ -3,7 +3,7 @@ package note_handler import ( "github.com/gofiber/fiber/v2" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/api_schema" ) func (i *Handler) GetNote(c *fiber.Ctx) error { diff --git a/internal/handlers/note_handler/handler.go b/internal/handlers/note_handler/handler.go index 878419b..2aa87b1 100644 --- a/internal/handlers/note_handler/handler.go +++ b/internal/handlers/note_handler/handler.go @@ -3,10 +3,10 @@ package note_handler import ( "github.com/go-logr/logr" "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/config" - "github.com/lysand-org/versia-go/internal/service" - "github.com/lysand-org/versia-go/internal/validators" - "github.com/lysand-org/versia-go/pkg/webfinger" + "github.com/versia-pub/versia-go/config" + "github.com/versia-pub/versia-go/internal/service" + "github.com/versia-pub/versia-go/internal/validators" + "github.com/versia-pub/versia-go/pkg/webfinger" ) type Handler struct { diff --git a/internal/handlers/user_handler/app_user_create.go b/internal/handlers/user_handler/app_user_create.go index c70a51d..0a272be 100644 --- a/internal/handlers/user_handler/app_user_create.go +++ b/internal/handlers/user_handler/app_user_create.go @@ -2,8 +2,8 @@ package user_handler import ( "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/internal/api_schema" ) func (i *Handler) CreateUser(c *fiber.Ctx) error { diff --git a/internal/handlers/user_handler/app_user_get.go b/internal/handlers/user_handler/app_user_get.go index 5a932ab..71ca65b 100644 --- a/internal/handlers/user_handler/app_user_get.go +++ b/internal/handlers/user_handler/app_user_get.go @@ -3,7 +3,7 @@ package user_handler import ( "github.com/gofiber/fiber/v2" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/api_schema" ) func (i *Handler) GetUser(c *fiber.Ctx) error { diff --git a/internal/handlers/user_handler/app_user_search.go b/internal/handlers/user_handler/app_user_search.go index ec3dca0..5b535a4 100644 --- a/internal/handlers/user_handler/app_user_search.go +++ b/internal/handlers/user_handler/app_user_search.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/internal/api_schema" - "github.com/lysand-org/versia-go/pkg/webfinger" + "github.com/versia-pub/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/pkg/webfinger" "net" "syscall" ) diff --git a/internal/handlers/user_handler/handler.go b/internal/handlers/user_handler/handler.go index ede00e4..3498372 100644 --- a/internal/handlers/user_handler/handler.go +++ b/internal/handlers/user_handler/handler.go @@ -3,8 +3,8 @@ package user_handler import ( "github.com/go-logr/logr" "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/internal/service" - "github.com/lysand-org/versia-go/internal/validators" + "github.com/versia-pub/versia-go/internal/service" + "github.com/versia-pub/versia-go/internal/validators" ) type Handler struct { diff --git a/internal/handlers/user_handler/versia_inbox.go b/internal/handlers/user_handler/versia_inbox.go index 78f20ea..ddbbdf7 100644 --- a/internal/handlers/user_handler/versia_inbox.go +++ b/internal/handlers/user_handler/versia_inbox.go @@ -4,12 +4,12 @@ import ( "encoding/json" "errors" "fmt" - "github.com/lysand-org/versia-go/internal/validators/val_impls" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/internal/validators/val_impls" + "github.com/versia-pub/versia-go/pkg/versia" "github.com/gofiber/fiber/v2" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/api_schema" ) func (i *Handler) HandleVersiaInbox(c *fiber.Ctx) error { diff --git a/internal/handlers/user_handler/versia_user_get.go b/internal/handlers/user_handler/versia_user_get.go index 57516a0..8a05d89 100644 --- a/internal/handlers/user_handler/versia_user_get.go +++ b/internal/handlers/user_handler/versia_user_get.go @@ -3,7 +3,7 @@ package user_handler import ( "github.com/gofiber/fiber/v2" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/api_schema" ) func (i *Handler) GetVersiaUser(c *fiber.Ctx) error { diff --git a/internal/handlers/user_handler/versia_webfinger.go b/internal/handlers/user_handler/versia_webfinger.go index ae44475..c7454ba 100644 --- a/internal/handlers/user_handler/versia_webfinger.go +++ b/internal/handlers/user_handler/versia_webfinger.go @@ -3,10 +3,10 @@ package user_handler import ( "errors" "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/config" - "github.com/lysand-org/versia-go/internal/api_schema" - "github.com/lysand-org/versia-go/internal/helpers" - "github.com/lysand-org/versia-go/pkg/webfinger" + "github.com/versia-pub/versia-go/config" + "github.com/versia-pub/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/helpers" + "github.com/versia-pub/versia-go/pkg/webfinger" ) func (i *Handler) Webfinger(c *fiber.Ctx) error { diff --git a/internal/helpers/ptr.go b/internal/helpers/ptr.go index b9af8d9..22d0084 100644 --- a/internal/helpers/ptr.go +++ b/internal/helpers/ptr.go @@ -3,3 +3,7 @@ package helpers func StringPtr(s string) *string { return &s } + +func BoolPtr(b bool) *bool { + return &b +} diff --git a/internal/repository/repo_impls/follow_repository_impl.go b/internal/repository/repo_impls/follow_repository_impl.go index 01a0f45..4e20b82 100644 --- a/internal/repository/repo_impls/follow_repository_impl.go +++ b/internal/repository/repo_impls/follow_repository_impl.go @@ -4,17 +4,17 @@ import ( "context" "errors" "fmt" - "github.com/lysand-org/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/repository" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/ent/follow" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/internal/entity" - "github.com/lysand-org/versia-go/internal/utils" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/ent/follow" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/utils" ) var ErrFollowAlreadyExists = errors.New("follow already exists") diff --git a/internal/repository/repo_impls/instance_metadata_repository_impl.go b/internal/repository/repo_impls/instance_metadata_repository_impl.go index 1f71fec..420d0c0 100644 --- a/internal/repository/repo_impls/instance_metadata_repository_impl.go +++ b/internal/repository/repo_impls/instance_metadata_repository_impl.go @@ -4,12 +4,12 @@ import ( "context" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/internal/entity" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/internal/service" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/service" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) var _ repository.InstanceMetadataRepository = (*InstanceMetadataRepositoryImpl)(nil) diff --git a/internal/repository/repo_impls/manager.go b/internal/repository/repo_impls/manager.go index b86dc0d..36ddec5 100644 --- a/internal/repository/repo_impls/manager.go +++ b/internal/repository/repo_impls/manager.go @@ -2,12 +2,12 @@ package repo_impls import ( "context" - "github.com/lysand-org/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/repository" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/internal/database" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/internal/database" ) type Factory[T any] func(db *ent.Client, log logr.Logger, telemetry *unitel.Telemetry) T diff --git a/internal/repository/repo_impls/note_repository_impl.go b/internal/repository/repo_impls/note_repository_impl.go index 28e1973..165fc51 100644 --- a/internal/repository/repo_impls/note_repository_impl.go +++ b/internal/repository/repo_impls/note_repository_impl.go @@ -2,16 +2,16 @@ package repo_impls import ( "context" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/pkg/versia" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/ent/note" - "github.com/lysand-org/versia-go/internal/entity" - "github.com/lysand-org/versia-go/internal/utils" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/ent/note" + "github.com/versia-pub/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/utils" ) var _ repository.NoteRepository = (*NoteRepositoryImpl)(nil) diff --git a/internal/repository/repo_impls/user_repository_impl.go b/internal/repository/repo_impls/user_repository_impl.go index 6f47e7f..b5f02c7 100644 --- a/internal/repository/repo_impls/user_repository_impl.go +++ b/internal/repository/repo_impls/user_repository_impl.go @@ -4,21 +4,21 @@ import ( "context" "crypto/ed25519" "errors" - "github.com/lysand-org/versia-go/config" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/internal/service" - "github.com/lysand-org/versia-go/pkg/versia" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/config" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/service" + "github.com/versia-pub/versia-go/pkg/versia" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" "golang.org/x/crypto/bcrypt" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" "github.com/google/uuid" - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/ent/predicate" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/internal/entity" - "github.com/lysand-org/versia-go/internal/utils" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/ent/predicate" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/utils" ) const bcryptCost = 12 @@ -106,7 +106,7 @@ func (i *UserRepositoryImpl) ImportVersiaUserByURI(ctx context.Context, uri *ver SetPublicKey(lUser.PublicKey.RawKey). SetPublicKeyAlgorithm(lUser.PublicKey.Algorithm). SetPublicKeyActor(lUser.PublicKey.Actor.String()). - SetIndexable(lUser.Indexable). + SetNillableIndexable(lUser.Indexable). SetFields(lUser.Fields). SetExtensions(lUser.Extensions). SetInbox(lUser.Inbox.String()). diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 256d391..b275021 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -3,11 +3,11 @@ package repository import ( "context" "crypto/ed25519" - "github.com/lysand-org/versia-go/pkg/versia" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/pkg/versia" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/entity" ) type UserRepository interface { diff --git a/internal/service/service.go b/internal/service/service.go index 4259830..0b409a5 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -3,15 +3,15 @@ package service import ( "context" "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/pkg/versia" - versiacrypto "github.com/lysand-org/versia-go/pkg/versia/crypto" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/pkg/versia" + versiacrypto "github.com/versia-pub/versia-go/pkg/versia/crypto" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/api_schema" - "github.com/lysand-org/versia-go/internal/entity" - "github.com/lysand-org/versia-go/pkg/webfinger" + "github.com/versia-pub/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/entity" + "github.com/versia-pub/versia-go/pkg/webfinger" ) type UserService interface { diff --git a/internal/service/svc_impls/Inbox_service_impl.go b/internal/service/svc_impls/Inbox_service_impl.go index 6c29c32..83a9e9e 100644 --- a/internal/service/svc_impls/Inbox_service_impl.go +++ b/internal/service/svc_impls/Inbox_service_impl.go @@ -3,16 +3,16 @@ package svc_impls import ( "context" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/internal/service" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/service" + "github.com/versia-pub/versia-go/pkg/versia" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/ent/user" - "github.com/lysand-org/versia-go/internal/api_schema" - "github.com/lysand-org/versia-go/internal/entity" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/ent/user" + "github.com/versia-pub/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/entity" ) var _ service.InboxService = (*InboxServiceImpl)(nil) diff --git a/internal/service/svc_impls/federation_service_impl.go b/internal/service/svc_impls/federation_service_impl.go index daf6af6..9c0ded7 100644 --- a/internal/service/svc_impls/federation_service_impl.go +++ b/internal/service/svc_impls/federation_service_impl.go @@ -10,13 +10,13 @@ import ( "fmt" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" - "github.com/lysand-org/versia-go/internal/entity" - "github.com/lysand-org/versia-go/internal/service" - "github.com/lysand-org/versia-go/pkg/protoretry" - "github.com/lysand-org/versia-go/pkg/versia" - versiacrypto "github.com/lysand-org/versia-go/pkg/versia/crypto" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" - "github.com/lysand-org/versia-go/pkg/webfinger" + "github.com/versia-pub/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/service" + "github.com/versia-pub/versia-go/pkg/protoretry" + "github.com/versia-pub/versia-go/pkg/versia" + versiacrypto "github.com/versia-pub/versia-go/pkg/versia/crypto" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/pkg/webfinger" "net/http" "net/url" ) diff --git a/internal/service/svc_impls/follow_service_impl.go b/internal/service/svc_impls/follow_service_impl.go index 50b5312..69f6a83 100644 --- a/internal/service/svc_impls/follow_service_impl.go +++ b/internal/service/svc_impls/follow_service_impl.go @@ -2,14 +2,14 @@ package svc_impls import ( "context" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/internal/service" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/service" + "github.com/versia-pub/versia-go/pkg/versia" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/entity" ) var _ service.FollowService = (*FollowServiceImpl)(nil) diff --git a/internal/service/svc_impls/instance_metadata_service_impl.go b/internal/service/svc_impls/instance_metadata_service_impl.go index 757cd64..5adc180 100644 --- a/internal/service/svc_impls/instance_metadata_service_impl.go +++ b/internal/service/svc_impls/instance_metadata_service_impl.go @@ -2,14 +2,14 @@ package svc_impls import ( "context" - "github.com/lysand-org/versia-go/config" - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/internal/service" + "github.com/versia-pub/versia-go/config" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/service" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" - "github.com/lysand-org/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/entity" ) var _ service.InstanceMetadataService = (*InstanceMetadataServiceImpl)(nil) diff --git a/internal/service/svc_impls/note_service_impl.go b/internal/service/svc_impls/note_service_impl.go index 7bed2f1..8e1c4c4 100644 --- a/internal/service/svc_impls/note_service_impl.go +++ b/internal/service/svc_impls/note_service_impl.go @@ -2,17 +2,17 @@ package svc_impls import ( "context" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/internal/service" - "github.com/lysand-org/versia-go/pkg/versia" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/service" + "github.com/versia-pub/versia-go/pkg/versia" "slices" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/api_schema" - "github.com/lysand-org/versia-go/internal/entity" - "github.com/lysand-org/versia-go/internal/tasks" + "github.com/versia-pub/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/tasks" ) var _ service.NoteService = (*NoteServiceImpl)(nil) diff --git a/internal/service/svc_impls/request_signer_impl.go b/internal/service/svc_impls/request_signer_impl.go index 3ec6fc6..4b19df9 100644 --- a/internal/service/svc_impls/request_signer_impl.go +++ b/internal/service/svc_impls/request_signer_impl.go @@ -7,8 +7,8 @@ import ( "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/internal/service" - versiacrypto "github.com/lysand-org/versia-go/pkg/versia/crypto" + "github.com/versia-pub/versia-go/internal/service" + versiacrypto "github.com/versia-pub/versia-go/pkg/versia/crypto" "net/url" ) diff --git a/internal/service/svc_impls/task_service_impl.go b/internal/service/svc_impls/task_service_impl.go index a2c6c67..c142741 100644 --- a/internal/service/svc_impls/task_service_impl.go +++ b/internal/service/svc_impls/task_service_impl.go @@ -2,11 +2,11 @@ package svc_impls import ( "context" - "github.com/lysand-org/versia-go/internal/service" + "github.com/versia-pub/versia-go/internal/service" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" - "github.com/lysand-org/versia-go/pkg/taskqueue" + "github.com/versia-pub/versia-go/pkg/taskqueue" ) var _ service.TaskService = (*TaskServiceImpl)(nil) diff --git a/internal/service/svc_impls/user_service_impl.go b/internal/service/svc_impls/user_service_impl.go index 98b45aa..2203490 100644 --- a/internal/service/svc_impls/user_service_impl.go +++ b/internal/service/svc_impls/user_service_impl.go @@ -4,19 +4,19 @@ import ( "context" "crypto/ed25519" "crypto/rand" - "github.com/lysand-org/versia-go/internal/api_schema" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/internal/service" + "github.com/versia-pub/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/service" "net/url" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" "github.com/google/uuid" - "github.com/lysand-org/versia-go/config" - "github.com/lysand-org/versia-go/ent/schema" - "github.com/lysand-org/versia-go/internal/entity" - "github.com/lysand-org/versia-go/internal/utils" - "github.com/lysand-org/versia-go/pkg/webfinger" + "github.com/versia-pub/versia-go/config" + "github.com/versia-pub/versia-go/ent/schema" + "github.com/versia-pub/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/utils" + "github.com/versia-pub/versia-go/pkg/webfinger" ) var _ service.UserService = (*UserServiceImpl)(nil) diff --git a/internal/tasks/federate_note.go b/internal/tasks/federate_note.go index b5412a8..7e0a9d3 100644 --- a/internal/tasks/federate_note.go +++ b/internal/tasks/federate_note.go @@ -2,10 +2,10 @@ package tasks import ( "context" - "github.com/lysand-org/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/repository" "github.com/google/uuid" - "github.com/lysand-org/versia-go/internal/entity" + "github.com/versia-pub/versia-go/internal/entity" ) type FederateNoteData struct { diff --git a/internal/tasks/handler.go b/internal/tasks/handler.go index 49e8400..0143760 100644 --- a/internal/tasks/handler.go +++ b/internal/tasks/handler.go @@ -3,12 +3,12 @@ package tasks import ( "context" "encoding/json" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/internal/service" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/service" "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" - "github.com/lysand-org/versia-go/pkg/taskqueue" + "github.com/versia-pub/versia-go/pkg/taskqueue" ) const ( diff --git a/internal/utils/urls.go b/internal/utils/urls.go index 36fc18a..76f5334 100644 --- a/internal/utils/urls.go +++ b/internal/utils/urls.go @@ -3,8 +3,8 @@ package utils import ( "fmt" "github.com/google/uuid" - "github.com/lysand-org/versia-go/config" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/config" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" "net/url" ) diff --git a/internal/validators/val_impls/body_validator_impl.go b/internal/validators/val_impls/body_validator_impl.go index 8c3f25e..ed6f100 100644 --- a/internal/validators/val_impls/body_validator_impl.go +++ b/internal/validators/val_impls/body_validator_impl.go @@ -2,8 +2,8 @@ package val_impls import ( "errors" - "github.com/lysand-org/versia-go/ent/schema" - "github.com/lysand-org/versia-go/internal/validators" + "github.com/versia-pub/versia-go/ent/schema" + "github.com/versia-pub/versia-go/internal/validators" "reflect" "regexp" "strings" @@ -13,7 +13,7 @@ import ( universal_translator "github.com/go-playground/universal-translator" "github.com/go-playground/validator/v10" en_translations "github.com/go-playground/validator/v10/translations/en" - "github.com/lysand-org/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/api_schema" ) type bodyValidator struct { diff --git a/internal/validators/val_impls/request_validator_impl.go b/internal/validators/val_impls/request_validator_impl.go index a8cb9c6..3fd4350 100644 --- a/internal/validators/val_impls/request_validator_impl.go +++ b/internal/validators/val_impls/request_validator_impl.go @@ -6,11 +6,11 @@ import ( "git.devminer.xyz/devminer/unitel" "github.com/go-logr/logr" "github.com/gofiber/fiber/v2" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/internal/utils" - "github.com/lysand-org/versia-go/internal/validators" - versiacrypto "github.com/lysand-org/versia-go/pkg/versia/crypto" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/utils" + "github.com/versia-pub/versia-go/internal/validators" + versiacrypto "github.com/versia-pub/versia-go/pkg/versia/crypto" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" "net/http" ) diff --git a/main.go b/main.go index 7c7cdfa..16d6b5a 100644 --- a/main.go +++ b/main.go @@ -10,15 +10,15 @@ import ( "fmt" "git.devminer.xyz/devminer/unitel/unitelhttp" "git.devminer.xyz/devminer/unitel/unitelsql" - "github.com/lysand-org/versia-go/ent/instancemetadata" - "github.com/lysand-org/versia-go/internal/api_schema" - "github.com/lysand-org/versia-go/internal/handlers/follow_handler" - "github.com/lysand-org/versia-go/internal/handlers/meta_handler" - "github.com/lysand-org/versia-go/internal/handlers/note_handler" - "github.com/lysand-org/versia-go/internal/repository" - "github.com/lysand-org/versia-go/internal/repository/repo_impls" - "github.com/lysand-org/versia-go/internal/service/svc_impls" - "github.com/lysand-org/versia-go/internal/validators/val_impls" + "github.com/versia-pub/versia-go/ent/instancemetadata" + "github.com/versia-pub/versia-go/internal/api_schema" + "github.com/versia-pub/versia-go/internal/handlers/follow_handler" + "github.com/versia-pub/versia-go/internal/handlers/meta_handler" + "github.com/versia-pub/versia-go/internal/handlers/note_handler" + "github.com/versia-pub/versia-go/internal/repository" + "github.com/versia-pub/versia-go/internal/repository/repo_impls" + "github.com/versia-pub/versia-go/internal/service/svc_impls" + "github.com/versia-pub/versia-go/internal/validators/val_impls" "net/http" "os" "os/signal" @@ -34,16 +34,16 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/cors" pgx "github.com/jackc/pgx/v5/stdlib" - "github.com/lysand-org/versia-go/config" - "github.com/lysand-org/versia-go/ent" - "github.com/lysand-org/versia-go/internal/database" - "github.com/lysand-org/versia-go/internal/handlers/user_handler" - "github.com/lysand-org/versia-go/internal/tasks" - "github.com/lysand-org/versia-go/internal/utils" - "github.com/lysand-org/versia-go/pkg/taskqueue" "github.com/nats-io/nats.go" "github.com/rs/zerolog" "github.com/rs/zerolog/log" + "github.com/versia-pub/versia-go/config" + "github.com/versia-pub/versia-go/ent" + "github.com/versia-pub/versia-go/internal/database" + "github.com/versia-pub/versia-go/internal/handlers/user_handler" + "github.com/versia-pub/versia-go/internal/tasks" + "github.com/versia-pub/versia-go/internal/utils" + "github.com/versia-pub/versia-go/pkg/taskqueue" "modernc.org/sqlite" ) diff --git a/pkg/versia/action_delete.go b/pkg/versia/action_delete.go index c854cf2..c27f748 100644 --- a/pkg/versia/action_delete.go +++ b/pkg/versia/action_delete.go @@ -2,7 +2,7 @@ package versia import ( "encoding/json" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) // Delete signals the deletion of an entity. For more information, see the [Spec]. diff --git a/pkg/versia/action_follow.go b/pkg/versia/action_follow.go index b0ddd86..18b918b 100644 --- a/pkg/versia/action_follow.go +++ b/pkg/versia/action_follow.go @@ -2,7 +2,7 @@ package versia import ( "encoding/json" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) // Follow defines a follow relationship between two users. For more information, see the [Spec]. diff --git a/pkg/versia/actor_group.go b/pkg/versia/actor_group.go index 1847f74..ac91b11 100644 --- a/pkg/versia/actor_group.go +++ b/pkg/versia/actor_group.go @@ -2,7 +2,7 @@ package versia import ( "encoding/json" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) // Group is a way to organize users and notes into communities. For more information, see the [Spec]. diff --git a/pkg/versia/actor_user.go b/pkg/versia/actor_user.go index 0f42f68..78543f4 100644 --- a/pkg/versia/actor_user.go +++ b/pkg/versia/actor_user.go @@ -2,54 +2,44 @@ package versia import ( "encoding/json" - versiacrypto "github.com/lysand-org/versia-go/pkg/versia/crypto" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + versiacrypto "github.com/versia-pub/versia-go/pkg/versia/crypto" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) -// User represents a user object in the Lysand protocol. For more information, see the [Spec]. +// User represents a user object in the Versia protocol. For more information, see the [Spec]. // -// [Spec]: https://lysand.org/objects/user +// [Spec]: https://versia.pub/entities/user type User struct { Entity - // PublicKey is the public key of the user. - // https://lysand.org/objects/user#public-key - PublicKey UserPublicKey `json:"public_key"` + // Avatar is the avatar of the user in different image content types. + Avatar versiautils.ImageContentMap `json:"avatar,omitempty"` + + // Bio is the biography of the user in different text content types. + Bio versiautils.TextContentTypeMap `json:"bio,omitempty"` // DisplayName is the display name of the user. - // https://lysand.org/objects/user#display-name DisplayName *string `json:"display_name,omitempty"` + // Fields is a list of fields that the user has filled out. + Fields []UserField `json:"fields"` + // Username is the username of the user. Must be unique on the instance and match the following regex: ^[a-z0-9_-]+$ - // https://lysand.org/objects/user#username Username string `json:"username"` - // Indexable is a boolean that indicates whether the user is indexable by search engines. - // https://lysand.org/objects/user#indexable - Indexable bool `json:"indexable"` - - // ManuallyApprovesFollowers is a boolean that indicates whether the user manually approves followers. - // https://lysand.org/objects/user#manually-approves-followers - ManuallyApprovesFollowers bool `json:"manually_approves_followers"` - - // Avatar is the avatar of the user in different image content types. - // https://lysand.org/objects/user#avatar - Avatar versiautils.ImageContentTypeMap `json:"avatar,omitempty"` - // Header is the header image of the user in different image content types. - // https://lysand.org/objects/user#header - Header versiautils.ImageContentTypeMap `json:"header,omitempty"` + Header versiautils.ImageContentMap `json:"header,omitempty"` - // Bio is the biography of the user in different text content types. - // https://lysand.org/objects/user#bio - Bio versiautils.TextContentTypeMap `json:"bio"` + // PublicKey is the public key of the user. + PublicKey UserPublicKey `json:"public_key"` - // Fields is a list of fields that the user has filled out. - // https://lysand.org/objects/user#fields - Fields []UserField `json:"fields,omitempty"` + // ManuallyApprovesFollowers is a boolean that indicates whether the user manually approves followers. + ManuallyApprovesFollowers *bool `json:"manually_approves_followers,omitempty"` + + // Indexable is a boolean that indicates whether the user is indexable by search engines. + Indexable *bool `json:"indexable,omitempty"` // Inbox is the inbox of the user. - // https://lysand.org/objects/user#posts Inbox *versiautils.URL `json:"inbox"` // Collections is a map of all collections for a user @@ -86,7 +76,7 @@ type UserCollections map[UserCollectionType]*versiautils.URL // UserPublicKey represents a public key for a user. For more information, see the [Spec]. // -// [Spec]: https://lysand.org/security/keys#public-key-cryptography +// [Spec]: https://versia.pub/signatures type UserPublicKey struct { Actor *versiautils.URL `json:"actor"` diff --git a/pkg/versia/attachment.go b/pkg/versia/attachment.go deleted file mode 100644 index bd10ceb..0000000 --- a/pkg/versia/attachment.go +++ /dev/null @@ -1,25 +0,0 @@ -package versia - -// Attachment is a file or other piece of content that is attached to a post. For more information, see the [Spec]. -// -// [Spec]: https://lysand.org/structures/content-format -type Attachment struct { - // URL to the attachment - Content string `json:"content"` - Description string `json:"description"` - Hash DataHash `json:"hash"` - Size int `json:"size"` - - // BlurHash is available when the content type is an image - BlurHash *string `json:"blurhash,omitempty"` - // BlurHash is available when the content type is an image - Height *int `json:"height,omitempty"` - // BlurHash is available when the content type is an image - Width *int `json:"width,omitempty"` - - FPS *int `json:"fps,omitempty"` -} - -type DataHash struct { - SHA256 string `json:"sha256"` -} diff --git a/pkg/versia/collection.go b/pkg/versia/collection.go index 4acf826..9d2237e 100644 --- a/pkg/versia/collection.go +++ b/pkg/versia/collection.go @@ -1,6 +1,6 @@ package versia -import versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" +import versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" // Collection is a paginated group of entities. For more information, see the [Spec]. // diff --git a/pkg/versia/crypto/federation_headers.go b/pkg/versia/crypto/federation_headers.go index 74f54b7..6f10eec 100644 --- a/pkg/versia/crypto/federation_headers.go +++ b/pkg/versia/crypto/federation_headers.go @@ -7,7 +7,7 @@ import ( "net/url" ) -// FederationHeaders represents the signature header of the Lysand protocol. For more information, see the [Spec]. +// FederationHeaders represents the signature header of the Versia protocol. For more information, see the [Spec]. // // [Spec]: https://versia.pub/signatures#signature-definition type FederationHeaders struct { diff --git a/pkg/versia/entity.go b/pkg/versia/entity.go index d786080..702815a 100644 --- a/pkg/versia/entity.go +++ b/pkg/versia/entity.go @@ -2,43 +2,30 @@ package versia import ( "github.com/google/uuid" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) -// Entity is the base type for all Lysand entities. For more information, see the [Spec]. +// Entity is the base type for all Versia entities. For more information, see the [Spec]. // -// [Spec]: https://lysand.org/objects#types +// [Spec]: https://versia.pub/entities type Entity struct { - // Type is the type of the entity - Type string `json:"type"` - // ID is a UUID for the entity ID uuid.UUID `json:"id"` - // URI is the URL to the entity - URI *versiautils.URL `json:"uri"` + // Type is the type of the entity + Type string `json:"type"` // CreatedAt is the time the entity was created CreatedAt versiautils.Time `json:"created_at"` - // Extensions is a map of active extensions - // https://lysand.org/objects/server-metadata#extensions + // URI is the URL to the entity + URI *versiautils.URL `json:"uri"` + + // Extensions is a map of active extensions for the entity Extensions Extensions `json:"extensions,omitempty"` } +// Extensions represents the active extensions on an entity. For more information, see the [Spec]. +// +// [Spec]: https://versia.pub/extensions#extension-definition type Extensions map[string]any - -// { -// "org.lysand:custom_emojis": { -// "emojis": [ -// { -// "name": "neocat_3c", -// "url": { -// "image/webp": { -// "content": "https://cdn.lysand.org/a97727158bf062ad31cbfb02e212ce0c7eca599a2f863276511b8512270b25e8/neocat_3c_256.webp" -// } -// } -// } -// ] -// } -// } diff --git a/pkg/versia/instance_metadata.go b/pkg/versia/instance_metadata.go index c8e70f5..2d66e0d 100644 --- a/pkg/versia/instance_metadata.go +++ b/pkg/versia/instance_metadata.go @@ -2,11 +2,11 @@ package versia import ( "encoding/json" - versiacrypto "github.com/lysand-org/versia-go/pkg/versia/crypto" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" + versiacrypto "github.com/versia-pub/versia-go/pkg/versia/crypto" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) -// InstanceMetadata represents the metadata of a Lysand instance. For more information, see the [Spec]. +// InstanceMetadata represents the metadata of a Versia instance. For more information, see the [Spec]. // // ! Unlike other entities, instance metadata is not meant to be federated. // @@ -43,15 +43,15 @@ type InstanceMetadata struct { Admins *versiautils.URL `json:"admins,omitempty"` // Logo is the URL to the instance's logo - Logo *versiautils.ImageContentTypeMap `json:"logo,omitempty"` + Logo *versiautils.ImageContentMap `json:"logo,omitempty"` // Banner is the URL to the instance's banner - Banner *versiautils.ImageContentTypeMap `json:"banner,omitempty"` + Banner *versiautils.ImageContentMap `json:"banner,omitempty"` // Software is information about the instance software Software InstanceSoftware `json:"software"` - // Compatibility is information about the instance's compatibility with different Lysand versions + // Compatibility is information about the instance's compatibility with different Versia versions Compatibility InstanceCompatibility `json:"compatibility"` } @@ -62,7 +62,7 @@ func (s InstanceMetadata) MarshalJSON() ([]byte, error) { return json.Marshal(s2) } -// InstanceSoftware represents the software of a Lysand instance. +// InstanceSoftware represents the software of a Versia instance. type InstanceSoftware struct { // Name is the name of the instance software Name string `json:"name"` @@ -70,9 +70,9 @@ type InstanceSoftware struct { Version string `json:"version"` } -// InstanceCompatibility represents the compatibility of a Lysand instance. +// InstanceCompatibility represents the compatibility of a Versia instance. type InstanceCompatibility struct { - // Versions is a list of versions of Lysand the instance is compatible with + // Versions is a list of versions of Versia the instance is compatible with Versions []string `json:"versions"` // Extensions is a list of extensions supported by the instance diff --git a/pkg/versia/note.go b/pkg/versia/note.go index 44e2930..403a939 100644 --- a/pkg/versia/note.go +++ b/pkg/versia/note.go @@ -2,23 +2,7 @@ package versia import ( "encoding/json" - versiautils "github.com/lysand-org/versia-go/pkg/versia/utils" -) - -// NoteVisibility is the visibility of a note. For more information, see the [Spec]. -// -// [Spec]: https://lysand.org/objects/publications#visibility -type NoteVisibility string - -const ( - // NoteVisiblePublic means that the Note is visible to everyone. - NoteVisiblePublic NoteVisibility = "public" - // NoteVisibleUnlisted means that the Note is visible everyone, but should not appear in public timelines and search results. - NoteVisibleUnlisted NoteVisibility = "unlisted" - // NoteVisibleFollowers means that the Note is visible to followers only. - NoteVisibleFollowers NoteVisibility = "followers" - // NoteVisibleDirect means that the Note is a direct message, and is visible only to the mentioned users. - NoteVisibleDirect NoteVisibility = "direct" + versiautils "github.com/versia-pub/versia-go/pkg/versia/utils" ) // Note is a published message, similar to a tweet (from Twitter) or a toot (from Mastodon). @@ -28,57 +12,42 @@ const ( type Note struct { Entity + // Attachments is a list of attachment objects, keyed by their MIME type + Attachments []versiautils.NoteAttachmentContentMap `json:"attachments,omitempty"` + // Author is the URL to the user - // https://lysand.org/objects/publications#author Author *versiautils.URL `json:"author"` - // Content is the content of the publication - // https://lysand.org/objects/publications#content - Content versiautils.TextContentTypeMap `json:"content,omitempty"` - - // Category is the category of the publication - // https://lysand.org/objects/publications#category + // Category is the category of the note Category *CategoryType `json:"category,omitempty"` - // Device that created the publication - // https://lysand.org/objects/publications#device - Device *Device `json:"device,omitempty"` + // Content is the content of the note + Content versiautils.TextContentTypeMap `json:"content,omitempty"` - // Previews is a list of URLs to preview images - // https://lysand.org/objects/publications#previews - Previews []LinkPreview `json:"previews,omitempty"` + // Device that created the note + Device *Device `json:"device,omitempty"` // Group is the URL to a group - // https://lysand.org/objects/publications#group + // TODO: Properly parse these, can be "public" | "followers" as well Group *versiautils.URL `json:"group,omitempty"` - // Attachments is a list of attachment objects, keyed by their MIME type - // https://lysand.org/objects/publications#attachments - Attachments []versiautils.ContentTypeMap[Attachment] `json:"attachments,omitempty"` - - // RepliesTo is the URL to the publication being replied to - // https://lysand.org/objects/publications#replies-to - RepliesTo *versiautils.URL `json:"replies_to,omitempty"` - - // Quoting is the URL to the publication being quoted - // https://lysand.org/objects/publications#quotes - Quoting *versiautils.URL `json:"quoting,omitempty"` + // IsSensitive is a boolean indicating whether the note contains sensitive content + IsSensitive *bool `json:"is_sensitive,omitempty"` // Mentions is a list of URLs to users - // https://lysand.org/objects/publications#mentionshttps://lysand.org/objects/publications#mentions Mentions []versiautils.URL `json:"mentions,omitempty"` - // Subject is the subject of the publication - // https://lysand.org/objects/publications#subject - Subject *string `json:"subject,omitempty"` + // Previews is a list of URLs to preview images + Previews []LinkPreview `json:"previews,omitempty"` - // IsSensitive is a boolean indicating whether the publication contains sensitive content - // https://lysand.org/objects/publications#is-sensitive - IsSensitive *bool `json:"is_sensitive,omitempty"` + // Quotes is the URL to the note being quoted + Quotes *versiautils.URL `json:"quotes,omitempty"` - // Visibility is the visibility of the publication - // https://lysand.org/objects/publications#visibility - Visibility NoteVisibility `json:"visibility"` + // RepliesTo is the URL to the note being replied to + RepliesTo *versiautils.URL `json:"replies_to,omitempty"` + + // Subject is the subject of the note + Subject *string `json:"subject,omitempty"` } func (p Note) MarshalJSON() ([]byte, error) { @@ -90,27 +59,27 @@ func (p Note) MarshalJSON() ([]byte, error) { // LinkPreview is a preview of a link. For more information, see the [Spec]. // -// [Spec]: https://lysand.org/objects/publications#types +// [Spec]: https://versia.pub/entities/note#entity-definition type LinkPreview struct { Link *versiautils.URL `json:"link"` Title string `json:"title"` - Description *string `json:"description"` - Image *versiautils.URL `json:"image"` - Icon *versiautils.URL `json:"icon"` + Description *string `json:"description,omitempty"` + Image *versiautils.URL `json:"image,omitempty"` + Icon *versiautils.URL `json:"icon,omitempty"` } -// Device is the device that creates publications. For more information, see the [Spec]. +// Device is the device that creates note. For more information, see the [Spec]. // -// [Spec]: https://lysand.org/objects/publications#types +// [Spec]: https://versia.pub/entities/note#entity-definition type Device struct { Name string `json:"name"` Version string `json:"version,omitempty"` URL *versiautils.URL `json:"url,omitempty"` } -// CategoryType is the type of publication. For more information, see the [Spec]. +// CategoryType is the type of note. For more information, see the [Spec]. // -// [Spec]: https://lysand.org/objects/publications#types +// [Spec]: https://versia.pub/entities/note#entity-definition type CategoryType string const ( diff --git a/pkg/versia/utils/content_map.go b/pkg/versia/utils/content_map.go new file mode 100644 index 0000000..2eb4f39 --- /dev/null +++ b/pkg/versia/utils/content_map.go @@ -0,0 +1,150 @@ +package versiautils + +import ( + "encoding/json" + "errors" + "fmt" + "slices" +) + +var ( + validTextContentTypes = []string{"text/html", "text/plain"} + validImageContentTypes = []string{"image/png", "image/jpeg", "image/gif", "image/svg+xml"} +) + +// ContentMap is a map of content types to their respective content. +type ContentMap[T any] map[string]T + +type UnexpectedContentTypeError struct { + MIMEType string +} + +func (e UnexpectedContentTypeError) Error() string { + return fmt.Sprintf("unexpected content type: %s", e.MIMEType) +} + +func (m ContentMap[T]) unmarshalJSON(raw []byte, valid []string) error { + var cm map[string]json.RawMessage + if err := json.Unmarshal(raw, &cm); err != nil { + return err + } + + m = make(ContentMap[T]) + + errs := make([]error, 0) + for k, v := range cm { + if valid != nil { + if !slices.Contains(valid, k) { + errs = append(errs, UnexpectedContentTypeError{k}) + continue + } + } + + var c T + if err := json.Unmarshal(v, &c); err != nil { + errs = append(errs, err) + continue + } + m[k] = c + } + if len(errs) > 0 { + return MultipleError{errs} + } + + return nil +} + +func (m ContentMap[T]) getPreferred(preferred []string) *T { + for _, v := range preferred { + if c, ok := m[v]; ok { + return &c + } + } + + return nil +} + +// TextContent is embedded string. For more information, see the [Spec]. +// +// [Spec]: https://versia.pub/structures/content-format +type TextContent struct { + Content string `json:"content"` + + // Remote is always false + Remote bool `json:"remote"` +} +type TextContentTypeMap ContentMap[TextContent] + +func (t TextContentTypeMap) UnmarshalJSON(data []byte) error { + return (ContentMap[TextContent])(t).unmarshalJSON(data, validTextContentTypes) +} + +func (t TextContentTypeMap) String() string { + if c := (ContentMap[TextContent])(t).getPreferred(validTextContentTypes); c != nil { + return c.Content + } + + return "" +} + +// File is a file or other piece of content. For more information, see the [Spec]. +// +// [Spec]: https://versia.pub/structures/content-format +type File struct { + // Remote is always true + Remote bool `json:"remote"` + + // URL to the attachment + Content *URL `json:"content"` + Description string `json:"description"` + Hash DataHash `json:"hash"` + Size int `json:"size"` + + // BlurHash is available when the content type is an image + BlurHash *string `json:"blurhash,omitempty"` + // BlurHash is available when the content type is an image + Height *int `json:"height,omitempty"` + // BlurHash is available when the content type is an image + Width *int `json:"width,omitempty"` + + FPS *int `json:"fps,omitempty"` +} +type DataHash struct { + SHA256 string `json:"sha256"` +} + +type ImageContentMap ContentMap[File] + +func (i ImageContentMap) UnmarshalJSON(data []byte) error { + return (ContentMap[File])(i).unmarshalJSON(data, validImageContentTypes) +} + +func (i ImageContentMap) String() string { + if c := (ContentMap[File])(i).getPreferred(validImageContentTypes); c != nil { + return c.Content.String() + } + + return "" +} + +type NoteAttachmentContentMap ContentMap[File] + +var ErrContentMapEntryNotRemote = errors.New("content map entry not remote") + +func (i NoteAttachmentContentMap) UnmarshalJSON(data []byte) error { + if err := (ContentMap[File])(i).unmarshalJSON(data, nil); err != nil { + return err + } + + errs := make([]error, 0) + for _, a := range i { + if !a.Remote { + errs = append(errs, ErrContentMapEntryNotRemote) + } + } + if len(errs) > 0 { + return MultipleError{errs} + } + + return nil +} diff --git a/pkg/versia/utils/content_types.go b/pkg/versia/utils/content_types.go deleted file mode 100644 index 5de526d..0000000 --- a/pkg/versia/utils/content_types.go +++ /dev/null @@ -1,85 +0,0 @@ -package versiautils - -import ( - "encoding/json" - "slices" - - "github.com/rs/zerolog/log" -) - -var ( - validTextContentTypes = []string{"text/html", "text/plain"} - validImageContentTypes = []string{"image/png", "image/jpeg", "image/gif", "image/svg+xml"} -) - -// ContentTypeMap is a map of content types to their respective content. -type ContentTypeMap[T any] map[string]T - -func (m *ContentTypeMap[T]) unmarshalJSON(raw []byte, valid []string) error { - var cm map[string]json.RawMessage - if err := json.Unmarshal(raw, &cm); err != nil { - return err - } - - *m = make(ContentTypeMap[T]) - - for k, v := range cm { - if !slices.Contains(valid, k) { - // TODO: replace with logr - log.Debug().Caller().Str("mimetype", k).Msg("unexpected content type, skipping") - continue - } - - var c T - if err := json.Unmarshal(v, &c); err != nil { - return err - } - (*m)[k] = c - } - - return nil -} - -func (m ContentTypeMap[T]) getPreferred(preferred []string) *T { - for _, v := range preferred { - if c, ok := m[v]; ok { - return &c - } - } - - return nil -} - -type TextContent struct { - Content string `json:"content"` -} -type TextContentTypeMap ContentTypeMap[TextContent] - -func (t *TextContentTypeMap) UnmarshalJSON(data []byte) error { - return (*ContentTypeMap[TextContent])(t).unmarshalJSON(data, validTextContentTypes) -} - -func (t TextContentTypeMap) String() string { - if c := (ContentTypeMap[TextContent])(t).getPreferred(validTextContentTypes); c != nil { - return c.Content - } - - return "" -} - -type ImageContent struct { - Content *URL `json:"content"` -} -type ImageContentTypeMap ContentTypeMap[ImageContent] - -func (i *ImageContentTypeMap) UnmarshalJSON(data []byte) error { - return (*ContentTypeMap[ImageContent])(i).unmarshalJSON(data, validImageContentTypes) -} - -func (i ImageContentTypeMap) String() string { - if c := (ContentTypeMap[ImageContent])(i).getPreferred(validImageContentTypes); c != nil { - return c.Content.String() - } - - return "" -} diff --git a/pkg/versia/utils/errors.go b/pkg/versia/utils/errors.go new file mode 100644 index 0000000..4a860dc --- /dev/null +++ b/pkg/versia/utils/errors.go @@ -0,0 +1,22 @@ +package versiautils + +import ( + "strings" +) + +type MultipleError struct { + Errors []error +} + +func (e MultipleError) Error() string { + s := strings.Builder{} + for i, err := range e.Errors { + s.WriteString(err.Error()) + + if i != len(e.Errors) { + s.WriteRune('\n') + } + } + + return s.String() +} diff --git a/pkg/webfinger/webfinger.go b/pkg/webfinger/webfinger.go index 0ab0287..9f7ca0a 100644 --- a/pkg/webfinger/webfinger.go +++ b/pkg/webfinger/webfinger.go @@ -5,7 +5,7 @@ import ( "encoding/json" "errors" "fmt" - "github.com/lysand-org/versia-go/pkg/protoretry" + "github.com/versia-pub/versia-go/pkg/protoretry" "net/http" "net/url" "strings"