chore(xo-server): use extensions for file imports
Will be necessary for ESM.
This commit is contained in:
parent
5171378bea
commit
b2ec0d288b
@ -1,6 +1,6 @@
|
||||
/* eslint-env jest */
|
||||
|
||||
import ensureArray from './_ensureArray'
|
||||
import ensureArray from './_ensureArray.js'
|
||||
|
||||
describe('ensureArray()', function () {
|
||||
it('wrap the value in an array', function () {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { MultiKeyMap } from '@vates/multi-key-map'
|
||||
|
||||
import ensureArray from './_ensureArray'
|
||||
import ensureArray from './_ensureArray.js'
|
||||
|
||||
function removeCacheEntry(cache, keys) {
|
||||
cache.delete(keys)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-env jest */
|
||||
|
||||
import { debounceWithKey, REMOVE_CACHE_ENTRY } from './_pDebounceWithKey'
|
||||
import { debounceWithKey, REMOVE_CACHE_ENTRY } from './_pDebounceWithKey.js'
|
||||
|
||||
describe('REMOVE_CACHE_ENTRY', () => {
|
||||
it('clears the cache', async () => {
|
||||
|
@ -2,9 +2,9 @@ import { basename } from 'path'
|
||||
import { fromCallback } from 'promise-toolbox'
|
||||
import { pipeline } from 'readable-stream'
|
||||
|
||||
import createNdJsonStream from '../_createNdJsonStream'
|
||||
import { REMOVE_CACHE_ENTRY } from '../_pDebounceWithKey'
|
||||
import { safeDateFormat } from '../utils'
|
||||
import createNdJsonStream from '../_createNdJsonStream.js'
|
||||
import { REMOVE_CACHE_ENTRY } from '../_pDebounceWithKey.js'
|
||||
import { safeDateFormat } from '../utils.js'
|
||||
|
||||
export function createJob({ schedules, ...job }) {
|
||||
job.userId = this.user.id
|
||||
|
@ -8,7 +8,7 @@ import { noSuchObject } from 'xo-common/api-errors'
|
||||
import { peekFooterFromVhdStream } from 'vhd-lib'
|
||||
import { vmdkToVhd } from 'xo-vmdk-to-vhd'
|
||||
|
||||
import { VDI_FORMAT_VHD } from '../xapi'
|
||||
import { VDI_FORMAT_VHD } from '../xapi/index.js'
|
||||
|
||||
const log = createLogger('xo:disk')
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import xapiObjectToXo from '../xapi-object-to-xo'
|
||||
import xapiObjectToXo from '../xapi-object-to-xo.js'
|
||||
|
||||
export function getBondModes() {
|
||||
return ['balance-slb', 'active-backup', 'lacp']
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import { filter, find } from 'lodash'
|
||||
|
||||
import { IPV4_CONFIG_MODES, IPV6_CONFIG_MODES } from '../xapi'
|
||||
import { IPV4_CONFIG_MODES, IPV6_CONFIG_MODES } from '../xapi/index.js'
|
||||
|
||||
export function getIpv4ConfigurationModes() {
|
||||
return IPV4_CONFIG_MODES
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { deprecate } from 'util'
|
||||
|
||||
import { getUserPublicProperties } from '../utils'
|
||||
import { getUserPublicProperties } from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import { some } from 'lodash'
|
||||
|
||||
import ensureArray from '../_ensureArray'
|
||||
import { asInteger } from '../xapi/utils'
|
||||
import { forEach, parseXml } from '../utils'
|
||||
import ensureArray from '../_ensureArray.js'
|
||||
import { asInteger } from '../xapi/utils.js'
|
||||
import { forEach, parseXml } from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { forbiddenOperation, invalidParameters } from 'xo-common/api-errors'
|
||||
import { isEmpty } from 'lodash'
|
||||
import { getUserPublicProperties } from '../utils'
|
||||
import { getUserPublicProperties } from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -4,7 +4,7 @@ import { defer } from 'golike-defer'
|
||||
import { invalidParameters } from 'xo-common/api-errors'
|
||||
import { reduce } from 'lodash'
|
||||
|
||||
import { parseSize } from '../utils'
|
||||
import { parseSize } from '../utils.js'
|
||||
|
||||
// ====================================================================
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ignoreErrors } from 'promise-toolbox'
|
||||
|
||||
import { diffItems } from '../utils'
|
||||
import { diffItems } from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as multiparty from 'multiparty'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import getStream from 'get-stream'
|
||||
import { createLogger } from '@xen-orchestra/log'
|
||||
import { defer } from 'golike-defer'
|
||||
@ -15,7 +15,7 @@ import {
|
||||
unauthorized,
|
||||
} from 'xo-common/api-errors'
|
||||
|
||||
import { forEach, map, mapFilter, parseSize, safeDateFormat } from '../utils'
|
||||
import { forEach, map, mapFilter, parseSize, safeDateFormat } from '../utils.js'
|
||||
|
||||
const log = createLogger('xo:vm')
|
||||
|
||||
|
@ -2,7 +2,7 @@ import getStream from 'get-stream'
|
||||
import { fromCallback } from 'promise-toolbox'
|
||||
import { pipeline } from 'readable-stream'
|
||||
|
||||
import createNdJsonStream from '../_createNdJsonStream'
|
||||
import createNdJsonStream from '../_createNdJsonStream.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import assert from 'assert'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import execa from 'execa'
|
||||
import fs from 'fs-extra'
|
||||
import map from 'lodash/map'
|
||||
@ -10,8 +10,8 @@ import { invalidParameters } from 'xo-common/api-errors'
|
||||
import { includes, remove, filter, find, range } from 'lodash'
|
||||
import { Ref } from 'xen-api'
|
||||
|
||||
import ensureArray from '../_ensureArray'
|
||||
import { parseXml } from '../utils'
|
||||
import ensureArray from '../_ensureArray.js'
|
||||
import { parseXml } from '../utils.js'
|
||||
|
||||
const log = createLogger('xo:xosan')
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Model from './model'
|
||||
import Model from './model.js'
|
||||
import { BaseError } from 'make-error'
|
||||
import { EventEmitter } from 'events'
|
||||
import { isObject, map } from './utils'
|
||||
import { isObject, map } from './utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import { createClient as createRedisClient } from 'redis'
|
||||
import { difference, filter, forEach, isEmpty, keys as getKeys, map } from 'lodash'
|
||||
import { ignoreErrors, promisifyAll } from 'promise-toolbox'
|
||||
import { v4 as generateUuid } from 'uuid'
|
||||
|
||||
import Collection, { ModelAlreadyExists } from '../collection'
|
||||
import Collection, { ModelAlreadyExists } from '../collection.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { EventEmitter } from 'events'
|
||||
|
||||
import { noop } from './utils'
|
||||
import { noop } from './utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
// ```js
|
||||
// import fatfs from 'fatfs'
|
||||
// import fatfsBuffer, { init as fatfsBufferInit } from './fatfs-buffer'
|
||||
// import fatfsBuffer, { init as fatfsBufferInit } from './fatfs-buffer.js'
|
||||
//
|
||||
// const buffer = fatfsBufferinit()
|
||||
//
|
||||
|
@ -10,7 +10,7 @@ import helmet from 'helmet'
|
||||
import includes from 'lodash/includes'
|
||||
import memoryStoreFactory from 'memorystore'
|
||||
import ms from 'ms'
|
||||
import proxyConsole from './proxy-console'
|
||||
import proxyConsole from './proxy-console.js'
|
||||
import pw from 'pw'
|
||||
import serveStatic from 'serve-static'
|
||||
import stoppable from 'stoppable'
|
||||
@ -33,8 +33,8 @@ import JsonRpcPeer from 'json-rpc-peer'
|
||||
import { invalidCredentials } from 'xo-common/api-errors'
|
||||
import { ensureDir, outputFile, readdir, readFile } from 'fs-extra'
|
||||
|
||||
import ensureArray from './_ensureArray'
|
||||
import Xo from './xo'
|
||||
import ensureArray from './_ensureArray.js'
|
||||
import Xo from './xo.js'
|
||||
|
||||
import bodyParser from 'body-parser'
|
||||
import connectFlash from 'connect-flash'
|
||||
@ -44,9 +44,9 @@ import passport from 'passport'
|
||||
import { parse as parseCookies } from 'cookie'
|
||||
import { Strategy as LocalStrategy } from 'passport-local'
|
||||
|
||||
import transportConsole from '@xen-orchestra/log/transports/console'
|
||||
import { configure } from '@xen-orchestra/log/configure'
|
||||
import { generateToken } from './utils'
|
||||
import transportConsole from '@xen-orchestra/log/transports/console.js'
|
||||
import { configure } from '@xen-orchestra/log/configure.js'
|
||||
import { generateToken } from './utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -8,8 +8,8 @@ import sublevel from 'subleveldown'
|
||||
import util from 'util'
|
||||
import { join as joinPath } from 'path'
|
||||
|
||||
import { forEach } from './utils'
|
||||
import globMatcher from './glob-matcher'
|
||||
import { forEach } from './utils.js'
|
||||
import globMatcher from './glob-matcher.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* eslint-env jest */
|
||||
|
||||
import { forEach } from 'lodash'
|
||||
import { thunkToArray } from './utils'
|
||||
import { crossProduct, mergeObjects } from './math'
|
||||
import { thunkToArray } from './utils.js'
|
||||
import { crossProduct, mergeObjects } from './math.js'
|
||||
|
||||
describe('mergeObjects', function () {
|
||||
forEach(
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { EventEmitter } from 'events'
|
||||
|
||||
import { forEach, isEmpty } from './utils'
|
||||
import { forEach, isEmpty } from './utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Collection from '../collection/redis'
|
||||
import Model from '../model'
|
||||
import { forEach, multiKeyHash } from '../utils'
|
||||
import Collection from '../collection/redis.js'
|
||||
import Model from '../model.js'
|
||||
import { forEach, multiKeyHash } from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import isEmpty from 'lodash/isEmpty'
|
||||
|
||||
import Collection from '../collection/redis'
|
||||
import Model from '../model'
|
||||
import Collection from '../collection/redis.js'
|
||||
import Model from '../model.js'
|
||||
|
||||
import { forEach } from '../utils'
|
||||
import { forEach } from '../utils.js'
|
||||
|
||||
import { parseProp } from './utils'
|
||||
import { parseProp } from './utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Collection from '../collection/redis'
|
||||
import Model from '../model'
|
||||
import Collection from '../collection/redis.js'
|
||||
import Model from '../model.js'
|
||||
import { createLogger } from '@xen-orchestra/log'
|
||||
import { forEach } from '../utils'
|
||||
import { forEach } from '../utils.js'
|
||||
|
||||
const log = createLogger('xo:plugin-metadata')
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Collection from '../collection/redis'
|
||||
import Model from '../model'
|
||||
import { forEach } from '../utils'
|
||||
import Collection from '../collection/redis.js'
|
||||
import Model from '../model.js'
|
||||
import { forEach } from '../utils.js'
|
||||
|
||||
import { parseProp } from './utils'
|
||||
import { parseProp } from './utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Collection from '../collection/redis'
|
||||
import Model from '../model'
|
||||
import { forEach, serializeError } from '../utils'
|
||||
import Collection from '../collection/redis.js'
|
||||
import Model from '../model.js'
|
||||
import { forEach, serializeError } from '../utils.js'
|
||||
|
||||
import { parseProp } from './utils'
|
||||
import { parseProp } from './utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Collection from '../collection/redis'
|
||||
import Model from '../model'
|
||||
import Collection from '../collection/redis.js'
|
||||
import Model from '../model.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import isEmpty from 'lodash/isEmpty'
|
||||
|
||||
import Collection from '../collection/redis'
|
||||
import Model from '../model'
|
||||
import Collection from '../collection/redis.js'
|
||||
import Model from '../model.js'
|
||||
|
||||
import { parseProp } from './utils'
|
||||
import { parseProp } from './utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -2,8 +2,8 @@ import appConf from 'app-conf'
|
||||
import pw from 'pw'
|
||||
import { join as joinPath } from 'path'
|
||||
|
||||
import Xo from './xo'
|
||||
import { generateToken } from './utils'
|
||||
import Xo from './xo.js'
|
||||
import { generateToken } from './utils.js'
|
||||
|
||||
const recoverAccount = async ([name]) => {
|
||||
if (name === undefined || name === '--help' || name === '-h') {
|
||||
|
@ -3,7 +3,7 @@
|
||||
import { createReadStream, readFile } from 'fs'
|
||||
import { fromCallback } from 'promise-toolbox'
|
||||
|
||||
import streamToExistingBuffer from './stream-to-existing-buffer'
|
||||
import streamToExistingBuffer from './stream-to-existing-buffer.js'
|
||||
|
||||
describe('streamToExistingBuffer()', () => {
|
||||
it('read the content of a stream in a buffer', async () => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-env jest */
|
||||
|
||||
import { camelToSnakeCase, diffItems, extractProperty, generateToken, parseSize, parseXml } from './utils'
|
||||
import { camelToSnakeCase, diffItems, extractProperty, generateToken, parseSize, parseXml } from './utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { isDefaultTemplate } from '@xen-orchestra/xapi'
|
||||
|
||||
import * as sensitiveValues from './sensitive-values'
|
||||
import ensureArray from './_ensureArray'
|
||||
import { extractIpFromVmNetworks } from './_extractIpFromVmNetworks'
|
||||
import { extractProperty, forEach, isEmpty, mapFilter, parseXml } from './utils'
|
||||
import { getVmDomainType, isHostRunning, isVmRunning, parseDateTime } from './xapi'
|
||||
import { useUpdateSystem } from './xapi/utils'
|
||||
import * as sensitiveValues from './sensitive-values.js'
|
||||
import ensureArray from './_ensureArray.js'
|
||||
import { extractIpFromVmNetworks } from './_extractIpFromVmNetworks.js'
|
||||
import { extractProperty, forEach, isEmpty, mapFilter, parseXml } from './utils.js'
|
||||
import { getVmDomainType, isHostRunning, isVmRunning, parseDateTime } from './xapi/index.js'
|
||||
import { useUpdateSystem } from './xapi/utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -4,7 +4,7 @@ import synchronized from 'decorator-synchronized'
|
||||
import { BaseError } from 'make-error'
|
||||
import { defaults, findKey, forEach, identity, map, mapValues, mean, sum, uniq, zipWith } from 'lodash'
|
||||
|
||||
import { parseDateTime } from './xapi'
|
||||
import { parseDateTime } from './xapi/index.js'
|
||||
|
||||
export class FaultyGranularity extends BaseError {}
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
/* eslint eslint-comments/disable-enable-pair: [error, {allowWholeFile: true}] */
|
||||
/* eslint-disable camelcase */
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import concurrency from 'limit-concurrency-decorator'
|
||||
import fatfs from 'fatfs'
|
||||
import mapToArray from 'lodash/map'
|
||||
import mixin from '@xen-orchestra/mixin/legacy'
|
||||
import mixin from '@xen-orchestra/mixin/legacy.js'
|
||||
import ms from 'ms'
|
||||
import synchronized from 'decorator-synchronized'
|
||||
import tarStream from 'tar-stream'
|
||||
@ -22,14 +22,14 @@ import { filter, find, flatMap, flatten, groupBy, identity, includes, isEmpty, n
|
||||
import { Ref } from 'xen-api'
|
||||
import { satisfies as versionSatisfies } from 'semver'
|
||||
|
||||
import createSizeStream from '../size-stream'
|
||||
import ensureArray from '../_ensureArray'
|
||||
import fatfsBuffer, { init as fatfsBufferInit } from '../fatfs-buffer'
|
||||
import { asyncMapValues } from '../_asyncMapValues'
|
||||
import { camelToSnakeCase, forEach, map, parseSize, pDelay, promisifyAll } from '../utils'
|
||||
import createSizeStream from '../size-stream.js'
|
||||
import ensureArray from '../_ensureArray.js'
|
||||
import fatfsBuffer, { init as fatfsBufferInit } from '../fatfs-buffer.js'
|
||||
import { asyncMapValues } from '../_asyncMapValues.js'
|
||||
import { camelToSnakeCase, forEach, map, parseSize, pDelay, promisifyAll } from '../utils.js'
|
||||
|
||||
import mixins from './mixins'
|
||||
import OTHER_CONFIG_TEMPLATE from './other-config-template'
|
||||
import mixins from './mixins/index.js'
|
||||
import OTHER_CONFIG_TEMPLATE from './other-config-template.js'
|
||||
import {
|
||||
asBoolean,
|
||||
asInteger,
|
||||
@ -41,7 +41,7 @@ import {
|
||||
optional,
|
||||
parseDateTime,
|
||||
prepareXapiParam,
|
||||
} from './utils'
|
||||
} from './utils.js'
|
||||
import { createVhdStreamWithLength } from 'vhd-lib'
|
||||
|
||||
const log = createLogger('xo:xapi')
|
||||
@ -54,7 +54,7 @@ export const TAG_COPY_SRC = 'xo:copy_of'
|
||||
// ===================================================================
|
||||
|
||||
// FIXME: remove this work around when fixed, https://phabricator.babeljs.io/T2877
|
||||
// export * from './utils'
|
||||
// export * from './utils.js'
|
||||
Object.assign(module.exports, require('./utils'))
|
||||
|
||||
// VDI formats. (Raw is not available for delta vdi.)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeEditObject } from '../utils'
|
||||
import { makeEditObject } from '../utils.js'
|
||||
|
||||
export default {
|
||||
async _connectVif(vif) {
|
||||
|
@ -9,7 +9,7 @@ import ensureArray from '../../_ensureArray'
|
||||
import { debounceWithKey } from '../../_pDebounceWithKey'
|
||||
import { forEach, mapFilter, parseXml } from '../../utils'
|
||||
|
||||
import { extractOpaqueRef, parseDateTime, useUpdateSystem } from '../utils'
|
||||
import { extractOpaqueRef, parseDateTime, useUpdateSystem } from '../utils.js'
|
||||
|
||||
// TOC -------------------------------------------------------------------------
|
||||
|
||||
|
@ -6,7 +6,7 @@ import { Ref } from 'xen-api'
|
||||
|
||||
import { forEach, parseSize } from '../../utils'
|
||||
|
||||
import { extractOpaqueRef, isVmHvm, isVmRunning, makeEditObject } from '../utils'
|
||||
import { extractOpaqueRef, isVmHvm, isVmRunning, makeEditObject } from '../utils.js'
|
||||
|
||||
// According to: https://xenserver.org/blog/entry/vga-over-cirrus-in-xenserver-6-2.html.
|
||||
const XEN_VGA_VALUES = ['std', 'cirrus']
|
||||
|
@ -6,7 +6,7 @@ import pickBy from 'lodash/pickBy'
|
||||
import { utcParse } from 'd3-time-format'
|
||||
import { satisfies as versionSatisfies } from 'semver'
|
||||
|
||||
import { camelToSnakeCase, forEach, isInteger, map, mapFilter, noop } from '../utils'
|
||||
import { camelToSnakeCase, forEach, isInteger, map, mapFilter, noop } from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import aclResolver from 'xo-acl-resolver'
|
||||
import { forEach, includes, map } from 'lodash'
|
||||
|
||||
import { ModelAlreadyExists } from '../collection'
|
||||
import { Acls } from '../models/acl'
|
||||
import { ModelAlreadyExists } from '../collection.js'
|
||||
import { Acls } from '../models/acl.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -8,9 +8,9 @@ import { forEach } from 'lodash'
|
||||
import { getBoundPropertyDescriptor } from 'bind-property-descriptor'
|
||||
import { MethodNotFound } from 'json-rpc-peer'
|
||||
|
||||
import * as methods from '../api'
|
||||
import * as sensitiveValues from '../sensitive-values'
|
||||
import { noop, serializeError } from '../utils'
|
||||
import * as methods from '../api/index.js'
|
||||
import * as sensitiveValues from '../sensitive-values.js'
|
||||
import { noop, serializeError } from '../utils.js'
|
||||
|
||||
import * as errors from 'xo-common/api-errors'
|
||||
|
||||
|
@ -4,8 +4,8 @@ import { ignoreErrors } from 'promise-toolbox'
|
||||
import { invalidCredentials, noSuchObject } from 'xo-common/api-errors'
|
||||
import { parseDuration } from '@vates/parse-duration'
|
||||
|
||||
import Token, { Tokens } from '../models/token'
|
||||
import { forEach, generateToken } from '../utils'
|
||||
import Token, { Tokens } from '../models/token.js'
|
||||
import { forEach, generateToken } from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import ms from 'ms'
|
||||
import { forEach, isEmpty, iteratee, sortedIndexBy } from 'lodash'
|
||||
|
||||
import { debounceWithKey } from '../_pDebounceWithKey'
|
||||
import { debounceWithKey } from '../_pDebounceWithKey.js'
|
||||
|
||||
const isSkippedError = error =>
|
||||
error != null &&
|
||||
|
@ -1,22 +1,22 @@
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import Disposable from 'promise-toolbox/Disposable'
|
||||
import { Backup } from '@xen-orchestra/backups/Backup'
|
||||
import { Backup } from '@xen-orchestra/backups/Backup.js'
|
||||
import { createLogger } from '@xen-orchestra/log'
|
||||
import { createPredicate } from 'value-matcher'
|
||||
import { decorateWith } from '@vates/decorate-with'
|
||||
import { formatVmBackups } from '@xen-orchestra/backups/formatVmBackups'
|
||||
import { formatVmBackups } from '@xen-orchestra/backups/formatVmBackups.js'
|
||||
import { forOwn, merge } from 'lodash'
|
||||
import { ImportVmBackup } from '@xen-orchestra/backups/ImportVmBackup'
|
||||
import { ImportVmBackup } from '@xen-orchestra/backups/ImportVmBackup.js'
|
||||
import { invalidParameters } from 'xo-common/api-errors'
|
||||
import { runBackupWorker } from '@xen-orchestra/backups/runBackupWorker'
|
||||
import { Task } from '@xen-orchestra/backups/Task'
|
||||
import { runBackupWorker } from '@xen-orchestra/backups/runBackupWorker.js'
|
||||
import { Task } from '@xen-orchestra/backups/Task.js'
|
||||
|
||||
import { debounceWithKey, REMOVE_CACHE_ENTRY } from '../../_pDebounceWithKey'
|
||||
import { handleBackupLog } from '../../_handleBackupLog'
|
||||
import { unboxIdsFromPattern } from '../../utils'
|
||||
import { waitAll } from '../../_waitAll'
|
||||
|
||||
import { translateLegacyJob } from './migration'
|
||||
import { translateLegacyJob } from './migration.js'
|
||||
|
||||
const log = createLogger('xo:xo-mixins:backups-ng')
|
||||
|
||||
|
@ -2,8 +2,8 @@ import Disposable from 'promise-toolbox/Disposable'
|
||||
|
||||
import { compose } from '@vates/compose'
|
||||
import { decorateWith } from '@vates/decorate-with'
|
||||
import { deduped } from '@vates/disposable/deduped'
|
||||
import { RemoteAdapter } from '@xen-orchestra/backups/RemoteAdapter'
|
||||
import { deduped } from '@vates/disposable/deduped.js'
|
||||
import { RemoteAdapter } from '@xen-orchestra/backups/RemoteAdapter.js'
|
||||
|
||||
export default class BackupsRemoteAdapter {
|
||||
constructor(app) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import execa from 'execa'
|
||||
import splitLines from 'split-lines'
|
||||
import { CancelToken, fromEvent, ignoreErrors, pReflect } from 'promise-toolbox'
|
||||
@ -13,10 +13,10 @@ import { basename, dirname } from 'path'
|
||||
import { escapeRegExp, filter, find, includes, map as mapToArray, once, range, sortBy } from 'lodash'
|
||||
import { chainVhd, createSyntheticStream as createVhdReadStream, mergeVhd } from 'vhd-lib'
|
||||
|
||||
import createSizeStream from '../size-stream'
|
||||
import xapiObjectToXo from '../xapi-object-to-xo'
|
||||
import { debounceWithKey } from '../_pDebounceWithKey'
|
||||
import { lvs, pvs } from '../lvm'
|
||||
import createSizeStream from '../size-stream.js'
|
||||
import xapiObjectToXo from '../xapi-object-to-xo.js'
|
||||
import { debounceWithKey } from '../_pDebounceWithKey.js'
|
||||
import { lvs, pvs } from '../lvm.js'
|
||||
import {
|
||||
forEach,
|
||||
getFirstPropertyName,
|
||||
@ -26,7 +26,7 @@ import {
|
||||
safeDateFormat,
|
||||
safeDateParse,
|
||||
tmpDir,
|
||||
} from '../utils'
|
||||
} from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { noSuchObject } from 'xo-common/api-errors'
|
||||
|
||||
import Collection from '../collection/redis'
|
||||
import patch from '../patch'
|
||||
import Collection from '../collection/redis.js'
|
||||
import patch from '../patch.js'
|
||||
|
||||
class CloudConfigs extends Collection {
|
||||
get(properties) {
|
||||
|
@ -2,7 +2,7 @@ import * as openpgp from 'openpgp'
|
||||
import DepTree from 'deptree'
|
||||
import { createLogger } from '@xen-orchestra/log'
|
||||
|
||||
import { asyncMapValues } from '../_asyncMapValues'
|
||||
import { asyncMapValues } from '../_asyncMapValues.js'
|
||||
|
||||
const log = createLogger('xo:config-management')
|
||||
|
||||
|
@ -15,7 +15,7 @@ import synchronized from 'decorator-synchronized'
|
||||
import { noSuchObject } from 'xo-common/api-errors'
|
||||
import { fromCallback } from 'promise-toolbox'
|
||||
|
||||
import { forEach, generateUnsecureToken, isEmpty, lightSet, streamToArray, throwFn } from '../utils'
|
||||
import { forEach, generateUnsecureToken, isEmpty, lightSet, streamToArray, throwFn } from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import { createPredicate } from 'value-matcher'
|
||||
import { timeout } from 'promise-toolbox'
|
||||
import { filter, isEmpty, map, mapValues } from 'lodash'
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-env jest */
|
||||
|
||||
import { forEach } from 'lodash'
|
||||
import { resolveParamsVector } from './execute-call'
|
||||
import { resolveParamsVector } from './execute-call.js'
|
||||
|
||||
describe('resolveParamsVector', function () {
|
||||
forEach(
|
||||
|
@ -1,4 +1,4 @@
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import emitAsync from '@xen-orchestra/emit-async'
|
||||
import { createLogger } from '@xen-orchestra/log'
|
||||
import { decorateWith } from '@vates/decorate-with'
|
||||
@ -11,7 +11,7 @@ import Collection from '../../collection/redis'
|
||||
import patch from '../../patch'
|
||||
import { serializeError } from '../../utils'
|
||||
|
||||
import executeCall from './execute-call'
|
||||
import executeCall from './execute-call.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { defer, fromEvent } from 'promise-toolbox'
|
||||
|
||||
import LevelDbLogger from './loggers/leveldb'
|
||||
import LevelDbLogger from './loggers/leveldb.js'
|
||||
|
||||
export default class Logs {
|
||||
constructor(app) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import highland from 'highland'
|
||||
import { ignoreErrors } from 'promise-toolbox'
|
||||
|
||||
import AbstractLogger from './abstract'
|
||||
import AbstractLogger from './abstract.js'
|
||||
|
||||
import { forEach, noop } from '../../../utils'
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import Disposable from 'promise-toolbox/Disposable'
|
||||
import { Backup } from '@xen-orchestra/backups/Backup'
|
||||
import { Backup } from '@xen-orchestra/backups/Backup.js'
|
||||
import { createLogger } from '@xen-orchestra/log'
|
||||
import { parseMetadataBackupId } from '@xen-orchestra/backups/parseMetadataBackupId'
|
||||
import { RestoreMetadataBackup } from '@xen-orchestra/backups/RestoreMetadataBackup'
|
||||
import { Task } from '@xen-orchestra/backups/Task'
|
||||
import { parseMetadataBackupId } from '@xen-orchestra/backups/parseMetadataBackupId.js'
|
||||
import { RestoreMetadataBackup } from '@xen-orchestra/backups/RestoreMetadataBackup.js'
|
||||
import { Task } from '@xen-orchestra/backups/Task.js'
|
||||
|
||||
import { debounceWithKey, REMOVE_CACHE_ENTRY } from '../_pDebounceWithKey'
|
||||
import { handleBackupLog } from '../_handleBackupLog'
|
||||
import { waitAll } from '../_waitAll'
|
||||
import { serializeError, unboxIdsFromPattern } from '../utils'
|
||||
import { debounceWithKey, REMOVE_CACHE_ENTRY } from '../_pDebounceWithKey.js'
|
||||
import { handleBackupLog } from '../_handleBackupLog.js'
|
||||
import { waitAll } from '../_waitAll.js'
|
||||
import { serializeError, unboxIdsFromPattern } from '../utils.js'
|
||||
|
||||
const log = createLogger('xo:xo-mixins:metadata-backups')
|
||||
|
||||
|
@ -3,8 +3,8 @@ import mapToArray from 'lodash/map'
|
||||
import { createLogger } from '@xen-orchestra/log'
|
||||
import { invalidParameters, noSuchObject } from 'xo-common/api-errors'
|
||||
|
||||
import * as sensitiveValues from '../sensitive-values'
|
||||
import { PluginsMetadata } from '../models/plugin-metadata'
|
||||
import * as sensitiveValues from '../sensitive-values.js'
|
||||
import { PluginsMetadata } from '../models/plugin-metadata.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -18,10 +18,10 @@ import { readChunk } from '@vates/read-chunk'
|
||||
import { Ref } from 'xen-api'
|
||||
import { timeout } from 'promise-toolbox'
|
||||
|
||||
import Collection from '../collection/redis'
|
||||
import patch from '../patch'
|
||||
import { extractIpFromVmNetworks } from '../_extractIpFromVmNetworks'
|
||||
import { generateToken } from '../utils'
|
||||
import Collection from '../collection/redis.js'
|
||||
import patch from '../patch.js'
|
||||
import { extractIpFromVmNetworks } from '../_extractIpFromVmNetworks.js'
|
||||
import { generateToken } from '../utils.js'
|
||||
|
||||
const extractProperties = _ => _.properties
|
||||
const omitToken = proxy => omit(proxy, 'authenticationToken')
|
||||
|
@ -1,13 +1,13 @@
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import synchronized from 'decorator-synchronized'
|
||||
import { format, parse } from 'xo-remote-parser'
|
||||
import { getHandler } from '@xen-orchestra/fs'
|
||||
import { ignoreErrors, timeout } from 'promise-toolbox'
|
||||
import { noSuchObject } from 'xo-common/api-errors'
|
||||
|
||||
import * as sensitiveValues from '../sensitive-values'
|
||||
import patch from '../patch'
|
||||
import { Remotes } from '../models/remote'
|
||||
import * as sensitiveValues from '../sensitive-values.js'
|
||||
import patch from '../patch.js'
|
||||
import { Remotes } from '../models/remote.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import synchronized from 'decorator-synchronized'
|
||||
import { decorateWith } from '@vates/decorate-with'
|
||||
import { defer as deferrable } from 'golike-defer'
|
||||
import { difference, every, forEach, isObject, keyBy, map as mapToArray, remove, some } from 'lodash'
|
||||
import { noSuchObject, notEnoughResources, unauthorized } from 'xo-common/api-errors'
|
||||
|
||||
import { generateUnsecureToken, lightSet, map, streamToArray } from '../utils'
|
||||
import { generateUnsecureToken, lightSet, map, streamToArray } from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import { createSchedule } from '@xen-orchestra/cron'
|
||||
import { ignoreErrors } from 'promise-toolbox'
|
||||
import { keyBy } from 'lodash'
|
||||
import { noSuchObject } from 'xo-common/api-errors'
|
||||
|
||||
import Collection from '../collection/redis'
|
||||
import patch from '../patch'
|
||||
import Collection from '../collection/redis.js'
|
||||
import patch from '../patch.js'
|
||||
|
||||
const normalize = schedule => {
|
||||
const { enabled } = schedule
|
||||
|
@ -4,10 +4,10 @@ import { ignoreErrors } from 'promise-toolbox'
|
||||
import { hash, needsRehash, verify } from 'hashy'
|
||||
import { invalidCredentials, noSuchObject } from 'xo-common/api-errors'
|
||||
|
||||
import * as XenStore from '../_XenStore'
|
||||
import { Groups } from '../models/group'
|
||||
import { Users } from '../models/user'
|
||||
import { forEach, isEmpty, lightSet } from '../utils'
|
||||
import * as XenStore from '../_XenStore.js'
|
||||
import { Groups } from '../models/group.js'
|
||||
import { Users } from '../models/user.js'
|
||||
import { forEach, isEmpty, lightSet } from '../utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -5,12 +5,12 @@ import { findKey } from 'lodash'
|
||||
import { noSuchObject } from 'xo-common/api-errors'
|
||||
import { pDelay, ignoreErrors } from 'promise-toolbox'
|
||||
|
||||
import * as XenStore from '../_XenStore'
|
||||
import Xapi from '../xapi'
|
||||
import xapiObjectToXo from '../xapi-object-to-xo'
|
||||
import XapiStats from '../xapi-stats'
|
||||
import { camelToSnakeCase, forEach, isEmpty, popProperty } from '../utils'
|
||||
import { Servers } from '../models/server'
|
||||
import * as XenStore from '../_XenStore.js'
|
||||
import Xapi from '../xapi/index.js'
|
||||
import xapiObjectToXo from '../xapi-object-to-xo.js'
|
||||
import XapiStats from '../xapi-stats.js'
|
||||
import { camelToSnakeCase, forEach, isEmpty, popProperty } from '../utils.js'
|
||||
import { Servers } from '../models/server.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
import Config from '@xen-orchestra/mixins/Config'
|
||||
import Hooks from '@xen-orchestra/mixins/Hooks'
|
||||
import Config from '@xen-orchestra/mixins/Config.js'
|
||||
import Hooks from '@xen-orchestra/mixins/Hooks.js'
|
||||
import mixin from '@xen-orchestra/mixin'
|
||||
import mixinLegacy from '@xen-orchestra/mixin/legacy'
|
||||
import mixinLegacy from '@xen-orchestra/mixin/legacy.js'
|
||||
import XoCollection from 'xo-collection'
|
||||
import XoUniqueIndex from 'xo-collection/unique-index'
|
||||
import { createClient as createRedisClient } from 'redis'
|
||||
import { createDebounceResource } from '@vates/disposable/debounceResource'
|
||||
import { createDebounceResource } from '@vates/disposable/debounceResource.js'
|
||||
import { createLogger } from '@xen-orchestra/log'
|
||||
import { EventEmitter } from 'events'
|
||||
import { noSuchObject } from 'xo-common/api-errors'
|
||||
import { forEach, includes, isEmpty, iteratee, stubTrue } from 'lodash'
|
||||
import { parseDuration } from '@vates/parse-duration'
|
||||
|
||||
import mixins from './xo-mixins'
|
||||
import Connection from './connection'
|
||||
import { generateToken, noop } from './utils'
|
||||
import mixins from './xo-mixins/index.js'
|
||||
import Connection from './connection.js'
|
||||
import { generateToken, noop } from './utils.js'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user