mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Use node protocol when importing builtins
This commit is contained in:
parent
def0b5c732
commit
990184dbb5
@ -166,7 +166,6 @@ const configs = antfu(
|
|||||||
|
|
||||||
'jsdoc/no-multi-asterisks': [ 'error', { allowWhitespace: true }],
|
'jsdoc/no-multi-asterisks': [ 'error', { allowWhitespace: true }],
|
||||||
|
|
||||||
// Might want to enable these
|
|
||||||
'node/prefer-global/buffer': 'off',
|
'node/prefer-global/buffer': 'off',
|
||||||
'node/prefer-global/process': 'off',
|
'node/prefer-global/process': 'off',
|
||||||
|
|
||||||
@ -273,7 +272,6 @@ const configs = antfu(
|
|||||||
'unicorn/no-await-expression-member': 'off',
|
'unicorn/no-await-expression-member': 'off',
|
||||||
'unicorn/no-negated-condition': 'off',
|
'unicorn/no-negated-condition': 'off',
|
||||||
'unicorn/no-object-as-default-parameter': 'off',
|
'unicorn/no-object-as-default-parameter': 'off',
|
||||||
'unicorn/prefer-node-protocol': 'off',
|
|
||||||
|
|
||||||
'unused-imports/no-unused-vars': [
|
'unused-imports/no-unused-vars': [
|
||||||
'error',
|
'error',
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const os = require('os');
|
const os = require('node:os');
|
||||||
const v8 = require('v8');
|
const v8 = require('node:v8');
|
||||||
|
|
||||||
// Several parts inspired by https://github.com/renovatebot/renovate/blob/main/package.json
|
// Several parts inspired by https://github.com/renovatebot/renovate/blob/main/package.json
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env ts-node
|
#!/usr/bin/env ts-node
|
||||||
/* eslint-disable import/extensions, no-console */
|
/* eslint-disable import/extensions, no-console */
|
||||||
import * as readline from 'readline';
|
import * as readline from 'node:readline';
|
||||||
import simpleGit from 'simple-git';
|
import simpleGit from 'simple-git';
|
||||||
import { version } from '../package.json';
|
import { version } from '../package.json';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Readable } from 'stream';
|
import { Readable } from 'node:stream';
|
||||||
import type { IAccessControlledResource, IContext, IPolicy } from '@solid/access-control-policy';
|
import type { IAccessControlledResource, IContext, IPolicy } from '@solid/access-control-policy';
|
||||||
import { allowAccessModes } from '@solid/access-control-policy';
|
import { allowAccessModes } from '@solid/access-control-policy';
|
||||||
import type { Store } from 'n3';
|
import type { Store } from 'n3';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { IncomingMessage } from 'http';
|
import type { IncomingMessage } from 'node:http';
|
||||||
import type { TLSSocket } from 'tls';
|
import type { TLSSocket } from 'node:tls';
|
||||||
import type { WebSocket } from 'ws';
|
import type { WebSocket } from 'ws';
|
||||||
import type { SingleThreaded } from '../init/cluster/SingleThreaded';
|
import type { SingleThreaded } from '../init/cluster/SingleThreaded';
|
||||||
import { getLoggerFor } from '../logging/LogUtil';
|
import { getLoggerFor } from '../logging/LogUtil';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { TLSSocket } from 'tls';
|
import type { TLSSocket } from 'node:tls';
|
||||||
import type { HttpRequest } from '../../../server/HttpRequest';
|
import type { HttpRequest } from '../../../server/HttpRequest';
|
||||||
import { BadRequestHttpError } from '../../../util/errors/BadRequestHttpError';
|
import { BadRequestHttpError } from '../../../util/errors/BadRequestHttpError';
|
||||||
import { errorTermsToMetadata } from '../../../util/errors/HttpErrorUtil';
|
import { errorTermsToMetadata } from '../../../util/errors/HttpErrorUtil';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import type { Guarded } from '../../../util/GuardedStream';
|
import type { Guarded } from '../../../util/GuardedStream';
|
||||||
import { SOLID_HTTP } from '../../../util/Vocabularies';
|
import { SOLID_HTTP } from '../../../util/Vocabularies';
|
||||||
import type { RepresentationMetadata } from '../../representation/RepresentationMetadata';
|
import type { RepresentationMetadata } from '../../representation/RepresentationMetadata';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import type { Guarded } from '../../../util/GuardedStream';
|
import type { Guarded } from '../../../util/GuardedStream';
|
||||||
import type { RepresentationMetadata } from '../../representation/RepresentationMetadata';
|
import type { RepresentationMetadata } from '../../representation/RepresentationMetadata';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import { INTERNAL_QUADS } from '../../util/ContentTypes';
|
import { INTERNAL_QUADS } from '../../util/ContentTypes';
|
||||||
import type { Guarded } from '../../util/GuardedStream';
|
import type { Guarded } from '../../util/GuardedStream';
|
||||||
import { guardStream } from '../../util/GuardedStream';
|
import { guardStream } from '../../util/GuardedStream';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import type { Guarded } from '../../util/GuardedStream';
|
import type { Guarded } from '../../util/GuardedStream';
|
||||||
import type { RepresentationMetadata } from './RepresentationMetadata';
|
import type { RepresentationMetadata } from './RepresentationMetadata';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { createPublicKey } from 'crypto';
|
import { createPublicKey } from 'node:crypto';
|
||||||
import type { KeyObject } from 'crypto';
|
import type { KeyObject } from 'node:crypto';
|
||||||
import { exportJWK, generateKeyPair, importJWK } from 'jose';
|
import { exportJWK, generateKeyPair, importJWK } from 'jose';
|
||||||
import type { AsymmetricSigningAlgorithm, JWKS } from '../../../templates/types/oidc-provider';
|
import type { AsymmetricSigningAlgorithm, JWKS } from '../../../templates/types/oidc-provider';
|
||||||
import type { KeyValueStorage } from '../../storage/keyvalue/KeyValueStorage';
|
import type { KeyValueStorage } from '../../storage/keyvalue/KeyValueStorage';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable ts/naming-convention */
|
/* eslint-disable ts/naming-convention */
|
||||||
import { randomBytes } from 'crypto';
|
import { randomBytes } from 'node:crypto';
|
||||||
import type {
|
import type {
|
||||||
Account,
|
Account,
|
||||||
Adapter,
|
Adapter,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { randomBytes } from 'crypto';
|
import { randomBytes } from 'node:crypto';
|
||||||
import { Initializer } from '../../../../init/Initializer';
|
import { Initializer } from '../../../../init/Initializer';
|
||||||
import { getLoggerFor } from '../../../../logging/LogUtil';
|
import { getLoggerFor } from '../../../../logging/LogUtil';
|
||||||
import { createErrorMessage } from '../../../../util/errors/ErrorUtil';
|
import { createErrorMessage } from '../../../../util/errors/ErrorUtil';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable unicorn/no-process-exit */
|
/* eslint-disable unicorn/no-process-exit */
|
||||||
import { existsSync } from 'fs';
|
import { existsSync } from 'node:fs';
|
||||||
import type { WriteStream } from 'tty';
|
import type { WriteStream } from 'node:tty';
|
||||||
import type { IComponentsManagerBuilderOptions } from 'componentsjs';
|
import type { IComponentsManagerBuilderOptions } from 'componentsjs';
|
||||||
import { ComponentsManager } from 'componentsjs';
|
import { ComponentsManager } from 'componentsjs';
|
||||||
import { readJSON } from 'fs-extra';
|
import { readJSON } from 'fs-extra';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { Server } from 'http';
|
import type { Server } from 'node:http';
|
||||||
import { URL } from 'url';
|
import { URL } from 'node:url';
|
||||||
import { promisify } from 'util';
|
import { promisify } from 'node:util';
|
||||||
import { getLoggerFor } from '../logging/LogUtil';
|
import { getLoggerFor } from '../logging/LogUtil';
|
||||||
import { isHttpsServer } from '../server/HttpServerFactory';
|
import { isHttpsServer } from '../server/HttpServerFactory';
|
||||||
import type { HttpServerFactory } from '../server/HttpServerFactory';
|
import type { HttpServerFactory } from '../server/HttpServerFactory';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { Worker } from 'cluster';
|
import type { Worker } from 'node:cluster';
|
||||||
import cluster from 'cluster';
|
import cluster from 'node:cluster';
|
||||||
import { cpus } from 'os';
|
import { cpus } from 'node:os';
|
||||||
import { getLoggerFor } from '../../logging/LogUtil';
|
import { getLoggerFor } from '../../logging/LogUtil';
|
||||||
import { InternalServerError } from '../../util/errors/InternalServerError';
|
import { InternalServerError } from '../../util/errors/InternalServerError';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { createInterface } from 'readline';
|
import { createInterface } from 'node:readline';
|
||||||
import { ACCOUNT_STORAGE_DESCRIPTION } from '../../identity/interaction/account/util/BaseAccountStore';
|
import { ACCOUNT_STORAGE_DESCRIPTION } from '../../identity/interaction/account/util/BaseAccountStore';
|
||||||
import type { AccountLoginStorage } from '../../identity/interaction/account/util/LoginStorage';
|
import type { AccountLoginStorage } from '../../identity/interaction/account/util/LoginStorage';
|
||||||
import { ACCOUNT_TYPE } from '../../identity/interaction/account/util/LoginStorage';
|
import { ACCOUNT_TYPE } from '../../identity/interaction/account/util/LoginStorage';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import cluster from 'cluster';
|
import cluster from 'node:cluster';
|
||||||
import { WrappingLogger } from './Logger';
|
import { WrappingLogger } from './Logger';
|
||||||
import type { Logger } from './Logger';
|
import type { Logger } from './Logger';
|
||||||
import type { LoggerFactory } from './LoggerFactory';
|
import type { LoggerFactory } from './LoggerFactory';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import cluster from 'cluster';
|
import cluster from 'node:cluster';
|
||||||
import process from 'process';
|
import process from 'node:process';
|
||||||
import type { LogLevel } from './LogLevel';
|
import type { LogLevel } from './LogLevel';
|
||||||
|
|
||||||
export interface LogMetadata {
|
export interface LogMetadata {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { createReadStream, promises as fsPromises } from 'fs';
|
import { createReadStream, promises as fsPromises } from 'node:fs';
|
||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import { pathExists } from 'fs-extra';
|
import { pathExists } from 'fs-extra';
|
||||||
import { Parser } from 'n3';
|
import { Parser } from 'n3';
|
||||||
import type { AuxiliaryStrategy } from '../../http/auxiliary/AuxiliaryStrategy';
|
import type { AuxiliaryStrategy } from '../../http/auxiliary/AuxiliaryStrategy';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { promises as fsPromises } from 'fs';
|
import { promises as fsPromises } from 'node:fs';
|
||||||
import type { ResourceIdentifier } from '../../../http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../../../http/representation/ResourceIdentifier';
|
||||||
import type { FileIdentifierMapper } from '../../../storage/mapping/FileIdentifierMapper';
|
import type { FileIdentifierMapper } from '../../../storage/mapping/FileIdentifierMapper';
|
||||||
import { ConflictHttpError } from '../../../util/errors/ConflictHttpError';
|
import { ConflictHttpError } from '../../../util/errors/ConflictHttpError';
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'node:fs';
|
||||||
import type { Server } from 'http';
|
import type { Server } from 'node:http';
|
||||||
import { createServer as createHttpServer } from 'http';
|
import { createServer as createHttpServer } from 'node:http';
|
||||||
import type { ServerOptions } from 'https';
|
import type { ServerOptions } from 'node:https';
|
||||||
import { createServer as createHttpsServer } from 'https';
|
import { createServer as createHttpsServer } from 'node:https';
|
||||||
import { getLoggerFor } from '../logging/LogUtil';
|
import { getLoggerFor } from '../logging/LogUtil';
|
||||||
import type { HttpServerFactory } from './HttpServerFactory';
|
import type { HttpServerFactory } from './HttpServerFactory';
|
||||||
import type { ServerConfigurator } from './ServerConfigurator';
|
import type { ServerConfigurator } from './ServerConfigurator';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { IncomingMessage, Server, ServerResponse } from 'http';
|
import type { IncomingMessage, Server, ServerResponse } from 'node:http';
|
||||||
import { getLoggerFor } from '../logging/LogUtil';
|
import { getLoggerFor } from '../logging/LogUtil';
|
||||||
import { isError } from '../util/errors/ErrorUtil';
|
import { isError } from '../util/errors/ErrorUtil';
|
||||||
import { guardStream } from '../util/GuardedStream';
|
import { guardStream } from '../util/GuardedStream';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { IncomingMessage } from 'http';
|
import type { IncomingMessage } from 'node:http';
|
||||||
import type { Guarded } from '../util/GuardedStream';
|
import type { Guarded } from '../util/GuardedStream';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { ServerResponse } from 'http';
|
import type { ServerResponse } from 'node:http';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An outgoing HTTP response;
|
* An outgoing HTTP response;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { Server } from 'http';
|
import type { Server } from 'node:http';
|
||||||
import { Server as HttpsServer } from 'https';
|
import { Server as HttpsServer } from 'node:https';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns `true` if the server is an HTTPS server.
|
* Returns `true` if the server is an HTTPS server.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Server } from 'http';
|
import type { Server } from 'node:http';
|
||||||
import { AsyncHandler } from '../util/handlers/AsyncHandler';
|
import { AsyncHandler } from '../util/handlers/AsyncHandler';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { IncomingMessage, Server } from 'http';
|
import type { IncomingMessage, Server } from 'node:http';
|
||||||
import type { Socket } from 'net';
|
import type { Socket } from 'node:net';
|
||||||
import type { WebSocket } from 'ws';
|
import type { WebSocket } from 'ws';
|
||||||
import { WebSocketServer } from 'ws';
|
import { WebSocketServer } from 'ws';
|
||||||
import { getLoggerFor } from '../logging/LogUtil';
|
import { getLoggerFor } from '../logging/LogUtil';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { createReadStream } from 'fs';
|
import { createReadStream } from 'node:fs';
|
||||||
import escapeStringRegexp from 'escape-string-regexp';
|
import escapeStringRegexp from 'escape-string-regexp';
|
||||||
import * as mime from 'mime-types';
|
import * as mime from 'mime-types';
|
||||||
import { getLoggerFor } from '../../logging/LogUtil';
|
import { getLoggerFor } from '../../logging/LogUtil';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Readable } from 'stream';
|
import { Readable } from 'node:stream';
|
||||||
import { KeysRdfParseJsonLd } from '@comunica/context-entries';
|
import { KeysRdfParseJsonLd } from '@comunica/context-entries';
|
||||||
import { parse, toSeconds } from 'iso8601-duration';
|
import { parse, toSeconds } from 'iso8601-duration';
|
||||||
import { DataFactory } from 'n3';
|
import { DataFactory } from 'n3';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { IncomingMessage } from 'http';
|
import type { IncomingMessage } from 'node:http';
|
||||||
import { BadRequestHttpError } from '../../../util/errors/BadRequestHttpError';
|
import { BadRequestHttpError } from '../../../util/errors/BadRequestHttpError';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import assert from 'assert';
|
import assert from 'node:assert';
|
||||||
import type { Representation } from '../http/representation/Representation';
|
import type { Representation } from '../http/representation/Representation';
|
||||||
import type { RepresentationPreferences } from '../http/representation/RepresentationPreferences';
|
import type { RepresentationPreferences } from '../http/representation/RepresentationPreferences';
|
||||||
import type { ResourceIdentifier } from '../http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../http/representation/ResourceIdentifier';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import type { AuxiliaryIdentifierStrategy } from '../http/auxiliary/AuxiliaryIdentifierStrategy';
|
import type { AuxiliaryIdentifierStrategy } from '../http/auxiliary/AuxiliaryIdentifierStrategy';
|
||||||
import { BasicRepresentation } from '../http/representation/BasicRepresentation';
|
import { BasicRepresentation } from '../http/representation/BasicRepresentation';
|
||||||
import type { Patch } from '../http/representation/Patch';
|
import type { Patch } from '../http/representation/Patch';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import { ensureDirSync, rename, unlink } from 'fs-extra';
|
import { ensureDirSync, rename, unlink } from 'fs-extra';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import type { Representation } from '../../http/representation/Representation';
|
import type { Representation } from '../../http/representation/Representation';
|
||||||
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
||||||
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import type { Stats } from 'fs-extra';
|
import type { Stats } from 'fs-extra';
|
||||||
import { createReadStream, createWriteStream, ensureDir, lstat, opendir, remove, stat } from 'fs-extra';
|
import { createReadStream, createWriteStream, ensureDir, lstat, opendir, remove, stat } from 'fs-extra';
|
||||||
import type { Quad } from 'rdf-js';
|
import type { Quad } from 'rdf-js';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
||||||
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
||||||
import type { Guarded } from '../../util/GuardedStream';
|
import type { Guarded } from '../../util/GuardedStream';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import arrayifyStream from 'arrayify-stream';
|
import arrayifyStream from 'arrayify-stream';
|
||||||
import { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
import { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
||||||
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import type { Representation } from '../../http/representation/Representation';
|
import type { Representation } from '../../http/representation/Representation';
|
||||||
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
||||||
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import arrayifyStream from 'arrayify-stream';
|
import arrayifyStream from 'arrayify-stream';
|
||||||
import { SparqlEndpointFetcher } from 'fetch-sparql-endpoint';
|
import { SparqlEndpointFetcher } from 'fetch-sparql-endpoint';
|
||||||
import { DataFactory } from 'n3';
|
import { DataFactory } from 'n3';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import type { Validator } from '../../http/auxiliary/Validator';
|
import type { Validator } from '../../http/auxiliary/Validator';
|
||||||
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
||||||
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { createReadStream } from 'fs';
|
import { createReadStream } from 'node:fs';
|
||||||
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
||||||
import type { Representation } from '../../http/representation/Representation';
|
import type { Representation } from '../../http/representation/Representation';
|
||||||
import { NotImplementedHttpError } from '../../util/errors/NotImplementedHttpError';
|
import { NotImplementedHttpError } from '../../util/errors/NotImplementedHttpError';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import orderBy from 'lodash.orderby';
|
import orderBy from 'lodash.orderby';
|
||||||
import type { Quad } from 'rdf-js';
|
import type { Quad } from 'rdf-js';
|
||||||
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import assert from 'assert';
|
import assert from 'node:assert';
|
||||||
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
||||||
import type { Representation } from '../../http/representation/Representation';
|
import type { Representation } from '../../http/representation/Representation';
|
||||||
import { INTERNAL_ERROR } from '../../util/ContentTypes';
|
import { INTERNAL_ERROR } from '../../util/ContentTypes';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { parse } from 'querystring';
|
import { parse } from 'node:querystring';
|
||||||
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
||||||
import type { Representation } from '../../http/representation/Representation';
|
import type { Representation } from '../../http/representation/Representation';
|
||||||
import { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
import { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import { DataFactory, StreamWriter } from 'n3';
|
import { DataFactory, StreamWriter } from 'n3';
|
||||||
import type { Quad } from 'rdf-js';
|
import type { Quad } from 'rdf-js';
|
||||||
import rdfSerializer from 'rdf-serialize';
|
import rdfSerializer from 'rdf-serialize';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PassThrough } from 'stream';
|
import { PassThrough } from 'node:stream';
|
||||||
import { KeysRdfParseJsonLd } from '@comunica/context-entries';
|
import { KeysRdfParseJsonLd } from '@comunica/context-entries';
|
||||||
import type { NamedNode } from '@rdfjs/types';
|
import type { NamedNode } from '@rdfjs/types';
|
||||||
import rdfParser from 'rdf-parse';
|
import rdfParser from 'rdf-parse';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { createHash } from 'crypto';
|
import { createHash } from 'node:crypto';
|
||||||
import { getLoggerFor } from '../../logging/LogUtil';
|
import { getLoggerFor } from '../../logging/LogUtil';
|
||||||
import { NotImplementedHttpError } from '../../util/errors/NotImplementedHttpError';
|
import { NotImplementedHttpError } from '../../util/errors/NotImplementedHttpError';
|
||||||
import type { KeyValueStorage } from './KeyValueStorage';
|
import type { KeyValueStorage } from './KeyValueStorage';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { createHash } from 'crypto';
|
import { createHash } from 'node:crypto';
|
||||||
import { getLoggerFor } from '../../logging/LogUtil';
|
import { getLoggerFor } from '../../logging/LogUtil';
|
||||||
import { NotImplementedHttpError } from '../../util/errors/NotImplementedHttpError';
|
import { NotImplementedHttpError } from '../../util/errors/NotImplementedHttpError';
|
||||||
import type { KeyValueStorage } from './KeyValueStorage';
|
import type { KeyValueStorage } from './KeyValueStorage';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { promises as fsPromises } from 'fs';
|
import { promises as fsPromises } from 'node:fs';
|
||||||
import * as mime from 'mime-types';
|
import * as mime from 'mime-types';
|
||||||
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
||||||
import { DEFAULT_CUSTOM_TYPES } from '../../util/ContentTypes';
|
import { DEFAULT_CUSTOM_TYPES } from '../../util/ContentTypes';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import { Store } from 'n3';
|
import { Store } from 'n3';
|
||||||
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
|
||||||
import type { RdfDatasetRepresentation } from '../../http/representation/RdfDatasetRepresentation';
|
import type { RdfDatasetRepresentation } from '../../http/representation/RdfDatasetRepresentation';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// These two eslint lines are needed to store 'this' in a variable so it can be used
|
// These two eslint lines are needed to store 'this' in a variable so it can be used
|
||||||
// in the PassThrough of createQuotaGuard
|
// in the PassThrough of createQuotaGuard
|
||||||
/* eslint-disable ts/no-this-alias */
|
/* eslint-disable ts/no-this-alias */
|
||||||
import { PassThrough } from 'stream';
|
import { PassThrough } from 'node:stream';
|
||||||
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
||||||
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
||||||
import { PayloadHttpError } from '../../util/errors/PayloadHttpError';
|
import { PayloadHttpError } from '../../util/errors/PayloadHttpError';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { Stats } from 'fs';
|
import type { Stats } from 'node:fs';
|
||||||
import { promises as fsPromises } from 'fs';
|
import { promises as fsPromises } from 'node:fs';
|
||||||
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
|
||||||
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
||||||
import { joinFilePath, normalizeFilePath, trimTrailingSlashes } from '../../util/PathUtil';
|
import { joinFilePath, normalizeFilePath, trimTrailingSlashes } from '../../util/PathUtil';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PassThrough, Readable } from 'stream';
|
import { PassThrough, Readable } from 'node:stream';
|
||||||
import { Validator } from '../../http/auxiliary/Validator';
|
import { Validator } from '../../http/auxiliary/Validator';
|
||||||
import type { ValidatorInput } from '../../http/auxiliary/Validator';
|
import type { ValidatorInput } from '../../http/auxiliary/Validator';
|
||||||
import type { Representation } from '../../http/representation/Representation';
|
import type { Representation } from '../../http/representation/Representation';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'node:events';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A typed interface of {@link EventEmitter}.
|
* A typed interface of {@link EventEmitter}.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { IncomingHttpHeaders } from 'http';
|
import type { IncomingHttpHeaders } from 'node:http';
|
||||||
import escapeStringRegexp from 'escape-string-regexp';
|
import escapeStringRegexp from 'escape-string-regexp';
|
||||||
import { getLoggerFor } from '../logging/LogUtil';
|
import { getLoggerFor } from '../logging/LogUtil';
|
||||||
import type { HttpResponse } from '../server/HttpResponse';
|
import type { HttpResponse } from '../server/HttpResponse';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { posix, win32 } from 'path';
|
import { posix, win32 } from 'node:path';
|
||||||
import { readJson } from 'fs-extra';
|
import { readJson } from 'fs-extra';
|
||||||
import urljoin from 'url-join';
|
import urljoin from 'url-join';
|
||||||
import type { TargetExtractor } from '../http/input/identifier/TargetExtractor';
|
import type { TargetExtractor } from '../http/input/identifier/TargetExtractor';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { types } from 'util';
|
import { types } from 'node:util';
|
||||||
import { createAggregateError } from './errors/HttpErrorUtil';
|
import { createAggregateError } from './errors/HttpErrorUtil';
|
||||||
|
|
||||||
export type PromiseOrValue<T> = T | Promise<T>;
|
export type PromiseOrValue<T> = T | Promise<T>;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import type { NamedNode } from '@rdfjs/types';
|
import type { NamedNode } from '@rdfjs/types';
|
||||||
import arrayifyStream from 'arrayify-stream';
|
import arrayifyStream from 'arrayify-stream';
|
||||||
import type { ParserOptions } from 'n3';
|
import type { ParserOptions } from 'n3';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { Readable, TransformCallback, TransformOptions } from 'stream';
|
import type { Readable, TransformCallback, TransformOptions } from 'node:stream';
|
||||||
import { Transform } from 'stream';
|
import { Transform } from 'node:stream';
|
||||||
import { RangeNotSatisfiedHttpError } from './errors/RangeNotSatisfiedHttpError';
|
import { RangeNotSatisfiedHttpError } from './errors/RangeNotSatisfiedHttpError';
|
||||||
import { pipeSafely } from './StreamUtil';
|
import { pipeSafely } from './StreamUtil';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { DuplexOptions, ReadableOptions, Writable } from 'stream';
|
import type { DuplexOptions, ReadableOptions, Writable } from 'node:stream';
|
||||||
import { Readable, Transform } from 'stream';
|
import { Readable, Transform } from 'node:stream';
|
||||||
import { promisify } from 'util';
|
import { promisify } from 'node:util';
|
||||||
import arrayifyStream from 'arrayify-stream';
|
import arrayifyStream from 'arrayify-stream';
|
||||||
import eos from 'end-of-stream';
|
import eos from 'end-of-stream';
|
||||||
import { Store } from 'n3';
|
import { Store } from 'n3';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { types } from 'util';
|
import { types } from 'node:util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the input is an {@link Error}.
|
* Checks if the input is an {@link Error}.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { URL } from 'url';
|
import { URL } from 'node:url';
|
||||||
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
||||||
import { errorTermsToMetadata } from '../errors/HttpErrorUtil';
|
import { errorTermsToMetadata } from '../errors/HttpErrorUtil';
|
||||||
import { InternalServerError } from '../errors/InternalServerError';
|
import { InternalServerError } from '../errors/InternalServerError';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { createHash } from 'crypto';
|
import { createHash } from 'node:crypto';
|
||||||
import { ensureDir, remove } from 'fs-extra';
|
import { ensureDir, remove } from 'fs-extra';
|
||||||
import type { LockOptions, UnlockOptions } from 'proper-lockfile';
|
import type { LockOptions, UnlockOptions } from 'proper-lockfile';
|
||||||
import { lock, unlock } from 'proper-lockfile';
|
import { lock, unlock } from 'proper-lockfile';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { promises as fsPromises } from 'fs';
|
import { promises as fsPromises } from 'node:fs';
|
||||||
import { joinFilePath, resolveAssetPath } from '../PathUtil';
|
import { joinFilePath, resolveAssetPath } from '../PathUtil';
|
||||||
import type { Template } from './TemplateEngine';
|
import type { Template } from './TemplateEngine';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import assert from 'assert';
|
import assert from 'node:assert';
|
||||||
import fetch from 'cross-fetch';
|
import fetch from 'cross-fetch';
|
||||||
import type { App } from '../../src/init/App';
|
import type { App } from '../../src/init/App';
|
||||||
import { getPort } from '../util/Util';
|
import { getPort } from '../util/Util';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { mkdirSync } from 'fs';
|
import { mkdirSync } from 'node:fs';
|
||||||
import fetch from 'cross-fetch';
|
import fetch from 'cross-fetch';
|
||||||
import type { App } from '../../src/init/App';
|
import type { App } from '../../src/init/App';
|
||||||
import { joinFilePath } from '../../src/util/PathUtil';
|
import { joinFilePath } from '../../src/util/PathUtil';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { promises as fsPromises } from 'fs';
|
import { promises as fsPromises } from 'node:fs';
|
||||||
import fetch from 'cross-fetch';
|
import fetch from 'cross-fetch';
|
||||||
import type { App, ResourceStore } from '../../src/';
|
import type { App, ResourceStore } from '../../src/';
|
||||||
import { BasicRepresentation, isSystemError, joinFilePath, joinUrl } from '../../src/';
|
import { BasicRepresentation, isSystemError, joinFilePath, joinUrl } from '../../src/';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { createReadStream } from 'fs';
|
import { createReadStream } from 'node:fs';
|
||||||
import fetch from 'cross-fetch';
|
import fetch from 'cross-fetch';
|
||||||
import type { Quad } from 'n3';
|
import type { Quad } from 'n3';
|
||||||
import { DataFactory, Parser, Store } from 'n3';
|
import { DataFactory, Parser, Store } from 'n3';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Server } from 'http';
|
import type { Server } from 'node:http';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
import type { App } from '../../src/init/App';
|
import type { App } from '../../src/init/App';
|
||||||
import type { HttpServerFactory } from '../../src/server/HttpServerFactory';
|
import type { HttpServerFactory } from '../../src/server/HttpServerFactory';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Stats } from 'fs';
|
import type { Stats } from 'node:fs';
|
||||||
import fetch from 'cross-fetch';
|
import fetch from 'cross-fetch';
|
||||||
import type { Response } from 'cross-fetch';
|
import type { Response } from 'cross-fetch';
|
||||||
import { ensureDir, pathExists, stat } from 'fs-extra';
|
import { ensureDir, pathExists, stat } from 'fs-extra';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import EventEmitter from 'events';
|
import EventEmitter from 'node:events';
|
||||||
import fetch from 'cross-fetch';
|
import fetch from 'cross-fetch';
|
||||||
import Redis, { ReplyError } from 'ioredis';
|
import Redis, { ReplyError } from 'ioredis';
|
||||||
import type { App } from '../../src';
|
import type { App } from '../../src';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Readable } from 'stream';
|
import { Readable } from 'node:stream';
|
||||||
import arrayifyStream from 'arrayify-stream';
|
import arrayifyStream from 'arrayify-stream';
|
||||||
import { BasicETagHandler, SingleRootIdentifierStrategy } from '../../src';
|
import { BasicETagHandler, SingleRootIdentifierStrategy } from '../../src';
|
||||||
import { BasicRequestParser } from '../../src/http/input/BasicRequestParser';
|
import { BasicRequestParser } from '../../src/http/input/BasicRequestParser';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'node:fs';
|
||||||
import { joinFilePath } from '../../src/';
|
import { joinFilePath } from '../../src/';
|
||||||
import type { App } from '../../src/';
|
import type { App } from '../../src/';
|
||||||
import { putResource } from '../util/FetchUtil';
|
import { putResource } from '../util/FetchUtil';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { createServer } from 'http';
|
import { createServer } from 'node:http';
|
||||||
import type { IncomingMessage, Server, ServerResponse } from 'http';
|
import type { IncomingMessage, Server, ServerResponse } from 'node:http';
|
||||||
import { fetch } from 'cross-fetch';
|
import { fetch } from 'cross-fetch';
|
||||||
import { createRemoteJWKSet, jwtVerify } from 'jose';
|
import { createRemoteJWKSet, jwtVerify } from 'jose';
|
||||||
import type { NamedNode } from 'n3';
|
import type { NamedNode } from 'n3';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'node:events';
|
||||||
import type { WebSocket } from 'ws';
|
import type { WebSocket } from 'ws';
|
||||||
import { RepresentationMetadata } from '../../../src/http/representation/RepresentationMetadata';
|
import { RepresentationMetadata } from '../../../src/http/representation/RepresentationMetadata';
|
||||||
import { UnsecureWebSocketsProtocol } from '../../../src/http/UnsecureWebSocketsProtocol';
|
import { UnsecureWebSocketsProtocol } from '../../../src/http/UnsecureWebSocketsProtocol';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import { GetOperationHandler } from '../../../../src/http/ldp/GetOperationHandler';
|
import { GetOperationHandler } from '../../../../src/http/ldp/GetOperationHandler';
|
||||||
import type { Operation } from '../../../../src/http/Operation';
|
import type { Operation } from '../../../../src/http/Operation';
|
||||||
import { BasicRepresentation } from '../../../../src/http/representation/BasicRepresentation';
|
import { BasicRepresentation } from '../../../../src/http/representation/BasicRepresentation';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'node:stream';
|
||||||
import { HeadOperationHandler } from '../../../../src/http/ldp/HeadOperationHandler';
|
import { HeadOperationHandler } from '../../../../src/http/ldp/HeadOperationHandler';
|
||||||
import type { Operation } from '../../../../src/http/Operation';
|
import type { Operation } from '../../../../src/http/Operation';
|
||||||
import { BasicRepresentation } from '../../../../src/http/representation/BasicRepresentation';
|
import { BasicRepresentation } from '../../../../src/http/representation/BasicRepresentation';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'node:events';
|
||||||
import { PassThrough } from 'stream';
|
import { PassThrough } from 'node:stream';
|
||||||
import type { MockResponse } from 'node-mocks-http';
|
import type { MockResponse } from 'node-mocks-http';
|
||||||
import { createResponse } from 'node-mocks-http';
|
import { createResponse } from 'node-mocks-http';
|
||||||
import { BasicResponseWriter } from '../../../../src/http/output/BasicResponseWriter';
|
import { BasicResponseWriter } from '../../../../src/http/output/BasicResponseWriter';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import 'jest-rdf';
|
import 'jest-rdf';
|
||||||
import { Readable } from 'stream';
|
import { Readable } from 'node:stream';
|
||||||
import arrayifyStream from 'arrayify-stream';
|
import arrayifyStream from 'arrayify-stream';
|
||||||
import { DataFactory } from 'n3';
|
import { DataFactory } from 'n3';
|
||||||
import { BasicRepresentation } from '../../../../src/http/representation/BasicRepresentation';
|
import { BasicRepresentation } from '../../../../src/http/representation/BasicRepresentation';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Readable } from 'stream';
|
import { Readable } from 'node:stream';
|
||||||
import { exportJWK, generateKeyPair } from 'jose';
|
import { exportJWK, generateKeyPair } from 'jose';
|
||||||
import type * as Koa from 'koa';
|
import type * as Koa from 'koa';
|
||||||
import type { ErrorHandler } from '../../../../src/http/output/error/ErrorHandler';
|
import type { ErrorHandler } from '../../../../src/http/output/error/ErrorHandler';
|
||||||
|
@ -14,7 +14,7 @@ import { InternalServerError } from '../../../../../../src/util/errors/InternalS
|
|||||||
|
|
||||||
const STORAGE_TYPE = 'clientCredentials';
|
const STORAGE_TYPE = 'clientCredentials';
|
||||||
const secret = 'verylongstringof64bytes';
|
const secret = 'verylongstringof64bytes';
|
||||||
jest.mock('crypto', (): any => ({ randomBytes: (): string => secret }));
|
jest.mock('node:crypto', (): any => ({ randomBytes: (): string => secret }));
|
||||||
|
|
||||||
describe('A BaseClientCredentialsStore', (): void => {
|
describe('A BaseClientCredentialsStore', (): void => {
|
||||||
const webId = 'http://example.com/card#me';
|
const webId = 'http://example.com/card#me';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { ServerResponse } from 'http';
|
import type { ServerResponse } from 'node:http';
|
||||||
import { createResponse } from 'node-mocks-http';
|
import { createResponse } from 'node-mocks-http';
|
||||||
import { RepresentationMetadata } from '../../../../../../src/http/representation/RepresentationMetadata';
|
import { RepresentationMetadata } from '../../../../../../src/http/representation/RepresentationMetadata';
|
||||||
import { OwnerMetadataWriter } from '../../../../../../src/identity/interaction/pod/util/OwnerMetadataWriter';
|
import { OwnerMetadataWriter } from '../../../../../../src/identity/interaction/pod/util/OwnerMetadataWriter';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Readable } from 'stream';
|
import { Readable } from 'node:stream';
|
||||||
import { DataFactory } from 'n3';
|
import { DataFactory } from 'n3';
|
||||||
import type { Quad } from 'n3';
|
import type { Quad } from 'n3';
|
||||||
import rdfDereferencer from 'rdf-dereference';
|
import rdfDereferencer from 'rdf-dereference';
|
||||||
|
@ -115,7 +115,7 @@ const packageJSON = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
jest.mock('fs', (): Partial<Record<string, jest.Mock>> => ({
|
jest.mock('node:fs', (): Partial<Record<string, jest.Mock>> => ({
|
||||||
cwd: jest.fn((): string => __dirname),
|
cwd: jest.fn((): string => __dirname),
|
||||||
existsSync: jest.fn((pth: string): boolean => typeof pth === 'string' && pth in files),
|
existsSync: jest.fn((pth: string): boolean => typeof pth === 'string' && pth in files),
|
||||||
}));
|
}));
|
||||||
|
@ -5,7 +5,7 @@ import type { PodCreator } from '../../../src/identity/interaction/pod/util/PodC
|
|||||||
import { SeededAccountInitializer } from '../../../src/init/SeededAccountInitializer';
|
import { SeededAccountInitializer } from '../../../src/init/SeededAccountInitializer';
|
||||||
import { mockFileSystem } from '../../util/Util';
|
import { mockFileSystem } from '../../util/Util';
|
||||||
|
|
||||||
jest.mock('fs');
|
jest.mock('node:fs');
|
||||||
jest.mock('fs-extra');
|
jest.mock('fs-extra');
|
||||||
|
|
||||||
describe('A SeededAccountInitializer', (): void => {
|
describe('A SeededAccountInitializer', (): void => {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import type { Server } from 'http';
|
import type { Server } from 'node:http';
|
||||||
import { Server as HttpsServer } from 'https';
|
import { Server as HttpsServer } from 'node:https';
|
||||||
import { ServerInitializer } from '../../../src/init/ServerInitializer';
|
import { ServerInitializer } from '../../../src/init/ServerInitializer';
|
||||||
import type { Logger } from '../../../src/logging/Logger';
|
import type { Logger } from '../../../src/logging/Logger';
|
||||||
import { getLoggerFor } from '../../../src/logging/LogUtil';
|
import { getLoggerFor } from '../../../src/logging/LogUtil';
|
||||||
import type { HttpServerFactory } from '../../../src/server/HttpServerFactory';
|
import type { HttpServerFactory } from '../../../src/server/HttpServerFactory';
|
||||||
|
|
||||||
// Mock so we don't create an actual HTTPS server in the test below
|
// Mock so we don't create an actual HTTPS server in the test below
|
||||||
jest.mock('https');
|
jest.mock('node:https');
|
||||||
jest.mock('../../../src/logging/LogUtil');
|
jest.mock('../../../src/logging/LogUtil');
|
||||||
|
|
||||||
describe('ServerInitializer', (): void => {
|
describe('ServerInitializer', (): void => {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import cluster from 'cluster';
|
import cluster from 'node:cluster';
|
||||||
import EventEmitter from 'events';
|
import EventEmitter from 'node:events';
|
||||||
import { cpus } from 'os';
|
import { cpus } from 'node:os';
|
||||||
import { ClusterManager } from '../../../../src';
|
import { ClusterManager } from '../../../../src';
|
||||||
import * as LogUtil from '../../../../src/logging/LogUtil';
|
import * as LogUtil from '../../../../src/logging/LogUtil';
|
||||||
|
|
||||||
jest.mock('cluster');
|
jest.mock('node:cluster');
|
||||||
jest.mock('os', (): any => ({
|
jest.mock('node:os', (): any => ({
|
||||||
...jest.requireActual('os'),
|
...jest.requireActual('node:os'),
|
||||||
cpus: jest.fn().mockImplementation((): any => [{}, {}, {}, {}, {}, {}]),
|
cpus: jest.fn().mockImplementation((): any => [{}, {}, {}, {}, {}, {}]),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ mockWorker.process = { pid: 666 };
|
|||||||
|
|
||||||
describe('A ClusterManager', (): void => {
|
describe('A ClusterManager', (): void => {
|
||||||
const emitter = new EventEmitter();
|
const emitter = new EventEmitter();
|
||||||
const mockCluster = jest.requireMock('cluster');
|
const mockCluster = jest.requireMock('node:cluster');
|
||||||
const mockLogger = { info: jest.fn(), warn: jest.fn() };
|
const mockLogger = { info: jest.fn(), warn: jest.fn() };
|
||||||
jest.spyOn(LogUtil, 'getLoggerFor').mockImplementation((): any => mockLogger);
|
jest.spyOn(LogUtil, 'getLoggerFor').mockImplementation((): any => mockLogger);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ type ClientCredentials = {
|
|||||||
|
|
||||||
const questionMock = jest.fn().mockImplementation((input, callback): void => callback('y'));
|
const questionMock = jest.fn().mockImplementation((input, callback): void => callback('y'));
|
||||||
const closeMock = jest.fn();
|
const closeMock = jest.fn();
|
||||||
jest.mock('readline', (): any => ({
|
jest.mock('node:readline', (): any => ({
|
||||||
createInterface: jest.fn().mockImplementation((): any => ({
|
createInterface: jest.fn().mockImplementation((): any => ({
|
||||||
question: questionMock,
|
question: questionMock,
|
||||||
close: closeMock,
|
close: closeMock,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import process from 'process';
|
import process from 'node:process';
|
||||||
import { BaseLogger, WrappingLogger } from '../../../src/logging/Logger';
|
import { BaseLogger, WrappingLogger } from '../../../src/logging/Logger';
|
||||||
import type { LogMetadata, SimpleLogger } from '../../../src/logging/Logger';
|
import type { LogMetadata, SimpleLogger } from '../../../src/logging/Logger';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PassThrough } from 'stream';
|
import { PassThrough } from 'node:stream';
|
||||||
import type { Logger } from 'winston';
|
import type { Logger } from 'winston';
|
||||||
import type * as Transport from 'winston-transport';
|
import type * as Transport from 'winston-transport';
|
||||||
import { WinstonLogger } from '../../../src/logging/WinstonLogger';
|
import { WinstonLogger } from '../../../src/logging/WinstonLogger';
|
||||||
|
@ -13,7 +13,7 @@ import { HandlebarsTemplateEngine } from '../../../../src/util/templates/Handleb
|
|||||||
import { SimpleSuffixStrategy } from '../../../util/SimpleSuffixStrategy';
|
import { SimpleSuffixStrategy } from '../../../util/SimpleSuffixStrategy';
|
||||||
import { mockFileSystem } from '../../../util/Util';
|
import { mockFileSystem } from '../../../util/Util';
|
||||||
|
|
||||||
jest.mock('fs');
|
jest.mock('node:fs');
|
||||||
jest.mock('fs-extra');
|
jest.mock('fs-extra');
|
||||||
|
|
||||||
class DummyFactory implements FileIdentifierMapperFactory {
|
class DummyFactory implements FileIdentifierMapperFactory {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import fs from 'fs';
|
import fs from 'node:fs';
|
||||||
import { RootFilePathHandler } from '../../../../../src/pods/generate/variables/RootFilePathHandler';
|
import { RootFilePathHandler } from '../../../../../src/pods/generate/variables/RootFilePathHandler';
|
||||||
import { TEMPLATE_VARIABLE } from '../../../../../src/pods/generate/variables/Variables';
|
import { TEMPLATE_VARIABLE } from '../../../../../src/pods/generate/variables/Variables';
|
||||||
import type { PodSettings } from '../../../../../src/pods/settings/PodSettings';
|
import type { PodSettings } from '../../../../../src/pods/settings/PodSettings';
|
||||||
@ -6,7 +6,7 @@ import type { ResourceLink } from '../../../../../src/storage/mapping/FileIdenti
|
|||||||
import { ConflictHttpError } from '../../../../../src/util/errors/ConflictHttpError';
|
import { ConflictHttpError } from '../../../../../src/util/errors/ConflictHttpError';
|
||||||
import { joinFilePath } from '../../../../../src/util/PathUtil';
|
import { joinFilePath } from '../../../../../src/util/PathUtil';
|
||||||
|
|
||||||
jest.mock('fs');
|
jest.mock('node:fs');
|
||||||
|
|
||||||
describe('A RootFilePathHandler', (): void => {
|
describe('A RootFilePathHandler', (): void => {
|
||||||
const rootFilePath = 'files/';
|
const rootFilePath = 'files/';
|
||||||
|
@ -11,7 +11,7 @@ import { SingleRootIdentifierStrategy } from '../../../src/util/identifiers/Sing
|
|||||||
import { PIM, RDF } from '../../../src/util/Vocabularies';
|
import { PIM, RDF } from '../../../src/util/Vocabularies';
|
||||||
import { mockFileSystem } from '../../util/Util';
|
import { mockFileSystem } from '../../util/Util';
|
||||||
|
|
||||||
jest.mock('fs');
|
jest.mock('node:fs');
|
||||||
|
|
||||||
describe('PodQuotaStrategy', (): void => {
|
describe('PodQuotaStrategy', (): void => {
|
||||||
let strategy: PodQuotaStrategy;
|
let strategy: PodQuotaStrategy;
|
||||||
|
@ -6,7 +6,7 @@ import type { SizeReporter } from '../../../src/storage/size-reporter/SizeReport
|
|||||||
import { guardedStreamFrom, pipeSafely } from '../../../src/util/StreamUtil';
|
import { guardedStreamFrom, pipeSafely } from '../../../src/util/StreamUtil';
|
||||||
import { mockFileSystem } from '../../util/Util';
|
import { mockFileSystem } from '../../util/Util';
|
||||||
|
|
||||||
jest.mock('fs');
|
jest.mock('node:fs');
|
||||||
|
|
||||||
class QuotaStrategyWrapper extends QuotaStrategy {
|
class QuotaStrategyWrapper extends QuotaStrategy {
|
||||||
public constructor(reporter: SizeReporter<any>, limit: Size) {
|
public constructor(reporter: SizeReporter<any>, limit: Size) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { RequestListener, Server } from 'http';
|
import type { RequestListener, Server } from 'node:http';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
import type { BaseServerFactoryOptions } from '../../../src/server/BaseServerFactory';
|
import type { BaseServerFactoryOptions } from '../../../src/server/BaseServerFactory';
|
||||||
import { BaseServerFactory } from '../../../src/server/BaseServerFactory';
|
import { BaseServerFactory } from '../../../src/server/BaseServerFactory';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'node:events';
|
||||||
import type { IncomingMessage, Server, ServerResponse } from 'http';
|
import type { IncomingMessage, Server, ServerResponse } from 'node:http';
|
||||||
import { Readable } from 'stream';
|
import { Readable } from 'node:stream';
|
||||||
import type { Logger } from '../../../src/logging/Logger';
|
import type { Logger } from '../../../src/logging/Logger';
|
||||||
import { getLoggerFor } from '../../../src/logging/LogUtil';
|
import { getLoggerFor } from '../../../src/logging/LogUtil';
|
||||||
import { HandlerServerConfigurator } from '../../../src/server/HandlerServerConfigurator';
|
import { HandlerServerConfigurator } from '../../../src/server/HandlerServerConfigurator';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'node:events';
|
||||||
import type { Server } from 'http';
|
import type { Server } from 'node:http';
|
||||||
import type { WebSocket } from 'ws';
|
import type { WebSocket } from 'ws';
|
||||||
import type { Logger } from '../../../src/logging/Logger';
|
import type { Logger } from '../../../src/logging/Logger';
|
||||||
import { getLoggerFor } from '../../../src/logging/LogUtil';
|
import { getLoggerFor } from '../../../src/logging/LogUtil';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'node:events';
|
||||||
import fs from 'fs';
|
import fs from 'node:fs';
|
||||||
import { PassThrough, Readable } from 'stream';
|
import { PassThrough, Readable } from 'node:stream';
|
||||||
import { createResponse } from 'node-mocks-http';
|
import { createResponse } from 'node-mocks-http';
|
||||||
import { StaticAssetEntry, StaticAssetHandler } from '../../../../src/server/middleware/StaticAssetHandler';
|
import { StaticAssetEntry, StaticAssetHandler } from '../../../../src/server/middleware/StaticAssetHandler';
|
||||||
import { InternalServerError } from '../../../../src/util/errors/InternalServerError';
|
import { InternalServerError } from '../../../../src/util/errors/InternalServerError';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'node:events';
|
||||||
import { RepresentationMetadata } from '../../../../src/http/representation/RepresentationMetadata';
|
import { RepresentationMetadata } from '../../../../src/http/representation/RepresentationMetadata';
|
||||||
import type { ResourceIdentifier } from '../../../../src/http/representation/ResourceIdentifier';
|
import type { ResourceIdentifier } from '../../../../src/http/representation/ResourceIdentifier';
|
||||||
import type { Logger } from '../../../../src/logging/Logger';
|
import type { Logger } from '../../../../src/logging/Logger';
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user