@dracul/audit-backend 1.23.5 → 1.23.10
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,6 +3,7 @@
|
|
|
3
3
|
const {
|
|
4
4
|
findAudit,
|
|
5
5
|
fetchAudit,
|
|
6
|
+
createAudit,
|
|
6
7
|
paginateAudit
|
|
7
8
|
} = require("../../services/AuditService.js");
|
|
8
9
|
|
|
@@ -50,6 +51,23 @@ const resolvers = {
|
|
|
50
51
|
if (!rbac.isAllowed(user.id, AUDIT_SHOW)) throw new ForbiddenError("Not Authorized");
|
|
51
52
|
return paginateAudit(pageNumber, itemsPerPage, search, filters, orderBy, orderDesc);
|
|
52
53
|
}
|
|
54
|
+
},
|
|
55
|
+
Mutation: {
|
|
56
|
+
createAudit: (_, {
|
|
57
|
+
action,
|
|
58
|
+
resource,
|
|
59
|
+
description
|
|
60
|
+
}, {
|
|
61
|
+
user
|
|
62
|
+
}) => {
|
|
63
|
+
if (!user) throw new AuthenticationError("Unauthenticated");
|
|
64
|
+
return createAudit(user, {
|
|
65
|
+
user: user.id,
|
|
66
|
+
action,
|
|
67
|
+
resource,
|
|
68
|
+
description
|
|
69
|
+
});
|
|
70
|
+
}
|
|
53
71
|
}
|
|
54
72
|
};
|
|
55
73
|
module.exports = resolvers;
|
|
@@ -17,4 +17,8 @@ type Query {
|
|
|
17
17
|
findAudit(id:ID!): Audit
|
|
18
18
|
fetchAudit: [Audit]
|
|
19
19
|
paginateAudit( pageNumber: Int, itemsPerPage: Int, search: String, filters: [FilterInput],orderBy: String, orderDesc: Boolean): AuditPaginated
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type Mutation {
|
|
23
|
+
createAudit(action: String!, resource: String!, description: String): Audit
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dracul/audit-backend",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.10",
|
|
4
4
|
"description": "Audit Backend",
|
|
5
5
|
"author": "Cristian Incarnato <cristian.cdi@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/draculjs/modular-framework#readme",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"mongoose-softdelete": "1.1.0",
|
|
65
65
|
"mongoose-unique-validator": "^2.0.3"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "c89409740944808db415bf91d7417ef16a88b921"
|
|
68
68
|
}
|