2,
{
"SwitchCase": 1,
- "MemberExpression": "off"
+ "MemberExpression": "off",
+ // https://github.com/eslint/eslint/issues/15299
+ "ignoredNodes": ["PropertyDefinition"]
}
],
"@typescript-eslint/consistent-type-assertions": [
"arrow-body-style": "off",
"import/no-webpack-loader-syntax": "off",
"no-underscore-dangle": "off",
- "node/no-callback-literal": "off",
+ "n/no-callback-literal": "off",
"@angular-eslint/component-selector": [
"error",
{
"eslint": "^8.0.0",
"eslint-config-standard-with-typescript": "^22.0.0",
"eslint-plugin-import": "^2.20.1",
+ "eslint-plugin-n": "^15.2.4",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^6.0.0",
"fast-xml-parser": "^4.0.0-beta.8",
return new Promise((res, rej) => {
autocannon({
url: server.url + path,
- method: method,
+ method,
body,
connections: 20,
headers,
})
const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({
- userToCreate: userToCreate,
+ userToCreate,
userDisplayName: body.displayName || undefined,
channelNames: body.channel
})
support: body.support || null,
privacy: body.privacy || VideoPrivacy.PRIVATE,
duration: 0, // duration will be set by the import job
- channelId: channelId,
+ channelId,
originallyPublishedAt: body.originallyPublishedAt
? new Date(body.originallyPublishedAt)
: importData.originallyPublishedAt
})
if (successView) {
- Hooks.runAction('action:api.video.viewed', { video: video, ip, req, res })
+ Hooks.runAction('action:api.video.viewed', { video, ip, req, res })
}
await updateUserHistoryIfNeeded(body, video, res)
html,
width: embedWidth,
height: embedHeight,
- title: title,
+ title,
author_name: channel.name,
author_url: channel.Actor.url,
provider_name: 'PeerTube',
if (sanitizeAndCheckActorObject(body) === false) {
logger.debug('Remote actor JSON is not valid.', { actorJSON: body })
- return { actorObject: undefined, statusCode: statusCode }
+ return { actorObject: undefined, statusCode }
}
if (checkUrlsSameHost(body.id, actorUrl) !== true) {
logger.warn('Actor url %s has not the same host than its AP id %s', actorUrl, body.id)
- return { actorObject: undefined, statusCode: statusCode }
+ return { actorObject: undefined, statusCode }
}
return {
return {
bypass: true,
pluginName: npmName,
- authName: authName,
+ authName,
user
}
}
return sequelizeTypescript.transaction(async t => {
return AccountBlocklistModel.upsert({
accountId: byAccountId,
- targetAccountId: targetAccountId
+ targetAccountId
}, { transaction: t })
})
}
const videoAbuseInstance: MVideoAbuseVideoFull = await VideoAbuseModel.create({
abuseId: abuseInstance.id,
videoId: videoInstance.id,
- startAt: startAt,
- endAt: endAt
+ startAt,
+ endAt
}, { transaction })
videoAbuseInstance.Video = videoInstance
})
registerInstrumentations({
- tracerProvider: tracerProvider,
+ tracerProvider,
instrumentations: [
new PgInstrumentation({
enhancedDatabaseReporting: true
if (!this.hooks[options.target]) this.hooks[options.target] = []
this.hooks[options.target].push({
- npmName: npmName,
+ npmName,
pluginName: plugin.name,
handler: options.handler,
priority: options.priority || 0
}
}
- this.updatedVideoConstants[type][npmName].added.push({ key: key, label } as VideoConstant)
+ this.updatedVideoConstants[type][npmName].added.push({ key, label } as VideoConstant)
obj[key] = label
return true
emailVerified,
adminFlags,
- videoQuota: videoQuota,
- videoQuotaDaily: videoQuotaDaily,
+ videoQuota,
+ videoQuotaDaily,
pluginAuth
})
const accountCreated = await createLocalAccountWithoutKeys({
name: SERVER_ACTOR_NAME,
userId: null,
- applicationId: applicationId,
+ applicationId,
t: undefined,
type: 'Application'
})
description: videoInfo.description,
support: videoInfo.support,
privacy: videoInfo.privacy || VideoPrivacy.PRIVATE,
- channelId: channelId,
+ channelId,
originallyPublishedAt: videoInfo.originallyPublishedAt
? new Date(videoInfo.originallyPublishedAt)
: null
async function addTranscodingJob (payload: VideoTranscodingPayload, options: CreateJobOptions = {}) {
await VideoJobInfoModel.increaseOrCreate(payload.videoUUID, 'pendingTranscode')
- return JobQueue.Instance.createJobWithPromise({ type: 'video-transcoding', payload: payload }, options)
+ return JobQueue.Instance.createJobWithPromise({ type: 'video-transcoding', payload }, options)
}
async function getTranscodingJobPriority (user: MUserId) {
const query = {
where: {
actorId,
- targetActorId: targetActorId
+ targetActorId
},
include: [
{
}) {
const { actorId, start, count, sort } = options
const where = {
- actorId: actorId
+ actorId
}
if (options.search) {
static getByIdAndSecret (clientId: string, clientSecret: string) {
const query = {
where: {
- clientId: clientId,
- clientSecret: clientSecret
+ clientId,
+ clientSecret
}
}
}
if (strategy) {
- Object.assign(redundancyWhere, { strategy: strategy })
+ Object.assign(redundancyWhere, { strategy })
}
const videoFilterWhere = {
}
if (blocked !== undefined) {
- Object.assign(where, {
- blocked: blocked
- })
+ Object.assign(where, { blocked })
}
const query: FindOptions = {
]).then(([ count, rows ]) => ({ total: count, data: rows }))
}
- static searchForApi (options: Pick<AvailableForListOptions, 'followerActorId' | 'search'| 'host'| 'uuids'> & {
+ static searchForApi (options: Pick<AvailableForListOptions, 'followerActorId' | 'search' | 'host' | 'uuids'> & {
start: number
count: number
sort: string
const total = totalVideos + totalVideoShares
return {
data: rows,
- total: total
+ total
}
})
}
it('Should fail with a wrong video', async function () {
const fields = { video: { id: 'blabla' }, reason: 'my super reason' }
- await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields })
+ await makePostBodyRequest({ url: server.url, path, token: userToken, fields })
})
it('Should fail with an unknown video', async function () {
it('Should fail with a wrong comment', async function () {
const fields = { comment: { id: 'blabla' }, reason: 'my super reason' }
- await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields })
+ await makePostBodyRequest({ url: server.url, path, token: userToken, fields })
})
it('Should fail with an unknown comment', async function () {
it('Should fail with a wrong account', async function () {
const fields = { account: { id: 'blabla' }, reason: 'my super reason' }
- await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields })
+ await makePostBodyRequest({ url: server.url, path, token: userToken, fields })
})
it('Should fail with an unknown account', async function () {
const username = 'user1'
const password = 'my super password'
- await server.users.create({ username: username, password: password })
+ await server.users.create({ username, password })
userAccessToken = await server.login.getAccessToken({ username, password })
{
await makePostBodyRequest({
url: server.url,
- path: path,
+ path,
token: server.accessToken,
fields,
expectedStatus: HttpStatusCode.OK_200
url: server.url,
path: registrationPath,
token: server.accessToken,
- fields: fields,
+ fields,
expectedStatus: HttpStatusCode.NO_CONTENT_204
})
})
{
const username = 'user1'
const password = 'my super password'
- await servers[0].users.create({ username: username, password: password })
+ await servers[0].users.create({ username, password })
userAccessToken1 = await servers[0].login.getAccessToken({ username, password })
}
{
const username = 'user2'
const password = 'my super password'
- await servers[0].users.create({ username: username, password: password })
+ await servers[0].users.create({ username, password })
userAccessToken2 = await servers[0].login.getAccessToken({ username, password })
}
const username = 'user1'
const password = 'my super password'
- await server.users.create({ username: username, password: password })
+ await server.users.create({ username, password })
userAccessToken = await server.login.getAccessToken({ username, password })
{
}
}
const getUpdate = (params: any, playlistId: number | string) => {
- return { ...params, playlistId: playlistId }
+ return { ...params, playlistId }
}
it('Should fail with an unauthenticated user', async function () {
support: 'my super support text',
tags: [ 'tag1', 'tag2' ],
privacy: VideoPrivacy.PUBLIC,
- channelId: channelId,
+ channelId,
originallyPublishedAt: new Date().toISOString()
}
})
})
it('Should fail without token', async function () {
- await servers[0].videoStats.getOverallStats({ videoId: videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
+ await servers[0].videoStats.getOverallStats({ videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
})
it('Should fail with another token', async function () {
await servers[0].videoStats.getOverallStats({
- videoId: videoId,
+ videoId,
token: userAccessToken,
expectedStatus: HttpStatusCode.FORBIDDEN_403
})
it('Should fail without token', async function () {
await servers[0].videoStats.getTimeserieStats({
- videoId: videoId,
+ videoId,
token: null,
metric: 'viewers',
expectedStatus: HttpStatusCode.UNAUTHORIZED_401
it('Should fail with another token', async function () {
await servers[0].videoStats.getTimeserieStats({
- videoId: videoId,
+ videoId,
token: userAccessToken,
metric: 'viewers',
expectedStatus: HttpStatusCode.FORBIDDEN_403
it('Should fail without token', async function () {
await servers[0].videoStats.getRetentionStats({
- videoId: videoId,
+ videoId,
token: null,
expectedStatus: HttpStatusCode.UNAUTHORIZED_401
})
it('Should fail with another token', async function () {
await servers[0].videoStats.getRetentionStats({
- videoId: videoId,
+ videoId,
token: userAccessToken,
expectedStatus: HttpStatusCode.FORBIDDEN_403
})
adminNotifications = res.adminNotifications
baseParams = {
- server: server,
+ server,
emails,
socketNotifications: adminNotifications,
token: server.accessToken
before(() => {
baseParams = {
- server: server,
+ server,
emails,
socketNotifications: userNotifications,
token: userToken
strategies.push(
{
min_lifetime: '1 hour',
- strategy: strategy,
+ strategy,
size: '400KB',
...additionalParams
licence: 2,
language: 'en'
}
- await server.videos.upload({ attributes: attributes })
+ await server.videos.upload({ attributes })
await server.videos.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } })
}
licence: 3,
language: 'pl'
}
- await server.videos.upload({ attributes: attributes })
+ await server.videos.upload({ attributes })
}
{
const search = {
categoryOneOf: [ 3 ]
}
- const body = await command.advancedVideoSearch({ search: search })
+ const body = await command.advancedVideoSearch({ search })
expect(body.total).to.equal(1)
for (const state of states) {
const body = await servers[0].jobs.list({
- state: state,
+ state,
start: 0,
count: 50,
sort: '-createdAt'
it('Should create a user having the default nsfw policy', async function () {
const username = 'user1'
const password = 'my super password'
- await server.users.create({ username: username, password: password })
+ await server.users.create({ username, password })
userAccessToken = await server.login.getAccessToken({ username, password })
const uuids: string[] = []
for (const name of [ 'bad torrent', 'bad file', 'bad playlist file' ]) {
- const uuid = (await servers[0].videos.quickUpload({ name: name })).uuid
+ const uuid = (await servers[0].videos.quickUpload({ name })).uuid
uuids.push(uuid)
}
for (const name of [ 'bad embed', 'good embed' ]) {
{
- const uuid = (await servers[0].videos.quickUpload({ name: name })).uuid
+ const uuid = (await servers[0].videos.quickUpload({ name })).uuid
embedVideos.push(await servers[0].videos.get({ id: uuid }))
}
const check = options.check || { web: true, mail: true }
if (check.web) {
- const notification = await server.notifications.getLatest({ token: token })
+ const notification = await server.notifications.getLatest({ token })
if (notification || checkType !== 'absence') {
notificationChecker(notification, checkType)
return makeGetRequest({
url,
path,
- expectedStatus: expectedStatus,
+ expectedStatus,
accept: 'application/activity+json,text/html;q=0.9,\\*/\\*;q=0.8'
})
}
...options,
search: {
- search: search,
+ search,
sort: sort ?? '-publishedAt'
}
})
const body = {
client_id: this.server.store.client.id,
client_secret: this.server.store.client.secret,
- username: username,
+ username,
response_type: 'code',
grant_type: 'password',
scope: 'upload',
hexer "^1.5.0"
xtend "^4.0.0"
+builtins@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/builtins/-/builtins-5.0.1.tgz#87f6db9ab0458be728564fa81d876d8d74552fa9"
+ integrity sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==
+ dependencies:
+ semver "^7.0.0"
+
bull@^4.1.0:
version "4.8.4"
resolved "https://registry.yarnpkg.com/bull/-/bull-4.8.4.tgz#c538610492050d5160dbd9180704145f135a0aa9"
eslint-utils "^2.0.0"
regexpp "^3.0.0"
+eslint-plugin-es@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz#f0822f0c18a535a97c3e714e89f88586a7641ec9"
+ integrity sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==
+ dependencies:
+ eslint-utils "^2.0.0"
+ regexpp "^3.0.0"
+
eslint-plugin-import@^2.20.1:
version "2.26.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b"
resolve "^1.22.0"
tsconfig-paths "^3.14.1"
+eslint-plugin-n@^15.2.4:
+ version "15.2.4"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-15.2.4.tgz#d62021a0821ae650701ed459756aaf478a9b6056"
+ integrity sha512-tjnVMv2fiXYMnuiIFI8QMtyUFI42SckEEWvi8h68SWGWshfqO6SSCASy24dGMGAiy7NUk6DZt90DM0iNUsmQ5w==
+ dependencies:
+ builtins "^5.0.1"
+ eslint-plugin-es "^4.1.0"
+ eslint-utils "^3.0.0"
+ ignore "^5.1.1"
+ is-core-module "^2.9.0"
+ minimatch "^3.1.2"
+ resolve "^1.10.1"
+ semver "^7.3.7"
+
eslint-plugin-node@^11.0.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
-semver@^7.3.2, semver@^7.3.5, semver@^7.3.7:
+semver@^7.0.0, semver@^7.3.2, semver@^7.3.5, semver@^7.3.7:
version "7.3.7"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==