refactor: Use path alias

This commit is contained in:
syuilo 2021-03-23 17:43:07 +09:00
parent d6e23b803b
commit c74fe3c6e2
391 changed files with 557 additions and 557 deletions

View file

@ -1,5 +1,5 @@
import * as program from 'commander';
import config from './config';
import config from '@/config';
program
.version(config.version)

View file

@ -6,11 +6,11 @@ import * as isRoot from 'is-root';
import { getConnection } from 'typeorm';
import Logger from '../services/logger';
import loadConfig from '../config/load';
import { Config } from '../config/types';
import loadConfig from '@/config/load';
import { Config } from '@/config/types';
import { lessThan } from '../prelude/array';
import { program } from '../argv';
import { showMachineInfo } from '../misc/show-machine-info';
import { showMachineInfo } from '@/misc/show-machine-info';
import { initDb } from '../db/postgre';
const meta = require('../meta.json');

View file

@ -29,9 +29,9 @@
<script lang="ts">
import { defineComponent, markRaw } from 'vue';
import { emojilist } from '../../misc/emojilist';
import { emojilist } from '@/misc/emojilist';
import contains from '@client/scripts/contains';
import { twemojiSvgBase } from '../../misc/twemoji-base';
import { twemojiSvgBase } from '@/misc/twemoji-base';
import { getStaticImageUrl } from '@client/scripts/get-static-image-url';
import { acct } from '@client/filters/user';
import * as os from '@client/os';

View file

@ -74,7 +74,7 @@
<script lang="ts">
import { defineComponent, markRaw } from 'vue';
import { emojilist } from '../../misc/emojilist';
import { emojilist } from '@/misc/emojilist';
import { getStaticImageUrl } from '@client/scripts/get-static-image-url';
import { faAsterisk, faLeaf, faUtensils, faFutbol, faCity, faDice, faGlobe, faClock, faUser, faChevronDown, faShapes, faBicycle, faHashtag } from '@fortawesome/free-solid-svg-icons';
import { faHeart, faFlag, faLaugh } from '@fortawesome/free-regular-svg-icons';

View file

@ -61,7 +61,7 @@
import { defineComponent } from 'vue';
import { faIdCardAlt, faPlus, faQuoteLeft, faQuoteRight, faRetweet, faReply, faAt, faCheck, faPollH } from '@fortawesome/free-solid-svg-icons';
import { faClock } from '@fortawesome/free-regular-svg-icons';
import { getNoteSummary } from '../../misc/get-note-summary';
import { getNoteSummary } from '@/misc/get-note-summary';
import XReactionIcon from './reaction-icon.vue';
import MkFollowButton from './follow-button.vue';
import notePage from '../filters/note';

View file

@ -52,7 +52,7 @@
import { defineComponent } from 'vue';
import { faExclamationTriangle, faTimes } from '@fortawesome/free-solid-svg-icons';
import { addTime } from '../../prelude/time';
import { formatDateTimeString } from '../../misc/format-time-string';
import { formatDateTimeString } from '@/misc/format-time-string';
import MkInput from './ui/input.vue';
import MkSelect from './ui/select.vue';
import MkSwitch from './ui/switch.vue';

View file

@ -61,9 +61,9 @@ import XNotePreview from './note-preview.vue';
import { parse } from '../../mfm/parse';
import { host, url } from '@client/config';
import { erase, unique } from '../../prelude/array';
import extractMentions from '../../misc/extract-mentions';
import getAcct from '../../misc/acct/render';
import { formatTimeString } from '../../misc/format-time-string';
import extractMentions from '@/misc/extract-mentions';
import getAcct from '@/misc/acct/render';
import { formatTimeString } from '@/misc/format-time-string';
import { Autocomplete } from '@client/scripts/autocomplete';
import { noteVisibilities } from '../../types';
import * as os from '@client/os';

View file

@ -27,7 +27,7 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { kinds } from '../../misc/api-permissions';
import { kinds } from '@/misc/api-permissions';
import XModalWindow from '@client/components/ui/modal-window.vue';
import MkInput from './ui/input.vue';
import MkTextarea from './ui/textarea.vue';

View file

@ -29,7 +29,7 @@
<script lang="ts">
import { defineComponent } from 'vue';
import parseAcct from '../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import MkFollowButton from './follow-button.vue';
import { userPage } from '../filters/user';

View file

@ -33,7 +33,7 @@
<script lang="ts">
import { defineComponent } from 'vue';
import parseAcct from '../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import MkFollowButton from './follow-button.vue';
import { userPage } from '../filters/user';
import * as os from '@client/os';

View file

@ -1,5 +1,5 @@
import getAcct from '../../misc/acct/render';
import getUserName from '../../misc/get-user-name';
import getAcct from '@/misc/acct/render';
import getUserName from '@/misc/get-user-name';
import { url } from '@client/config';
export const acct = user => {

View file

@ -1,6 +1,6 @@
import { markRaw } from 'vue';
import { locale } from '@client/config';
import { I18n } from '../misc/i18n';
import { I18n } from '@/misc/i18n';
export const i18n = markRaw(new I18n(locale));

View file

@ -6,7 +6,7 @@
<script lang="ts">
import { defineComponent } from 'vue';
import * as os from '@client/os';
import parseAcct from '../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
export default defineComponent({
created() {

View file

@ -65,7 +65,7 @@
import { defineComponent } from 'vue';
import { faPlus, faUsers, faSearch, faBookmark, faMicrophoneSlash, faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
import { faSnowflake, faBookmark as farBookmark } from '@fortawesome/free-regular-svg-icons';
import parseAcct from '../../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import MkButton from '@client/components/ui/button.vue';
import MkInput from '@client/components/ui/input.vue';
import MkSelect from '@client/components/ui/select.vue';

View file

@ -258,7 +258,7 @@ import MkTextarea from '@client/components/ui/textarea.vue';
import MkSwitch from '@client/components/ui/switch.vue';
import MkInfo from '@client/components/ui/info.vue';
import { url } from '@client/config';
import getAcct from '../../../misc/acct/render';
import getAcct from '@/misc/acct/render';
import * as os from '@client/os';
import { fetchInstance } from '@client/instance';

View file

@ -82,7 +82,7 @@
import { defineComponent } from 'vue';
import { faPlus, faUsers, faSearch, faBookmark, faMicrophoneSlash } from '@fortawesome/free-solid-svg-icons';
import { faSnowflake, faBookmark as farBookmark } from '@fortawesome/free-regular-svg-icons';
import parseAcct from '../../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import MkButton from '@client/components/ui/button.vue';
import MkInput from '@client/components/ui/input.vue';
import MkSelect from '@client/components/ui/select.vue';

View file

@ -41,7 +41,7 @@
<script lang="ts">
import { defineAsyncComponent, defineComponent } from 'vue';
import { faUser, faUsers, faComments, faPlus } from '@fortawesome/free-solid-svg-icons';
import getAcct from '../../../misc/acct/render';
import getAcct from '@/misc/acct/render';
import MkButton from '@client/components/ui/button.vue';
import { acct } from '../../filters/user';
import * as os from '@client/os';

View file

@ -26,7 +26,7 @@ import { defineComponent, defineAsyncComponent } from 'vue';
import { faPaperPlane, faPhotoVideo, faLaughSquint } from '@fortawesome/free-solid-svg-icons';
import insertTextAtCursor from 'insert-text-at-cursor';
import * as autosize from 'autosize';
import { formatTimeString } from '../../../misc/format-time-string';
import { formatTimeString } from '@/misc/format-time-string';
import { selectFile } from '@client/scripts/select-file';
import * as os from '@client/os';
import { Autocomplete } from '@client/scripts/autocomplete';

View file

@ -42,7 +42,7 @@ import { faWindowMaximize } from '@fortawesome/free-regular-svg-icons';
import XList from '@client/components/date-separated-list.vue';
import XMessage from './messaging-room.message.vue';
import XForm from './messaging-room.form.vue';
import parseAcct from '../../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import { isBottom, onScrollBottom, scroll } from '@client/scripts/scroll';
import * as os from '@client/os';
import { popout } from '@client/scripts/popout';

View file

@ -53,7 +53,7 @@ import MkInput from '@client/components/ui/input.vue';
import MkTextarea from '@client/components/ui/textarea.vue';
import MkSelect from '@client/components/ui/select.vue';
import MkSwitch from '@client/components/ui/switch.vue';
import getAcct from '../../../misc/acct/render';
import getAcct from '@/misc/acct/render';
import * as os from '@client/os';
export default defineComponent({

View file

@ -52,7 +52,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue';
import { Room } from '@client/scripts/room/room';
import parseAcct from '../../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import XPreview from './preview.vue';
const storeItems = require('@client/scripts/room/furnitures.json5');
import { faBoxOpen, faUndo, faArrowsAlt, faBan, faBroom } from '@fortawesome/free-solid-svg-icons';

View file

@ -228,7 +228,7 @@ import MkFolder from '@client/components/ui/folder.vue';
import MkRemoteCaution from '@client/components/remote-caution.vue';
import MkTab from '@client/components/tab.vue';
import Progress from '@client/scripts/loading';
import parseAcct from '../../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import { getScrollPosition } from '@client/scripts/scroll';
import { getUserMenu } from '@client/scripts/get-user-menu';
import number from '../../filters/number';

View file

@ -1,4 +1,4 @@
import parseAcct from '../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import { host as localHost } from '@client/config';
export async function genSearchQuery(v: any, q: string) {

View file

@ -3,7 +3,7 @@ import { faSnowflake, faEnvelope } from '@fortawesome/free-regular-svg-icons';
import { i18n } from '@client/i18n';
import copyToClipboard from '@client/scripts/copy-to-clipboard';
import { host } from '@client/config';
import getAcct from '../../misc/acct/render';
import getAcct from '@/misc/acct/render';
import * as os from '@client/os';
import { userActions } from '@client/store';
import { router } from '@client/router';

View file

@ -3,8 +3,8 @@
*/
declare var self: ServiceWorkerGlobalScope;
import { getNoteSummary } from '../../misc/get-note-summary';
import getUserName from '../../misc/get-user-name';
import { getNoteSummary } from '@/misc/get-note-summary';
import getUserName from '@/misc/get-user-name';
export default async function(type, data, i18n): Promise<[string, NotificationOptions] | null | undefined> {
if (!i18n) {

View file

@ -5,7 +5,7 @@ declare var self: ServiceWorkerGlobalScope;
import { get, set } from 'idb-keyval';
import composeNotification from '@client/sw/compose-notification';
import { I18n } from '../../misc/i18n';
import { I18n } from '@/misc/i18n';
//#region Variables
const version = _VERSION_;

View file

@ -56,9 +56,9 @@ import { toASCII } from 'punycode';
import { parse } from '../../../mfm/parse';
import { host, url } from '@client/config';
import { erase, unique } from '../../../prelude/array';
import extractMentions from '../../../misc/extract-mentions';
import getAcct from '../../../misc/acct/render';
import { formatTimeString } from '../../../misc/format-time-string';
import extractMentions from '@/misc/extract-mentions';
import getAcct from '@/misc/acct/render';
import { formatTimeString } from '@/misc/format-time-string';
import { Autocomplete } from '@client/scripts/autocomplete';
import { noteVisibilities } from '../../../types';
import * as os from '@client/os';

View file

@ -1,5 +1,5 @@
import * as elasticsearch from '@elastic/elasticsearch';
import config from '../config';
import config from '@/config';
const index = {
settings: {

View file

@ -3,7 +3,7 @@ const types = require('pg').types;
types.setTypeParser(20, Number);
import { createConnection, Logger, getConnection } from 'typeorm';
import config from '../config';
import config from '@/config';
import { entities as charts } from '../services/chart/entities';
import { dbLogger } from './logger';
import * as highlight from 'cli-highlight';

View file

@ -1,5 +1,5 @@
import * as redis from 'redis';
import config from '../config';
import config from '@/config';
export function createConnection() {
return redis.createClient(

View file

@ -1,9 +1,9 @@
import * as P from 'parsimmon';
import { createLeaf, createTree, urlRegex } from './prelude';
import { takeWhile, cumulativeSum } from '../prelude/array';
import parseAcct from '../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import { toUnicode } from 'punycode';
import { emojiRegex } from '../misc/emoji-regex';
import { emojiRegex } from '@/misc/emoji-regex';
export function removeOrphanedBrackets(s: string): string {
const openBrackets = ['(', '「', '['];

View file

@ -1,5 +1,5 @@
import { JSDOM } from 'jsdom';
import config from '../config';
import config from '@/config';
import { intersperse } from '../prelude/array';
import { MfmForest, MfmTree } from './prelude';
import { IMentionedRemoteUsers } from '../models/entities/note';

View file

@ -1,5 +1,5 @@
import { MfmForest, MfmTree } from './prelude';
import { nyaize } from '../misc/nyaize';
import { nyaize } from '@/misc/nyaize';
export type RestoreOptions = {
doNyaize?: boolean;

View file

@ -1,7 +1,7 @@
import fetch from 'node-fetch';
import { URLSearchParams } from 'url';
import { getAgentByUrl } from './fetch';
import config from '../config';
import config from '@/config';
export async function verifyRecaptcha(secret: string, response: string) {
const result = await getCaptchaResponse('https://www.recaptcha.net/recaptcha/api/siteverify', secret, response).catch(e => {

View file

@ -1,4 +1,4 @@
import config from '../config';
import config from '@/config';
import { toASCII } from 'punycode';
export function getFullApAccount(username: string, host: string | null) {

View file

@ -4,7 +4,7 @@ import * as util from 'util';
import fetch from 'node-fetch';
import { getAgentByUrl } from './fetch';
import { AbortController } from 'abort-controller';
import config from '../config';
import config from '@/config';
import * as chalk from 'chalk';
import Logger from '../services/logger';

View file

@ -4,7 +4,7 @@ import * as cache from 'lookup-dns-cache';
import fetch, { HeadersInit } from 'node-fetch';
import { HttpProxyAgent } from 'http-proxy-agent';
import { HttpsProxyAgent } from 'https-proxy-agent';
import config from '../config';
import config from '@/config';
import { URL } from 'url';
export async function getJson(url: string, accept = 'application/json, */*', timeout = 10000, headers?: HeadersInit) {

View file

@ -3,7 +3,7 @@ import { genAid } from './id/aid';
import { genMeid } from './id/meid';
import { genMeidg } from './id/meidg';
import { genObjectId } from './id/object-id';
import config from '../config';
import config from '@/config';
const metohd = config.id.toLowerCase();

View file

@ -1,6 +1,6 @@
import { EntityRepository, Repository } from 'typeorm';
import { Antenna } from '../entities/antenna';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
import { AntennaNotes, UserGroupJoinings } from '..';
export type PackedAntenna = SchemaType<typeof packedAntennaSchema>;

View file

@ -1,7 +1,7 @@
import { EntityRepository, Repository } from 'typeorm';
import { App } from '../entities/app';
import { AccessTokens } from '..';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
export type PackedApp = SchemaType<typeof packedAppSchema>;

View file

@ -2,7 +2,7 @@ import { EntityRepository, Repository } from 'typeorm';
import { Users } from '..';
import { Blocking } from '../entities/blocking';
import { awaitAll } from '../../prelude/await-all';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
export type PackedBlocking = SchemaType<typeof packedBlockingSchema>;

View file

@ -1,6 +1,6 @@
import { EntityRepository, Repository } from 'typeorm';
import { Channel } from '../entities/channel';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
import { DriveFiles, ChannelFollowings, NoteUnreads } from '..';
import { User } from '../entities/user';

View file

@ -1,6 +1,6 @@
import { EntityRepository, Repository } from 'typeorm';
import { Clip } from '../entities/clip';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
import { Users } from '..';
import { awaitAll } from '../../prelude/await-all';

View file

@ -2,13 +2,13 @@ import { EntityRepository, Repository } from 'typeorm';
import { DriveFile } from '../entities/drive-file';
import { Users, DriveFolders } from '..';
import { User } from '../entities/user';
import { toPuny } from '../../misc/convert-host';
import { toPuny } from '@/misc/convert-host';
import { awaitAll } from '../../prelude/await-all';
import { SchemaType } from '../../misc/schema';
import config from '../../config';
import { SchemaType } from '@/misc/schema';
import config from '@/config';
import { query, appendQuery } from '../../prelude/url';
import { Meta } from '../entities/meta';
import { fetchMeta } from '../../misc/fetch-meta';
import { fetchMeta } from '@/misc/fetch-meta';
export type PackedDriveFile = SchemaType<typeof packedDriveFileSchema>;

View file

@ -2,7 +2,7 @@ import { EntityRepository, Repository } from 'typeorm';
import { DriveFolders, DriveFiles } from '..';
import { DriveFolder } from '../entities/drive-folder';
import { awaitAll } from '../../prelude/await-all';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
export type PackedDriveFolder = SchemaType<typeof packedDriveFolderSchema>;

View file

@ -1,4 +1,4 @@
import config from '../../config';
import config from '@/config';
export const packedFederationInstanceSchema = {
type: 'object' as const,

View file

@ -2,7 +2,7 @@ import { EntityRepository, Repository } from 'typeorm';
import { Users } from '..';
import { Following } from '../entities/following';
import { awaitAll } from '../../prelude/await-all';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
type LocalFollowerFollowing = Following & {
followerHost: null;

View file

@ -1,6 +1,6 @@
import { EntityRepository, Repository } from 'typeorm';
import { Hashtag } from '../entities/hashtag';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
export type PackedHashtag = SchemaType<typeof packedHashtagSchema>;

View file

@ -1,7 +1,7 @@
import { EntityRepository, Repository } from 'typeorm';
import { MessagingMessage } from '../entities/messaging-message';
import { Users, DriveFiles, UserGroups } from '..';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
export type PackedMessagingMessage = SchemaType<typeof packedMessagingMessageSchema>;

View file

@ -2,7 +2,7 @@ import { EntityRepository, Repository } from 'typeorm';
import { Users } from '..';
import { Muting } from '../entities/muting';
import { awaitAll } from '../../prelude/await-all';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
export type PackedMuting = SchemaType<typeof packedMutingSchema>;

View file

@ -1,8 +1,8 @@
import { EntityRepository, Repository } from 'typeorm';
import { NoteReaction } from '../entities/note-reaction';
import { Users } from '..';
import { SchemaType } from '../../misc/schema';
import { convertLegacyReaction } from '../../misc/reaction-lib';
import { SchemaType } from '@/misc/schema';
import { convertLegacyReaction } from '@/misc/reaction-lib';
export type PackedNoteReaction = SchemaType<typeof packedNoteReactionSchema>;

View file

@ -2,13 +2,13 @@ import { EntityRepository, Repository, In } from 'typeorm';
import { Note } from '../entities/note';
import { User } from '../entities/user';
import { Users, PollVotes, DriveFiles, NoteReactions, Followings, Polls, Channels } from '..';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
import { awaitAll } from '../../prelude/await-all';
import { convertLegacyReaction, convertLegacyReactions, decodeReaction } from '../../misc/reaction-lib';
import { convertLegacyReaction, convertLegacyReactions, decodeReaction } from '@/misc/reaction-lib';
import { toString } from '../../mfm/to-string';
import { parse } from '../../mfm/parse';
import { NoteReaction } from '../entities/note-reaction';
import { aggregateNoteEmojis, populateEmojis, prefetchEmojis } from '../../misc/populate-emojis';
import { aggregateNoteEmojis, populateEmojis, prefetchEmojis } from '@/misc/populate-emojis';
export type PackedNote = SchemaType<typeof packedNoteSchema>;

View file

@ -2,11 +2,11 @@ import { EntityRepository, In, Repository } from 'typeorm';
import { Users, Notes, UserGroupInvitations, AccessTokens, NoteReactions } from '..';
import { Notification } from '../entities/notification';
import { awaitAll } from '../../prelude/await-all';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
import { Note } from '../entities/note';
import { NoteReaction } from '../entities/note-reaction';
import { User } from '../entities/user';
import { aggregateNoteEmojis, prefetchEmojis } from '../../misc/populate-emojis';
import { aggregateNoteEmojis, prefetchEmojis } from '@/misc/populate-emojis';
export type PackedNotification = SchemaType<typeof packedNotificationSchema>;

View file

@ -1,6 +1,6 @@
import { EntityRepository, Repository } from 'typeorm';
import { Page } from '../entities/page';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
import { Users, DriveFiles, PageLikes } from '..';
import { awaitAll } from '../../prelude/await-all';
import { DriveFile } from '../entities/drive-file';

View file

@ -1,7 +1,7 @@
import { EntityRepository, Repository } from 'typeorm';
import { UserGroup } from '../entities/user-group';
import { UserGroupJoinings } from '..';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
export type PackedUserGroup = SchemaType<typeof packedUserGroupSchema>;

View file

@ -1,7 +1,7 @@
import { EntityRepository, Repository } from 'typeorm';
import { UserList } from '../entities/user-list';
import { UserListJoinings } from '..';
import { SchemaType } from '../../misc/schema';
import { SchemaType } from '@/misc/schema';
export type PackedUserList = SchemaType<typeof packedUserListSchema>;

View file

@ -2,11 +2,11 @@ import $ from 'cafy';
import { EntityRepository, Repository, In, Not } from 'typeorm';
import { User, ILocalUser, IRemoteUser } from '../entities/user';
import { Notes, NoteUnreads, FollowRequests, Notifications, MessagingMessages, UserNotePinings, Followings, Blockings, Mutings, UserProfiles, UserSecurityKeys, UserGroupJoinings, Pages, Announcements, AnnouncementReads, Antennas, AntennaNotes, ChannelFollowings, Instances } from '..';
import config from '../../config';
import { SchemaType } from '../../misc/schema';
import config from '@/config';
import { SchemaType } from '@/misc/schema';
import { awaitAll } from '../../prelude/await-all';
import { populateEmojis } from '../../misc/populate-emojis';
import { getAntennas } from '../../misc/antenna-cache';
import { populateEmojis } from '@/misc/populate-emojis';
import { getAntennas } from '@/misc/antenna-cache';
export type PackedUser = SchemaType<typeof packedUserSchema>;

View file

@ -1,6 +1,6 @@
import * as httpSignature from 'http-signature';
import config from '../config';
import config from '@/config';
import { ILocalUser } from '../models/entities/user';
import { program } from '../argv';

View file

@ -1,5 +1,5 @@
import * as Queue from 'bull';
import config from '../config';
import config from '@/config';
export function initialize(name: string, limitPerSec = -1) {
return new Queue(name, {

View file

@ -5,7 +5,7 @@ import * as fs from 'fs';
import { queueLogger } from '../../logger';
import addFile from '../../../services/drive/add-file';
import dateFormat = require('dateformat');
import { getFullApAccount } from '../../../misc/convert-host';
import { getFullApAccount } from '@/misc/convert-host';
import { Users, Blockings } from '../../../models';
import { MoreThan } from 'typeorm';

View file

@ -5,7 +5,7 @@ import * as fs from 'fs';
import { queueLogger } from '../../logger';
import addFile from '../../../services/drive/add-file';
import dateFormat = require('dateformat');
import { getFullApAccount } from '../../../misc/convert-host';
import { getFullApAccount } from '@/misc/convert-host';
import { Users, Followings } from '../../../models';
import { MoreThan } from 'typeorm';

View file

@ -5,7 +5,7 @@ import * as fs from 'fs';
import { queueLogger } from '../../logger';
import addFile from '../../../services/drive/add-file';
import dateFormat = require('dateformat');
import { getFullApAccount } from '../../../misc/convert-host';
import { getFullApAccount } from '@/misc/convert-host';
import { Users, Mutings } from '../../../models';
import { MoreThan } from 'typeorm';

View file

@ -5,7 +5,7 @@ import * as fs from 'fs';
import { queueLogger } from '../../logger';
import addFile from '../../../services/drive/add-file';
import dateFormat = require('dateformat');
import { getFullApAccount } from '../../../misc/convert-host';
import { getFullApAccount } from '@/misc/convert-host';
import { Users, UserLists, UserListJoinings } from '../../../models';
import { In } from 'typeorm';

View file

@ -2,10 +2,10 @@ import * as Bull from 'bull';
import { queueLogger } from '../../logger';
import follow from '../../../services/following/create';
import parseAcct from '../../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import { resolveUser } from '../../../remote/resolve-user';
import { downloadTextFile } from '../../../misc/download-text-file';
import { isSelfHost, toPuny } from '../../../misc/convert-host';
import { downloadTextFile } from '@/misc/download-text-file';
import { isSelfHost, toPuny } from '@/misc/convert-host';
import { Users, DriveFiles } from '../../../models';
const logger = queueLogger.createSubLogger('import-following');

View file

@ -1,13 +1,13 @@
import * as Bull from 'bull';
import { queueLogger } from '../../logger';
import parseAcct from '../../../misc/acct/parse';
import parseAcct from '@/misc/acct/parse';
import { resolveUser } from '../../../remote/resolve-user';
import { pushUserToUserList } from '../../../services/user-list/push';
import { downloadTextFile } from '../../../misc/download-text-file';
import { isSelfHost, toPuny } from '../../../misc/convert-host';
import { downloadTextFile } from '@/misc/download-text-file';
import { isSelfHost, toPuny } from '@/misc/convert-host';
import { DriveFiles, Users, UserLists, UserListJoinings } from '../../../models';
import { genId } from '../../../misc/gen-id';
import { genId } from '@/misc/gen-id';
const logger = queueLogger.createSubLogger('import-user-lists');

View file

@ -5,9 +5,9 @@ import Logger from '../../services/logger';
import { Instances } from '../../models';
import { instanceChart } from '../../services/chart';
import { fetchInstanceMetadata } from '../../services/fetch-instance-metadata';
import { fetchMeta } from '../../misc/fetch-meta';
import { toPuny } from '../../misc/convert-host';
import { Cache } from '../../misc/cache';
import { fetchMeta } from '@/misc/fetch-meta';
import { toPuny } from '@/misc/convert-host';
import { Cache } from '@/misc/cache';
import { Instance } from '../../models/entities/instance';
const logger = new Logger('deliver');

View file

@ -5,8 +5,8 @@ import Logger from '../../services/logger';
import { registerOrFetchInstanceDoc } from '../../services/register-or-fetch-instance-doc';
import { Instances } from '../../models';
import { instanceChart } from '../../services/chart';
import { fetchMeta } from '../../misc/fetch-meta';
import { toPuny, extractDbHost } from '../../misc/convert-host';
import { fetchMeta } from '@/misc/fetch-meta';
import { toPuny, extractDbHost } from '@/misc/convert-host';
import { getApId } from '../../remote/activitypub/type';
import { fetchInstanceMetadata } from '../../services/fetch-instance-metadata';
import { InboxJobData } from '..';

View file

@ -1,4 +1,4 @@
import config from '../config';
import config from '@/config';
import { initialize as initializeQueue } from './initialize';
export const deliverQueue = initializeQueue('deliver', config.deliverJobPerSec || 128);

View file

@ -1,4 +1,4 @@
import config from '../../config';
import config from '@/config';
import { Note } from '../../models/entities/note';
import { User, IRemoteUser } from '../../models/entities/user';
import { UserPublickey } from '../../models/entities/user-publickey';

View file

@ -4,9 +4,9 @@ import { IRemoteUser } from '../../../../models/entities/user';
import { IAnnounce, getApId } from '../../type';
import { fetchNote, resolveNote } from '../../models/note';
import { apLogger } from '../../logger';
import { extractDbHost } from '../../../../misc/convert-host';
import { fetchMeta } from '../../../../misc/fetch-meta';
import { getApLock } from '../../../../misc/app-lock';
import { extractDbHost } from '@/misc/convert-host';
import { fetchMeta } from '@/misc/fetch-meta';
import { getApLock } from '@/misc/app-lock';
import { parseAudience } from '../../audience';
const logger = apLogger;

View file

@ -2,8 +2,8 @@ import Resolver from '../../resolver';
import { IRemoteUser } from '../../../../models/entities/user';
import { createNote, fetchNote } from '../../models/note';
import { getApId, IObject, ICreate } from '../../type';
import { getApLock } from '../../../../misc/app-lock';
import { extractDbHost } from '../../../../misc/convert-host';
import { getApLock } from '@/misc/app-lock';
import { extractDbHost } from '@/misc/convert-host';
/**
* 稿

View file

@ -2,7 +2,7 @@ import { IRemoteUser } from '../../../../models/entities/user';
import deleteNode from '../../../../services/note/delete';
import { apLogger } from '../../logger';
import DbResolver from '../../db-resolver';
import { getApLock } from '../../../../misc/app-lock';
import { getApLock } from '@/misc/app-lock';
import { deleteMessage } from '../../../../services/messages/delete';
const logger = apLogger;

View file

@ -1,9 +1,9 @@
import { IRemoteUser } from '../../../../models/entities/user';
import config from '../../../../config';
import config from '@/config';
import { IFlag, getApIds } from '../../type';
import { AbuseUserReports, Users } from '../../../../models';
import { In } from 'typeorm';
import { genId } from '../../../../misc/gen-id';
import { genId } from '@/misc/gen-id';
export default async (actor: IRemoteUser, activity: IFlag): Promise<string> => {
// objectは `(User|Note) | (User|Note)[]` だけど、全パターンDBスキーマと対応させられないので

View file

@ -1,6 +1,6 @@
import { IRemoteUser } from '../../../models/entities/user';
import { IRead, getApId } from '../type';
import { isSelfHost, extractDbHost } from '../../../misc/convert-host';
import { isSelfHost, extractDbHost } from '@/misc/convert-host';
import { MessagingMessages } from '../../../models';
import { readUserMessagingMessage } from '../../../server/api/common/read-messaging-message';

View file

@ -2,7 +2,7 @@ import * as crypto from 'crypto';
import * as jsonld from 'jsonld';
import { CONTEXTS } from './contexts';
import fetch from 'node-fetch';
import { httpAgent, httpsAgent } from '../../../misc/fetch';
import { httpAgent, httpsAgent } from '@/misc/fetch';
// RsaSignature2017 based from https://github.com/transmute-industries/RsaSignature2017

View file

@ -1,7 +1,7 @@
import uploadFromUrl from '../../../services/drive/upload-from-url';
import { IRemoteUser } from '../../../models/entities/user';
import Resolver from '../resolver';
import { fetchMeta } from '../../../misc/fetch-meta';
import { fetchMeta } from '@/misc/fetch-meta';
import { apLogger } from '../logger';
import { DriveFile } from '../../../models/entities/drive-file';
import { DriveFiles } from '../../../models';

View file

@ -1,6 +1,6 @@
import * as promiseLimit from 'promise-limit';
import config from '../../../config';
import config from '@/config';
import Resolver from '../resolver';
import post from '../../../services/note/create';
import { resolvePerson, updatePerson } from './person';
@ -14,14 +14,14 @@ import vote from '../../../services/note/polls/vote';
import { apLogger } from '../logger';
import { DriveFile } from '../../../models/entities/drive-file';
import { deliverQuestionUpdate } from '../../../services/note/polls/update';
import { extractDbHost, toPuny } from '../../../misc/convert-host';
import { extractDbHost, toPuny } from '@/misc/convert-host';
import { Emojis, Polls, MessagingMessages } from '../../../models';
import { Note } from '../../../models/entities/note';
import { IObject, getOneApId, getApId, getOneApHrefNullable, validPost, IPost, isEmoji } from '../type';
import { Emoji } from '../../../models/entities/emoji';
import { genId } from '../../../misc/gen-id';
import { fetchMeta } from '../../../misc/fetch-meta';
import { getApLock } from '../../../misc/app-lock';
import { genId } from '@/misc/gen-id';
import { fetchMeta } from '@/misc/fetch-meta';
import { getApLock } from '@/misc/app-lock';
import { createMessage } from '../../../services/messages/create';
import { parseAudience } from '../audience';
import { extractApMentions } from './mention';

View file

@ -1,6 +1,6 @@
import * as promiseLimit from 'promise-limit';
import config from '../../../config';
import config from '@/config';
import Resolver from '../resolver';
import { resolveImage } from './image';
import { isCollectionOrOrderedCollection, isCollection, IPerson, getApId, getOneApHrefNullable, IObject, isPropertyValue, IApPropertyValue } from '../type';
@ -16,17 +16,17 @@ import { Users, Instances, DriveFiles, Followings, UserProfiles, UserPublickeys
import { User, IRemoteUser } from '../../../models/entities/user';
import { Emoji } from '../../../models/entities/emoji';
import { UserNotePining } from '../../../models/entities/user-note-pining';
import { genId } from '../../../misc/gen-id';
import { genId } from '@/misc/gen-id';
import { instanceChart, usersChart } from '../../../services/chart';
import { UserPublickey } from '../../../models/entities/user-publickey';
import { isDuplicateKeyValueError } from '../../../misc/is-duplicate-key-value-error';
import { toPuny } from '../../../misc/convert-host';
import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error';
import { toPuny } from '@/misc/convert-host';
import { UserProfile } from '../../../models/entities/user-profile';
import { validActor } from '../../../remote/activitypub/type';
import { getConnection } from 'typeorm';
import { toArray } from '../../../prelude/array';
import { fetchInstanceMetadata } from '../../../services/fetch-instance-metadata';
import { normalizeForSearch } from '../../../misc/normalize-for-search';
import { normalizeForSearch } from '@/misc/normalize-for-search';
const logger = apLogger;

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import Resolver from '../resolver';
import { IObject, IQuestion, isQuestion, } from '../type';
import { apLogger } from '../logger';

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { ILocalUser } from '../../../models/entities/user';
export default (object: any, user: ILocalUser) => ({

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { ILocalUser } from '../../../models/entities/user';
export default (user: ILocalUser, target: any, object: any) => ({

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { Note } from '../../../models/entities/note';
export default (object: any, note: Note) => {

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { ILocalUser, IRemoteUser } from '../../../models/entities/user';
export default (blocker: ILocalUser, blockee: IRemoteUser) => ({

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { Note } from '../../../models/entities/note';
export default (object: any, note: Note) => {

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { ILocalUser } from '../../../models/entities/user';
export default (object: any, user: ILocalUser) => ({

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { Emoji } from '../../../models/entities/emoji';
export default (emoji: Emoji) => ({

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { Relay } from '../../../models/entities/relay';
import { ILocalUser } from '../../../models/entities/user';

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { Users } from '../../../models';
import { User } from '../../../models/entities/user';

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { User } from '../../../models/entities/user';
import { Users } from '../../../models';

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
export default (tag: string) => ({
type: 'Hashtag',

View file

@ -1,9 +1,9 @@
import config from '../../../config';
import config from '@/config';
import { v4 as uuid } from 'uuid';
import { IActivity } from '../type';
import { LdSignature } from '../misc/ld-signature';
import { ILocalUser } from '../../../models/entities/user';
import { getUserKeypair } from '../../../misc/keypair-store';
import { getUserKeypair } from '@/misc/keypair-store';
export const renderActivity = (x: any): IActivity | null => {
if (x == null) return null;

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { ILocalUser } from '../../../models/entities/user';
import { UserKeypair } from '../../../models/entities/user-keypair';
import { createPublicKey } from 'crypto';

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { NoteReaction } from '../../../models/entities/note-reaction';
import { Note } from '../../../models/entities/note';
import { Emojis } from '../../../models';

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { User, ILocalUser } from '../../../models/entities/user';
import { Users } from '../../../models';

View file

@ -2,7 +2,7 @@ import renderDocument from './document';
import renderHashtag from './hashtag';
import renderMention from './mention';
import renderEmoji from './emoji';
import config from '../../../config';
import config from '@/config';
import toHtml from '../misc/get-note-html';
import { Note, IMentionedRemoteUsers } from '../../../models/entities/note';
import { DriveFile } from '../../../models/entities/drive-file';

View file

@ -1,6 +1,6 @@
import renderImage from './image';
import renderKey from './key';
import config from '../../../config';
import config from '@/config';
import { ILocalUser } from '../../../models/entities/user';
import { toHtml } from '../../../mfm/to-html';
import { parse } from '../../../mfm/parse';
@ -9,7 +9,7 @@ import renderEmoji from './emoji';
import { IIdentifier } from '../models/identifier';
import renderHashtag from './hashtag';
import { DriveFiles, UserProfiles } from '../../../models';
import { getUserKeypair } from '../../../misc/keypair-store';
import { getUserKeypair } from '@/misc/keypair-store';
export async function renderPerson(user: ILocalUser) {
const id = `${config.url}/users/${user.id}`;

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { ILocalUser } from '../../../models/entities/user';
import { Note } from '../../../models/entities/note';
import { Poll } from '../../../models/entities/poll';

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { ILocalUser } from '../../../models/entities/user';
import { MessagingMessage } from '../../../models/entities/messaging-message';

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { ILocalUser } from '../../../models/entities/user';
export default (object: any, user: ILocalUser) => ({

View file

@ -1,4 +1,4 @@
import config from '../../../config';
import config from '@/config';
import { ILocalUser } from '../../../models/entities/user';
export default (user: ILocalUser, target: any, object: any) => ({

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