esModuleInterop to true

This commit is contained in:
Chocobozzz
2021-08-27 14:32:44 +02:00
parent 40e7ed0714
commit 41fb13c330
208 changed files with 444 additions and 425 deletions

View File

@@ -1,4 +1,4 @@
import * as memoizee from 'memoizee'
import memoizee from 'memoizee'
import { AllowNull, Column, Default, DefaultScope, HasOne, IsInt, Model, Table } from 'sequelize-typescript'
import { AttributesOnly } from '@shared/core-utils'
import { AccountModel } from '../account/account'

View File

@@ -1,5 +1,4 @@
import { Model } from 'sequelize-typescript'
import * as Bluebird from 'bluebird'
import { logger } from '@server/helpers/logger'
type ModelCacheType =
@@ -52,7 +51,7 @@ class ModelCache {
if (cache.has(key)) {
logger.debug('Model cache hit for %s -> %s.', cacheType, key)
return Bluebird.resolve<T>(cache.get(key))
return Promise.resolve<T>(cache.get(key))
}
return fun().then(m => {

View File

@@ -585,7 +585,7 @@ export class VideoCommentModel extends Model<Partial<AttributesOnly<VideoComment
if (accountId) {
whereAnd.push({
[Op.eq]: accountId
accountId
})
}

View File

@@ -1,5 +1,5 @@
import { remove } from 'fs-extra'
import * as memoizee from 'memoizee'
import memoizee from 'memoizee'
import { join } from 'path'
import { FindOptions, Op, Transaction } from 'sequelize'
import {

View File

@@ -1,4 +1,4 @@
import * as memoizee from 'memoizee'
import memoizee from 'memoizee'
import { join } from 'path'
import { Op } from 'sequelize'
import {

View File

@@ -1,5 +1,5 @@
import * as Sequelize from 'sequelize'
import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Table } from 'sequelize-typescript'
import { literal, Op } from 'sequelize'
import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Model, Table } from 'sequelize-typescript'
import { AttributesOnly } from '@shared/core-utils'
import { VideoModel } from './video'
@@ -20,11 +20,11 @@ export class VideoViewModel extends Model<Partial<AttributesOnly<VideoViewModel>
createdAt: Date
@AllowNull(false)
@Column(Sequelize.DATE)
@Column(DataType.DATE)
startDate: Date
@AllowNull(false)
@Column(Sequelize.DATE)
@Column(DataType.DATE)
endDate: Date
@AllowNull(false)
@@ -47,10 +47,10 @@ export class VideoViewModel extends Model<Partial<AttributesOnly<VideoViewModel>
const query = {
where: {
startDate: {
[Sequelize.Op.lt]: beforeDate
[Op.lt]: beforeDate
},
videoId: {
[Sequelize.Op.in]: Sequelize.literal('(SELECT "id" FROM "video" WHERE "remote" IS TRUE)')
[Op.in]: literal('(SELECT "id" FROM "video" WHERE "remote" IS TRUE)')
}
}
}

View File

@@ -1,4 +1,4 @@
import * as Bluebird from 'bluebird'
import Bluebird from 'bluebird'
import { remove } from 'fs-extra'
import { maxBy, minBy } from 'lodash'
import { join } from 'path'