@things-factory/attachment-base 7.0.1-beta.9 → 7.0.1-rc.1
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/attachment-const.d.ts +3 -0
- package/dist-server/awb-storage-s3.d.ts +1 -0
- package/dist-server/awb-storage-s3.js.map +1 -1
- package/dist-server/index.d.ts +7 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/routes.d.ts +4 -0
- package/dist-server/service/attachment/attachment-mutation.d.ts +46 -0
- package/dist-server/service/attachment/attachment-mutation.js +11 -11
- package/dist-server/service/attachment/attachment-mutation.js.map +1 -1
- package/dist-server/service/attachment/attachment-query.d.ts +11 -0
- package/dist-server/service/attachment/attachment-query.js +3 -3
- package/dist-server/service/attachment/attachment-query.js.map +1 -1
- package/dist-server/service/attachment/attachment-types.d.ts +27 -0
- package/dist-server/service/attachment/attachment-types.js +8 -8
- package/dist-server/service/attachment/attachment-types.js.map +1 -1
- package/dist-server/service/attachment/attachment.d.ts +24 -0
- package/dist-server/service/attachment/attachment.js +2 -2
- package/dist-server/service/attachment/attachment.js.map +1 -1
- package/dist-server/service/attachment/index.d.ts +5 -0
- package/dist-server/service/index.d.ts +6 -0
- package/dist-server/storage-azure-blob.d.ts +1 -0
- package/dist-server/storage-azure-blob.js.map +1 -1
- package/dist-server/storage-database.d.ts +1 -0
- package/dist-server/storage-database.js +4 -9
- package/dist-server/storage-database.js.map +1 -1
- package/dist-server/storage-file.d.ts +1 -0
- package/dist-server/storage-file.js.map +1 -1
- package/dist-server/storage-s3.d.ts +1 -0
- package/dist-server/storage-s3.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/util/index.d.ts +1 -0
- package/dist-server/util/upload-awb.d.ts +2 -0
- package/dist-server/util/upload-awb.js +1 -2
- package/dist-server/util/upload-awb.js.map +1 -1
- package/package.json +5 -5
- package/server/service/attachment/attachment-query.ts +4 -1
- package/server/service/attachment/attachment.ts +21 -21
@@ -0,0 +1 @@
|
|
1
|
+
export * from './upload-awb';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.uploadAwb =
|
3
|
+
exports.uploadAwb = uploadAwb;
|
4
4
|
require("../awb-storage-s3");
|
5
5
|
const attachment_const_1 = require("../attachment-const");
|
6
6
|
async function uploadAwb(param) {
|
@@ -8,5 +8,4 @@ async function uploadAwb(param) {
|
|
8
8
|
let result = await attachment_const_1.AWBSTORAGE.uploadFile({ stream: content, filename: title });
|
9
9
|
return result;
|
10
10
|
}
|
11
|
-
exports.uploadAwb = uploadAwb;
|
12
11
|
//# sourceMappingURL=upload-awb.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"upload-awb.js","sourceRoot":"","sources":["../../server/util/upload-awb.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"upload-awb.js","sourceRoot":"","sources":["../../server/util/upload-awb.ts"],"names":[],"mappings":";;AAIA,8BAMC;AAVD,6BAA0B;AAE1B,0DAAgD;AAEzC,KAAK,UAAU,SAAS,CAAC,KAAU;IACxC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IAEhC,IAAI,MAAM,GAAG,MAAM,6BAAU,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAA;IAE9E,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import '../awb-storage-s3'\n\nimport { AWBSTORAGE } from '../attachment-const'\n\nexport async function uploadAwb(param: any) {\n const { content, title } = param\n\n let result = await AWBSTORAGE.uploadFile({ stream: content, filename: title })\n\n return result\n}\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/attachment-base",
|
3
|
-
"version": "7.0.1-
|
3
|
+
"version": "7.0.1-rc.1",
|
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": "^7.0.1-
|
33
|
-
"@things-factory/env": "^7.0.1-
|
34
|
-
"@things-factory/shell": "^7.0.1-
|
32
|
+
"@things-factory/auth-base": "^7.0.1-rc.1",
|
33
|
+
"@things-factory/env": "^7.0.1-rc.0",
|
34
|
+
"@things-factory/shell": "^7.0.1-rc.1",
|
35
35
|
"mime": "^3.0.0",
|
36
36
|
"multer": "^1.4.5-lts.1"
|
37
37
|
},
|
38
|
-
"gitHead": "
|
38
|
+
"gitHead": "fa52d291483c4aa913a9c6a9a4463a73058b1b0d"
|
39
39
|
}
|
@@ -11,7 +11,10 @@ import { Attachment } from './attachment'
|
|
11
11
|
export class AttachmentQuery {
|
12
12
|
@Directive('@privilege(category: "attachment", privilege: "query", domainOwnerGranted: true)')
|
13
13
|
@Query(returns => AttachmentList)
|
14
|
-
async attachments(
|
14
|
+
async attachments(
|
15
|
+
@Ctx() context: ResolverContext,
|
16
|
+
@Args(type => ListParam) params: ListParam
|
17
|
+
): Promise<AttachmentList> {
|
15
18
|
const { domain } = context.state
|
16
19
|
|
17
20
|
const queryBuilder = getQueryBuilderFromListParams({
|
@@ -34,50 +34,50 @@ const DATABASE_TYPE = ORMCONFIG.type
|
|
34
34
|
export class Attachment {
|
35
35
|
@PrimaryGeneratedColumn('uuid')
|
36
36
|
@Field(type => ID)
|
37
|
-
readonly id
|
37
|
+
readonly id?: string
|
38
38
|
|
39
39
|
@ManyToOne(type => Domain, { nullable: false })
|
40
40
|
@Field(type => Domain)
|
41
|
-
domain
|
41
|
+
domain?: Domain
|
42
42
|
|
43
43
|
@RelationId((attachment: Attachment) => attachment.domain)
|
44
|
-
domainId
|
44
|
+
domainId?: string
|
45
45
|
|
46
46
|
@Column()
|
47
47
|
@Field()
|
48
|
-
name
|
48
|
+
name?: string
|
49
49
|
|
50
50
|
@Column({ nullable: true })
|
51
51
|
@Field({ nullable: true })
|
52
|
-
description
|
52
|
+
description?: string
|
53
53
|
|
54
54
|
@Column()
|
55
55
|
@Field()
|
56
|
-
mimetype
|
56
|
+
mimetype?: string
|
57
57
|
|
58
58
|
@Column()
|
59
59
|
@Field()
|
60
|
-
encoding
|
60
|
+
encoding?: string
|
61
61
|
|
62
62
|
@Column({ nullable: true })
|
63
63
|
@Field({ nullable: true })
|
64
|
-
category
|
64
|
+
category?: string
|
65
65
|
|
66
66
|
@Column({ nullable: true, default: '' })
|
67
67
|
@Field({ nullable: true })
|
68
|
-
refType
|
68
|
+
refType?: string = ''
|
69
69
|
|
70
70
|
@Column({ nullable: true })
|
71
71
|
@Field({ nullable: true })
|
72
|
-
refBy
|
72
|
+
refBy?: string
|
73
73
|
|
74
74
|
@Column()
|
75
75
|
@Field()
|
76
|
-
path
|
76
|
+
path?: string
|
77
77
|
|
78
78
|
@Column()
|
79
79
|
@Field()
|
80
|
-
size
|
80
|
+
size?: string
|
81
81
|
|
82
82
|
@Column({
|
83
83
|
nullable: true,
|
@@ -85,32 +85,32 @@ export class Attachment {
|
|
85
85
|
DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
86
86
|
? 'longblob'
|
87
87
|
: DATABASE_TYPE == 'postgres'
|
88
|
-
|
89
|
-
|
88
|
+
? 'bytea'
|
89
|
+
: 'blob'
|
90
90
|
})
|
91
|
-
contents
|
91
|
+
contents?: Buffer
|
92
92
|
|
93
93
|
@CreateDateColumn()
|
94
94
|
@Field()
|
95
|
-
createdAt
|
95
|
+
createdAt?: Date
|
96
96
|
|
97
97
|
@UpdateDateColumn()
|
98
98
|
@Field()
|
99
|
-
updatedAt
|
99
|
+
updatedAt?: Date
|
100
100
|
|
101
101
|
@ManyToOne(type => User)
|
102
102
|
@Field(type => User, { nullable: true })
|
103
|
-
creator
|
103
|
+
creator?: User
|
104
104
|
|
105
105
|
@RelationId((attachment: Attachment) => attachment.creator)
|
106
|
-
creatorId
|
106
|
+
creatorId?: string
|
107
107
|
|
108
108
|
@ManyToOne(type => User)
|
109
109
|
@Field(type => User, { nullable: true })
|
110
|
-
updater
|
110
|
+
updater?: User
|
111
111
|
|
112
112
|
@RelationId((attachment: Attachment) => attachment.updater)
|
113
|
-
updaterId
|
113
|
+
updaterId?: string
|
114
114
|
|
115
115
|
@Field()
|
116
116
|
get fullpath(): string {
|