diff --git a/src/client/app/admin/views/announcements.vue b/src/client/app/admin/views/announcements.vue index 64ac2615c..2e64e47d9 100644 --- a/src/client/app/admin/views/announcements.vue +++ b/src/client/app/admin/views/announcements.vue @@ -35,7 +35,7 @@ export default Vue.extend({ created() { this.$root.getMeta().then(meta => { - this.announcements = meta.broadcasts; + this.announcements = meta.announcements; }); }, @@ -65,7 +65,7 @@ export default Vue.extend({ save(silent) { this.$root.api('admin/update-meta', { - broadcasts: this.announcements + announcements: this.announcements }).then(() => { if (!silent) { this.$root.dialog({ diff --git a/src/client/app/common/views/widgets/broadcast.vue b/src/client/app/common/views/widgets/broadcast.vue index 1222c3956..f8897da25 100644 --- a/src/client/app/common/views/widgets/broadcast.vue +++ b/src/client/app/common/views/widgets/broadcast.vue @@ -16,7 +16,7 @@
{{ $t('fetching') }}
{{ $t('have-a-nice-day') }} @@ -47,7 +47,7 @@ export default define({ }, mounted() { this.$root.getMeta().then(meta => { - this.announcements = meta.broadcasts; + this.announcements = meta.announcements; this.fetching = false; }); }, diff --git a/src/client/app/desktop/views/pages/welcome.vue b/src/client/app/desktop/views/pages/welcome.vue index 88a11eafa..3c34989f7 100644 --- a/src/client/app/desktop/views/pages/welcome.vue +++ b/src/client/app/desktop/views/pages/welcome.vue @@ -174,7 +174,7 @@ export default Vue.extend({ this.meta = meta; this.name = meta.name; this.description = meta.description; - this.announcements = meta.broadcasts; + this.announcements = meta.announcements; this.banner = meta.bannerUrl; }); diff --git a/src/client/app/mobile/views/components/ui.nav.vue b/src/client/app/mobile/views/components/ui.nav.vue index 26da9d668..627a322e6 100644 --- a/src/client/app/mobile/views/components/ui.nav.vue +++ b/src/client/app/mobile/views/components/ui.nav.vue @@ -82,7 +82,7 @@ export default Vue.extend({ mounted() { this.$root.getMeta().then(meta => { - this.announcements = meta.broadcasts; + this.announcements = meta.announcements; }); if (this.$store.getters.isSignedIn) { diff --git a/src/client/app/mobile/views/pages/welcome.vue b/src/client/app/mobile/views/pages/welcome.vue index acc4eef79..cf5ac5f07 100644 --- a/src/client/app/mobile/views/pages/welcome.vue +++ b/src/client/app/mobile/views/pages/welcome.vue @@ -98,7 +98,7 @@ export default Vue.extend({ this.meta = meta; this.name = meta.name; this.description = meta.description; - this.announcements = meta.broadcasts; + this.announcements = meta.announcements; this.banner = meta.bannerUrl; }); diff --git a/src/models/meta.ts b/src/models/meta.ts index e5b729ea1..9e4468032 100644 --- a/src/models/meta.ts +++ b/src/models/meta.ts @@ -151,6 +151,15 @@ if ((config as any).sw) { } }); } +Meta.findOne({}).then(m => { + if (m != null && (m as any).broadcasts != null) { + Meta.update({}, { + $rename: { + broadcasts: 'announcements' + } + }); + } +}); export type IMeta = { name?: string; @@ -173,7 +182,7 @@ export type IMeta = { langs?: string[]; - broadcasts?: any[]; + announcements?: any[]; stats?: { notesCount: number; diff --git a/src/server/api/endpoints/admin/update-meta.ts b/src/server/api/endpoints/admin/update-meta.ts index 46fdeff75..5d08a6e37 100644 --- a/src/server/api/endpoints/admin/update-meta.ts +++ b/src/server/api/endpoints/admin/update-meta.ts @@ -13,10 +13,10 @@ export const meta = { requireModerator: true, params: { - broadcasts: { + announcements: { validator: $.optional.nullable.arr($.obj()), desc: { - 'ja-JP': 'ブロードキャスト' + 'ja-JP': 'お知らせ' } }, @@ -328,8 +328,8 @@ export const meta = { export default define(meta, async (ps) => { const set = {} as any; - if (ps.broadcasts) { - set.broadcasts = ps.broadcasts; + if (ps.announcements) { + set.announcements = ps.announcements; } if (typeof ps.disableRegistration === 'boolean') { diff --git a/src/server/api/endpoints/drive.ts b/src/server/api/endpoints/drive.ts index 9c4482f91..138adffad 100644 --- a/src/server/api/endpoints/drive.ts +++ b/src/server/api/endpoints/drive.ts @@ -12,7 +12,19 @@ export const meta = { requireCredential: true, - kind: 'drive-read' + kind: 'drive-read', + + res: { + type: 'object', + properties: { + capacity: { + type: 'number' + }, + usage: { + type: 'number' + } + } + } }; export default define(meta, async (ps, user) => { diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts index 07a475d4c..d7099ea04 100644 --- a/src/server/api/endpoints/meta.ts +++ b/src/server/api/endpoints/meta.ts @@ -24,6 +24,54 @@ export const meta = { default: true } }, + + res: { + type: 'object', + properties: { + version: { + type: 'string', + description: 'The version of Misskey of this instance.', + example: pkg.version + }, + name: { + type: 'string', + description: 'The name of this instance.', + }, + description: { + type: 'string', + description: 'The description of this instance.', + }, + announcements: { + type: 'array', + items: { + type: 'object', + properties: { + title: { + type: 'string', + description: 'The title of the announcement.', + }, + text: { + type: 'string', + description: 'The text of the announcement. (can be HTML)', + }, + } + }, + description: 'The description of this instance.', + }, + disableRegistration: { + type: 'boolean', + description: 'Whether disabled open registration.', + }, + disableLocalTimeline: { + type: 'boolean', + description: 'Whether disabled LTL and STL.', + }, + disableGlobalTimeline: { + type: 'boolean', + description: 'Whether disabled GTL.', + }, + } + } }; export default define(meta, async (ps, me) => { @@ -55,7 +103,7 @@ export default define(meta, async (ps, me) => { cores: os.cpus().length }, - broadcasts: instance.broadcasts || [], + announcements: instance.announcements || [], disableRegistration: instance.disableRegistration, disableLocalTimeline: instance.disableLocalTimeline, disableGlobalTimeline: instance.disableGlobalTimeline, diff --git a/src/server/nodeinfo.ts b/src/server/nodeinfo.ts index 9e4ce37b8..a783eea90 100644 --- a/src/server/nodeinfo.ts +++ b/src/server/nodeinfo.ts @@ -20,7 +20,7 @@ export const links = [/* (awaiting release) { const nodeinfo2 = async () => { const [ - { name, description, maintainer, langs, broadcasts, disableRegistration, disableLocalTimeline, disableGlobalTimeline, enableRecaptcha, maxNoteTextLength, enableTwitterIntegration, enableGithubIntegration, enableDiscordIntegration, enableEmail, enableServiceWorker }, + { name, description, maintainer, langs, announcements, disableRegistration, disableLocalTimeline, disableGlobalTimeline, enableRecaptcha, maxNoteTextLength, enableTwitterIntegration, enableGithubIntegration, enableDiscordIntegration, enableEmail, enableServiceWorker }, // total, // activeHalfyear, // activeMonth, @@ -52,7 +52,7 @@ const nodeinfo2 = async () => { // localPosts, // localComments }, - metadata: { name, description, maintainer, langs, broadcasts, disableRegistration, disableLocalTimeline, disableGlobalTimeline, enableRecaptcha, maxNoteTextLength, enableTwitterIntegration, enableGithubIntegration, enableDiscordIntegration, enableEmail, enableServiceWorker } + metadata: { name, description, maintainer, langs, announcements, disableRegistration, disableLocalTimeline, disableGlobalTimeline, enableRecaptcha, maxNoteTextLength, enableTwitterIntegration, enableGithubIntegration, enableDiscordIntegration, enableEmail, enableServiceWorker } }; };