From 7591c8ad640a0af5fc93e86054ba42c5bca35e11 Mon Sep 17 00:00:00 2001 From: mStar Date: Wed, 20 Nov 2024 13:39:34 +0100 Subject: [PATCH] Start work on copying API types to the frontend --- frontend-reactive/app/models/account.js | 3 +++ .../app/models/custom-account-field.js | 3 +++ frontend-reactive/app/models/emote.js | 3 +++ frontend-reactive/app/models/media-metadata.js | 3 +++ frontend-reactive/app/models/note.js | 3 +++ frontend-reactive/app/models/reaction.js | 3 +++ frontend-reactive/app/models/relation.js | 3 +++ frontend-reactive/app/models/remote-server.js | 8 -------- frontend-reactive/app/models/remote-server.ts | 8 ++++++++ frontend-reactive/tests/unit/models/account-test.js | 13 +++++++++++++ .../tests/unit/models/custom-account-field-test.js | 13 +++++++++++++ frontend-reactive/tests/unit/models/emote-test.js | 13 +++++++++++++ .../tests/unit/models/media-metadata-test.js | 13 +++++++++++++ frontend-reactive/tests/unit/models/note-test.js | 13 +++++++++++++ .../tests/unit/models/reaction-test.js | 13 +++++++++++++ .../tests/unit/models/relation-test.js | 13 +++++++++++++ frontend-reactive/tests/unit/models/role-test.js | 13 +++++++++++++ 17 files changed, 133 insertions(+), 8 deletions(-) create mode 100644 frontend-reactive/app/models/account.js create mode 100644 frontend-reactive/app/models/custom-account-field.js create mode 100644 frontend-reactive/app/models/emote.js create mode 100644 frontend-reactive/app/models/media-metadata.js create mode 100644 frontend-reactive/app/models/note.js create mode 100644 frontend-reactive/app/models/reaction.js create mode 100644 frontend-reactive/app/models/relation.js delete mode 100644 frontend-reactive/app/models/remote-server.js create mode 100644 frontend-reactive/app/models/remote-server.ts create mode 100644 frontend-reactive/tests/unit/models/account-test.js create mode 100644 frontend-reactive/tests/unit/models/custom-account-field-test.js create mode 100644 frontend-reactive/tests/unit/models/emote-test.js create mode 100644 frontend-reactive/tests/unit/models/media-metadata-test.js create mode 100644 frontend-reactive/tests/unit/models/note-test.js create mode 100644 frontend-reactive/tests/unit/models/reaction-test.js create mode 100644 frontend-reactive/tests/unit/models/relation-test.js create mode 100644 frontend-reactive/tests/unit/models/role-test.js diff --git a/frontend-reactive/app/models/account.js b/frontend-reactive/app/models/account.js new file mode 100644 index 0000000..df3d98b --- /dev/null +++ b/frontend-reactive/app/models/account.js @@ -0,0 +1,3 @@ +import Model from '@ember-data/model'; + +export default class AccountModel extends Model {} diff --git a/frontend-reactive/app/models/custom-account-field.js b/frontend-reactive/app/models/custom-account-field.js new file mode 100644 index 0000000..133cdb8 --- /dev/null +++ b/frontend-reactive/app/models/custom-account-field.js @@ -0,0 +1,3 @@ +import Model from '@ember-data/model'; + +export default class CustomAccountFieldModel extends Model {} diff --git a/frontend-reactive/app/models/emote.js b/frontend-reactive/app/models/emote.js new file mode 100644 index 0000000..28f7588 --- /dev/null +++ b/frontend-reactive/app/models/emote.js @@ -0,0 +1,3 @@ +import Model from '@ember-data/model'; + +export default class EmoteModel extends Model {} diff --git a/frontend-reactive/app/models/media-metadata.js b/frontend-reactive/app/models/media-metadata.js new file mode 100644 index 0000000..b61d8ef --- /dev/null +++ b/frontend-reactive/app/models/media-metadata.js @@ -0,0 +1,3 @@ +import Model from '@ember-data/model'; + +export default class MediaMetadataModel extends Model {} diff --git a/frontend-reactive/app/models/note.js b/frontend-reactive/app/models/note.js new file mode 100644 index 0000000..5f32ce2 --- /dev/null +++ b/frontend-reactive/app/models/note.js @@ -0,0 +1,3 @@ +import Model from '@ember-data/model'; + +export default class NoteModel extends Model {} diff --git a/frontend-reactive/app/models/reaction.js b/frontend-reactive/app/models/reaction.js new file mode 100644 index 0000000..4b509e7 --- /dev/null +++ b/frontend-reactive/app/models/reaction.js @@ -0,0 +1,3 @@ +import Model from '@ember-data/model'; + +export default class ReactionModel extends Model {} diff --git a/frontend-reactive/app/models/relation.js b/frontend-reactive/app/models/relation.js new file mode 100644 index 0000000..582ea61 --- /dev/null +++ b/frontend-reactive/app/models/relation.js @@ -0,0 +1,3 @@ +import Model from '@ember-data/model'; + +export default class RelationModel extends Model {} diff --git a/frontend-reactive/app/models/remote-server.js b/frontend-reactive/app/models/remote-server.js deleted file mode 100644 index 362ab31..0000000 --- a/frontend-reactive/app/models/remote-server.js +++ /dev/null @@ -1,8 +0,0 @@ -import Model, { attr } from '@ember-data/model'; - -export default class RemoteServerModel extends Model { - @attr('string') serverType; - @attr('string') name; - @attr('string') iconUrl; - @attr('boolean') isSelf; -} diff --git a/frontend-reactive/app/models/remote-server.ts b/frontend-reactive/app/models/remote-server.ts new file mode 100644 index 0000000..2cbe8e7 --- /dev/null +++ b/frontend-reactive/app/models/remote-server.ts @@ -0,0 +1,8 @@ +import Model, { attr } from '@ember-data/model' + +export default class RemoteServerModel extends Model { + @attr() declare serverType: string + @attr() declare name: string + @attr() declare iconUrl: string + @attr() declare isSelf: boolean +} diff --git a/frontend-reactive/tests/unit/models/account-test.js b/frontend-reactive/tests/unit/models/account-test.js new file mode 100644 index 0000000..8073a00 --- /dev/null +++ b/frontend-reactive/tests/unit/models/account-test.js @@ -0,0 +1,13 @@ +import { setupTest } from 'frontend-reactive/tests/helpers'; +import { module, test } from 'qunit'; + +module('Unit | Model | account', function (hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function (assert) { + const store = this.owner.lookup('service:store'); + const model = store.createRecord('account', {}); + assert.ok(model, 'model exists'); + }); +}); diff --git a/frontend-reactive/tests/unit/models/custom-account-field-test.js b/frontend-reactive/tests/unit/models/custom-account-field-test.js new file mode 100644 index 0000000..a19b689 --- /dev/null +++ b/frontend-reactive/tests/unit/models/custom-account-field-test.js @@ -0,0 +1,13 @@ +import { setupTest } from 'frontend-reactive/tests/helpers'; +import { module, test } from 'qunit'; + +module('Unit | Model | custom account field', function (hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function (assert) { + const store = this.owner.lookup('service:store'); + const model = store.createRecord('custom-account-field', {}); + assert.ok(model, 'model exists'); + }); +}); diff --git a/frontend-reactive/tests/unit/models/emote-test.js b/frontend-reactive/tests/unit/models/emote-test.js new file mode 100644 index 0000000..20f680e --- /dev/null +++ b/frontend-reactive/tests/unit/models/emote-test.js @@ -0,0 +1,13 @@ +import { setupTest } from 'frontend-reactive/tests/helpers'; +import { module, test } from 'qunit'; + +module('Unit | Model | emote', function (hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function (assert) { + const store = this.owner.lookup('service:store'); + const model = store.createRecord('emote', {}); + assert.ok(model, 'model exists'); + }); +}); diff --git a/frontend-reactive/tests/unit/models/media-metadata-test.js b/frontend-reactive/tests/unit/models/media-metadata-test.js new file mode 100644 index 0000000..aee6705 --- /dev/null +++ b/frontend-reactive/tests/unit/models/media-metadata-test.js @@ -0,0 +1,13 @@ +import { setupTest } from 'frontend-reactive/tests/helpers'; +import { module, test } from 'qunit'; + +module('Unit | Model | media metadata', function (hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function (assert) { + const store = this.owner.lookup('service:store'); + const model = store.createRecord('media-metadata', {}); + assert.ok(model, 'model exists'); + }); +}); diff --git a/frontend-reactive/tests/unit/models/note-test.js b/frontend-reactive/tests/unit/models/note-test.js new file mode 100644 index 0000000..634db8b --- /dev/null +++ b/frontend-reactive/tests/unit/models/note-test.js @@ -0,0 +1,13 @@ +import { setupTest } from 'frontend-reactive/tests/helpers'; +import { module, test } from 'qunit'; + +module('Unit | Model | note', function (hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function (assert) { + const store = this.owner.lookup('service:store'); + const model = store.createRecord('note', {}); + assert.ok(model, 'model exists'); + }); +}); diff --git a/frontend-reactive/tests/unit/models/reaction-test.js b/frontend-reactive/tests/unit/models/reaction-test.js new file mode 100644 index 0000000..4696464 --- /dev/null +++ b/frontend-reactive/tests/unit/models/reaction-test.js @@ -0,0 +1,13 @@ +import { setupTest } from 'frontend-reactive/tests/helpers'; +import { module, test } from 'qunit'; + +module('Unit | Model | reaction', function (hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function (assert) { + const store = this.owner.lookup('service:store'); + const model = store.createRecord('reaction', {}); + assert.ok(model, 'model exists'); + }); +}); diff --git a/frontend-reactive/tests/unit/models/relation-test.js b/frontend-reactive/tests/unit/models/relation-test.js new file mode 100644 index 0000000..2ff932e --- /dev/null +++ b/frontend-reactive/tests/unit/models/relation-test.js @@ -0,0 +1,13 @@ +import { setupTest } from 'frontend-reactive/tests/helpers'; +import { module, test } from 'qunit'; + +module('Unit | Model | relation', function (hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function (assert) { + const store = this.owner.lookup('service:store'); + const model = store.createRecord('relation', {}); + assert.ok(model, 'model exists'); + }); +}); diff --git a/frontend-reactive/tests/unit/models/role-test.js b/frontend-reactive/tests/unit/models/role-test.js new file mode 100644 index 0000000..432ce2d --- /dev/null +++ b/frontend-reactive/tests/unit/models/role-test.js @@ -0,0 +1,13 @@ +import { setupTest } from 'frontend-reactive/tests/helpers'; +import { module, test } from 'qunit'; + +module('Unit | Model | role', function (hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function (assert) { + const store = this.owner.lookup('service:store'); + const model = store.createRecord('role', {}); + assert.ok(model, 'model exists'); + }); +});