@things-factory/attachment-base 6.4.0 → 6.4.2
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/attachment-base",
|
3
|
-
"version": "6.4.
|
3
|
+
"version": "6.4.2",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -29,12 +29,12 @@
|
|
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": "^6.4.
|
32
|
+
"@things-factory/auth-base": "^6.4.2",
|
33
33
|
"@things-factory/env": "^6.3.0",
|
34
|
-
"@things-factory/shell": "^6.4.
|
34
|
+
"@things-factory/shell": "^6.4.2",
|
35
35
|
"memfs": "^3.0.1",
|
36
36
|
"mime": "^3.0.0",
|
37
37
|
"multer": "^1.4.5-lts.1"
|
38
38
|
},
|
39
|
-
"gitHead": "
|
39
|
+
"gitHead": "786d16d546045fba8e1c3542ec31d4eddbf4e7a1"
|
40
40
|
}
|
@@ -17,6 +17,7 @@ const allowedMimeTypes = config.get('fileUpload/mimeTypes', [])
|
|
17
17
|
@Resolver(Attachment)
|
18
18
|
export class AttachmentMutation {
|
19
19
|
@Directive('@transaction')
|
20
|
+
@Directive('@privilege(category: "attachment", privilege: "mutation", domainOwnerGranted: true)')
|
20
21
|
@Mutation(returns => Attachment)
|
21
22
|
async createAttachment(
|
22
23
|
@Arg('attachment', type => NewAttachment) attachment: NewAttachment,
|
@@ -26,6 +27,7 @@ export class AttachmentMutation {
|
|
26
27
|
}
|
27
28
|
|
28
29
|
@Directive('@transaction')
|
30
|
+
@Directive('@privilege(category: "attachment", privilege: "mutation", domainOwnerGranted: true)')
|
29
31
|
@Mutation(returns => [Attachment])
|
30
32
|
async createAttachments(
|
31
33
|
@Arg('attachments', type => [NewAttachment]) attachments: NewAttachment[],
|
@@ -35,6 +37,7 @@ export class AttachmentMutation {
|
|
35
37
|
}
|
36
38
|
|
37
39
|
@Directive('@transaction')
|
40
|
+
@Directive('@privilege(category: "attachment", privilege: "mutation", domainOwnerGranted: true)')
|
38
41
|
@Mutation(returns => Attachment)
|
39
42
|
async updateAttachment(
|
40
43
|
@Arg('id') id: string,
|
@@ -56,12 +59,14 @@ export class AttachmentMutation {
|
|
56
59
|
}
|
57
60
|
|
58
61
|
@Directive('@transaction')
|
62
|
+
@Directive('@privilege(category: "attachment", privilege: "mutation", domainOwnerGranted: true)')
|
59
63
|
@Mutation(returns => Boolean)
|
60
64
|
async deleteAttachment(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {
|
61
65
|
return await deleteAttachment(null, { id }, context)
|
62
66
|
}
|
63
67
|
|
64
68
|
@Directive('@transaction')
|
69
|
+
@Directive('@privilege(category: "attachment", privilege: "mutation", domainOwnerGranted: true)')
|
65
70
|
@Mutation(returns => Boolean)
|
66
71
|
async deleteAttachmentsByRef(
|
67
72
|
@Arg('refBys', type => [String]) refBys: string[],
|
@@ -71,6 +76,7 @@ export class AttachmentMutation {
|
|
71
76
|
}
|
72
77
|
|
73
78
|
@Directive('@transaction')
|
79
|
+
@Directive('@privilege(category: "attachment", privilege: "mutation", domainOwnerGranted: true)')
|
74
80
|
@Mutation(returns => Attachment)
|
75
81
|
async singleUpload(
|
76
82
|
@Arg('file', type => GraphQLUpload) file: FileUpload,
|
@@ -80,6 +86,7 @@ export class AttachmentMutation {
|
|
80
86
|
}
|
81
87
|
|
82
88
|
@Directive('@transaction')
|
89
|
+
@Directive('@privilege(category: "attachment", privilege: "mutation", domainOwnerGranted: true)')
|
83
90
|
@Mutation(returns => [Attachment])
|
84
91
|
async multipleUpload(
|
85
92
|
@Arg('files', type => [GraphQLUpload]) files: FileUpload[],
|
@@ -88,6 +95,7 @@ export class AttachmentMutation {
|
|
88
95
|
return await multipleUpload(null, { files }, context)
|
89
96
|
}
|
90
97
|
|
98
|
+
@Directive('@privilege(category: "attachment", privilege: "mutation", domainOwnerGranted: true)')
|
91
99
|
@Mutation(returns => UploadURL)
|
92
100
|
async generateUploadURL(
|
93
101
|
@Arg('type', type => String) type: string,
|
@@ -97,6 +105,7 @@ export class AttachmentMutation {
|
|
97
105
|
}
|
98
106
|
|
99
107
|
@Directive('@transaction')
|
108
|
+
@Directive('@privilege(category: "attachment", privilege: "mutation", domainOwnerGranted: true)')
|
100
109
|
@Mutation(returns => [Attachment], { description: 'To import some Attachments' })
|
101
110
|
async importAttachments(
|
102
111
|
@Arg('file', () => GraphQLUpload) file: FileUpload,
|