From 7961ef33b28db67c4725a1e6534d03dd59d4aa44 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 6 Apr 2018 03:10:25 +0900 Subject: [PATCH] RENAME: api --> services --- src/queue/processors/http/report-github-failure.ts | 2 +- src/remote/activitypub/act/create.ts | 4 ++-- src/remote/activitypub/act/follow.ts | 2 +- src/remote/activitypub/act/unfollow.ts | 2 +- src/remote/activitypub/resolve-person.ts | 2 +- src/server/api/endpoints/following/create.ts | 2 +- src/server/api/endpoints/posts/create.ts | 2 +- src/{api => services}/drive/add-file.ts | 0 src/{api => services}/drive/upload-from-url.ts | 0 src/{api => services}/following/create.ts | 0 src/{api => services}/following/delete.ts | 0 src/{api => services}/post/create.ts | 0 src/services/post/reaction/create.ts | 0 src/{api => services}/post/watch.ts | 0 14 files changed, 8 insertions(+), 8 deletions(-) rename src/{api => services}/drive/add-file.ts (100%) rename src/{api => services}/drive/upload-from-url.ts (100%) rename src/{api => services}/following/create.ts (100%) rename src/{api => services}/following/delete.ts (100%) rename src/{api => services}/post/create.ts (100%) create mode 100644 src/services/post/reaction/create.ts rename src/{api => services}/post/watch.ts (100%) diff --git a/src/queue/processors/http/report-github-failure.ts b/src/queue/processors/http/report-github-failure.ts index e747d062d..1e0b51f89 100644 --- a/src/queue/processors/http/report-github-failure.ts +++ b/src/queue/processors/http/report-github-failure.ts @@ -1,6 +1,6 @@ import * as request from 'request-promise-native'; import User from '../../../models/user'; -import createPost from '../../../api/post/create'; +import createPost from '../../../services/post/create'; export default async ({ data }) => { const asyncBot = User.findOne({ _id: data.userId }); diff --git a/src/remote/activitypub/act/create.ts b/src/remote/activitypub/act/create.ts index fe58f58f8..139c98f3b 100644 --- a/src/remote/activitypub/act/create.ts +++ b/src/remote/activitypub/act/create.ts @@ -3,8 +3,8 @@ import * as debug from 'debug'; import Resolver from '../resolver'; import Post from '../../../models/post'; -import uploadFromUrl from '../../../api/drive/upload-from-url'; -import createPost from '../../../api/post/create'; +import uploadFromUrl from '../../../services/drive/upload-from-url'; +import createPost from '../../../services/post/create'; import { IRemoteUser, isRemoteUser } from '../../../models/user'; import resolvePerson from '../resolve-person'; diff --git a/src/remote/activitypub/act/follow.ts b/src/remote/activitypub/act/follow.ts index dc173a0ac..4fc423d15 100644 --- a/src/remote/activitypub/act/follow.ts +++ b/src/remote/activitypub/act/follow.ts @@ -1,7 +1,7 @@ import parseAcct from '../../../acct/parse'; import User from '../../../models/user'; import config from '../../../config'; -import follow from '../../../api/following/create'; +import follow from '../../../services/following/create'; export default async (actor, activity): Promise => { const prefix = config.url + '/@'; diff --git a/src/remote/activitypub/act/unfollow.ts b/src/remote/activitypub/act/unfollow.ts index e3c9e1c1c..66c15e9a9 100644 --- a/src/remote/activitypub/act/unfollow.ts +++ b/src/remote/activitypub/act/unfollow.ts @@ -1,7 +1,7 @@ import parseAcct from '../../../acct/parse'; import User from '../../../models/user'; import config from '../../../config'; -import unfollow from '../../../api/following/delete'; +import unfollow from '../../../services/following/delete'; export default async (actor, activity): Promise => { const prefix = config.url + '/@'; diff --git a/src/remote/activitypub/resolve-person.ts b/src/remote/activitypub/resolve-person.ts index 2bf7a1354..907f19834 100644 --- a/src/remote/activitypub/resolve-person.ts +++ b/src/remote/activitypub/resolve-person.ts @@ -3,7 +3,7 @@ import { toUnicode } from 'punycode'; import User, { validateUsername, isValidName, isValidDescription } from '../../models/user'; import webFinger from '../webfinger'; import Resolver from './resolver'; -import uploadFromUrl from '../../api/drive/upload-from-url'; +import uploadFromUrl from '../../services/drive/upload-from-url'; export default async (value, verifier?: string) => { const resolver = new Resolver(); diff --git a/src/server/api/endpoints/following/create.ts b/src/server/api/endpoints/following/create.ts index fae686ce5..0ccac8d83 100644 --- a/src/server/api/endpoints/following/create.ts +++ b/src/server/api/endpoints/following/create.ts @@ -4,7 +4,7 @@ import $ from 'cafy'; import User from '../../../../models/user'; import Following from '../../../../models/following'; -import create from '../../../../api/following/create'; +import create from '../../../../services/following/create'; /** * Follow a user diff --git a/src/server/api/endpoints/posts/create.ts b/src/server/api/endpoints/posts/create.ts index d241c8c38..003a892bc 100644 --- a/src/server/api/endpoints/posts/create.ts +++ b/src/server/api/endpoints/posts/create.ts @@ -7,7 +7,7 @@ import Post, { IPost, isValidText, isValidCw, pack } from '../../../../models/po import { ILocalUser } from '../../../../models/user'; import Channel, { IChannel } from '../../../../models/channel'; import DriveFile from '../../../../models/drive-file'; -import create from '../../../../api/post/create'; +import create from '../../../../services/post/create'; import { IApp } from '../../../../models/app'; /** diff --git a/src/api/drive/add-file.ts b/src/services/drive/add-file.ts similarity index 100% rename from src/api/drive/add-file.ts rename to src/services/drive/add-file.ts diff --git a/src/api/drive/upload-from-url.ts b/src/services/drive/upload-from-url.ts similarity index 100% rename from src/api/drive/upload-from-url.ts rename to src/services/drive/upload-from-url.ts diff --git a/src/api/following/create.ts b/src/services/following/create.ts similarity index 100% rename from src/api/following/create.ts rename to src/services/following/create.ts diff --git a/src/api/following/delete.ts b/src/services/following/delete.ts similarity index 100% rename from src/api/following/delete.ts rename to src/services/following/delete.ts diff --git a/src/api/post/create.ts b/src/services/post/create.ts similarity index 100% rename from src/api/post/create.ts rename to src/services/post/create.ts diff --git a/src/services/post/reaction/create.ts b/src/services/post/reaction/create.ts new file mode 100644 index 000000000..e69de29bb diff --git a/src/api/post/watch.ts b/src/services/post/watch.ts similarity index 100% rename from src/api/post/watch.ts rename to src/services/post/watch.ts