Compare commits

...

18 Commits
1.0.0 ... 1.3.0

Author SHA1 Message Date
985a105930 1.3.0 2018-04-28 12:05:39 +09:00
52560dd986 🎨 2018-04-28 12:04:31 +09:00
de81502fdf 🎨 2018-04-28 12:00:58 +09:00
51876bac62 🎨 2018-04-28 10:59:37 +09:00
a5b994259e Fix bug 2018-04-28 10:27:53 +09:00
c85c825bad 🎨 2018-04-28 10:27:43 +09:00
1cd1c31467 1.2.0 2018-04-28 02:30:27 +09:00
8984e3131d モバイル版のダークモード
など
2018-04-28 02:29:17 +09:00
93fa28991e 🎨 2018-04-28 00:47:52 +09:00
b694bf1f41 1.1.0 2018-04-27 21:37:00 +09:00
0bbfbfc762 Merge pull request #1558 from syuilo/better-mobile-design
Better mobile design
2018-04-27 21:34:03 +09:00
319f525199 wip 2018-04-27 21:33:18 +09:00
ee62f6e356 wip 2018-04-27 21:06:28 +09:00
0f27b62924 Update dependencies 🚀 2018-04-27 19:12:15 +09:00
6274f6f2f6 Update README.md 2018-04-27 10:36:05 +09:00
32da569ef6 #1029 2018-04-26 20:30:49 +09:00
1625fdc2f4 ✌️ 2018-04-26 20:22:51 +09:00
a0795b1afe Fix #1552 2018-04-26 18:24:14 +09:00
135 changed files with 951 additions and 807 deletions

View File

@ -18,10 +18,11 @@ ultimately sophisticated new type of mini-blog based SNS.
:sparkles: Features
----------------------------------------------------------------
* Automatically updated timeline
* Reactions
* User lists
* Private messages
* ServiceWorker support
* Mute
* Real time contents
* ActivityPub compatible
and more! You can touch with your own eyes at https://misskey.xyz/.

View File

@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "1.0.0",
"clientVersion": "1.0.0",
"version": "1.3.0",
"clientVersion": "1.0.5139",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,
@ -31,7 +31,7 @@
"@prezzemolo/rap": "0.1.2",
"@prezzemolo/zip": "0.0.3",
"@types/bcryptjs": "2.4.1",
"@types/chai": "4.1.2",
"@types/chai": "4.1.3",
"@types/chai-http": "3.0.4",
"@types/debug": "0.0.30",
"@types/deep-equal": "1.0.1",
@ -51,22 +51,22 @@
"@types/js-yaml": "3.11.1",
"@types/koa": "2.0.45",
"@types/koa-bodyparser": "4.2.0",
"@types/koa-compress": "^2.0.8",
"@types/koa-compress": "2.0.8",
"@types/koa-favicon": "2.0.19",
"@types/koa-logger": "^3.1.0",
"@types/koa-logger": "3.1.0",
"@types/koa-mount": "3.0.1",
"@types/koa-multer": "1.0.0",
"@types/koa-router": "7.0.27",
"@types/koa-router": "7.0.28",
"@types/koa-send": "4.1.1",
"@types/koa__cors": "2.2.2",
"@types/kue": "0.11.8",
"@types/license-checker": "15.0.0",
"@types/mkdirp": "0.5.2",
"@types/mocha": "5.0.0",
"@types/mocha": "5.2.0",
"@types/mongodb": "3.0.15",
"@types/monk": "6.0.0",
"@types/ms": "0.7.30",
"@types/node": "9.6.5",
"@types/node": "9.6.6",
"@types/nopt": "3.0.29",
"@types/pug": "2.0.4",
"@types/qrcode": "0.8.1",
@ -79,7 +79,7 @@
"@types/speakeasy": "2.0.2",
"@types/tmp": "0.0.33",
"@types/uuid": "3.4.3",
"@types/webpack": "4.1.3",
"@types/webpack": "4.1.4",
"@types/webpack-stream": "3.2.10",
"@types/websocket": "0.0.38",
"@types/ws": "4.0.2",
@ -88,10 +88,10 @@
"autwh": "0.1.0",
"bcryptjs": "2.4.3",
"bootstrap-vue": "2.0.0-rc.6",
"cafy": "6.0.0",
"cafy": "7.0.1",
"chai": "4.1.2",
"chai-http": "4.0.0",
"chalk": "2.4.0",
"chalk": "2.4.1",
"crc-32": "1.2.0",
"css-loader": "0.28.11",
"debug": "3.1.0",
@ -100,12 +100,12 @@
"diskusage": "0.2.4",
"dompurify": "1.0.3",
"elasticsearch": "14.2.2",
"element-ui": "2.3.4",
"element-ui": "2.3.6",
"emojilib": "2.2.12",
"escape-regexp": "0.0.1",
"eslint": "4.19.1",
"eslint-plugin-vue": "4.4.0",
"eventemitter3": "3.0.1",
"eslint-plugin-vue": "4.5.0",
"eventemitter3": "3.1.0",
"exif-js": "2.3.0",
"file-loader": "1.1.11",
"file-type": "7.6.0",
@ -133,30 +133,30 @@
"is-root": "2.0.0",
"is-url": "1.2.4",
"js-yaml": "3.11.0",
"jsdom": "11.8.0",
"koa": "2.5.0",
"jsdom": "11.9.0",
"koa": "2.5.1",
"koa-bodyparser": "4.2.0",
"koa-compress": "3.0.0",
"koa-favicon": "2.0.1",
"koa-json-body": "^5.3.0",
"koa-logger": "^3.2.0",
"koa-json-body": "5.3.0",
"koa-logger": "3.2.0",
"koa-mount": "3.0.0",
"koa-multer": "1.0.2",
"koa-router": "7.4.0",
"koa-send": "4.1.3",
"koa-slow": "^2.1.0",
"koa-slow": "2.1.0",
"kue": "0.11.6",
"license-checker": "18.0.0",
"loader-utils": "1.1.0",
"mecab-async": "0.1.2",
"mkdirp": "0.5.1",
"mocha": "5.1.0",
"mocha": "5.1.1",
"moji": "0.5.1",
"mongodb": "3.0.7",
"monk": "6.0.5",
"ms": "2.1.1",
"nan": "2.10.0",
"node-sass": "4.8.3",
"node-sass": "4.9.0",
"node-sass-json-importer": "3.2.0",
"nopt": "4.0.1",
"nprogress": "0.2.0",
@ -190,9 +190,9 @@
"textarea-caret": "3.1.0",
"tmp": "0.0.33",
"ts-loader": "4.2.0",
"ts-node": "6.0.0",
"ts-node": "6.0.1",
"tslint": "5.9.1",
"typescript": "2.8.1",
"typescript": "2.8.3",
"typescript-eslint-parser": "15.0.0",
"uglify-es": "3.3.9",
"url-loader": "1.0.1",
@ -201,18 +201,18 @@
"vue": "2.5.16",
"vue-cropperjs": "2.2.0",
"vue-js-modal": "1.3.13",
"vue-json-tree-view": "2.1.3",
"vue-loader": "14.2.2",
"vue-json-tree-view": "2.1.4",
"vue-loader": "15.0.3",
"vue-router": "3.0.1",
"vue-template-compiler": "2.5.16",
"vuedraggable": "2.16.0",
"vuex": "^3.0.1",
"vuex": "3.0.1",
"web-push": "3.3.0",
"webfinger.js": "2.6.6",
"webpack": "4.6.0",
"webpack-cli": "2.0.14",
"webpack-cli": "2.0.15",
"webpack-replace-loader": "1.3.0",
"websocket": "1.0.25",
"websocket": "1.0.26",
"ws": "5.1.1",
"xev": "2.0.0"
}

View File

@ -120,7 +120,7 @@ root(isDark)
z-index 10000
width 100%
height 100%
background rgba(0, 0, 0, 0.1)
background isDark ? rgba(#000, 0.4) : rgba(#000, 0.1)
opacity 0
> .popover

View File

@ -16,7 +16,9 @@
</div>
</header>
<div class="body">
<mk-note-html v-if="note.text" :text="note.text" :i="os.i" :class="$style.text"/>
<div class="text">
<mk-note-html v-if="note.text" :text="note.text" :i="os.i"/>
</div>
<div class="media" v-if="note.mediaIds.length > 0">
<mk-media-list :media-list="note.media"/>
</div>
@ -40,10 +42,10 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.sub
root(isDark)
margin 0
padding 20px 32px
background #fdfdfd
background isDark ? #21242d : #fdfdfd
&:after
content ""
@ -87,7 +89,7 @@ export default Vue.extend({
display inline
margin 0
padding 0
color #777
color isDark ? #fff : #777
font-size 1em
font-weight 700
text-align left
@ -99,24 +101,29 @@ export default Vue.extend({
> .username
text-align left
margin 0 0 0 8px
color #ccc
color isDark ? #606984 : #ccc
> .right
float right
> .time
font-size 0.9em
color #c0c0c0
color isDark ? #606984 : #c0c0c0
> .body
> .text
cursor default
display block
margin 0
padding 0
overflow-wrap break-word
font-size 1em
color isDark ? #959ba7 : #717171
.sub[data-darkmode]
root(true)
.sub:not([data-darkmode])
root(false)
</style>
<style lang="stylus" module>
.text
cursor default
display block
margin 0
padding 0
overflow-wrap break-word
font-size 1em
color #717171
</style>

View File

@ -38,7 +38,9 @@
</router-link>
</header>
<div class="body">
<mk-note-html :class="$style.text" v-if="p.text" :text="p.text" :i="os.i"/>
<div class="text">
<mk-note-html v-if="p.text" :text="p.text" :i="os.i"/>
</div>
<div class="media" v-if="p.media.length > 0">
<mk-media-list :media-list="p.media"/>
</div>
@ -214,12 +216,12 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-note-detail
margin 0
root(isDark)
margin 0 auto
padding 0
overflow hidden
text-align left
background #fff
background isDark ? #282C37 : #fff
border solid 1px rgba(0, 0, 0, 0.1)
border-radius 8px
@ -232,28 +234,28 @@ export default Vue.extend({
text-align center
color #999
cursor pointer
background #fafafa
background isDark ? #21242d : #fafafa
outline none
border none
border-bottom solid 1px #eef0f2
border-bottom solid 1px isDark ? #1c2023 : #eef0f2
border-radius 6px 6px 0 0
&:hover
background #f6f6f6
background isDark ? #2e3440 : #f6f6f6
&:active
background #f0f0f0
background isDark ? #21242b : #f0f0f0
&:disabled
color #ccc
color isDark ? #21242b : #ccc
> .context
> *
border-bottom 1px solid #eef0f2
border-bottom 1px solid isDark ? #1c2023 : #eef0f2
> .renote
color #9dbb00
background linear-gradient(to bottom, #edfde2 0%, #fff 100%)
background isDark ? linear-gradient(to bottom, #314027 0%, #282c37 100%) : linear-gradient(to bottom, #edfde2 0%, #fff 100%)
> p
margin 0
@ -281,7 +283,7 @@ export default Vue.extend({
padding-top 8px
> .reply-to
border-bottom 1px solid #eef0f2
border-bottom 1px solid isDark ? #1c2023 : #eef0f2
> article
padding 28px 32px 18px 32px
@ -292,8 +294,8 @@ export default Vue.extend({
clear both
&:hover
> .main > footer > button
color #888
> footer > button
color isDark ? #707b97 : #888
> .avatar-anchor
display block
@ -318,7 +320,7 @@ export default Vue.extend({
display inline-block
margin 0
line-height 24px
color #777
color isDark ? #fff : #627079
font-size 18px
font-weight 700
text-align left
@ -331,18 +333,27 @@ export default Vue.extend({
display block
text-align left
margin 0
color #ccc
color isDark ? #606984 : #ccc
> .time
position absolute
top 0
right 32px
font-size 1em
color #c0c0c0
color isDark ? #606984 : #c0c0c0
> .body
padding 8px 0
> .text
cursor default
display block
margin 0
padding 0
overflow-wrap break-word
font-size 1.5em
color isDark ? #fff : #717171
> .renote
margin 8px 0
@ -404,11 +415,11 @@ export default Vue.extend({
background transparent
border none
font-size 1em
color #ddd
color isDark ? #606984 : #ccc
cursor pointer
&:hover
color #666
color isDark ? #9198af : #666
> .count
display inline
@ -420,17 +431,12 @@ export default Vue.extend({
> .replies
> *
border-top 1px solid #eef0f2
border-top 1px solid isDark ? #1c2023 : #eef0f2
.mk-note-detail[data-darkmode]
root(true)
.mk-note-detail:not([data-darkmode])
root(false)
</style>
<style lang="stylus" module>
.text
cursor default
display block
margin 0
padding 0
overflow-wrap break-word
font-size 1.5em
color #717171
</style>

View File

@ -35,8 +35,9 @@ export default Vue.extend({
<style lang="stylus" scoped>
root(isDark)
margin 0
padding 16px
padding 16px 32px
font-size 0.9em
background isDark ? #21242d : #fcfcfc
&:after
content ""

View File

@ -371,13 +371,6 @@ root(isDark)
& + article
padding-top 8px
> .reply-to
padding 0 16px
background rgba(0, 0, 0, 0.0125)
> .mk-note-preview
background transparent
> article
padding 28px 32px 18px 32px
@ -434,7 +427,7 @@ root(isDark)
margin 0 .5em 0 0
padding 1px 6px
font-size 12px
color isDark ? #758188 :#aaa
color isDark ? #758188 : #aaa
border solid 1px isDark ? #57616f : #ddd
border-radius 3px

View File

@ -156,7 +156,7 @@ export default Vue.extend({
this.notes = this.notes.slice(0, displayLimit);
}
} else {
this.queue.unshift(note);
this.queue.push(note);
}
},

View File

@ -10,7 +10,7 @@
<x-core v-if="src == 'home'" ref="tl" key="home" src="home"/>
<x-core v-if="src == 'local'" ref="tl" key="local" src="local"/>
<x-core v-if="src == 'global'" ref="tl" key="global" src="global"/>
<mk-user-list-timeline v-if="src == 'list'" ref="tl" key="list" :list="list"/>
<mk-user-list-timeline v-if="src == 'list'" ref="tl" :key="list.id" :list="list"/>
</div>
</template>
@ -67,7 +67,7 @@ root(isDark)
z-index 10
background isDark ? #313543 : #fff
border-radius 6px 6px 0 0
box-shadow 0 1px rgba(0, 0, 0, 0.08)
box-shadow 0 1px isDark ? rgba(#000, 0.15) : rgba(#000, 0.08)
> button
position absolute

View File

@ -125,7 +125,8 @@ export default Vue.extend({
flex 1
$width = 1000px
background-image url('/assets/welcome-bg.svg')
background linear-gradient(to bottom, #1e1d65, #bd6659)
//background-image url('/assets/welcome-bg.svg')
background-size cover
background-position top center
@ -309,9 +310,3 @@ export default Vue.extend({
a
color #666
</style>
<style lang="stylus">
html
body
background linear-gradient(to bottom, #1e1d65, #bd6659)
</style>

View File

@ -55,15 +55,15 @@ init((launch) => {
{ path: '/signup', name: 'signup', component: MkSignup },
{ path: '/i/settings', component: MkSettings },
{ path: '/i/settings/profile', component: MkProfileSetting },
{ path: '/i/notifications', component: MkNotifications },
{ path: '/i/messaging', component: MkMessaging },
{ path: '/i/notifications', name: 'notifications', component: MkNotifications },
{ path: '/i/messaging', name: 'messaging', component: MkMessaging },
{ path: '/i/messaging/:user', component: MkMessagingRoom },
{ path: '/i/drive', component: MkDrive },
{ path: '/i/drive', name: 'drive', component: MkDrive },
{ path: '/i/drive/folder/:folder', component: MkDrive },
{ path: '/i/drive/file/:file', component: MkDrive },
{ path: '/selectdrive', component: MkSelectDrive },
{ path: '/search', component: MkSearch },
{ path: '/othello', component: MkOthello },
{ path: '/othello', name: 'othello', component: MkOthello },
{ path: '/othello/:game', component: MkOthello },
{ path: '/@:user', component: MkUser },
{ path: '/@:user/followers', component: MkFollowers },

View File

@ -8,6 +8,10 @@
html
height 100%
background #ececed
&[data-darkmode]
background #191B22
body
display flex

View File

@ -27,17 +27,17 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-note-card
root(isDark)
display inline-block
width 150px
//height 120px
font-size 12px
background #fff
background isDark ? #282c37 : #fff
border-radius 4px
> a
display block
color #2c3940
color isDark ? #fff : #2c3940
&:hover
text-decoration none
@ -75,11 +75,17 @@ export default Vue.extend({
left 0
width 100%
height 20px
background linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #fff 100%)
background isDark ? linear-gradient(to bottom, rgba(#282c37, 0) 0%, #282c37 100%) : linear-gradient(to bottom, rgba(#fff, 0) 0%, #fff 100%)
> .mk-time
display inline-block
padding 8px
color #aaa
.mk-note-card[data-darkmode]
root(true)
.mk-note-card:not([data-darkmode])
root(false)
</style>

View File

@ -27,23 +27,22 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.root.sub
root(isDark)
padding 8px
font-size 0.9em
background #fdfdfd
background isDark ? #21242d : #fdfdfd
@media (min-width 500px)
padding 12px
@media (min-width 600px)
padding 24px 32px
&:after
content ""
display block
clear both
&:hover
> .main > footer > button
color #888
> .avatar-anchor
display block
float left
@ -71,7 +70,7 @@ export default Vue.extend({
margin 0 .5em 0 0
padding 0
overflow hidden
color #607073
color isDark ? #fff : #607073
font-size 1em
font-weight 700
text-align left
@ -84,11 +83,11 @@ export default Vue.extend({
> .username
text-align left
margin 0 .5em 0 0
color #d1d8da
color isDark ? #606984 : #d1d8da
> .time
margin-left auto
color #b2b8bb
color isDark ? #606984 : #b2b8bb
> .body
@ -97,7 +96,12 @@ export default Vue.extend({
margin 0
padding 0
font-size 1.1em
color #717171
color isDark ? #959ba7 : #717171
.root.sub[data-darkmode]
root(true)
.root.sub:not([data-darkmode])
root(false)
</style>

View File

@ -34,7 +34,9 @@
</div>
</header>
<div class="body">
<mk-note-html v-if="p.text" :text="p.text" :i="os.i" :class="$style.text"/>
<div class="text">
<mk-note-html v-if="p.text" :text="p.text" :i="os.i"/>
</div>
<div class="tags" v-if="p.tags && p.tags.length > 0">
<router-link v-for="tag in p.tags" :key="tag" :to="`/search?q=#${tag}`">{{ tag }}</router-link>
</div>
@ -209,15 +211,18 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-note-detail
root(isDark)
overflow hidden
margin 0 auto
padding 0
width 100%
text-align left
background #fff
background isDark ? #282C37 : #fff
border-radius 8px
box-shadow 0 0 0 1px rgba(0, 0, 0, 0.2)
box-shadow 0 0 2px rgba(#000, 0.1)
@media (min-width 500px)
box-shadow 0 8px 32px rgba(#000, 0.1)
> .fetching
padding 64px 0
@ -231,29 +236,26 @@ export default Vue.extend({
text-align center
color #999
cursor pointer
background #fafafa
background isDark ? #21242d : #fafafa
outline none
border none
border-bottom solid 1px #eef0f2
border-bottom solid 1px isDark ? #1c2023 : #eef0f2
border-radius 6px 6px 0 0
box-shadow none
&:hover
background #f6f6f6
&:active
background #f0f0f0
background isDark ? #16181d : #f6f6f6
&:disabled
color #ccc
> .context
> *
border-bottom 1px solid #eef0f2
border-bottom 1px solid isDark ? #1c2023 : #eef0f2
> .renote
color #9dbb00
background linear-gradient(to bottom, #edfde2 0%, #fff 100%)
background isDark ? linear-gradient(to bottom, #314027 0%, #282c37 100%) : linear-gradient(to bottom, #edfde2 0%, #fff 100%)
> p
margin 0
@ -281,7 +283,7 @@ export default Vue.extend({
padding-top 8px
> .reply-to
border-bottom 1px solid #eef0f2
border-bottom 1px solid isDark ? #1c2023 : #eef0f2
> article
padding 14px 16px 9px 16px
@ -294,17 +296,13 @@ export default Vue.extend({
display block
clear both
&:hover
> .main > footer > button
color #888
> header
display flex
line-height 1.1
line-height 1.1em
> .avatar-anchor
display block
padding 0 .5em 0 0
padding 0 12px 0 0
> .avatar
display block
@ -323,7 +321,7 @@ export default Vue.extend({
> .name
display inline-block
margin .4em 0
color #777
color isDark ? #fff : #627079
font-size 16px
font-weight bold
text-align left
@ -336,11 +334,22 @@ export default Vue.extend({
display block
text-align left
margin 0
color #ccc
color isDark ? #606984 : #ccc
> .body
padding 8px 0
> .text
display block
margin 0
padding 0
overflow-wrap break-word
font-size 16px
color isDark ? #fff : #717171
@media (min-width 500px)
font-size 24px
> .renote
margin 8px 0
@ -396,7 +405,7 @@ export default Vue.extend({
> .time
font-size 16px
color #c0c0c0
color isDark ? #606984 : #c0c0c0
> footer
font-size 1.2em
@ -408,14 +417,14 @@ export default Vue.extend({
border none
box-shadow none
font-size 1em
color #ddd
color isDark ? #606984 : #ddd
cursor pointer
&:not(:last-child)
margin-right 28px
&:hover
color #666
color isDark ? #9198af : #666
> .count
display inline
@ -427,20 +436,12 @@ export default Vue.extend({
> .replies
> *
border-top 1px solid #eef0f2
</style>
<style lang="stylus" module>
.text
display block
margin 0
padding 0
overflow-wrap break-word
font-size 16px
color #717171
@media (min-width 500px)
font-size 24px
border-top 1px solid isDark ? #1c2023 : #eef0f2
.mk-note-detail[data-darkmode]
root(true)
.mk-note-detail:not([data-darkmode])
root(false)
</style>

View File

@ -31,7 +31,6 @@ export default Vue.extend({
margin 0
padding 0
font-size 0.9em
background #fff
&:after
content ""

View File

@ -27,9 +27,13 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.sub
font-size 0.9em
root(isDark)
padding 16px
font-size 0.9em
background isDark ? #21242d : #fcfcfc
@media (min-width 600px)
padding 24px 32px
&:after
content ""
@ -73,7 +77,7 @@ export default Vue.extend({
margin 0 0.5em 0 0
padding 0
overflow hidden
color #607073
color isDark ? #fff : #607073
font-size 1em
font-weight 700
text-align left
@ -86,11 +90,11 @@ export default Vue.extend({
> .username
text-align left
margin 0
color #d1d8da
color isDark ? #606984 : #d1d8da
> .created-at
margin-left auto
color #b2b8bb
color isDark ? #606984 : #b2b8bb
> .body
max-height 128px
@ -101,11 +105,16 @@ export default Vue.extend({
margin 0
padding 0
font-size 1.1em
color #717171
color isDark ? #959ba7 : #717171
pre
max-height 120px
font-size 80%
</style>
.sub[data-darkmode]
root(true)
.sub:not([data-darkmode])
root(false)
</style>

View File

@ -238,13 +238,7 @@ export default Vue.extend({
root(isDark)
font-size 12px
border-bottom solid 1px #eaeaea
&:first-child
border-radius 8px 8px 0 0
> .renote
border-radius 8px 8px 0 0
border-bottom solid 1px isDark ? #1c2023 : #eaeaea
&:last-of-type
border-bottom none
@ -261,11 +255,14 @@ root(isDark)
padding 8px 16px
line-height 28px
color #9dbb00
background linear-gradient(to bottom, #edfde2 0%, #fff 100%)
background isDark ? linear-gradient(to bottom, #314027 0%, #282c37 100%) : linear-gradient(to bottom, #edfde2 0%, #fff 100%)
@media (min-width 500px)
padding 16px
@media (min-width 600px)
padding 16px 32px
.avatar-anchor
display inline-block
@ -301,14 +298,11 @@ root(isDark)
& + article
padding-top 8px
> .reply-to
background rgba(0, 0, 0, 0.0125)
> .mk-note-preview
background transparent
> article
padding 14px 16px 9px 16px
padding 16px 16px 9px
@media (min-width 600px)
padding 32px 32px 22px
&:after
content ""
@ -319,9 +313,9 @@ root(isDark)
display block
float left
margin 0 10px 8px 0
position -webkit-sticky
position sticky
top 62px
//position -webkit-sticky
//position sticky
//top 62px
@media (min-width 500px)
margin-right 16px
@ -359,7 +353,7 @@ root(isDark)
margin 0 0.5em 0 0
padding 0
overflow hidden
color #627079
color isDark ? #fff : #627079
font-size 1em
font-weight bold
text-decoration none
@ -372,15 +366,15 @@ root(isDark)
margin 0 0.5em 0 0
padding 1px 6px
font-size 12px
color #aaa
border solid 1px #ddd
color isDark ? #758188 : #aaa
border solid 1px isDark ? #57616f : #ddd
border-radius 3px
> .username
margin 0 0.5em 0 0
overflow hidden
text-overflow ellipsis
color #ccc
color isDark ? #606984 : #ccc
> .info
margin-left auto
@ -388,10 +382,10 @@ root(isDark)
> .mobile
margin-right 6px
color #c0c0c0
color isDark ? #606984 : #c0c0c0
> .created-at
color #c0c0c0
color isDark ? #606984 : #c0c0c0
> .body
@ -428,7 +422,7 @@ root(isDark)
padding 0
overflow-wrap break-word
font-size 1.1em
color #717171
color isDark ? #fff : #717171
>>> .title
display block
@ -436,7 +430,7 @@ root(isDark)
padding 4px
font-size 90%
text-align center
background #eef1f3
background isDark ? #2f3944 : #eef1f3
border-radius 4px
>>> .code
@ -445,12 +439,12 @@ root(isDark)
>>> .quote
margin 8px
padding 6px 12px
color #aaa
border-left solid 3px #eee
color isDark ? #6f808e : #aaa
border-left solid 3px isDark ? #637182 : #eee
> .reply
margin-right 8px
color #717171
color isDark ? #99abbf : #717171
> .rp
margin-left 4px
@ -522,7 +516,7 @@ root(isDark)
> .mk-note-preview
padding 16px
border dashed 1px #c0dac6
border dashed 1px isDark ? #4e945e : #c0dac6
border-radius 8px
> .app
@ -537,14 +531,14 @@ root(isDark)
border none
box-shadow none
font-size 1em
color #ddd
color isDark ? #606984 : #ddd
cursor pointer
&:not(:last-child)
margin-right 28px
&:hover
color #666
color isDark ? #9198af : #666
> .count
display inline

View File

@ -144,7 +144,7 @@ export default Vue.extend({
this.notes = this.notes.slice(0, displayLimit);
}
} else {
this.queue.unshift(note);
this.queue.push(note);
}
},
@ -199,10 +199,14 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-notes
background #fff
root(isDark)
overflow hidden
background isDark ? #282C37 : #fff
border-radius 8px
box-shadow 0 0 0 1px rgba(0, 0, 0, 0.2)
box-shadow 0 0 2px rgba(#000, 0.1)
@media (min-width 500px)
box-shadow 0 8px 32px rgba(#000, 0.1)
.transition
.mk-notes-enter
@ -219,9 +223,9 @@ export default Vue.extend({
line-height 32px
text-align center
font-size 0.9em
color #aaa
background #fdfdfd
border-bottom solid 1px #eaeaea
color isDark ? #666b79 : #aaa
background isDark ? #242731 : #fdfdfd
border-bottom solid 1px isDark ? #1c2023 : #eaeaea
span
margin 0 16px
@ -259,9 +263,7 @@ export default Vue.extend({
> footer
text-align center
border-top solid 1px #eaeaea
border-bottom-left-radius 4px
border-bottom-right-radius 4px
border-top solid 1px isDark ? #1c2023 : #eaeaea
&:empty
display none
@ -270,10 +272,18 @@ export default Vue.extend({
margin 0
padding 16px
width 100%
color $theme-color
border-radius 0 0 8px 8px
color #ccc
@media (min-width 500px)
padding 20px
&:disabled
opacity 0.7
.mk-notes[data-darkmode]
root(true)
.mk-notes:not([data-darkmode])
root(false)
</style>

View File

@ -1,15 +1,15 @@
<template>
<div class="mk-notification">
<div class="notification reaction" v-if="notification.type == 'reaction'">
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="notification.user | userPage">
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>
<div>
<header>
<mk-reaction-icon :reaction="notification.reaction"/>
<router-link :to="notification.user | userPage">{{ notification.user | userName }}</router-link>
</p>
<mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-ref" :to="notification.note | notePage">
%fa:quote-left%{{ getNoteSummary(notification.note) }}
%fa:quote-right%
@ -18,38 +18,54 @@
</div>
<div class="notification renote" v-if="notification.type == 'renote'">
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="notification.user | userPage">
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>
<div>
<header>
%fa:retweet%
<router-link :to="notification.user | userPage">{{ notification.user | userName }}</router-link>
</p>
<mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-ref" :to="notification.note | notePage">
%fa:quote-left%{{ getNoteSummary(notification.note.renote) }}%fa:quote-right%
</router-link>
</div>
</div>
<div class="notification follow" v-if="notification.type == 'follow'">
<router-link class="avatar-anchor" :to="notification.user | userPage">
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div>
<header>
%fa:user-plus%
<router-link :to="notification.user | userPage">{{ notification.user | userName }}</router-link>
<mk-time :time="notification.createdAt"/>
</header>
</div>
</div>
<div class="notification poll_vote" v-if="notification.type == 'poll_vote'">
<router-link class="avatar-anchor" :to="notification.user | userPage">
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div>
<header>
%fa:chart-pie%
<router-link :to="notification.user | userPage">{{ notification.user | userName }}</router-link>
<mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-ref" :to="notification.note | notePage">
%fa:quote-left%{{ getNoteSummary(notification.note) }}%fa:quote-right%
</router-link>
</div>
</div>
<template v-if="notification.type == 'quote'">
<mk-note :note="notification.note"/>
</template>
<div class="notification follow" v-if="notification.type == 'follow'">
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="notification.user | userPage">
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>
%fa:user-plus%
<router-link :to="notification.user | userPage">{{ notification.user | userName }}</router-link>
</p>
</div>
</div>
<template v-if="notification.type == 'reply'">
<mk-note :note="notification.note"/>
</template>
@ -57,22 +73,6 @@
<template v-if="notification.type == 'mention'">
<mk-note :note="notification.note"/>
</template>
<div class="notification poll_vote" v-if="notification.type == 'poll_vote'">
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="notification.user | userPage">
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>
%fa:chart-pie%
<router-link :to="notification.user | userPage">{{ notification.user | userName }}</router-link>
</p>
<router-link class="note-ref" :to="notification.note | notePage">
%fa:quote-left%{{ getNoteSummary(notification.note) }}%fa:quote-right%
</router-link>
</div>
</div>
</div>
</template>
@ -91,53 +91,65 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-notification
root(isDark)
> .notification
padding 16px
font-size 12px
overflow-wrap break-word
@media (min-width 350px)
font-size 14px
@media (min-width 500px)
font-size 16px
@media (min-width 600px)
padding 24px 32px
&:after
content ""
display block
clear both
> .mk-time
display inline
position absolute
top 16px
right 12px
vertical-align top
color rgba(0, 0, 0, 0.6)
font-size 0.9em
> .avatar-anchor
display block
float left
img
min-width 36px
min-height 36px
max-width 36px
max-height 36px
width 36px
height 36px
border-radius 6px
> .text
@media (min-width 500px)
width 42px
height 42px
> div
float right
width calc(100% - 36px)
padding-left 8px
p
margin 0
@media (min-width 500px)
width calc(100% - 42px)
> header
display flex
align-items center
white-space nowrap
i, .mk-reaction-icon
margin-right 4px
> .mk-time
margin-left auto
color isDark ? #606984 : #c0c0c0
font-size 0.9em
> .note-preview
color rgba(0, 0, 0, 0.7)
color isDark ? #fff : #717171
> .note-ref
color rgba(0, 0, 0, 0.7)
color isDark ? #fff : #717171
[data-fa]
font-size 1em
@ -147,12 +159,17 @@ export default Vue.extend({
margin-right 3px
&.renote
.text p i
> div > header i
color #77B255
&.follow
.text p i
> div > header i
color #53c7ce
</style>
.mk-notification[data-darkmode]
root(true)
.mk-notification:not([data-darkmode])
root(false)
</style>

View File

@ -1,18 +1,20 @@
<template>
<div class="mk-notifications">
<div class="notifications" v-if="notifications.length != 0">
<transition-group name="mk-notifications" class="transition notifications">
<template v-for="(notification, i) in _notifications">
<mk-notification :notification="notification" :key="notification.id"/>
<p class="date" v-if="i != notifications.length - 1 && notification._date != _notifications[i + 1]._date">
<p class="date" :key="notification.id + '_date'" v-if="i != notifications.length - 1 && notification._date != _notifications[i + 1]._date">
<span>%fa:angle-up%{{ notification._datetext }}</span>
<span>%fa:angle-down%{{ _notifications[i + 1]._datetext }}</span>
</p>
</template>
</div>
</transition-group>
<button class="more" v-if="moreNotifications" @click="fetchMoreNotifications" :disabled="fetchingMoreNotifications">
<template v-if="fetchingMoreNotifications">%fa:spinner .pulse .fw%</template>
{{ fetchingMoreNotifications ? '%i18n:!common.loading%' : '%i18n:!@more%' }}
</button>
<p class="empty" v-if="notifications.length == 0 && !fetching">%i18n:@empty%</p>
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
</div>
@ -101,28 +103,28 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-notifications
margin 8px auto
padding 0
max-width 500px
width calc(100% - 16px)
background #fff
root(isDark)
margin 0 auto
background isDark ? #282C37 :#fff
border-radius 8px
box-shadow 0 0 0 1px rgba(0, 0, 0, 0.2)
box-shadow 0 0 2px rgba(0, 0, 0, 0.1)
@media (min-width 500px)
margin 16px auto
width calc(100% - 32px)
box-shadow 0 8px 32px rgba(0, 0, 0, 0.1)
.transition
.mk-notifications-enter
.mk-notifications-leave-to
opacity 0
transform translateY(-30px)
> *
transition transform .3s ease, opacity .3s ease
> .notifications
> .mk-notification
margin 0 auto
max-width 500px
border-bottom solid 1px rgba(0, 0, 0, 0.05)
&:last-child
border-bottom none
> .mk-notification:not(:last-child)
border-bottom solid 1px isDark ? #1c2023 : #eaeaea
> .date
display block
@ -130,9 +132,9 @@ export default Vue.extend({
line-height 32px
text-align center
font-size 0.8em
color #aaa
background #fdfdfd
border-bottom solid 1px rgba(0, 0, 0, 0.05)
color isDark ? #666b79 : #aaa
background isDark ? #242731 : #fdfdfd
border-bottom solid 1px isDark ? #1c2023 : #eaeaea
span
margin 0 16px
@ -165,4 +167,10 @@ export default Vue.extend({
> [data-fa]
margin-right 4px
.mk-notifications[data-darkmode]
root(true)
.mk-notifications:not([data-darkmode])
root(false)
</style>

View File

@ -175,11 +175,15 @@ export default Vue.extend({
margin 8px auto
background #fff
border-radius 8px
box-shadow 0 0 0 1px rgba(0, 0, 0, 0.2)
box-shadow 0 0 2px rgba(0, 0, 0, 0.1)
@media (min-width 500px)
margin 16px auto
width calc(100% - 32px)
box-shadow 0 8px 32px rgba(0, 0, 0, 0.1)
@media (min-width 600px)
margin 32px auto
> header
z-index 1

View File

@ -143,7 +143,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.header
root(isDark)
$height = 48px
position fixed
@ -167,7 +167,7 @@ export default Vue.extend({
-webkit-backdrop-filter blur(12px)
backdrop-filter blur(12px)
//background-color rgba(#1b2023, 0.75)
background-color #1b2023
background-color isDark ? #313543 : #595f6f
> p
display none
@ -244,4 +244,10 @@ export default Vue.extend({
line-height $height
border-left solid 1px rgba(#000, 0.1)
.header[data-darkmode]
root(true)
.header:not([data-darkmode])
root(false)
</style>

View File

@ -15,19 +15,20 @@
</router-link>
<div class="links">
<ul>
<li><router-link to="/">%fa:home%%i18n:@home%%fa:angle-right%</router-link></li>
<li><router-link to="/i/notifications">%fa:R bell%%i18n:@notifications%<template v-if="hasUnreadNotifications">%fa:circle%</template>%fa:angle-right%</router-link></li>
<li><router-link to="/i/messaging">%fa:R comments%%i18n:@messaging%<template v-if="hasUnreadMessagingMessages">%fa:circle%</template>%fa:angle-right%</router-link></li>
<li><router-link to="/othello">%fa:gamepad%ゲーム<template v-if="hasGameInvitations">%fa:circle%</template>%fa:angle-right%</router-link></li>
<li><router-link to="/" :data-active="$route.name == 'index'">%fa:home%%i18n:@home%%fa:angle-right%</router-link></li>
<li><router-link to="/i/notifications" :data-active="$route.name == 'notifications'">%fa:R bell%%i18n:@notifications%<template v-if="hasUnreadNotifications">%fa:circle%</template>%fa:angle-right%</router-link></li>
<li><router-link to="/i/messaging" :data-active="$route.name == 'messaging'">%fa:R comments%%i18n:@messaging%<template v-if="hasUnreadMessagingMessages">%fa:circle%</template>%fa:angle-right%</router-link></li>
<li><router-link to="/othello" :data-active="$route.name == 'othello'">%fa:gamepad%ゲーム<template v-if="hasGameInvitations">%fa:circle%</template>%fa:angle-right%</router-link></li>
</ul>
<ul>
<li><router-link to="/i/drive">%fa:cloud%%i18n:@drive%%fa:angle-right%</router-link></li>
<li><router-link to="/i/drive" :data-active="$route.name == 'drive'">%fa:cloud%%i18n:@drive%%fa:angle-right%</router-link></li>
</ul>
<ul>
<li><a @click="search">%fa:search%%i18n:@search%%fa:angle-right%</a></li>
</ul>
<ul>
<li><router-link to="/i/settings">%fa:cog%%i18n:@settings%%fa:angle-right%</router-link></li>
<li @click="dark"><p><template v-if="_darkmode_">%fa:moon%</template><template v-else>%fa:R moon%</template><span>ダークモード</span></p></li>
</ul>
</div>
<a :href="aboutUrl"><p class="about">%i18n:@about%</p></a>
@ -113,6 +114,9 @@ export default Vue.extend({
},
onOthelloNoInvites() {
this.hasGameInvitations = false;
},
dark() {
(this as any)._updateDarkmode_(!(this as any)._darkmode_);
}
}
});
@ -121,7 +125,9 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.nav
root(isDark)
$color = isDark ? #c9d2e0 : #777
.backdrop
position fixed
top 0
@ -129,7 +135,7 @@ export default Vue.extend({
z-index 1025
width 100%
height 100%
background rgba(0, 0, 0, 0.2)
background isDark ? rgba(#000, 0.7) : rgba(#000, 0.2)
.body
position fixed
@ -140,8 +146,7 @@ export default Vue.extend({
height 100%
overflow auto
-webkit-overflow-scrolling touch
color #777
background #fff
background isDark ? #16191f : #fff
.me
display block
@ -162,7 +167,7 @@ export default Vue.extend({
left 80px
padding 0
width calc(100% - 112px)
color #777
color $color
line-height 96px
overflow hidden
text-overflow ellipsis
@ -182,14 +187,22 @@ export default Vue.extend({
font-size 1em
line-height 1em
a
a, p
display block
margin 0
padding 0 20px
line-height 3rem
line-height calc(1rem + 30px)
color #777
color $color
text-decoration none
&[data-active]
color $theme-color-foreground
background $theme-color
> [data-fa]:last-child
color $theme-color-foreground
> [data-fa]:first-child
margin-right 0.5em
@ -205,18 +218,17 @@ export default Vue.extend({
padding 0 20px
font-size 1.2em
line-height calc(1rem + 30px)
color #ccc
color $color
opacity 0.5
.about
margin 0
padding 1em 0
text-align center
font-size 0.8em
color $color
opacity 0.5
a
color #777
.nav-enter-active,
.nav-leave-active {
opacity: 1;
@ -239,4 +251,10 @@ export default Vue.extend({
opacity: 0;
}
.nav[data-darkmode]
root(true)
.nav:not([data-darkmode])
root(false)
</style>

View File

@ -65,9 +65,3 @@ export default Vue.extend({
}
});
</script>
<style lang="stylus" scoped>
.mk-user-timeline
max-width 600px
margin 0 auto
</style>

View File

@ -102,7 +102,6 @@ export default Vue.extend({
mounted() {
document.title = 'Misskey';
document.documentElement.style.background = '#313a42';
},
methods: {

View File

@ -40,9 +40,6 @@ export default Vue.extend({
created() {
this.fetch();
},
mounted() {
document.documentElement.style.background = '#313a42';
},
methods: {
fetch() {
Progress.start();

View File

@ -39,9 +39,6 @@ export default Vue.extend({
created() {
this.fetch();
},
mounted() {
document.documentElement.style.background = '#313a42';
},
methods: {
fetch() {
Progress.start();

View File

@ -17,7 +17,7 @@
<button @click="fn">%fa:pencil-alt%</button>
</template>
<main>
<main :data-darkmode="_darkmode_">
<div class="nav" v-if="showNav">
<div class="bg" @click="showNav = false"></div>
<div class="body">
@ -36,7 +36,7 @@
<x-tl v-if="src == 'home'" ref="tl" key="home" src="home" @loaded="onLoaded"/>
<x-tl v-if="src == 'local'" ref="tl" key="local" src="local"/>
<x-tl v-if="src == 'global'" ref="tl" key="global" src="global"/>
<mk-user-list-timeline v-if="src.startsWith('list:')" ref="tl" key="list" :list="list"/>
<mk-user-list-timeline v-if="src.startsWith('list:')" ref="tl" :key="list.id" :list="list"/>
</div>
</main>
</mk-ui>
@ -77,7 +77,6 @@ export default Vue.extend({
mounted() {
document.title = 'Misskey';
document.documentElement.style.background = '#313a42';
Progress.start();
},
@ -101,7 +100,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
main
root(isDark)
> .nav
> .bg
position fixed
@ -120,23 +119,12 @@ main
right 0
width 300px
margin 0 auto
background #fff
background isDark ? #272f3a : #fff
border-radius 8px
box-shadow 0 0 16px rgba(0, 0, 0, 0.1)
$balloon-size = 16px
&:before
content ""
display block
position absolute
top -($balloon-size * 2)
left s('calc(50% - %s)', $balloon-size)
border-top solid $balloon-size transparent
border-left solid $balloon-size transparent
border-right solid $balloon-size transparent
border-bottom solid $balloon-size $border-color
&:after
content ""
display block
@ -146,7 +134,7 @@ main
border-top solid $balloon-size transparent
border-left solid $balloon-size transparent
border-right solid $balloon-size transparent
border-bottom solid $balloon-size #fff
border-bottom solid $balloon-size isDark ? #272f3a : #fff
> div
padding 8px 0
@ -154,20 +142,30 @@ main
> *
display block
padding 8px 16px
color isDark ? #cdd0d8 : #666
&[data-active]
color $theme-color-foreground
background $theme-color
&:not([data-active]):hover
background #eee
background isDark ? #353e4a : #eee
> .tl
max-width 600px
max-width 680px
margin 0 auto
padding 8px
@media (min-width 500px)
padding 16px
@media (min-width 600px)
padding 32px
main[data-darkmode]
root(true)
main:not([data-darkmode])
root(false)
</style>

View File

@ -2,11 +2,13 @@
<mk-ui>
<span slot="header">%fa:R sticky-note%%i18n:@title%</span>
<main v-if="!fetching">
<a v-if="note.next" :href="note.next">%fa:angle-up%%i18n:@next%</a>
<div>
<mk-note-detail :note="note"/>
</div>
<a v-if="note.prev" :href="note.prev">%fa:angle-down%%i18n:@prev%</a>
<footer>
<a v-if="note.prev" :href="note.prev">%fa:angle-left% %i18n:@prev%</a>
<a v-if="note.next" :href="note.next">%i18n:@next% %fa:angle-right%</a>
</footer>
</main>
</mk-ui>
</template>
@ -30,7 +32,6 @@ export default Vue.extend({
},
mounted() {
document.title = 'Misskey';
document.documentElement.style.background = '#313a42';
},
methods: {
fetch() {
@ -53,33 +54,24 @@ export default Vue.extend({
<style lang="stylus" scoped>
main
text-align center
padding 8px
@media (min-width 500px)
padding 16px
@media (min-width 600px)
padding 32px
> div
margin 8px auto
margin 0 auto
padding 0
max-width 500px
width calc(100% - 16px)
max-width 600px
@media (min-width 500px)
margin 16px auto
width calc(100% - 32px)
> footer
margin-top 16px
> a
display inline-block
&:first-child
margin-top 8px
@media (min-width 500px)
margin-top 16px
&:last-child
margin-bottom 8px
@media (min-width 500px)
margin-bottom 16px
> [data-fa]
margin-right 4px
> a
display inline-block
margin 0 16px
</style>

View File

@ -2,7 +2,10 @@
<mk-ui>
<span slot="header">%fa:R bell%%i18n:@notifications%</span>
<template slot="func"><button @click="fn">%fa:check%</button></template>
<mk-notifications @fetched="onFetched"/>
<main>
<mk-notifications @fetched="onFetched"/>
</main>
</mk-ui>
</template>
@ -13,7 +16,6 @@ import Progress from '../../../common/scripts/loading';
export default Vue.extend({
mounted() {
document.title = 'Misskey | %i18n:@notifications%';
document.documentElement.style.background = '#313a42';
Progress.start();
},
@ -30,3 +32,20 @@ export default Vue.extend({
}
});
</script>
<style lang="stylus" scoped>
@import '~const.styl'
main
width 100%
max-width 680px
margin 0 auto
padding 8px
@media (min-width 500px)
padding 16px
@media (min-width 600px)
padding 32px
</style>

View File

@ -59,7 +59,6 @@ export default Vue.extend({
},
mounted() {
document.title = 'Misskey | %i18n:@title%';
document.documentElement.style.background = '#313a42';
},
methods: {
setAvatar() {

View File

@ -39,7 +39,6 @@ export default Vue.extend({
},
mounted() {
document.title = `%i18n:@search%: ${this.q} | Misskey`;
document.documentElement.style.background = '#313a42';
this.fetch();
},

View File

@ -34,7 +34,6 @@ export default Vue.extend({
},
mounted() {
document.title = 'Misskey | %i18n:@settings%';
document.documentElement.style.background = '#313a42';
},
methods: {
signout() {

View File

@ -1,7 +1,7 @@
<template>
<mk-ui>
<template slot="header" v-if="!fetching"><img :src="`${user.avatarUrl}?thumbnail&size=64`" alt="">{{ user | userName }}</template>
<main v-if="!fetching">
<main v-if="!fetching" :data-darkmode="_darkmode_">
<div class="is-suspended" v-if="user.isSuspended"><p>%fa:exclamation-triangle% %i18n:@is-suspended%</p></div>
<div class="is-remote" v-if="user.host != null"><p>%fa:exclamation-triangle% %i18n:@is-remote%<a :href="user.url || user.uri" target="_blank">%i18n:@view-remote%</a></p></div>
<header>
@ -45,9 +45,9 @@
</header>
<nav>
<div class="nav-container">
<a :data-active="page == 'home'" @click="page = 'home'">%i18n:@overview%</a>
<a :data-active="page == 'notes'" @click="page = 'notes'">%i18n:@timeline%</a>
<a :data-active="page == 'media'" @click="page = 'media'">%i18n:@media%</a>
<a :data-active="page == 'home'" @click="page = 'home'">%fa:home% %i18n:@overview%</a>
<a :data-active="page == 'notes'" @click="page = 'notes'">%fa:R comment-alt% %i18n:@timeline%</a>
<a :data-active="page == 'media'" @click="page = 'media'">%fa:image% %i18n:@media%</a>
</div>
</nav>
<div class="body">
@ -88,9 +88,6 @@ export default Vue.extend({
created() {
this.fetch();
},
mounted() {
document.documentElement.style.background = '#313a42';
},
methods: {
fetch() {
Progress.start();
@ -110,7 +107,9 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
main
root(isDark)
$bg = isDark ? #22252f : #f7f7f7
> .is-suspended
> .is-remote
&.is-suspended
@ -135,10 +134,11 @@ main
font-size 12px
> header
background $bg
> .banner
padding-bottom 33.3%
background-color #1b1b1b
background-color isDark ? #5f7273 : #cacaca
background-size cover
background-position center
@ -165,13 +165,14 @@ main
left -2px
bottom -2px
width 100%
border 3px solid #313a42
background $bg
border 3px solid $bg
border-radius 6px
@media (min-width 500px)
left -4px
bottom -4px
border 4px solid #313a42
border 4px solid $bg
border-radius 12px
> .mk-follow-button
@ -185,26 +186,26 @@ main
margin 0
line-height 22px
font-size 20px
color #fff
color isDark ? #fff : #757c82
> .username
display inline-block
line-height 20px
font-size 16px
font-weight bold
color #657786
color isDark ? #657786 : #969ea5
> .followed
margin-left 8px
padding 2px 4px
font-size 12px
color #657786
background #f8f8f8
color isDark ? #657786 : #fff
background isDark ? #f8f8f8 : #a7bec7
border-radius 4px
> .description
margin 8px 0
color #fff
color isDark ? #fff : #757c82
> .info
margin 8px 0
@ -212,14 +213,14 @@ main
> p
display inline
margin 0 16px 0 0
color #a9b9c1
color isDark ? #a9b9c1 : #90989c
> i
margin-right 4px
> .status
> a
color #657786
color isDark ? #657786 : #818a92
&:not(:last-child)
margin-right 16px
@ -227,7 +228,7 @@ main
> b
margin-right 4px
font-size 16px
color #fff
color isDark ? #fff : #787e86
> i
font-size 14px
@ -235,9 +236,9 @@ main
> nav
position -webkit-sticky
position sticky
top 48px
box-shadow 0 4px 4px rgba(0, 0, 0, 0.3)
background-color #313a42
top 47px
box-shadow 0 4px 4px isDark ? rgba(#000, 0.3) : rgba(#000, 0.07)
background-color $bg
z-index 1
> .nav-container
@ -250,21 +251,36 @@ main
display block
flex 1 1
text-align center
line-height 52px
font-size 14px
line-height 48px
font-size 12px
text-decoration none
color #657786
color isDark ? #657786 : #9ca1a5
border-bottom solid 2px transparent
@media (min-width 400px)
line-height 52px
font-size 14px
&[data-active]
font-weight bold
color $theme-color
border-color $theme-color
> .body
max-width 680px
margin 0 auto
padding 8px
@media (min-width 500px)
padding 16px
@media (min-width 600px)
padding 32px
main[data-darkmode]
root(true)
main:not([data-darkmode])
root(false)
</style>

View File

@ -54,30 +54,39 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.root.home
root(isDark)
max-width 600px
margin 0 auto
> .mk-note-detail
margin 0 0 8px 0
@media (min-width 500px)
margin 0 0 16px 0
> section
background #eee
background isDark ? #21242f : #eee
border-radius 8px
box-shadow 0 0 0 1px rgba(0, 0, 0, 0.2)
box-shadow 0 4px 16px rgba(#000, 0.1)
&:not(:last-child)
margin-bottom 8px
@media (min-width 500px)
margin-bottom 16px
> h2
margin 0
padding 8px 10px
font-size 15px
font-weight normal
color #465258
background #fff
color isDark ? #b8c5cc : #465258
background isDark ? #282c37 : #fff
border-radius 8px 8px 0 0
@media (min-width 500px)
padding 10px 16px
> i
margin-right 6px
@ -89,6 +98,12 @@ export default Vue.extend({
display block
margin 16px
text-align center
color #cad2da
color isDark ? #cad2da : #929aa0
.root.home[data-darkmode]
root(true)
.root.home:not([data-darkmode])
root(false)
</style>

View File

@ -1,33 +1,35 @@
<template>
<div class="welcome">
<h1><b>Misskey</b>へようこそ</h1>
<p>Twitter風ミニブログSNSMisskeyへようこそ共有したいことを投稿したりタイムラインでみんなの投稿を読むこともできます<br><a href="/signup">アカウントを作成する</a></p>
<div class="form">
<p>%fa:lock% ログイン</p>
<div>
<form @submit.prevent="onSubmit">
<input v-model="username" type="text" pattern="^[a-zA-Z0-9_]+$" placeholder="ユーザー名" autofocus required @change="onUsernameChange"/>
<input v-model="password" type="password" placeholder="パスワード" required/>
<input v-if="user && user.twoFactorEnabled" v-model="token" type="number" placeholder="トークン" required/>
<button type="submit" :disabled="signing">{{ signing ? 'ログインしています' : 'ログイン' }}</button>
</form>
<div>
<h1><b>Misskey</b>へようこそ</h1>
<p>Twitter風ミニブログSNSMisskeyへようこそ共有したいことを投稿したりタイムラインでみんなの投稿を読むこともできます<br><a href="/signup">アカウントを作成する</a></p>
<div class="form">
<p>%fa:lock% ログイン</p>
<div>
<a :href="`${apiUrl}/signin/twitter`">Twitterでログイン</a>
<form @submit.prevent="onSubmit">
<input v-model="username" type="text" pattern="^[a-zA-Z0-9_]+$" placeholder="ユーザー名" autofocus required @change="onUsernameChange"/>
<input v-model="password" type="password" placeholder="パスワード" required/>
<input v-if="user && user.twoFactorEnabled" v-model="token" type="number" placeholder="トークン" required/>
<button type="submit" :disabled="signing">{{ signing ? 'ログインしています' : 'ログイン' }}</button>
</form>
<div>
<a :href="`${apiUrl}/signin/twitter`">Twitterでログイン</a>
</div>
</div>
</div>
<div class="tl">
<p>%fa:comments R% タイムラインを見てみる</p>
<mk-welcome-timeline/>
</div>
<div class="users">
<router-link v-for="user in users" :key="user.id" class="avatar-anchor" :to="`/@${user.username}`">
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
</div>
<footer>
<small>{{ copyright }}</small>
</footer>
</div>
<div class="tl">
<p>%fa:comments R% タイムラインを見てみる</p>
<mk-welcome-timeline/>
</div>
<div class="users">
<router-link v-for="user in users" :key="user.id" class="avatar-anchor" :to="`/@${user.username}`">
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
</div>
<footer>
<small>{{ copyright }}</small>
</footer>
</div>
</template>
@ -84,123 +86,120 @@ export default Vue.extend({
<style lang="stylus" scoped>
.welcome
padding 16px
margin 0 auto
max-width 500px
background linear-gradient(to bottom, #1e1d65, #bd6659)
h1
margin 0
padding 8px
font-size 1.5em
font-weight normal
color #cacac3
> div
padding 16px
margin 0 auto
max-width 500px
& + p
margin 0 0 16px 0
padding 0 8px 0 8px
color #949fa9
.form
margin-bottom 16px
background #fff
border solid 1px rgba(0, 0, 0, 0.2)
border-radius 8px
overflow hidden
> p
h1
margin 0
padding 12px 20px
color #555
background #f5f5f5
border-bottom solid 1px #ddd
padding 8px
font-size 1.5em
font-weight normal
color #cacac3
> div
& + p
margin 0 0 16px 0
padding 0 8px 0 8px
color #949fa9
> form
padding 16px
.form
margin-bottom 16px
background #fff
border solid 1px rgba(0, 0, 0, 0.2)
border-radius 8px
overflow hidden
> p
margin 0
padding 12px 20px
color #555
background #f5f5f5
border-bottom solid 1px #ddd
input
display block
padding 12px
margin 0 0 16px 0
width 100%
font-size 1em
color rgba(0, 0, 0, 0.7)
background #fff
outline none
border solid 1px #ddd
border-radius 4px
button
display block
width 100%
padding 10px
margin 0
color #333
font-size 1em
text-align center
text-decoration none
text-shadow 0 1px 0 rgba(255, 255, 255, 0.9)
background-image linear-gradient(#fafafa, #eaeaea)
border 1px solid #ddd
border-bottom-color #cecece
border-radius 4px
&:active
background-color #767676
background-image none
border-color #444
box-shadow 0 1px 3px rgba(0, 0, 0, 0.075), inset 0 0 5px rgba(0, 0, 0, 0.2)
> div
padding 16px
text-align center
> .tl
background #fff
border solid 1px rgba(0, 0, 0, 0.2)
border-radius 8px
overflow hidden
> form
padding 16px
border-bottom solid 1px #ddd
> p
margin 0
padding 12px 20px
color #555
background #f5f5f5
border-bottom solid 1px #ddd
input
display block
padding 12px
margin 0 0 16px 0
width 100%
font-size 1em
color rgba(0, 0, 0, 0.7)
background #fff
outline none
border solid 1px #ddd
border-radius 4px
> .mk-welcome-timeline
max-height 300px
overflow auto
button
display block
width 100%
padding 10px
margin 0
color #333
font-size 1em
text-align center
text-decoration none
text-shadow 0 1px 0 rgba(255, 255, 255, 0.9)
background-image linear-gradient(#fafafa, #eaeaea)
border 1px solid #ddd
border-bottom-color #cecece
border-radius 4px
> .users
margin 12px 0 0 0
&:active
background-color #767676
background-image none
border-color #444
box-shadow 0 1px 3px rgba(0, 0, 0, 0.075), inset 0 0 5px rgba(0, 0, 0, 0.2)
> *
display inline-block
margin 4px
> div
padding 16px
text-align center
> .tl
background #fff
border solid 1px rgba(0, 0, 0, 0.2)
border-radius 8px
overflow hidden
> p
margin 0
padding 12px 20px
color #555
background #f5f5f5
border-bottom solid 1px #ddd
> .mk-welcome-timeline
max-height 300px
overflow auto
> .users
margin 12px 0 0 0
> *
display inline-block
width 38px
height 38px
vertical-align top
border-radius 6px
margin 4px
> footer
text-align center
color #fff
> *
display inline-block
width 38px
height 38px
vertical-align top
border-radius 6px
> small
display block
margin 16px 0 0 0
opacity 0.7
> footer
text-align center
color #fff
> small
display block
margin 16px 0 0 0
opacity 0.7
</style>
<style lang="stylus">
html
body
background linear-gradient(to bottom, #1e1d65, #bd6659)
</style>

View File

@ -40,6 +40,12 @@ export type Source = {
site_key: string;
secret_key: string;
};
/**
* ゴーストアカウントのID
*/
ghost?: string;
accesslog?: string;
twitter?: {
consumer_key: string;

View File

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import $ from 'cafy'; import ID from '../../../../cafy-id';
import $ from 'cafy';
import deepcopy = require('deepcopy');
import db from '../db/mongodb';
import Reaction from './note-reaction';

View File

@ -37,7 +37,7 @@ export default User;
type IUserBase = {
_id: mongo.ObjectID;
createdAt: Date;
deletedAt: Date;
deletedAt?: Date;
followersCount: number;
followingCount: number;
name?: string;
@ -51,7 +51,6 @@ type IUserBase = {
description: string;
pinnedNoteId: mongo.ObjectID;
isSuspended: boolean;
keywords: string[];
host: string;
};
@ -81,7 +80,7 @@ export interface ILocalUser extends IUserBase {
isPro: boolean;
twoFactorSecret: string;
twoFactorEnabled: boolean;
twoFactorTempSecret: string;
twoFactorTempSecret?: string;
clientSettings: any;
settings: any;
}
@ -459,3 +458,7 @@ function img(url) {
};
}
*/
export function getGhost(): Promise<ILocalUser> {
return User.findOne({ _id: new mongo.ObjectId(config.ghost) });
}

View File

@ -9,7 +9,7 @@ import Note from '../../../../models/note';
*/
module.exports = params => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 365, limitErr] = $(params.limit).optional.number().range(1, 365).$;
const [limit = 365, limitErr] = $(params.limit).optional.number().range(1, 365).get();
if (limitErr) return rej('invalid limit param');
const datas = await Note

View File

@ -9,7 +9,7 @@ import User from '../../../../models/user';
*/
module.exports = params => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 365, limitErr] = $(params.limit).optional.number().range(1, 365).$;
const [limit = 365, limitErr] = $(params.limit).optional.number().range(1, 365).get();
if (limitErr) return rej('invalid limit param');
const users = await User

View File

@ -12,11 +12,11 @@ import Note from '../../../../../models/note';
*/
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 365, limitErr] = $(params.limit).optional.number().range(1, 365).$;
const [limit = 365, limitErr] = $(params.limit).optional.number().range(1, 365).get();
if (limitErr) return rej('invalid limit param');
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// Lookup user

View File

@ -10,7 +10,7 @@ import FollowedLog from '../../../../../models/followed-log';
*/
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// Lookup user

View File

@ -10,7 +10,7 @@ import FollowingLog from '../../../../../models/following-log';
*/
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// Lookup user

View File

@ -10,7 +10,7 @@ import Note from '../../../../../models/note';
*/
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// Lookup user

View File

@ -13,7 +13,7 @@ import Reaction from '../../../../../models/note-reaction';
*/
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// Lookup user

View File

@ -67,24 +67,24 @@ import App, { isValidNameId, pack } from '../../../../models/app';
*/
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'nameId' parameter
const [nameId, nameIdErr] = $(params.nameId).string().pipe(isValidNameId).$;
const [nameId, nameIdErr] = $(params.nameId).string().pipe(isValidNameId).get();
if (nameIdErr) return rej('invalid nameId param');
// Get 'name' parameter
const [name, nameErr] = $(params.name).string().$;
const [name, nameErr] = $(params.name).string().get();
if (nameErr) return rej('invalid name param');
// Get 'description' parameter
const [description, descriptionErr] = $(params.description).string().$;
const [description, descriptionErr] = $(params.description).string().get();
if (descriptionErr) return rej('invalid description param');
// Get 'permission' parameter
const [permission, permissionErr] = $(params.permission).array($().string()).unique().$;
const [permission, permissionErr] = $(params.permission).array($().string()).unique().get();
if (permissionErr) return rej('invalid permission param');
// Get 'callbackUrl' parameter
// TODO: Check it is valid url
const [callbackUrl = null, callbackUrlErr] = $(params.callbackUrl).optional.nullable.string().$;
const [callbackUrl = null, callbackUrlErr] = $(params.callbackUrl).optional.nullable.string().get();
if (callbackUrlErr) return rej('invalid callbackUrl param');
// Generate secret

View File

@ -42,7 +42,7 @@ import { isValidNameId } from '../../../../../models/app';
*/
module.exports = async (params) => new Promise(async (res, rej) => {
// Get 'nameId' parameter
const [nameId, nameIdErr] = $(params.nameId).string().pipe(isValidNameId).$;
const [nameId, nameIdErr] = $(params.nameId).string().pipe(isValidNameId).get();
if (nameIdErr) return rej('invalid nameId param');
// Get exist

View File

@ -41,11 +41,11 @@ module.exports = (params, user, app) => new Promise(async (res, rej) => {
const isSecure = user != null && app == null;
// Get 'appId' parameter
const [appId, appIdErr] = $(params.appId).optional.type(ID).$;
const [appId, appIdErr] = $(params.appId).optional.type(ID).get();
if (appIdErr) return rej('invalid appId param');
// Get 'nameId' parameter
const [nameId, nameIdErr] = $(params.nameId).optional.string().$;
const [nameId, nameIdErr] = $(params.nameId).optional.string().get();
if (nameIdErr) return rej('invalid nameId param');
if (appId === undefined && nameId === undefined) {

View File

@ -40,7 +40,7 @@ import AccessToken from '../../../../models/access-token';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'token' parameter
const [token, tokenErr] = $(params.token).string().$;
const [token, tokenErr] = $(params.token).string().get();
if (tokenErr) return rej('invalid token param');
// Fetch token

View File

@ -46,7 +46,7 @@ import config from '../../../../../config';
*/
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'appSecret' parameter
const [appSecret, appSecretErr] = $(params.appSecret).string().$;
const [appSecret, appSecretErr] = $(params.appSecret).string().get();
if (appSecretErr) return rej('invalid appSecret param');
// Lookup app

View File

@ -53,7 +53,7 @@ import AuthSess, { pack } from '../../../../../models/auth-session';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'token' parameter
const [token, tokenErr] = $(params.token).string().$;
const [token, tokenErr] = $(params.token).string().get();
if (tokenErr) return rej('invalid token param');
// Lookup session

View File

@ -51,7 +51,7 @@ import { pack } from '../../../../../models/user';
*/
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'appSecret' parameter
const [appSecret, appSecretErr] = $(params.appSecret).string().$;
const [appSecret, appSecretErr] = $(params.appSecret).string().get();
if (appSecretErr) return rej('invalid appSecret param');
// Lookup app
@ -64,7 +64,7 @@ module.exports = (params) => new Promise(async (res, rej) => {
}
// Get 'token' parameter
const [token, tokenErr] = $(params.token).string().$;
const [token, tokenErr] = $(params.token).string().get();
if (tokenErr) return rej('invalid token param');
// Fetch token

View File

@ -13,15 +13,15 @@ import Channel, { pack } from '../../../models/channel';
*/
module.exports = (params, me) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified

View File

@ -11,7 +11,7 @@ import { pack } from '../../../../models/channel';
*/
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'title' parameter
const [title, titleErr] = $(params.title).string().range(1, 100).$;
const [title, titleErr] = $(params.title).string().range(1, 100).get();
if (titleErr) return rej('invalid title param');
// Create a channel

View File

@ -10,15 +10,15 @@ import Note, { pack } from '../../../../models/note';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 1000, limitErr] = $(params.limit).optional.number().range(1, 1000).$;
const [limit = 1000, limitErr] = $(params.limit).optional.number().range(1, 1000).get();
if (limitErr) return rej('invalid limit param');
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified
@ -27,7 +27,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
}
// Get 'channelId' parameter
const [channelId, channelIdErr] = $(params.channelId).type(ID).$;
const [channelId, channelIdErr] = $(params.channelId).type(ID).get();
if (channelIdErr) return rej('invalid channelId param');
// Fetch channel

View File

@ -9,7 +9,7 @@ import Channel, { IChannel, pack } from '../../../../models/channel';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'channelId' parameter
const [channelId, channelIdErr] = $(params.channelId).type(ID).$;
const [channelId, channelIdErr] = $(params.channelId).type(ID).get();
if (channelIdErr) return rej('invalid channelId param');
// Fetch channel

View File

@ -10,7 +10,7 @@ import Watching from '../../../../models/channel-watching';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'channelId' parameter
const [channelId, channelIdErr] = $(params.channelId).type(ID).$;
const [channelId, channelIdErr] = $(params.channelId).type(ID).get();
if (channelIdErr) return rej('invalid channelId param');
//#region Fetch channel

View File

@ -10,7 +10,7 @@ import Watching from '../../../../models/channel-watching';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'channelId' parameter
const [channelId, channelIdErr] = $(params.channelId).type(ID).$;
const [channelId, channelIdErr] = $(params.channelId).type(ID).get();
if (channelIdErr) return rej('invalid channelId param');
//#region Fetch channel

View File

@ -9,15 +9,15 @@ import DriveFile, { pack } from '../../../../models/drive-file';
*/
module.exports = async (params, user, app) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) throw 'invalid limit param';
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
if (sinceIdErr) throw 'invalid sinceId param';
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
if (untilIdErr) throw 'invalid untilId param';
// Check if both of sinceId and untilId is specified
@ -26,11 +26,11 @@ module.exports = async (params, user, app) => {
}
// Get 'folderId' parameter
const [folderId = null, folderIdErr] = $(params.folderId).optional.nullable.type(ID).$;
const [folderId = null, folderIdErr] = $(params.folderId).optional.nullable.type(ID).get();
if (folderIdErr) throw 'invalid folderId param';
// Get 'type' parameter
const [type, typeErr] = $(params.type).optional.string().match(/^[a-zA-Z\/\-\*]+$/).$;
const [type, typeErr] = $(params.type).optional.string().match(/^[a-zA-Z\/\-\*]+$/).get();
if (typeErr) throw 'invalid type param';
// Construct query

View File

@ -29,7 +29,7 @@ module.exports = async (file, params, user): Promise<any> => {
}
// Get 'folderId' parameter
const [folderId = null, folderIdErr] = $(params.folderId).optional.nullable.type(ID).$;
const [folderId = null, folderIdErr] = $(params.folderId).optional.nullable.type(ID).get();
if (folderIdErr) throw 'invalid folderId param';
try {

View File

@ -9,11 +9,11 @@ import DriveFile, { pack } from '../../../../../models/drive-file';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'name' parameter
const [name, nameErr] = $(params.name).string().$;
const [name, nameErr] = $(params.name).string().get();
if (nameErr) return rej('invalid name param');
// Get 'folderId' parameter
const [folderId = null, folderIdErr] = $(params.folderId).optional.nullable.type(ID).$;
const [folderId = null, folderIdErr] = $(params.folderId).optional.nullable.type(ID).get();
if (folderIdErr) return rej('invalid folderId param');
// Issue query

View File

@ -9,7 +9,7 @@ import DriveFile, { pack } from '../../../../../models/drive-file';
*/
module.exports = async (params, user) => {
// Get 'fileId' parameter
const [fileId, fileIdErr] = $(params.fileId).type(ID).$;
const [fileId, fileIdErr] = $(params.fileId).type(ID).get();
if (fileIdErr) throw 'invalid fileId param';
// Fetch file

View File

@ -11,7 +11,7 @@ import { publishDriveStream } from '../../../../../publishers/stream';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'fileId' parameter
const [fileId, fileIdErr] = $(params.fileId).type(ID).$;
const [fileId, fileIdErr] = $(params.fileId).type(ID).get();
if (fileIdErr) return rej('invalid fileId param');
// Fetch file
@ -26,12 +26,12 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
}
// Get 'name' parameter
const [name, nameErr] = $(params.name).optional.string().pipe(validateFileName).$;
const [name, nameErr] = $(params.name).optional.string().pipe(validateFileName).get();
if (nameErr) return rej('invalid name param');
if (name) file.filename = name;
// Get 'folderId' parameter
const [folderId, folderIdErr] = $(params.folderId).optional.nullable.type(ID).$;
const [folderId, folderIdErr] = $(params.folderId).optional.nullable.type(ID).get();
if (folderIdErr) return rej('invalid folderId param');
if (folderId !== undefined) {

View File

@ -11,11 +11,11 @@ import uploadFromUrl from '../../../../../services/drive/upload-from-url';
module.exports = async (params, user): Promise<any> => {
// Get 'url' parameter
// TODO: Validate this url
const [url, urlErr] = $(params.url).string().$;
const [url, urlErr] = $(params.url).string().get();
if (urlErr) throw 'invalid url param';
// Get 'folderId' parameter
const [folderId = null, folderIdErr] = $(params.folderId).optional.nullable.type(ID).$;
const [folderId = null, folderIdErr] = $(params.folderId).optional.nullable.type(ID).get();
if (folderIdErr) throw 'invalid folderId param';
return pack(await uploadFromUrl(url, user, folderId));

View File

@ -9,15 +9,15 @@ import DriveFolder, { pack } from '../../../../models/drive-folder';
*/
module.exports = (params, user, app) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified
@ -26,7 +26,7 @@ module.exports = (params, user, app) => new Promise(async (res, rej) => {
}
// Get 'folderId' parameter
const [folderId = null, folderIdErr] = $(params.folderId).optional.nullable.type(ID).$;
const [folderId = null, folderIdErr] = $(params.folderId).optional.nullable.type(ID).get();
if (folderIdErr) return rej('invalid folderId param');
// Construct query

View File

@ -10,11 +10,11 @@ import { publishDriveStream } from '../../../../../publishers/stream';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'name' parameter
const [name = '無題のフォルダー', nameErr] = $(params.name).optional.string().pipe(isValidFolderName).$;
const [name = '無題のフォルダー', nameErr] = $(params.name).optional.string().pipe(isValidFolderName).get();
if (nameErr) return rej('invalid name param');
// Get 'parentId' parameter
const [parentId = null, parentIdErr] = $(params.parentId).optional.nullable.type(ID).$;
const [parentId = null, parentIdErr] = $(params.parentId).optional.nullable.type(ID).get();
if (parentIdErr) return rej('invalid parentId param');
// If the parent folder is specified

View File

@ -9,11 +9,11 @@ import DriveFolder, { pack } from '../../../../../models/drive-folder';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'name' parameter
const [name, nameErr] = $(params.name).string().$;
const [name, nameErr] = $(params.name).string().get();
if (nameErr) return rej('invalid name param');
// Get 'parentId' parameter
const [parentId = null, parentIdErr] = $(params.parentId).optional.nullable.type(ID).$;
const [parentId = null, parentIdErr] = $(params.parentId).optional.nullable.type(ID).get();
if (parentIdErr) return rej('invalid parentId param');
// Issue query

View File

@ -9,7 +9,7 @@ import DriveFolder, { pack } from '../../../../../models/drive-folder';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'folderId' parameter
const [folderId, folderIdErr] = $(params.folderId).type(ID).$;
const [folderId, folderIdErr] = $(params.folderId).type(ID).get();
if (folderIdErr) return rej('invalid folderId param');
// Get folder

View File

@ -10,7 +10,7 @@ import { publishDriveStream } from '../../../../../publishers/stream';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'folderId' parameter
const [folderId, folderIdErr] = $(params.folderId).type(ID).$;
const [folderId, folderIdErr] = $(params.folderId).type(ID).get();
if (folderIdErr) return rej('invalid folderId param');
// Fetch folder
@ -25,12 +25,12 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
}
// Get 'name' parameter
const [name, nameErr] = $(params.name).optional.string().pipe(isValidFolderName).$;
const [name, nameErr] = $(params.name).optional.string().pipe(isValidFolderName).get();
if (nameErr) return rej('invalid name param');
if (name) folder.name = name;
// Get 'parentId' parameter
const [parentId, parentIdErr] = $(params.parentId).optional.nullable.type(ID).$;
const [parentId, parentIdErr] = $(params.parentId).optional.nullable.type(ID).get();
if (parentIdErr) return rej('invalid parentId param');
if (parentId !== undefined) {
if (parentId === null) {

View File

@ -9,15 +9,15 @@ import DriveFile, { pack } from '../../../../models/drive-file';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified
@ -26,7 +26,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
}
// Get 'type' parameter
const [type, typeErr] = $(params.type).optional.string().match(/^[a-zA-Z\/\-\*]+$/).$;
const [type, typeErr] = $(params.type).optional.string().match(/^[a-zA-Z\/\-\*]+$/).get();
if (typeErr) return rej('invalid type param');
// Construct query

View File

@ -13,7 +13,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
const follower = user;
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// 自分自身

View File

@ -13,7 +13,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
const follower = user;
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// Check if the followee is yourself

View File

@ -8,7 +8,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
const follower = user;
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// Fetch following

View File

@ -8,7 +8,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
const follower = user;
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// Fetch following

View File

@ -7,7 +7,7 @@ import User from '../../../../../models/user';
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'token' parameter
const [token, tokenErr] = $(params.token).string().$;
const [token, tokenErr] = $(params.token).string().get();
if (tokenErr) return rej('invalid token param');
const _token = token.replace(/\s/g, '');

View File

@ -10,7 +10,7 @@ import config from '../../../../../config';
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'password' parameter
const [password, passwordErr] = $(params.password).string().$;
const [password, passwordErr] = $(params.password).string().get();
if (passwordErr) return rej('invalid password param');
// Compare password

View File

@ -7,7 +7,7 @@ import User from '../../../../../models/user';
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'password' parameter
const [password, passwordErr] = $(params.password).string().$;
const [password, passwordErr] = $(params.password).string().get();
if (passwordErr) return rej('invalid password param');
// Compare password

View File

@ -10,15 +10,15 @@ import { pack } from '../../../../models/app';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'offset' parameter
const [offset = 0, offsetErr] = $(params.offset).optional.number().min(0).$;
const [offset = 0, offsetErr] = $(params.offset).optional.number().min(0).get();
if (offsetErr) return rej('invalid offset param');
// Get 'sort' parameter
const [sort = 'desc', sortError] = $(params.sort).optional.string().or('desc asc').$;
const [sort = 'desc', sortError] = $(params.sort).optional.string().or('desc asc').get();
if (sortError) return rej('invalid sort param');
// Get tokens

View File

@ -10,11 +10,11 @@ import User from '../../../../models/user';
*/
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'currentPasword' parameter
const [currentPassword, currentPasswordErr] = $(params.currentPasword).string().$;
const [currentPassword, currentPasswordErr] = $(params.currentPasword).string().get();
if (currentPasswordErr) return rej('invalid currentPasword param');
// Get 'newPassword' parameter
const [newPassword, newPasswordErr] = $(params.newPassword).string().$;
const [newPassword, newPasswordErr] = $(params.newPassword).string().get();
if (newPasswordErr) return rej('invalid newPassword param');
// Compare password

View File

@ -9,15 +9,15 @@ import Favorite, { pack } from '../../../../models/favorite';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified

View File

@ -14,27 +14,27 @@ import read from '../../common/read-notification';
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'following' parameter
const [following = false, followingError] =
$(params.following).optional.boolean().$;
$(params.following).optional.boolean().get();
if (followingError) return rej('invalid following param');
// Get 'markAsRead' parameter
const [markAsRead = true, markAsReadErr] = $(params.markAsRead).optional.boolean().$;
const [markAsRead = true, markAsReadErr] = $(params.markAsRead).optional.boolean().get();
if (markAsReadErr) return rej('invalid markAsRead param');
// Get 'type' parameter
const [type, typeErr] = $(params.type).optional.array($().string()).unique().$;
const [type, typeErr] = $(params.type).optional.array($().string()).unique().get();
if (typeErr) return rej('invalid type param');
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified

View File

@ -11,7 +11,7 @@ import { pack } from '../../../../models/user';
*/
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'noteId' parameter
const [noteId, noteIdErr] = $(params.noteId).type(ID).$;
const [noteId, noteIdErr] = $(params.noteId).type(ID).get();
if (noteIdErr) return rej('invalid noteId param');
// Fetch pinee

View File

@ -12,7 +12,7 @@ import generateUserToken from '../../common/generate-native-user-token';
*/
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'password' parameter
const [password, passwordErr] = $(params.password).string().$;
const [password, passwordErr] = $(params.password).string().get();
if (passwordErr) return rej('invalid password param');
// Compare password

View File

@ -9,15 +9,15 @@ import Signin, { pack } from '../../../../models/signin';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified

View File

@ -12,42 +12,42 @@ module.exports = async (params, user, app) => new Promise(async (res, rej) => {
const isSecure = user != null && app == null;
// Get 'name' parameter
const [name, nameErr] = $(params.name).optional.nullable.string().pipe(isValidName).$;
const [name, nameErr] = $(params.name).optional.nullable.string().pipe(isValidName).get();
if (nameErr) return rej('invalid name param');
if (name) user.name = name;
// Get 'description' parameter
const [description, descriptionErr] = $(params.description).optional.nullable.string().pipe(isValidDescription).$;
const [description, descriptionErr] = $(params.description).optional.nullable.string().pipe(isValidDescription).get();
if (descriptionErr) return rej('invalid description param');
if (description !== undefined) user.description = description;
// Get 'location' parameter
const [location, locationErr] = $(params.location).optional.nullable.string().pipe(isValidLocation).$;
const [location, locationErr] = $(params.location).optional.nullable.string().pipe(isValidLocation).get();
if (locationErr) return rej('invalid location param');
if (location !== undefined) user.profile.location = location;
// Get 'birthday' parameter
const [birthday, birthdayErr] = $(params.birthday).optional.nullable.string().pipe(isValidBirthday).$;
const [birthday, birthdayErr] = $(params.birthday).optional.nullable.string().pipe(isValidBirthday).get();
if (birthdayErr) return rej('invalid birthday param');
if (birthday !== undefined) user.profile.birthday = birthday;
// Get 'avatarId' parameter
const [avatarId, avatarIdErr] = $(params.avatarId).optional.type(ID).$;
const [avatarId, avatarIdErr] = $(params.avatarId).optional.type(ID).get();
if (avatarIdErr) return rej('invalid avatarId param');
if (avatarId) user.avatarId = avatarId;
// Get 'bannerId' parameter
const [bannerId, bannerIdErr] = $(params.bannerId).optional.type(ID).$;
const [bannerId, bannerIdErr] = $(params.bannerId).optional.type(ID).get();
if (bannerIdErr) return rej('invalid bannerId param');
if (bannerId) user.bannerId = bannerId;
// Get 'isBot' parameter
const [isBot, isBotErr] = $(params.isBot).optional.boolean().$;
const [isBot, isBotErr] = $(params.isBot).optional.boolean().get();
if (isBotErr) return rej('invalid isBot param');
if (isBot != null) user.isBot = isBot;
// Get 'autoWatch' parameter
const [autoWatch, autoWatchErr] = $(params.autoWatch).optional.boolean().$;
const [autoWatch, autoWatchErr] = $(params.autoWatch).optional.boolean().get();
if (autoWatchErr) return rej('invalid autoWatch param');
if (autoWatch != null) user.settings.autoWatch = autoWatch;

View File

@ -10,11 +10,11 @@ import event from '../../../../publishers/stream';
*/
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'name' parameter
const [name, nameErr] = $(params.name).string().$;
const [name, nameErr] = $(params.name).string().get();
if (nameErr) return rej('invalid name param');
// Get 'value' parameter
const [value, valueErr] = $(params.value).nullable.any().$;
const [value, valueErr] = $(params.value).nullable.any().get();
if (valueErr) return rej('invalid value param');
const x = {};

View File

@ -12,15 +12,15 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
.have('name', $().string())
.have('id', $().string())
.have('place', $().string())
.have('data', $().object())).$;
.have('data', $().object())).get();
if (homeErr) return rej('invalid home param');
// Get 'id' parameter
const [id, idErr] = $(params.id).optional.string().$;
const [id, idErr] = $(params.id).optional.string().get();
if (idErr) return rej('invalid id param');
// Get 'data' parameter
const [data, dataErr] = $(params.data).optional.object().$;
const [data, dataErr] = $(params.data).optional.object().get();
if (dataErr) return rej('invalid data param');
if (home) {

View File

@ -11,15 +11,15 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
$().object(true)
.have('name', $().string())
.have('id', $().string())
.have('data', $().object())).$;
.have('data', $().object())).get();
if (homeErr) return rej('invalid home param');
// Get 'id' parameter
const [id, idErr] = $(params.id).optional.string().$;
const [id, idErr] = $(params.id).optional.string().get();
if (idErr) return rej('invalid id param');
// Get 'data' parameter
const [data, dataErr] = $(params.data).optional.object().$;
const [data, dataErr] = $(params.data).optional.object().get();
if (dataErr) return rej('invalid data param');
if (home) {

View File

@ -11,7 +11,7 @@ import { pack } from '../../../../models/messaging-message';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
const mute = await Mute.find({

View File

@ -16,7 +16,7 @@ import read from '../../common/read-messaging-message';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'userId' parameter
const [recipientId, recipientIdErr] = $(params.userId).type(ID).$;
const [recipientId, recipientIdErr] = $(params.userId).type(ID).get();
if (recipientIdErr) return rej('invalid userId param');
// Fetch recipient
@ -33,19 +33,19 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
}
// Get 'markAsRead' parameter
const [markAsRead = true, markAsReadErr] = $(params.markAsRead).optional.boolean().$;
const [markAsRead = true, markAsReadErr] = $(params.markAsRead).optional.boolean().get();
if (markAsReadErr) return rej('invalid markAsRead param');
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified

View File

@ -19,7 +19,7 @@ import config from '../../../../../config';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'userId' parameter
const [recipientId, recipientIdErr] = $(params.userId).type(ID).$;
const [recipientId, recipientIdErr] = $(params.userId).type(ID).get();
if (recipientIdErr) return rej('invalid userId param');
// Myself
@ -41,11 +41,11 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
}
// Get 'text' parameter
const [text, textErr] = $(params.text).optional.string().pipe(isValidText).$;
const [text, textErr] = $(params.text).optional.string().pipe(isValidText).get();
if (textErr) return rej('invalid text');
// Get 'fileId' parameter
const [fileId, fileIdErr] = $(params.fileId).optional.type(ID).$;
const [fileId, fileIdErr] = $(params.fileId).optional.type(ID).get();
if (fileIdErr) return rej('invalid fileId param');
let file = null;

View File

@ -12,7 +12,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
const muter = user;
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// 自分自身

View File

@ -12,7 +12,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
const muter = user;
// Get 'userId' parameter
const [userId, userIdErr] = $(params.userId).type(ID).$;
const [userId, userIdErr] = $(params.userId).type(ID).get();
if (userIdErr) return rej('invalid userId param');
// Check if the mutee is yourself

View File

@ -11,15 +11,15 @@ import { getFriendIds } from '../../common/get-friends';
*/
module.exports = (params, me) => new Promise(async (res, rej) => {
// Get 'iknow' parameter
const [iknow = false, iknowErr] = $(params.iknow).optional.boolean().$;
const [iknow = false, iknowErr] = $(params.iknow).optional.boolean().get();
if (iknowErr) return rej('invalid iknow param');
// Get 'limit' parameter
const [limit = 30, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 30, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'cursor' parameter
const [cursor = null, cursorErr] = $(params.cursor).optional.type(ID).$;
const [cursor = null, cursorErr] = $(params.cursor).optional.type(ID).get();
if (cursorErr) return rej('invalid cursor param');
// Construct query

View File

@ -9,11 +9,11 @@ import App, { pack } from '../../../../models/app';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'offset' parameter
const [offset = 0, offsetErr] = $(params.offset).optional.number().min(0).$;
const [offset = 0, offsetErr] = $(params.offset).optional.number().min(0).get();
if (offsetErr) return rej('invalid offset param');
const query = {

View File

@ -9,35 +9,35 @@ import Note, { pack } from '../../../models/note';
*/
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'reply' parameter
const [reply, replyErr] = $(params.reply).optional.boolean().$;
const [reply, replyErr] = $(params.reply).optional.boolean().get();
if (replyErr) return rej('invalid reply param');
// Get 'renote' parameter
const [renote, renoteErr] = $(params.renote).optional.boolean().$;
const [renote, renoteErr] = $(params.renote).optional.boolean().get();
if (renoteErr) return rej('invalid renote param');
// Get 'media' parameter
const [media, mediaErr] = $(params.media).optional.boolean().$;
const [media, mediaErr] = $(params.media).optional.boolean().get();
if (mediaErr) return rej('invalid media param');
// Get 'poll' parameter
const [poll, pollErr] = $(params.poll).optional.boolean().$;
const [poll, pollErr] = $(params.poll).optional.boolean().get();
if (pollErr) return rej('invalid poll param');
// Get 'bot' parameter
//const [bot, botErr] = $(params.bot).optional.boolean().$;
//const [bot, botErr] = $(params.bot).optional.boolean().get();
//if (botErr) return rej('invalid bot param');
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'sinceId' parameter
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'untilId' parameter
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified

View File

@ -13,15 +13,15 @@ import Note, { pack } from '../../../../models/note';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'noteId' parameter
const [noteId, noteIdErr] = $(params.noteId).type(ID).$;
const [noteId, noteIdErr] = $(params.noteId).type(ID).get();
if (noteIdErr) return rej('invalid noteId param');
// Get 'limit' parameter
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
if (limitErr) return rej('invalid limit param');
// Get 'offset' parameter
const [offset = 0, offsetErr] = $(params.offset).optional.number().min(0).$;
const [offset = 0, offsetErr] = $(params.offset).optional.number().min(0).get();
if (offsetErr) return rej('invalid offset param');
// Lookup note

View File

@ -14,23 +14,23 @@ import { IApp } from '../../../../models/app';
*/
module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res, rej) => {
// Get 'visibility' parameter
const [visibility = 'public', visibilityErr] = $(params.visibility).optional.string().or(['public', 'unlisted', 'private', 'direct']).$;
const [visibility = 'public', visibilityErr] = $(params.visibility).optional.string().or(['public', 'unlisted', 'private', 'direct']).get();
if (visibilityErr) return rej('invalid visibility');
// Get 'text' parameter
const [text = null, textErr] = $(params.text).optional.nullable.string().pipe(isValidText).$;
const [text = null, textErr] = $(params.text).optional.nullable.string().pipe(isValidText).get();
if (textErr) return rej('invalid text');
// Get 'cw' parameter
const [cw, cwErr] = $(params.cw).optional.nullable.string().pipe(isValidCw).$;
const [cw, cwErr] = $(params.cw).optional.nullable.string().pipe(isValidCw).get();
if (cwErr) return rej('invalid cw');
// Get 'viaMobile' parameter
const [viaMobile = false, viaMobileErr] = $(params.viaMobile).optional.boolean().$;
const [viaMobile = false, viaMobileErr] = $(params.viaMobile).optional.boolean().get();
if (viaMobileErr) return rej('invalid viaMobile');
// Get 'tags' parameter
const [tags = [], tagsErr] = $(params.tags).optional.array($().string().range(1, 32)).unique().$;
const [tags = [], tagsErr] = $(params.tags).optional.array($().string().range(1, 32)).unique().get();
if (tagsErr) return rej('invalid tags');
// Get 'geo' parameter
@ -43,11 +43,11 @@ module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res
.have('altitudeAccuracy', $().nullable.number())
.have('heading', $().nullable.number().range(0, 360))
.have('speed', $().nullable.number())
.$;
.get();
if (geoErr) return rej('invalid geo');
// Get 'mediaIds' parameter
const [mediaIds, mediaIdsErr] = $(params.mediaIds).optional.array($().type(ID)).unique().range(1, 4).$;
const [mediaIds, mediaIdsErr] = $(params.mediaIds).optional.array($().type(ID)).unique().range(1, 4).get();
if (mediaIdsErr) return rej('invalid mediaIds');
let files = [];
@ -74,7 +74,7 @@ module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res
}
// Get 'renoteId' parameter
const [renoteId, renoteIdErr] = $(params.renoteId).optional.type(ID).$;
const [renoteId, renoteIdErr] = $(params.renoteId).optional.type(ID).get();
if (renoteIdErr) return rej('invalid renoteId');
let renote: INote = null;
@ -95,7 +95,7 @@ module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res
}
// Get 'replyId' parameter
const [replyId, replyIdErr] = $(params.replyId).optional.type(ID).$;
const [replyId, replyIdErr] = $(params.replyId).optional.type(ID).get();
if (replyIdErr) return rej('invalid replyId');
let reply: INote = null;
@ -116,7 +116,7 @@ module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res
}
// Get 'channelId' parameter
const [channelId, channelIdErr] = $(params.channelId).optional.type(ID).$;
const [channelId, channelIdErr] = $(params.channelId).optional.type(ID).get();
if (channelIdErr) return rej('invalid channelId');
let channel: IChannel = null;
@ -162,7 +162,7 @@ module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res
.unique()
.range(2, 10)
.each(c => c.length > 0 && c.length < 50))
.$;
.get();
if (pollErr) return rej('invalid poll');
if (poll) {

Some files were not shown because too many files have changed in this diff Show More