diff --git a/plugins.js b/plugins.js index b881df336..f55de2ccb 100644 --- a/plugins.js +++ b/plugins.js @@ -3,8 +3,8 @@ // 1. node plugins.js update // 2. node plugins.js install // More operations coming soon. -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { default as git } from 'simple-git'; diff --git a/post-install.js b/post-install.js index 08e8a0573..962927c22 100644 --- a/post-install.js +++ b/post-install.js @@ -1,10 +1,10 @@ /** * Scripts to be done before starting the server for the first time. */ -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import * as crypto from 'node:crypto'; -import * as yaml from 'yaml'; +import fs from 'node:fs'; +import path from 'node:path'; +import crypto from 'node:crypto'; +import yaml from 'yaml'; import _ from 'lodash'; import { createRequire } from 'node:module'; diff --git a/recover.js b/recover.js index 531c77bb4..176983718 100644 --- a/recover.js +++ b/recover.js @@ -1,4 +1,4 @@ -import * as fs from 'node:fs'; +import fs from 'node:fs'; import yaml from 'yaml'; import storage from 'node-persist'; import * as users from './src/users.js'; diff --git a/server.js b/server.js index 3c1994a7b..7f53fe534 100644 --- a/server.js +++ b/server.js @@ -1,13 +1,13 @@ #!/usr/bin/env node // native node modules -import * as fs from 'node:fs'; -import * as http from 'node:http'; -import * as https from 'node:https'; -import * as path from 'node:path'; -import * as util from 'node:util'; -import * as net from 'node:net'; -import * as dns from 'node:dns'; +import fs from 'node:fs'; +import http from 'node:http'; +import https from 'node:https'; +import path from 'node:path'; +import util from 'node:util'; +import net from 'node:net'; +import dns from 'node:dns'; import { fileURLToPath } from 'node:url'; // cli/fs related library imports @@ -440,7 +440,6 @@ app.use(multerMonkeyPatch); // User data mount app.use('/', userModule.router); // Private endpoints - app.use('/api/users', usersPrivateRouter); // Admin endpoints app.use('/api/users', usersAdminRouter); diff --git a/src/endpoints/assets.js b/src/endpoints/assets.js index 7379aceba..a9d7fd201 100644 --- a/src/endpoints/assets.js +++ b/src/endpoints/assets.js @@ -1,5 +1,5 @@ -import * as path from 'node:path'; -import * as fs from 'node:fs'; +import path from 'node:path'; +import fs from 'node:fs'; import { finished } from 'node:stream/promises'; import mime from 'mime-types'; diff --git a/src/endpoints/avatars.js b/src/endpoints/avatars.js index d16eb2969..73b995ffb 100644 --- a/src/endpoints/avatars.js +++ b/src/endpoints/avatars.js @@ -1,5 +1,5 @@ -import * as path from 'node:path'; -import * as fs from 'node:fs'; +import path from 'node:path'; +import fs from 'node:fs'; import express from 'express'; import sanitize from 'sanitize-filename'; diff --git a/src/endpoints/backends/kobold.js b/src/endpoints/backends/kobold.js index 990e0085d..e2fa630ff 100644 --- a/src/endpoints/backends/kobold.js +++ b/src/endpoints/backends/kobold.js @@ -1,4 +1,4 @@ -import * as fs from 'node:fs'; +import fs from 'node:fs'; import express from 'express'; import fetch from 'node-fetch'; diff --git a/src/endpoints/backgrounds.js b/src/endpoints/backgrounds.js index 4ee1f7c1c..0638415e6 100644 --- a/src/endpoints/backgrounds.js +++ b/src/endpoints/backgrounds.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import express from 'express'; import sanitize from 'sanitize-filename'; diff --git a/src/endpoints/characters.js b/src/endpoints/characters.js index 20a947ef8..8504a3462 100644 --- a/src/endpoints/characters.js +++ b/src/endpoints/characters.js @@ -1,7 +1,7 @@ -import * as path from 'node:path'; -import * as fs from 'node:fs'; +import path from 'node:path'; +import fs from 'node:fs'; import { promises as fsPromises } from 'node:fs'; -import * as readline from 'node:readline'; +import readline from 'node:readline'; import { Buffer } from 'node:buffer'; import express from 'express'; diff --git a/src/endpoints/chats.js b/src/endpoints/chats.js index cc23f9d3e..e1b6fc097 100644 --- a/src/endpoints/chats.js +++ b/src/endpoints/chats.js @@ -1,6 +1,6 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import * as readline from 'node:readline'; +import fs from 'node:fs'; +import path from 'node:path'; +import readline from 'node:readline'; import express from 'express'; import sanitize from 'sanitize-filename'; diff --git a/src/endpoints/content-manager.js b/src/endpoints/content-manager.js index d587c2a34..542611202 100644 --- a/src/endpoints/content-manager.js +++ b/src/endpoints/content-manager.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import { Buffer } from 'node:buffer'; import express from 'express'; diff --git a/src/endpoints/extensions.js b/src/endpoints/extensions.js index 1c58b4e8c..ecc2f1d23 100644 --- a/src/endpoints/extensions.js +++ b/src/endpoints/extensions.js @@ -1,5 +1,5 @@ -import * as path from 'node:path'; -import * as fs from 'node:fs'; +import path from 'node:path'; +import fs from 'node:fs'; import express from 'express'; import sanitize from 'sanitize-filename'; diff --git a/src/endpoints/files.js b/src/endpoints/files.js index e92a892d5..dd34a4ab6 100644 --- a/src/endpoints/files.js +++ b/src/endpoints/files.js @@ -1,5 +1,5 @@ -import * as path from 'node:path'; -import * as fs from 'node:fs'; +import path from 'node:path'; +import fs from 'node:fs'; import express from 'express'; import sanitize from 'sanitize-filename'; diff --git a/src/endpoints/groups.js b/src/endpoints/groups.js index 0c1c55131..fb2e51d75 100644 --- a/src/endpoints/groups.js +++ b/src/endpoints/groups.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import express from 'express'; import sanitize from 'sanitize-filename'; diff --git a/src/endpoints/images.js b/src/endpoints/images.js index cf52c6a76..eeacb90fc 100644 --- a/src/endpoints/images.js +++ b/src/endpoints/images.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import { Buffer } from 'node:buffer'; import express from 'express'; diff --git a/src/endpoints/moving-ui.js b/src/endpoints/moving-ui.js index 0b82ea919..484dfbba8 100644 --- a/src/endpoints/moving-ui.js +++ b/src/endpoints/moving-ui.js @@ -1,4 +1,4 @@ -import * as path from 'node:path'; +import path from 'node:path'; import express from 'express'; import sanitize from 'sanitize-filename'; import { sync as writeFileAtomicSync } from 'write-file-atomic'; diff --git a/src/endpoints/novelai.js b/src/endpoints/novelai.js index 19046a2a5..a4b770308 100644 --- a/src/endpoints/novelai.js +++ b/src/endpoints/novelai.js @@ -1,4 +1,4 @@ -import * as util from 'node:util'; +import util from 'node:util'; import { Buffer } from 'node:buffer'; import fetch from 'node-fetch'; diff --git a/src/endpoints/openai.js b/src/endpoints/openai.js index 55b2d7c11..08d138e52 100644 --- a/src/endpoints/openai.js +++ b/src/endpoints/openai.js @@ -1,4 +1,4 @@ -import * as fs from 'node:fs'; +import fs from 'node:fs'; import { Buffer } from 'node:buffer'; import fetch from 'node-fetch'; diff --git a/src/endpoints/presets.js b/src/endpoints/presets.js index 36eb53b38..fc7f72cb3 100644 --- a/src/endpoints/presets.js +++ b/src/endpoints/presets.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import express from 'express'; import sanitize from 'sanitize-filename'; diff --git a/src/endpoints/quick-replies.js b/src/endpoints/quick-replies.js index 45df14ce7..f2f05852c 100644 --- a/src/endpoints/quick-replies.js +++ b/src/endpoints/quick-replies.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import express from 'express'; import sanitize from 'sanitize-filename'; diff --git a/src/endpoints/secrets.js b/src/endpoints/secrets.js index 51cbcf2fe..078792cb6 100644 --- a/src/endpoints/secrets.js +++ b/src/endpoints/secrets.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import express from 'express'; import { sync as writeFileAtomicSync } from 'write-file-atomic'; diff --git a/src/endpoints/settings.js b/src/endpoints/settings.js index 8e9e052db..0c4a7cf28 100644 --- a/src/endpoints/settings.js +++ b/src/endpoints/settings.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import express from 'express'; import _ from 'lodash'; diff --git a/src/endpoints/sprites.js b/src/endpoints/sprites.js index e1ce6024d..733b12478 100644 --- a/src/endpoints/sprites.js +++ b/src/endpoints/sprites.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import express from 'express'; import mime from 'mime-types'; diff --git a/src/endpoints/stable-diffusion.js b/src/endpoints/stable-diffusion.js index 4be405c58..75cec8c91 100644 --- a/src/endpoints/stable-diffusion.js +++ b/src/endpoints/stable-diffusion.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import express from 'express'; import fetch from 'node-fetch'; diff --git a/src/endpoints/stats.js b/src/endpoints/stats.js index a7478f7c2..dbde6cb17 100644 --- a/src/endpoints/stats.js +++ b/src/endpoints/stats.js @@ -1,6 +1,6 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import * as crypto from 'node:crypto'; +import fs from 'node:fs'; +import path from 'node:path'; +import crypto from 'node:crypto'; import express from 'express'; import writeFileAtomic from 'write-file-atomic'; diff --git a/src/endpoints/themes.js b/src/endpoints/themes.js index 9edca31be..7d8145162 100644 --- a/src/endpoints/themes.js +++ b/src/endpoints/themes.js @@ -1,5 +1,5 @@ -import * as path from 'node:path'; -import * as fs from 'node:fs'; +import path from 'node:path'; +import fs from 'node:fs'; import express from 'express'; import sanitize from 'sanitize-filename'; diff --git a/src/endpoints/thumbnails.js b/src/endpoints/thumbnails.js index 9f1812b72..275c64f07 100644 --- a/src/endpoints/thumbnails.js +++ b/src/endpoints/thumbnails.js @@ -1,6 +1,6 @@ -import * as fs from 'node:fs'; -import * as fsPromises from 'node:fs/promises'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import { promises as fsPromises } from 'node:fs'; +import path from 'node:path'; import mime from 'mime-types'; import express from 'express'; diff --git a/src/endpoints/tokenizers.js b/src/endpoints/tokenizers.js index 719d2219c..c3766f8e8 100644 --- a/src/endpoints/tokenizers.js +++ b/src/endpoints/tokenizers.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import { Buffer } from 'node:buffer'; import express from 'express'; diff --git a/src/endpoints/translate.js b/src/endpoints/translate.js index e254506cb..67f98ddc8 100644 --- a/src/endpoints/translate.js +++ b/src/endpoints/translate.js @@ -1,4 +1,4 @@ -import * as https from 'node:https'; +import https from 'node:https'; import { createRequire } from 'node:module'; import { Buffer } from 'node:buffer'; diff --git a/src/endpoints/users-private.js b/src/endpoints/users-private.js index 65e9a22f3..10051c5f5 100644 --- a/src/endpoints/users-private.js +++ b/src/endpoints/users-private.js @@ -1,6 +1,6 @@ -import * as path from 'node:path'; +import path from 'node:path'; import { promises as fsPromises } from 'node:fs'; -import * as crypto from 'node:crypto'; +import crypto from 'node:crypto'; import storage from 'node-persist'; import express from 'express'; diff --git a/src/endpoints/users-public.js b/src/endpoints/users-public.js index 618b222b2..5e6b60941 100644 --- a/src/endpoints/users-public.js +++ b/src/endpoints/users-public.js @@ -1,4 +1,4 @@ -import * as crypto from 'node:crypto'; +import crypto from 'node:crypto'; import storage from 'node-persist'; import express from 'express'; diff --git a/src/endpoints/vectors.js b/src/endpoints/vectors.js index 386b804f6..325684601 100644 --- a/src/endpoints/vectors.js +++ b/src/endpoints/vectors.js @@ -1,5 +1,5 @@ -import * as path from 'node:path'; -import * as fs from 'node:fs'; +import path from 'node:path'; +import fs from 'node:fs'; import vectra from 'vectra'; import express from 'express'; diff --git a/src/endpoints/worldinfo.js b/src/endpoints/worldinfo.js index 3fe2593c6..e0b3bd269 100644 --- a/src/endpoints/worldinfo.js +++ b/src/endpoints/worldinfo.js @@ -1,5 +1,5 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; +import fs from 'node:fs'; +import path from 'node:path'; import express from 'express'; import sanitize from 'sanitize-filename'; diff --git a/src/middleware/whitelist.js b/src/middleware/whitelist.js index eda161bc9..d3a2c117b 100644 --- a/src/middleware/whitelist.js +++ b/src/middleware/whitelist.js @@ -1,5 +1,5 @@ -import * as path from 'node:path'; -import * as fs from 'node:fs'; +import path from 'node:path'; +import fs from 'node:fs'; import ipMatching from 'ip-matching'; import { getIpFromRequest } from '../express-common.js'; diff --git a/src/plugin-loader.js b/src/plugin-loader.js index c5c7e2995..433d9f411 100644 --- a/src/plugin-loader.js +++ b/src/plugin-loader.js @@ -1,6 +1,6 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import * as url from 'node:url'; +import fs from 'node:fs'; +import path from 'node:path'; +import url from 'node:url'; import express from 'express'; import { getConfigValue } from './util.js'; diff --git a/src/prompt-converters.js b/src/prompt-converters.js index bfc08ad68..bdb4c8233 100644 --- a/src/prompt-converters.js +++ b/src/prompt-converters.js @@ -1,4 +1,4 @@ -import * as crypto from 'node:crypto'; +import crypto from 'node:crypto'; import polyfill from './polyfill.js'; import { getConfigValue } from './util.js'; diff --git a/src/users.js b/src/users.js index 41632931b..e43025816 100644 --- a/src/users.js +++ b/src/users.js @@ -1,8 +1,8 @@ // Native Node Modules -import * as path from 'node:path'; -import * as fs from 'node:fs'; -import * as crypto from 'node:crypto'; -import * as os from 'node:os'; +import path from 'node:path'; +import fs from 'node:fs'; +import crypto from 'node:crypto'; +import os from 'node:os'; import { Buffer } from 'node:buffer'; // Express and other dependencies diff --git a/src/util.js b/src/util.js index 210056b66..33bbed9bc 100644 --- a/src/util.js +++ b/src/util.js @@ -1,6 +1,6 @@ -import * as path from 'node:path'; -import * as fs from 'node:fs'; -import * as http2 from 'node:http2'; +import path from 'node:path'; +import fs from 'node:fs'; +import http2 from 'node:http2'; import { Readable } from 'node:stream'; import { createRequire } from 'node:module'; import { Buffer } from 'node:buffer';