mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09:16 +01:00
Add new API endpoint (accounts/verify_credentials)
This commit is contained in:
parent
e25b745e25
commit
ce2ed0754e
11 changed files with 234 additions and 181 deletions
|
|
@ -112,7 +112,7 @@ export class RawActor extends BaseEntity {
|
|||
username: this.data.preferredUsername ?? "",
|
||||
display_name: this.data.name ?? this.data.preferredUsername ?? "",
|
||||
note: this.data.summary ?? "",
|
||||
url: `${config.http.base_url}:${config.http.port}/@${
|
||||
url: `${config.http.base_url}/@${
|
||||
this.data.preferredUsername
|
||||
}@${this.getInstanceDomain()}`,
|
||||
// @ts-expect-error It actually works
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { appendFile } from "fs/promises";
|
|||
import { APIStatus } from "~types/entities/status";
|
||||
import { RawActor } from "./RawActor";
|
||||
import { APIAccount } from "~types/entities/account";
|
||||
import { User } from "./User";
|
||||
|
||||
/**
|
||||
* Stores an ActivityPub object as raw JSON-LD data
|
||||
|
|
@ -28,10 +27,6 @@ export class RawObject extends BaseEntity {
|
|||
.getOne();
|
||||
}
|
||||
|
||||
async isPinned() {
|
||||
|
||||
}
|
||||
|
||||
async toAPI(): Promise<APIStatus> {
|
||||
return {
|
||||
account:
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import { APActor } from "activitypub-types";
|
|||
import { RawObject } from "./RawObject";
|
||||
import { Token } from "./Token";
|
||||
import { Status } from "./Status";
|
||||
import { APISource } from "~types/entities/source";
|
||||
|
||||
const config = getConfig();
|
||||
|
||||
|
|
@ -57,6 +58,9 @@ export class User extends BaseEntity {
|
|||
})
|
||||
is_admin!: boolean;
|
||||
|
||||
@Column("jsonb")
|
||||
source!: APISource;
|
||||
|
||||
@Column("varchar")
|
||||
avatar!: string;
|
||||
|
||||
|
|
@ -124,6 +128,14 @@ export class User extends BaseEntity {
|
|||
user.avatar = data.avatar ?? config.defaults.avatar;
|
||||
user.header = data.header ?? config.defaults.avatar;
|
||||
|
||||
user.source = {
|
||||
language: null,
|
||||
note: "",
|
||||
privacy: "public",
|
||||
sensitive: false,
|
||||
fields: [],
|
||||
};
|
||||
|
||||
user.followers = [];
|
||||
user.following = [];
|
||||
|
||||
|
|
@ -257,7 +269,6 @@ export class User extends BaseEntity {
|
|||
emojis: [],
|
||||
fields: [],
|
||||
limited: false,
|
||||
source: undefined,
|
||||
statuses_count: 0,
|
||||
discoverable: undefined,
|
||||
role: undefined,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue