mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Features ESM conversion
GitOrigin-RevId: d659326723a90ac0789f4f7acc7f00aa9eaa63e2
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
const { URL, URLSearchParams } = require('url')
|
||||
const OError = require('@overleaf/o-error')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const {
|
||||
import { URL, URLSearchParams } from 'node:url'
|
||||
import OError from '@overleaf/o-error'
|
||||
import Settings from '@overleaf/settings'
|
||||
import {
|
||||
fetchNothing,
|
||||
fetchStringWithResponse,
|
||||
RequestFailedError,
|
||||
} = require('@overleaf/fetch-utils')
|
||||
const RedisWrapper = require('../../infrastructure/RedisWrapper')
|
||||
const Cookie = require('cookie')
|
||||
const logger = require('@overleaf/logger')
|
||||
const Metrics = require('@overleaf/metrics')
|
||||
} from '@overleaf/fetch-utils'
|
||||
import RedisWrapper from '../../infrastructure/RedisWrapper.js'
|
||||
import Cookie from 'cookie'
|
||||
import logger from '@overleaf/logger'
|
||||
import Metrics from '@overleaf/metrics'
|
||||
|
||||
const clsiCookiesEnabled = (Settings.clsiCookie?.key ?? '') !== ''
|
||||
|
||||
@@ -256,4 +256,4 @@ const ClsiCookieManagerFactory = function (backendGroup) {
|
||||
return cookieManager
|
||||
}
|
||||
|
||||
module.exports = ClsiCookieManagerFactory
|
||||
export default ClsiCookieManagerFactory
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const _ = require('lodash')
|
||||
const settings = require('@overleaf/settings')
|
||||
import _ from 'lodash'
|
||||
import settings from '@overleaf/settings'
|
||||
|
||||
const ClsiFormatChecker = {
|
||||
checkRecoursesForProblems(resources) {
|
||||
@@ -56,4 +56,4 @@ const ClsiFormatChecker = {
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = ClsiFormatChecker
|
||||
export default ClsiFormatChecker
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
/* eslint-disable
|
||||
n/handle-callback-err,
|
||||
max-len,
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
@@ -13,11 +8,8 @@
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
let ClsiStateManager
|
||||
const Settings = require('@overleaf/settings')
|
||||
const logger = require('@overleaf/logger')
|
||||
const crypto = require('crypto')
|
||||
const ProjectEntityHandler = require('../Project/ProjectEntityHandler')
|
||||
import crypto from 'node:crypto'
|
||||
import ProjectEntityHandler from '../Project/ProjectEntityHandler.js'
|
||||
|
||||
// The "state" of a project is a hash of the relevant attributes in the
|
||||
// project object in this case we only need the rootFolder.
|
||||
@@ -36,7 +28,7 @@ const ProjectEntityHandler = require('../Project/ProjectEntityHandler')
|
||||
const buildState = s =>
|
||||
crypto.createHash('sha1').update(s, 'utf8').digest('hex')
|
||||
|
||||
module.exports = ClsiStateManager = {
|
||||
export default {
|
||||
computeHash(project, options) {
|
||||
const { docs, files } =
|
||||
ProjectEntityHandler.getAllEntitiesFromProject(project)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const { promisify, callbackify } = require('util')
|
||||
const UserGetter = require('../User/UserGetter')
|
||||
const UserMembershipsHandler = require('../UserMembership/UserMembershipsHandler')
|
||||
const UserMembershipEntityConfigs = require('../UserMembership/UserMembershipEntityConfigs')
|
||||
import { promisify, callbackify } from 'node:util'
|
||||
import UserGetter from '../User/UserGetter.js'
|
||||
import UserMembershipsHandler from '../UserMembership/UserMembershipsHandler.js'
|
||||
import UserMembershipEntityConfigs from '../UserMembership/UserMembershipEntityConfigs.js'
|
||||
|
||||
async function getCurrentAffiliations(userId) {
|
||||
const fullEmails = await UserGetter.promises.getUserFullEmails(userId)
|
||||
@@ -98,4 +98,4 @@ InstitutionsGetter.promises = {
|
||||
getManagedInstitutions: promisify(InstitutionsGetter.getManagedInstitutions),
|
||||
}
|
||||
|
||||
module.exports = InstitutionsGetter
|
||||
export default InstitutionsGetter
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
const {
|
||||
callbackifyAll,
|
||||
promiseMapWithLimit,
|
||||
} = require('@overleaf/promise-utils')
|
||||
const { ObjectId } = require('mongodb-legacy')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const logger = require('@overleaf/logger')
|
||||
const { fetchJson } = require('@overleaf/fetch-utils')
|
||||
const InstitutionsAPI = require('./InstitutionsAPI')
|
||||
const FeaturesUpdater = require('../Subscription/FeaturesUpdater')
|
||||
const FeaturesHelper = require('../Subscription/FeaturesHelper')
|
||||
const UserGetter = require('../User/UserGetter')
|
||||
const NotificationsBuilder = require('../Notifications/NotificationsBuilder')
|
||||
const NotificationsHandler = require('../Notifications/NotificationsHandler')
|
||||
const SubscriptionLocator = require('../Subscription/SubscriptionLocator')
|
||||
const { Institution } = require('../../models/Institution')
|
||||
const { Subscription } = require('../../models/Subscription')
|
||||
const OError = require('@overleaf/o-error')
|
||||
import { callbackifyAll, promiseMapWithLimit } from '@overleaf/promise-utils'
|
||||
import mongodb from 'mongodb-legacy'
|
||||
import Settings from '@overleaf/settings'
|
||||
import logger from '@overleaf/logger'
|
||||
import { fetchJson } from '@overleaf/fetch-utils'
|
||||
import InstitutionsAPI from './InstitutionsAPI.js'
|
||||
import FeaturesUpdater from '../Subscription/FeaturesUpdater.js'
|
||||
import FeaturesHelper from '../Subscription/FeaturesHelper.js'
|
||||
import UserGetter from '../User/UserGetter.js'
|
||||
import NotificationsBuilder from '../Notifications/NotificationsBuilder.js'
|
||||
import NotificationsHandler from '../Notifications/NotificationsHandler.js'
|
||||
import SubscriptionLocator from '../Subscription/SubscriptionLocator.js'
|
||||
import { Institution } from '../../models/Institution.js'
|
||||
import { Subscription } from '../../models/Subscription.js'
|
||||
import OError from '@overleaf/o-error'
|
||||
|
||||
const { ObjectId } = mongodb
|
||||
|
||||
const ASYNC_LIMIT = parseInt(process.env.ASYNC_LIMIT, 10) || 5
|
||||
|
||||
@@ -355,7 +354,7 @@ async function affiliateUserByReversedHostname(user, reversedHostname) {
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
...callbackifyAll(InstitutionsManager),
|
||||
promises: InstitutionsManager,
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import EmailHandler from '../Email/EmailHandler.js'
|
||||
import UserGetter from '../User/UserGetter.js'
|
||||
import './SubscriptionEmailBuilder.js'
|
||||
import './SubscriptionEmailBuilder.mjs'
|
||||
import PlansLocator from './PlansLocator.js'
|
||||
import Settings from '@overleaf/settings'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import dateformat from 'dateformat';
|
||||
import dateformat from 'dateformat'
|
||||
|
||||
function formatDateTime(date) {
|
||||
if (!date) {
|
||||
@@ -17,4 +17,4 @@ function formatDate(date) {
|
||||
export default {
|
||||
formatDateTime,
|
||||
formatDate,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user