@memberjunction/server 0.9.251 → 0.9.253
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/build.log.json +6 -0
- package/dist/generated/generated.d.ts +2 -0
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +30 -11
- package/dist/generated/generated.js.map +1 -1
- package/dist/generic/ResolverBase.d.ts.map +1 -1
- package/dist/generic/ResolverBase.js +4 -1
- package/dist/generic/ResolverBase.js.map +1 -1
- package/package.json +9 -9
- package/src/generated/generated.ts +18700 -18689
- package/src/generic/ResolverBase.ts +22 -8
|
@@ -271,19 +271,33 @@ export class ResolverBase {
|
|
|
271
271
|
if (!userInfo) throw new Error(`User ${userPayload?.email} not found in metadata`);
|
|
272
272
|
if (!auditLogType) throw new Error(`Audit Log Type ${auditLogTypeName} not found in metadata`);
|
|
273
273
|
|
|
274
|
-
const auditLog =
|
|
274
|
+
const auditLog = await md.GetEntityObject<AuditLogEntity>('Audit Logs', userInfo); // must pass user context on back end as we're not authenticated the same way as the front end
|
|
275
275
|
auditLog.NewRecord();
|
|
276
276
|
auditLog.UserID = userInfo.ID;
|
|
277
277
|
auditLog.AuditLogTypeName = auditLogType.Name;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
278
|
+
|
|
279
|
+
if (authorization)
|
|
280
|
+
auditLog.AuthorizationName = authorization.Name;
|
|
281
|
+
|
|
282
|
+
if (status?.trim().toLowerCase() === 'success')
|
|
283
|
+
auditLog.Status = "Success"
|
|
284
|
+
else
|
|
285
|
+
auditLog.Status = "Failed";
|
|
286
|
+
|
|
287
|
+
if (details)
|
|
288
|
+
auditLog.Details = details;
|
|
289
|
+
|
|
281
290
|
auditLog.EntityID = entityId;
|
|
282
|
-
if (recordId) auditLog.RecordID = recordId;
|
|
283
291
|
|
|
284
|
-
if (
|
|
285
|
-
|
|
286
|
-
|
|
292
|
+
if (recordId)
|
|
293
|
+
auditLog.RecordID = recordId;
|
|
294
|
+
|
|
295
|
+
if (await auditLog.Save())
|
|
296
|
+
return auditLog;
|
|
297
|
+
else
|
|
298
|
+
throw new Error(`Error saving audit log record`);
|
|
299
|
+
}
|
|
300
|
+
catch (err) {
|
|
287
301
|
console.log(err);
|
|
288
302
|
return null;
|
|
289
303
|
}
|