Implement existing API types
This commit is contained in:
parent
e76490f637
commit
a6291fd098
14 changed files with 108 additions and 21 deletions
|
@ -1,3 +0,0 @@
|
||||||
import Model from '@ember-data/model';
|
|
||||||
|
|
||||||
export default class AccountModel extends Model {}
|
|
30
frontend-reactive/app/models/account.ts
Normal file
30
frontend-reactive/app/models/account.ts
Normal file
|
@ -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<CustomAccountFieldModel>
|
||||||
|
@attr declare customFieldIds: Array<number>
|
||||||
|
@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<number>
|
||||||
|
@attr declare indexable: boolean
|
||||||
|
@attr declare restrictedFollow: boolean
|
||||||
|
@attr declare identifiesAs: Array<string>
|
||||||
|
@attr declare pronouns: Array<string>
|
||||||
|
@attr declare roles: Array<string>
|
||||||
|
}
|
|
@ -1,3 +0,0 @@
|
||||||
import Model from '@ember-data/model';
|
|
||||||
|
|
||||||
export default class CustomAccountFieldModel extends Model {}
|
|
10
frontend-reactive/app/models/custom-account-field.ts
Normal file
10
frontend-reactive/app/models/custom-account-field.ts
Normal file
|
@ -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
|
||||||
|
}
|
|
@ -1,3 +0,0 @@
|
||||||
import Model from '@ember-data/model';
|
|
||||||
|
|
||||||
export default class EmoteModel extends Model {}
|
|
11
frontend-reactive/app/models/emote.ts
Normal file
11
frontend-reactive/app/models/emote.ts
Normal file
|
@ -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
|
||||||
|
}
|
|
@ -1,3 +0,0 @@
|
||||||
import Model from '@ember-data/model';
|
|
||||||
|
|
||||||
export default class MediaMetadataModel extends Model {}
|
|
12
frontend-reactive/app/models/media-metadata.ts
Normal file
12
frontend-reactive/app/models/media-metadata.ts
Normal file
|
@ -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
|
||||||
|
}
|
|
@ -1,3 +0,0 @@
|
||||||
import Model from '@ember-data/model';
|
|
||||||
|
|
||||||
export default class NoteModel extends Model {}
|
|
26
frontend-reactive/app/models/note.ts
Normal file
26
frontend-reactive/app/models/note.ts
Normal file
|
@ -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<string>
|
||||||
|
@hasMany('media-metadata')
|
||||||
|
declare attachments: AsyncHasMany<MediaMetadataModel>
|
||||||
|
@attr declare attachmentIds: Array<string>
|
||||||
|
@attr declare accessLevel: number
|
||||||
|
@hasMany('account') declare pings?: AsyncHasMany<AccountModel>
|
||||||
|
@attr declare pingIds?: Array<string>
|
||||||
|
@attr declare reactionIds: Array<number>
|
||||||
|
}
|
|
@ -1,3 +0,0 @@
|
||||||
import Model from '@ember-data/model';
|
|
||||||
|
|
||||||
export default class ReactionModel extends Model {}
|
|
9
frontend-reactive/app/models/reaction.ts
Normal file
9
frontend-reactive/app/models/reaction.ts
Normal file
|
@ -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
|
||||||
|
}
|
|
@ -1,3 +0,0 @@
|
||||||
import Model from '@ember-data/model';
|
|
||||||
|
|
||||||
export default class RelationModel extends Model {}
|
|
10
frontend-reactive/app/models/relation.ts
Normal file
10
frontend-reactive/app/models/relation.ts
Normal file
|
@ -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
|
||||||
|
}
|
Loading…
Reference in a new issue