diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-27 14:32:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-27 15:12:22 +0200 |
commit | 41fb13c330de629df2d23379209e79c7af0f2e9a (patch) | |
tree | 73bc5a90566406b3910f142beae2a879c1e4265d /server/lib/activitypub | |
parent | 40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff) | |
download | PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.gz PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.zst PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.zip |
esModuleInterop to true
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/actors/webfinger.ts | 2 | ||||
-rw-r--r-- | server/lib/activitypub/crawl.ts | 6 | ||||
-rw-r--r-- | server/lib/activitypub/playlists/create-update.ts | 6 | ||||
-rw-r--r-- | server/lib/activitypub/share.ts | 4 | ||||
-rw-r--r-- | server/lib/activitypub/video-comments.ts | 4 | ||||
-rw-r--r-- | server/lib/activitypub/video-rates.ts | 4 | ||||
-rw-r--r-- | server/lib/activitypub/videos/shared/object-to-model-attributes.ts | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/server/lib/activitypub/actors/webfinger.ts b/server/lib/activitypub/actors/webfinger.ts index 1c7ec4717..5532f05bd 100644 --- a/server/lib/activitypub/actors/webfinger.ts +++ b/server/lib/activitypub/actors/webfinger.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as WebFinger from 'webfinger.js' | 1 | import WebFinger from 'webfinger.js' |
2 | import { isProdInstance } from '@server/helpers/core-utils' | 2 | import { isProdInstance } from '@server/helpers/core-utils' |
3 | import { isActivityPubUrlValid } from '@server/helpers/custom-validators/activitypub/misc' | 3 | import { isActivityPubUrlValid } from '@server/helpers/custom-validators/activitypub/misc' |
4 | import { REQUEST_TIMEOUT, WEBSERVER } from '@server/initializers/constants' | 4 | import { REQUEST_TIMEOUT, WEBSERVER } from '@server/initializers/constants' |
diff --git a/server/lib/activitypub/crawl.ts b/server/lib/activitypub/crawl.ts index 28ff5225a..336129b82 100644 --- a/server/lib/activitypub/crawl.ts +++ b/server/lib/activitypub/crawl.ts | |||
@@ -1,13 +1,13 @@ | |||
1 | import { retryTransactionWrapper } from '@server/helpers/database-utils' | 1 | import Bluebird from 'bluebird' |
2 | import * as Bluebird from 'bluebird' | ||
3 | import { URL } from 'url' | 2 | import { URL } from 'url' |
3 | import { retryTransactionWrapper } from '@server/helpers/database-utils' | ||
4 | import { ActivityPubOrderedCollection } from '../../../shared/models/activitypub' | 4 | import { ActivityPubOrderedCollection } from '../../../shared/models/activitypub' |
5 | import { logger } from '../../helpers/logger' | 5 | import { logger } from '../../helpers/logger' |
6 | import { doJSONRequest } from '../../helpers/requests' | 6 | import { doJSONRequest } from '../../helpers/requests' |
7 | import { ACTIVITY_PUB, WEBSERVER } from '../../initializers/constants' | 7 | import { ACTIVITY_PUB, WEBSERVER } from '../../initializers/constants' |
8 | 8 | ||
9 | type HandlerFunction<T> = (items: T[]) => (Promise<any> | Bluebird<any>) | 9 | type HandlerFunction<T> = (items: T[]) => (Promise<any> | Bluebird<any>) |
10 | type CleanerFunction = (startedDate: Date) => (Promise<any> | Bluebird<any>) | 10 | type CleanerFunction = (startedDate: Date) => Promise<any> |
11 | 11 | ||
12 | async function crawlCollectionPage <T> (argUrl: string, handler: HandlerFunction<T>, cleaner?: CleanerFunction) { | 12 | async function crawlCollectionPage <T> (argUrl: string, handler: HandlerFunction<T>, cleaner?: CleanerFunction) { |
13 | let url = argUrl | 13 | let url = argUrl |
diff --git a/server/lib/activitypub/playlists/create-update.ts b/server/lib/activitypub/playlists/create-update.ts index ea3e61ac5..b152d709c 100644 --- a/server/lib/activitypub/playlists/create-update.ts +++ b/server/lib/activitypub/playlists/create-update.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as Bluebird from 'bluebird' | 1 | import { map } from 'bluebird' |
2 | import { getAPId } from '@server/helpers/activitypub' | 2 | import { getAPId } from '@server/helpers/activitypub' |
3 | import { isArray } from '@server/helpers/custom-validators/misc' | 3 | import { isArray } from '@server/helpers/custom-validators/misc' |
4 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 4 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
@@ -24,7 +24,7 @@ import { | |||
24 | const lTags = loggerTagsFactory('ap', 'video-playlist') | 24 | const lTags = loggerTagsFactory('ap', 'video-playlist') |
25 | 25 | ||
26 | async function createAccountPlaylists (playlistUrls: string[]) { | 26 | async function createAccountPlaylists (playlistUrls: string[]) { |
27 | await Bluebird.map(playlistUrls, async playlistUrl => { | 27 | await map(playlistUrls, async playlistUrl => { |
28 | try { | 28 | try { |
29 | const exists = await VideoPlaylistModel.doesPlaylistExist(playlistUrl) | 29 | const exists = await VideoPlaylistModel.doesPlaylistExist(playlistUrl) |
30 | if (exists === true) return | 30 | if (exists === true) return |
@@ -140,7 +140,7 @@ async function rebuildVideoPlaylistElements (elementUrls: string[], playlist: MV | |||
140 | async function buildElementsDBAttributes (elementUrls: string[], playlist: MVideoPlaylist) { | 140 | async function buildElementsDBAttributes (elementUrls: string[], playlist: MVideoPlaylist) { |
141 | const elementsToCreate: FilteredModelAttributes<VideoPlaylistElementModel>[] = [] | 141 | const elementsToCreate: FilteredModelAttributes<VideoPlaylistElementModel>[] = [] |
142 | 142 | ||
143 | await Bluebird.map(elementUrls, async elementUrl => { | 143 | await map(elementUrls, async elementUrl => { |
144 | try { | 144 | try { |
145 | const { elementObject } = await fetchRemotePlaylistElement(elementUrl) | 145 | const { elementObject } = await fetchRemotePlaylistElement(elementUrl) |
146 | 146 | ||
diff --git a/server/lib/activitypub/share.ts b/server/lib/activitypub/share.ts index 1ff01a175..b18761174 100644 --- a/server/lib/activitypub/share.ts +++ b/server/lib/activitypub/share.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as Bluebird from 'bluebird' | 1 | import { map } from 'bluebird' |
2 | import { Transaction } from 'sequelize' | 2 | import { Transaction } from 'sequelize' |
3 | import { getServerActor } from '@server/models/application/application' | 3 | import { getServerActor } from '@server/models/application/application' |
4 | import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub' | 4 | import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub' |
@@ -38,7 +38,7 @@ async function changeVideoChannelShare ( | |||
38 | } | 38 | } |
39 | 39 | ||
40 | async function addVideoShares (shareUrls: string[], video: MVideoId) { | 40 | async function addVideoShares (shareUrls: string[], video: MVideoId) { |
41 | await Bluebird.map(shareUrls, async shareUrl => { | 41 | await map(shareUrls, async shareUrl => { |
42 | try { | 42 | try { |
43 | await addVideoShare(shareUrl, video) | 43 | await addVideoShare(shareUrl, video) |
44 | } catch (err) { | 44 | } catch (err) { |
diff --git a/server/lib/activitypub/video-comments.ts b/server/lib/activitypub/video-comments.ts index 6b7f9504f..2a14790fe 100644 --- a/server/lib/activitypub/video-comments.ts +++ b/server/lib/activitypub/video-comments.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as Bluebird from 'bluebird' | 1 | import { map } from 'bluebird' |
2 | import { checkUrlsSameHost } from '../../helpers/activitypub' | 2 | import { checkUrlsSameHost } from '../../helpers/activitypub' |
3 | import { sanitizeAndCheckVideoCommentObject } from '../../helpers/custom-validators/activitypub/video-comments' | 3 | import { sanitizeAndCheckVideoCommentObject } from '../../helpers/custom-validators/activitypub/video-comments' |
4 | import { logger } from '../../helpers/logger' | 4 | import { logger } from '../../helpers/logger' |
@@ -18,7 +18,7 @@ type ResolveThreadParams = { | |||
18 | type ResolveThreadResult = Promise<{ video: MVideoAccountLightBlacklistAllFiles, comment: MCommentOwnerVideo, commentCreated: boolean }> | 18 | type ResolveThreadResult = Promise<{ video: MVideoAccountLightBlacklistAllFiles, comment: MCommentOwnerVideo, commentCreated: boolean }> |
19 | 19 | ||
20 | async function addVideoComments (commentUrls: string[]) { | 20 | async function addVideoComments (commentUrls: string[]) { |
21 | return Bluebird.map(commentUrls, async commentUrl => { | 21 | return map(commentUrls, async commentUrl => { |
22 | try { | 22 | try { |
23 | await resolveThread({ url: commentUrl, isVideo: false }) | 23 | await resolveThread({ url: commentUrl, isVideo: false }) |
24 | } catch (err) { | 24 | } catch (err) { |
diff --git a/server/lib/activitypub/video-rates.ts b/server/lib/activitypub/video-rates.ts index 9fb97ef84..04aa5eae9 100644 --- a/server/lib/activitypub/video-rates.ts +++ b/server/lib/activitypub/video-rates.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as Bluebird from 'bluebird' | 1 | import { map } from 'bluebird' |
2 | import { Transaction } from 'sequelize' | 2 | import { Transaction } from 'sequelize' |
3 | import { doJSONRequest } from '@server/helpers/requests' | 3 | import { doJSONRequest } from '@server/helpers/requests' |
4 | import { VideoRateType } from '../../../shared/models/videos' | 4 | import { VideoRateType } from '../../../shared/models/videos' |
@@ -15,7 +15,7 @@ import { getVideoDislikeActivityPubUrlByLocalActor, getVideoLikeActivityPubUrlBy | |||
15 | const lTags = loggerTagsFactory('ap', 'video-rate', 'create') | 15 | const lTags = loggerTagsFactory('ap', 'video-rate', 'create') |
16 | 16 | ||
17 | async function createRates (ratesUrl: string[], video: MVideo, rate: VideoRateType) { | 17 | async function createRates (ratesUrl: string[], video: MVideo, rate: VideoRateType) { |
18 | await Bluebird.map(ratesUrl, async rateUrl => { | 18 | await map(ratesUrl, async rateUrl => { |
19 | try { | 19 | try { |
20 | await createRate(rateUrl, video, rate) | 20 | await createRate(rateUrl, video, rate) |
21 | } catch (err) { | 21 | } catch (err) { |
diff --git a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts index bd9ed45a9..62354ab56 100644 --- a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts +++ b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { maxBy, minBy } from 'lodash' | 1 | import { maxBy, minBy } from 'lodash' |
2 | import * as magnetUtil from 'magnet-uri' | 2 | import magnetUtil from 'magnet-uri' |
3 | import { basename } from 'path' | 3 | import { basename } from 'path' |
4 | import { isAPVideoFileUrlMetadataObject } from '@server/helpers/custom-validators/activitypub/videos' | 4 | import { isAPVideoFileUrlMetadataObject } from '@server/helpers/custom-validators/activitypub/videos' |
5 | import { isVideoFileInfoHashValid } from '@server/helpers/custom-validators/videos' | 5 | import { isVideoFileInfoHashValid } from '@server/helpers/custom-validators/videos' |