diff --git a/frontend-reactive/app/models/account.js b/frontend-reactive/app/models/account.js deleted file mode 100644 index df3d98b..0000000 --- a/frontend-reactive/app/models/account.js +++ /dev/null @@ -1,3 +0,0 @@ -import Model from '@ember-data/model'; - -export default class AccountModel extends Model {} diff --git a/frontend-reactive/app/models/account.ts b/frontend-reactive/app/models/account.ts new file mode 100644 index 0000000..5caee9d --- /dev/null +++ b/frontend-reactive/app/models/account.ts @@ -0,0 +1,30 @@ +import Model, { attr, hasMany, type AsyncHasMany } from '@ember-data/model' +import type RemoteServerModel from './remote-server' +import type CustomAccountFieldModel from './custom-account-field' +import type MediaMetadataModel from './media-metadata' + +export default class AccountModel extends Model { + @attr declare createdAt: Date + @attr declare updatedAt: Date + @attr declare username: string + @attr declare originServer: RemoteServerModel + @attr declare originServerId: number + @attr declare displayName: string + @hasMany('custom-account-field') + declare customFields: AsyncHasMany + @attr declare customFieldIds: Array + @attr declare isBot: boolean + @attr declare description: string + @attr declare icon: MediaMetadataModel + @attr declare iconId: string + @attr declare banner: MediaMetadataModel + @attr declare bannerId: string + @attr declare background: MediaMetadataModel + @attr declare backgroundId: string + @attr declare relationIds: Array + @attr declare indexable: boolean + @attr declare restrictedFollow: boolean + @attr declare identifiesAs: Array + @attr declare pronouns: Array + @attr declare roles: Array +} diff --git a/frontend-reactive/app/models/custom-account-field.js b/frontend-reactive/app/models/custom-account-field.js deleted file mode 100644 index 133cdb8..0000000 --- a/frontend-reactive/app/models/custom-account-field.js +++ /dev/null @@ -1,3 +0,0 @@ -import Model from '@ember-data/model'; - -export default class CustomAccountFieldModel extends Model {} diff --git a/frontend-reactive/app/models/custom-account-field.ts b/frontend-reactive/app/models/custom-account-field.ts new file mode 100644 index 0000000..db00952 --- /dev/null +++ b/frontend-reactive/app/models/custom-account-field.ts @@ -0,0 +1,10 @@ +import Model, { attr } from '@ember-data/model' + +export default class CustomAccountFieldModel extends Model { + @attr declare createdAt: Date + @attr declare updatedAt: Date + @attr declare key: string + @attr declare value: string + @attr declare verified?: boolean + @attr declare belongsToId: string +} diff --git a/frontend-reactive/app/models/emote.js b/frontend-reactive/app/models/emote.js deleted file mode 100644 index 28f7588..0000000 --- a/frontend-reactive/app/models/emote.js +++ /dev/null @@ -1,3 +0,0 @@ -import Model from '@ember-data/model'; - -export default class EmoteModel extends Model {} diff --git a/frontend-reactive/app/models/emote.ts b/frontend-reactive/app/models/emote.ts new file mode 100644 index 0000000..a483915 --- /dev/null +++ b/frontend-reactive/app/models/emote.ts @@ -0,0 +1,11 @@ +import Model, { attr } from '@ember-data/model' +import type MediaMetadataModel from './media-metadata' +import type RemoteServerModel from './remote-server' + +export default class EmoteModel extends Model { + @attr declare metadataId: string + @attr declare metadata: MediaMetadataModel + @attr declare name: string + @attr declare serverId: number + @attr declare server: RemoteServerModel +} diff --git a/frontend-reactive/app/models/media-metadata.js b/frontend-reactive/app/models/media-metadata.js deleted file mode 100644 index b61d8ef..0000000 --- a/frontend-reactive/app/models/media-metadata.js +++ /dev/null @@ -1,3 +0,0 @@ -import Model from '@ember-data/model'; - -export default class MediaMetadataModel extends Model {} diff --git a/frontend-reactive/app/models/media-metadata.ts b/frontend-reactive/app/models/media-metadata.ts new file mode 100644 index 0000000..2f2986e --- /dev/null +++ b/frontend-reactive/app/models/media-metadata.ts @@ -0,0 +1,12 @@ +import Model, { attr } from '@ember-data/model' + +export default class MediaMetadataModel extends Model { + @attr declare createdAt: Date + @attr declare updatedAt: Date + @attr declare isRemote: boolean + @attr declare url: string + @attr declare mimeType: string + @attr declare name: string + @attr declare altText: string + @attr declare blurred: boolean +} diff --git a/frontend-reactive/app/models/note.js b/frontend-reactive/app/models/note.js deleted file mode 100644 index 5f32ce2..0000000 --- a/frontend-reactive/app/models/note.js +++ /dev/null @@ -1,3 +0,0 @@ -import Model from '@ember-data/model'; - -export default class NoteModel extends Model {} diff --git a/frontend-reactive/app/models/note.ts b/frontend-reactive/app/models/note.ts new file mode 100644 index 0000000..cabc14b --- /dev/null +++ b/frontend-reactive/app/models/note.ts @@ -0,0 +1,26 @@ +import Model, { attr, hasMany, type AsyncHasMany } from '@ember-data/model' +import type RemoteServerModel from './remote-server' +import type AccountModel from './account' +import type MediaMetadataModel from './media-metadata' + +export default class NoteModel extends Model { + @attr declare content: string + @attr declare originServer: RemoteServerModel + @attr declare originServerId: number + @attr declare reactionCount: number + @attr declare createdAt: Date + @attr declare updatedAt: Date + @attr declare author: AccountModel + @attr declare authorId: string + @attr declare contentWarning?: string + @attr declare inReplyToId?: string + @attr declare quotesId?: string + @attr declare emoteIds?: Array + @hasMany('media-metadata') + declare attachments: AsyncHasMany + @attr declare attachmentIds: Array + @attr declare accessLevel: number + @hasMany('account') declare pings?: AsyncHasMany + @attr declare pingIds?: Array + @attr declare reactionIds: Array +} diff --git a/frontend-reactive/app/models/reaction.js b/frontend-reactive/app/models/reaction.js deleted file mode 100644 index 4b509e7..0000000 --- a/frontend-reactive/app/models/reaction.js +++ /dev/null @@ -1,3 +0,0 @@ -import Model from '@ember-data/model'; - -export default class ReactionModel extends Model {} diff --git a/frontend-reactive/app/models/reaction.ts b/frontend-reactive/app/models/reaction.ts new file mode 100644 index 0000000..d201b91 --- /dev/null +++ b/frontend-reactive/app/models/reaction.ts @@ -0,0 +1,9 @@ +import Model, { attr } from '@ember-data/model' +import type EmoteModel from './emote' + +export default class ReactionModel extends Model { + @attr declare noteId: string + @attr declare reactorId: string + @attr declare emoteId: number + @attr declare emote: EmoteModel +} diff --git a/frontend-reactive/app/models/relation.js b/frontend-reactive/app/models/relation.js deleted file mode 100644 index 582ea61..0000000 --- a/frontend-reactive/app/models/relation.js +++ /dev/null @@ -1,3 +0,0 @@ -import Model from '@ember-data/model'; - -export default class RelationModel extends Model {} diff --git a/frontend-reactive/app/models/relation.ts b/frontend-reactive/app/models/relation.ts new file mode 100644 index 0000000..f5be28b --- /dev/null +++ b/frontend-reactive/app/models/relation.ts @@ -0,0 +1,10 @@ +import Model, { attr } from '@ember-data/model' + +export default class RelationModel extends Model { + @attr declare createdAt: Date + @attr declare updatedAt: Date + @attr declare fromId: string + @attr declare toId: string + @attr declare requested: boolean + @attr declare accepted: boolean +}