@unchainedshop/core-files 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,13 +3,13 @@ import { generateDbFilterById, generateDbObjectId, mongodb } from '@unchainedsho
|
|
|
3
3
|
import { MediaObjectsCollection } from "../db/MediaObjectsCollection.js";
|
|
4
4
|
import { filesSettings } from "../files-settings.js";
|
|
5
5
|
const FILE_EVENTS = ['FILE_CREATE', 'FILE_UPDATE', 'FILE_REMOVE'];
|
|
6
|
-
const { ROOT_URL = 'http://localhost:4010' } = process.env;
|
|
7
6
|
export const configureFilesModule = async ({ db, options: filesOptions = {}, }) => {
|
|
8
7
|
registerEvents(FILE_EVENTS);
|
|
9
8
|
await filesSettings.configureSettings(filesOptions);
|
|
10
9
|
const Files = await MediaObjectsCollection(db);
|
|
11
10
|
return {
|
|
12
11
|
normalizeUrl: (url, params) => {
|
|
12
|
+
const { ROOT_URL = 'http://localhost:4010' } = process.env;
|
|
13
13
|
const transformedURLString = filesSettings.transformUrl(url, params);
|
|
14
14
|
if (URL.canParse(transformedURLString)) {
|
|
15
15
|
const finalURL = new URL(transformedURLString);
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-files",
|
|
3
|
-
"
|
|
3
|
+
"description": "File management module for the Unchained Engine",
|
|
4
|
+
"version": "4.6.0",
|
|
4
5
|
"main": "lib/files-index.js",
|
|
5
6
|
"types": "lib/files-index.d.ts",
|
|
6
7
|
"type": "module",
|
|
@@ -34,10 +35,10 @@
|
|
|
34
35
|
},
|
|
35
36
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@unchainedshop/events": "^4.
|
|
38
|
-
"@unchainedshop/file-upload": "^4.
|
|
39
|
-
"@unchainedshop/logger": "^4.
|
|
40
|
-
"@unchainedshop/utils": "^4.
|
|
38
|
+
"@unchainedshop/events": "^4.6.0",
|
|
39
|
+
"@unchainedshop/file-upload": "^4.6.0",
|
|
40
|
+
"@unchainedshop/logger": "^4.6.0",
|
|
41
|
+
"@unchainedshop/utils": "^4.6.0"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@types/node": "^25.0.0",
|