@things-factory/attachment-base 8.0.0-alpha.23 → 8.0.0-alpha.25
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.
- package/dist-server/service/attachment/attachment-query.js +2 -15
- package/dist-server/service/attachment/attachment-query.js.map +1 -1
- package/dist-server/service/attachment/attachment.js +4 -1
- package/dist-server/service/attachment/attachment.js.map +1 -1
- package/dist-server/service/attachment/index.d.ts +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/storage-database.js +3 -1
- package/dist-server/storage-database.js.map +1 -1
- package/dist-server/storage-file.js +3 -1
- package/dist-server/storage-file.js.map +1 -1
- package/dist-server/storage-s3.js +3 -1
- package/dist-server/storage-s3.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/server/service/attachment/attachment-query.ts +2 -15
- package/server/service/attachment/attachment.ts +4 -1
- package/server/storage-database.ts +3 -1
- package/server/storage-file.ts +3 -1
- package/server/storage-s3.ts +3 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/attachment-base",
|
3
|
-
"version": "8.0.0-alpha.
|
3
|
+
"version": "8.0.0-alpha.25",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -29,11 +29,11 @@
|
|
29
29
|
"@aws-sdk/s3-presigned-post": "^3.46.0",
|
30
30
|
"@azure/storage-blob": "^12.18.0",
|
31
31
|
"@koa/multer": "^3.0.0",
|
32
|
-
"@things-factory/auth-base": "^8.0.0-alpha.
|
32
|
+
"@things-factory/auth-base": "^8.0.0-alpha.24",
|
33
33
|
"@things-factory/env": "^8.0.0-alpha.8",
|
34
34
|
"@things-factory/shell": "^8.0.0-alpha.22",
|
35
35
|
"mime": "^3.0.0",
|
36
36
|
"multer": "^1.4.5-lts.1"
|
37
37
|
},
|
38
|
-
"gitHead": "
|
38
|
+
"gitHead": "126c290973df223812311e21599224f527449b34"
|
39
39
|
}
|
@@ -22,21 +22,8 @@ export class AttachmentQuery {
|
|
22
22
|
params,
|
23
23
|
domain,
|
24
24
|
alias: 'attachment',
|
25
|
-
searchables: ['name', 'description', 'tags']
|
26
|
-
})
|
27
|
-
'attachment.domain',
|
28
|
-
'attachment.id',
|
29
|
-
'attachment.name',
|
30
|
-
'attachment.path',
|
31
|
-
'attachment.size',
|
32
|
-
'attachment.mimetype',
|
33
|
-
'attachment.encoding',
|
34
|
-
'attachment.category',
|
35
|
-
'attachment.updatedAt',
|
36
|
-
'attachment.updater',
|
37
|
-
'attachment.createdAt',
|
38
|
-
'attachment.creator'
|
39
|
-
])
|
25
|
+
searchables: ['id', 'name', 'description', 'tags']
|
26
|
+
})
|
40
27
|
|
41
28
|
const [items, total] = await queryBuilder.getManyAndCount()
|
42
29
|
|
@@ -11,7 +11,9 @@ const crypto = require('crypto')
|
|
11
11
|
if (STORAGE && STORAGE.type == 'database') {
|
12
12
|
STORAGE.uploadFile = async ({ id, file, context }) => {
|
13
13
|
var { createReadStream, filename, mimetype, encoding } = await file
|
14
|
-
filename = Buffer.from(filename, 'latin1')
|
14
|
+
filename = Buffer.from(filename, 'latin1')
|
15
|
+
.toString('utf-8')
|
16
|
+
.normalize('NFC') /* Because busboy uses latin1 encoding */
|
15
17
|
|
16
18
|
const stream = createReadStream()
|
17
19
|
|
package/server/storage-file.ts
CHANGED
@@ -14,7 +14,9 @@ if (STORAGE && STORAGE.type == 'file') {
|
|
14
14
|
|
15
15
|
STORAGE.uploadFile = async ({ id, file }) => {
|
16
16
|
var { createReadStream, filename, mimetype, encoding } = await file
|
17
|
-
filename = Buffer.from(filename, 'latin1')
|
17
|
+
filename = Buffer.from(filename, 'latin1')
|
18
|
+
.toString('utf-8')
|
19
|
+
.normalize('NFC') /* Because busboy uses latin1 encoding */
|
18
20
|
|
19
21
|
const stream = createReadStream()
|
20
22
|
|
package/server/storage-s3.ts
CHANGED
@@ -36,7 +36,9 @@ if (STORAGE && STORAGE.type == 's3') {
|
|
36
36
|
/* upload file */
|
37
37
|
STORAGE.uploadFile = async ({ id, file }) => {
|
38
38
|
var { createReadStream, filename, mimetype, encoding } = await file
|
39
|
-
filename = Buffer.from(filename, 'latin1')
|
39
|
+
filename = Buffer.from(filename, 'latin1')
|
40
|
+
.toString('utf-8')
|
41
|
+
.normalize('NFC') /* Because busboy uses latin1 encoding */
|
40
42
|
|
41
43
|
const stream = createReadStream()
|
42
44
|
id = id || crypto.randomUUID()
|