Simplify node imports
| @@ -3,8 +3,8 @@ | ||
| 3 | 3 | // 1. node plugins.js update |
| 4 | 4 | // 2. node plugins.js install <plugin-git-url> |
| 5 | 5 | // More operations coming soon. |
| 6 | 6 | import * as fs from 'node:fs'; |
| 7 | 7 | import * as path from 'node:path'; |
| 8 | 8 | import { fileURLToPath } from 'node:url'; |
| 9 | 9 | |
| 10 | 10 | import { default as git } from 'simple-git'; |
| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | /** |
| 2 | 2 | * Scripts to be done before starting the server for the first time. |
| 3 | 3 | */ |
| 4 | 4 | import * as fs from 'node:fs'; |
| 5 | 5 | import * as path from 'node:path'; |
| 6 | 6 | import * as crypto from 'node:crypto'; |
| 7 | 7 | import * as yaml from 'yaml'; |
| 8 | 8 | import _ from 'lodash'; |
| 9 | 9 | import { createRequire } from 'node:module'; |
| 10 | 10 | |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import yaml from 'yaml'; |
| 3 | 3 | import storage from 'node-persist'; |
| 4 | 4 | import * as users from './src/users.js'; |
| @@ -1,13 +1,13 @@ | ||
| 1 | 1 | #!/usr/bin/env node |
| 2 | 2 | |
| 3 | 3 | // native node modules |
| 4 | 4 | import * as fs from 'node:fs'; |
| 5 | 5 | import * as http from 'node:http'; |
| 6 | 6 | import * as https from 'node:https'; |
| 7 | 7 | import * as path from 'node:path'; |
| 8 | 8 | import * as util from 'node:util'; |
| 9 | 9 | import * as net from 'node:net'; |
| 10 | 10 | import * as dns from 'node:dns'; |
| 11 | 11 | import { fileURLToPath } from 'node:url'; |
| 12 | 12 | |
| 13 | 13 | // cli/fs related library imports |
| @@ -440,7 +440,6 @@ app.use(multerMonkeyPatch); | ||
| 440 | 440 | // User data mount |
| 441 | 441 | app.use('/', userModule.router); |
| 442 | 442 | // Private endpoints |
| 443 | - | |
| 444 | 443 | app.use('/api/users', usersPrivateRouter); |
| 445 | 444 | // Admin endpoints |
| 446 | 445 | app.use('/api/users', usersAdminRouter); |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import * as fs from 'node:fs'; |
| 3 | 3 | import { finished } from 'node:stream/promises'; |
| 4 | 4 | |
| 5 | 5 | import mime from 'mime-types'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import * as fs from 'node:fs'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import sanitize from 'sanitize-filename'; |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import express from 'express'; |
| 3 | 3 | import fetch from 'node-fetch'; |
| 4 | 4 | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import sanitize from 'sanitize-filename'; |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import * as fs from 'node:fs'; |
| 3 | 3 | import { promises as fsPromises } from 'node:fs'; |
| 4 | 4 | import * as readline from 'node:readline'; |
| 5 | 5 | import { Buffer } from 'node:buffer'; |
| 6 | 6 | |
| 7 | 7 | import express from 'express'; |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | import * as readline from 'node:readline'; |
| 4 | 4 | |
| 5 | 5 | import express from 'express'; |
| 6 | 6 | import sanitize from 'sanitize-filename'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | import { Buffer } from 'node:buffer'; |
| 4 | 4 | |
| 5 | 5 | import express from 'express'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import * as fs from 'node:fs'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import sanitize from 'sanitize-filename'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import * as fs from 'node:fs'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import sanitize from 'sanitize-filename'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import sanitize from 'sanitize-filename'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | import { Buffer } from 'node:buffer'; |
| 4 | 4 | |
| 5 | 5 | import express from 'express'; |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import express from 'express'; |
| 3 | 3 | import sanitize from 'sanitize-filename'; |
| 4 | 4 | import { sync as writeFileAtomicSync } from 'write-file-atomic'; |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | import * as util from 'node:util'; |
| 2 | 2 | import { Buffer } from 'node:buffer'; |
| 3 | 3 | |
| 4 | 4 | import fetch from 'node-fetch'; |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import { Buffer } from 'node:buffer'; |
| 3 | 3 | |
| 4 | 4 | import fetch from 'node-fetch'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import sanitize from 'sanitize-filename'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import sanitize from 'sanitize-filename'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import { sync as writeFileAtomicSync } from 'write-file-atomic'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import _ from 'lodash'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import mime from 'mime-types'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import fetch from 'node-fetch'; |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | import * as crypto from 'node:crypto'; |
| 4 | 4 | |
| 5 | 5 | import express from 'express'; |
| 6 | 6 | import writeFileAtomic from 'write-file-atomic'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import * as fs from 'node:fs'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import sanitize from 'sanitize-filename'; |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import *{ promises as fsPromises } from 'node:fs/promises'; |
| 3 | 3 | import * as path from 'node:path'; |
| 4 | 4 | |
| 5 | 5 | import mime from 'mime-types'; |
| 6 | 6 | import express from 'express'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | import { Buffer } from 'node:buffer'; |
| 4 | 4 | |
| 5 | 5 | import express from 'express'; |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | import * as https from 'node:https'; |
| 2 | 2 | import { createRequire } from 'node:module'; |
| 3 | 3 | import { Buffer } from 'node:buffer'; |
| 4 | 4 | |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import { promises as fsPromises } from 'node:fs'; |
| 3 | 3 | import * as crypto from 'node:crypto'; |
| 4 | 4 | |
| 5 | 5 | import storage from 'node-persist'; |
| 6 | 6 | import express from 'express'; |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | import * as crypto from 'node:crypto'; |
| 2 | 2 | |
| 3 | 3 | import storage from 'node-persist'; |
| 4 | 4 | import express from 'express'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import * as fs from 'node:fs'; |
| 3 | 3 | |
| 4 | 4 | import vectra from 'vectra'; |
| 5 | 5 | import express from 'express'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | |
| 4 | 4 | import express from 'express'; |
| 5 | 5 | import sanitize from 'sanitize-filename'; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import * as fs from 'node:fs'; |
| 3 | 3 | import ipMatching from 'ip-matching'; |
| 4 | 4 | |
| 5 | 5 | import { getIpFromRequest } from '../express-common.js'; |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | import * as fs from 'node:fs'; |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | import * as url from 'node:url'; |
| 4 | 4 | |
| 5 | 5 | import express from 'express'; |
| 6 | 6 | import { getConfigValue } from './util.js'; |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | import * as crypto from 'node:crypto'; |
| 2 | 2 | import polyfill from './polyfill.js'; |
| 3 | 3 | import { getConfigValue } from './util.js'; |
| 4 | 4 | |
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | // Native Node Modules |
| 2 | 2 | import * as path from 'node:path'; |
| 3 | 3 | import * as fs from 'node:fs'; |
| 4 | 4 | import * as crypto from 'node:crypto'; |
| 5 | 5 | import * as os from 'node:os'; |
| 6 | 6 | import { Buffer } from 'node:buffer'; |
| 7 | 7 | |
| 8 | 8 | // Express and other dependencies |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | import * as path from 'node:path'; |
| 2 | 2 | import * as fs from 'node:fs'; |
| 3 | 3 | import * as http2 from 'node:http2'; |
| 4 | 4 | import { Readable } from 'node:stream'; |
| 5 | 5 | import { createRequire } from 'node:module'; |
| 6 | 6 | import { Buffer } from 'node:buffer'; |