@payfit/audit-log 1.0.0-alpha6 → 1.0.0-alpha7
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/transport/implementation.js +3 -2
- package/dist/transport/implementation.js.map +1 -1
- package/dist/transport/interface.d.ts +1 -0
- package/package.json +1 -1
- package/playground/index.ts +4 -1
- package/src/index.ts +1 -1
- package/src/transport/implementation.ts +5 -3
- package/src/transport/interface.ts +1 -0
|
@@ -29,8 +29,9 @@ class Transport {
|
|
|
29
29
|
}
|
|
30
30
|
create(auditLogData) {
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const {
|
|
33
|
-
const dataToSend = Object.assign({},
|
|
32
|
+
const { account } = auditLogData, logDataWithoutAccount = __rest(auditLogData, ["account"]);
|
|
33
|
+
const dataToSend = Object.assign({}, logDataWithoutAccount, account);
|
|
34
|
+
console.log(dataToSend);
|
|
34
35
|
yield this.api.v1LogPost(dataToSend);
|
|
35
36
|
});
|
|
36
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../src/transport/implementation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AAGxC,MAAa,SAAS;IAGpB,YAAsB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAClC,IAAI,CAAC,GAAG,GAAG,IAAI,sBAAU,CAAC;YACxB,QAAQ,EAAE,IAAI,CAAC,MAAM;SACtB,CAAC,CAAA;IACJ,CAAC;IAEK,MAAM,CAAC,YAAmC;;YAC9C,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../src/transport/implementation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AAGxC,MAAa,SAAS;IAGpB,YAAsB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAClC,IAAI,CAAC,GAAG,GAAG,IAAI,sBAAU,CAAC;YACxB,QAAQ,EAAE,IAAI,CAAC,MAAM;SACtB,CAAC,CAAA;IACJ,CAAC;IAEK,MAAM,CAAC,YAAmC;;YAC9C,MAAM,EAAE,OAAO,KAA+B,YAAY,EAAzC,yDAAyC,CAAA;YAE1D,MAAM,UAAU,qBACX,qBAAqB,EACrB,OAAO,CACX,CAAA;YAED,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;YAEvB,MAAM,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QACtC,CAAC;KAAA;CACF;AArBD,8BAqBC"}
|
package/package.json
CHANGED
package/playground/index.ts
CHANGED
|
@@ -7,13 +7,16 @@ const logger = new AuditLogger({
|
|
|
7
7
|
|
|
8
8
|
async function main() {
|
|
9
9
|
await logger.log({
|
|
10
|
-
countryCode: 'fr',
|
|
11
10
|
event: 'signin',
|
|
12
11
|
namespace: 'auth',
|
|
13
12
|
service: 'auth',
|
|
14
13
|
payload: {
|
|
15
14
|
isTest: true,
|
|
16
15
|
},
|
|
16
|
+
account: {
|
|
17
|
+
isSystem: true,
|
|
18
|
+
},
|
|
19
|
+
scope: null,
|
|
17
20
|
})
|
|
18
21
|
}
|
|
19
22
|
|
package/src/index.ts
CHANGED
|
@@ -77,7 +77,7 @@ export type IAuditLogAuthData =
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
* Data used to "scope" the audit log.
|
|
80
|
+
* Data used to "scope" the audit log.
|
|
81
81
|
* Might be useful to retrieve all actions performed in a holding, a company, or on an employee.
|
|
82
82
|
*/
|
|
83
83
|
export type IAuditLogScope =
|
|
@@ -11,13 +11,15 @@ export class Transport implements IAuditLogTransport {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
async create(auditLogData: IAuditLogCreationData) {
|
|
14
|
-
const {
|
|
14
|
+
const { account, ...logDataWithoutAccount } = auditLogData
|
|
15
15
|
|
|
16
16
|
const dataToSend = {
|
|
17
|
-
...
|
|
18
|
-
|
|
17
|
+
...logDataWithoutAccount,
|
|
18
|
+
...account,
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
console.log(dataToSend)
|
|
22
|
+
|
|
21
23
|
await this.api.v1LogPost(dataToSend)
|
|
22
24
|
}
|
|
23
25
|
}
|