hippofish/packages/backend/src/models/schema/antenna.ts
Kaity A 4ca445b587 Implementation of an instances wide antenna source. (#9604)
This PR contains new source for antenna posts, which is a list of instance hostnames to process all posts from.

Using this mode, a user can filter for keywords on an instance wide basis.

This change includes a new antenna source called `instances` and a new database column in the `antenna` table called `instances` to store the instance names.

On the antenna editor, there's also an "Add an instance" finder dialog to allow users to search through the known instance hostnames.

Co-authored-by: Kaity A <supakaity@blahaj.zone>
Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9604
Co-authored-by: Kaity A <supakaity@noreply.codeberg.org>
Co-committed-by: Kaity A <supakaity@noreply.codeberg.org>
2023-02-12 01:20:17 +00:00

118 lines
1.9 KiB
TypeScript

export const packedAntennaSchema = {
type: "object",
properties: {
id: {
type: "string",
optional: false,
nullable: false,
format: "id",
},
createdAt: {
type: "string",
optional: false,
nullable: false,
format: "date-time",
},
name: {
type: "string",
optional: false,
nullable: false,
},
keywords: {
type: "array",
optional: false,
nullable: false,
items: {
type: "array",
optional: false,
nullable: false,
items: {
type: "string",
optional: false,
nullable: false,
},
},
},
excludeKeywords: {
type: "array",
optional: false,
nullable: false,
items: {
type: "array",
optional: false,
nullable: false,
items: {
type: "string",
optional: false,
nullable: false,
},
},
},
src: {
type: "string",
optional: false,
nullable: false,
enum: ["home", "all", "users", "list", "group", "instances"],
},
userListId: {
type: "string",
optional: false,
nullable: true,
format: "id",
},
userGroupId: {
type: "string",
optional: false,
nullable: true,
format: "id",
},
users: {
type: "array",
optional: false,
nullable: false,
items: {
type: "string",
optional: false,
nullable: false,
},
},
instances: {
type: "array",
optional: false,
nullable: false,
items: {
type: "string",
optional: false,
nullable: false,
},
},
caseSensitive: {
type: "boolean",
optional: false,
nullable: false,
default: false,
},
notify: {
type: "boolean",
optional: false,
nullable: false,
},
withReplies: {
type: "boolean",
optional: false,
nullable: false,
default: false,
},
withFile: {
type: "boolean",
optional: false,
nullable: false,
},
hasUnreadNote: {
type: "boolean",
optional: false,
nullable: false,
default: false,
},
},
} as const;