refactor: Use ESM (#8358)

* wip

* wip

* fix

* clean up

* Update tsconfig.json

* Update activitypub.ts

* wip
This commit is contained in:
syuilo
2022-02-27 11:07:39 +09:00
committed by GitHub
parent 0a882471f3
commit d071d18dd7
737 changed files with 4135 additions and 3678 deletions

View File

@@ -1,13 +1,13 @@
import * as Koa from 'koa';
import * as bcrypt from 'bcryptjs';
import Koa from 'koa';
import bcrypt from 'bcryptjs';
import * as speakeasy from 'speakeasy';
import signin from '../common/signin';
import config from '@/config/index';
import { Users, Signins, UserProfiles, UserSecurityKeys, AttestationChallenges } from '@/models/index';
import { ILocalUser } from '@/models/entities/user';
import { genId } from '@/misc/gen-id';
import { verifyLogin, hash } from '../2fa';
import { randomBytes } from 'crypto';
import signin from '../common/signin.js';
import config from '@/config/index.js';
import { Users, Signins, UserProfiles, UserSecurityKeys, AttestationChallenges } from '@/models/index.js';
import { ILocalUser } from '@/models/entities/user.js';
import { genId } from '@/misc/gen-id.js';
import { verifyLogin, hash } from '../2fa.js';
import { randomBytes } from 'node:crypto';
export default async (ctx: Koa.Context) => {
ctx.set('Access-Control-Allow-Origin', config.url);

View File

@@ -1,7 +1,7 @@
import * as Koa from 'koa';
import { Users, UserPendings, UserProfiles } from '@/models/index';
import { signup } from '../common/signup';
import signin from '../common/signin';
import Koa from 'koa';
import { Users, UserPendings, UserProfiles } from '@/models/index.js';
import { signup } from '../common/signup.js';
import signin from '../common/signin.js';
export default async (ctx: Koa.Context) => {
const body = ctx.request.body;

View File

@@ -1,14 +1,14 @@
import * as Koa from 'koa';
import Koa from 'koa';
import rndstr from 'rndstr';
import * as bcrypt from 'bcryptjs';
import { fetchMeta } from '@/misc/fetch-meta';
import { verifyHcaptcha, verifyRecaptcha } from '@/misc/captcha';
import { Users, RegistrationTickets, UserPendings } from '@/models/index';
import { signup } from '../common/signup';
import config from '@/config';
import { sendEmail } from '@/services/send-email';
import { genId } from '@/misc/gen-id';
import { validateEmailForAccount } from '@/services/validate-email-for-account';
import bcrypt from 'bcryptjs';
import { fetchMeta } from '@/misc/fetch-meta.js';
import { verifyHcaptcha, verifyRecaptcha } from '@/misc/captcha.js';
import { Users, RegistrationTickets, UserPendings } from '@/models/index.js';
import { signup } from '../common/signup.js';
import config from '@/config/index.js';
import { sendEmail } from '@/services/send-email.js';
import { genId } from '@/misc/gen-id.js';
import { validateEmailForAccount } from '@/services/validate-email-for-account.js';
export default async (ctx: Koa.Context) => {
const body = ctx.request.body;