@aeriajs/builtins 0.0.153 → 0.0.154
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.
|
@@ -10,7 +10,7 @@ const insert = async (payload, context) => {
|
|
|
10
10
|
}
|
|
11
11
|
const what = Object.assign({}, payload.what);
|
|
12
12
|
what.owner = context.token.sub;
|
|
13
|
-
const extension = what.name.split('.').
|
|
13
|
+
const extension = what.name.split('.').at(-1);
|
|
14
14
|
if (!context.config.storage) {
|
|
15
15
|
throw new Error('config.storage is not set');
|
|
16
16
|
}
|
|
@@ -35,7 +35,7 @@ const insert = async (payload, context) => {
|
|
|
35
35
|
.update(what.name + Date.now())
|
|
36
36
|
.digest('hex');
|
|
37
37
|
what.absolute_path = `${tempPath}/${filenameHash}.${extension}`;
|
|
38
|
-
await (0, promises_1.writeFile)(what.absolute_path, Buffer.from(what.content.split(',').
|
|
38
|
+
await (0, promises_1.writeFile)(what.absolute_path, Buffer.from(what.content.split(',').at(-1), 'base64'));
|
|
39
39
|
return (0, core_1.insert)({
|
|
40
40
|
...payload,
|
|
41
41
|
what,
|
|
@@ -8,7 +8,7 @@ export const insert = async (payload, context) => {
|
|
|
8
8
|
}
|
|
9
9
|
const what = Object.assign({}, payload.what);
|
|
10
10
|
what.owner = context.token.sub;
|
|
11
|
-
const extension = what.name.split(".").
|
|
11
|
+
const extension = what.name.split(".").at(-1);
|
|
12
12
|
if (!context.config.storage) {
|
|
13
13
|
throw new Error("config.storage is not set");
|
|
14
14
|
}
|
|
@@ -34,7 +34,7 @@ export const insert = async (payload, context) => {
|
|
|
34
34
|
}
|
|
35
35
|
const filenameHash = createHash("sha1").update(what.name + Date.now()).digest("hex");
|
|
36
36
|
what.absolute_path = `${tempPath}/${filenameHash}.${extension}`;
|
|
37
|
-
await writeFile(what.absolute_path, Buffer.from(what.content.split(",").
|
|
37
|
+
await writeFile(what.absolute_path, Buffer.from(what.content.split(",").at(-1), "base64"));
|
|
38
38
|
return originalInsert({
|
|
39
39
|
...payload,
|
|
40
40
|
what
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/builtins",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.154",
|
|
4
4
|
"description": "## Installation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"mongodb": "^6.5.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@aeriajs/core": "^0.0.
|
|
49
|
-
"@aeriajs/common": "^0.0.
|
|
50
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
51
|
-
"@aeriajs/types": "^0.0.
|
|
52
|
-
"@aeriajs/validation": "^0.0.
|
|
48
|
+
"@aeriajs/core": "^0.0.154",
|
|
49
|
+
"@aeriajs/common": "^0.0.93",
|
|
50
|
+
"@aeriajs/entrypoint": "^0.0.95",
|
|
51
|
+
"@aeriajs/types": "^0.0.80",
|
|
52
|
+
"@aeriajs/validation": "^0.0.96"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"test": "echo skipping",
|