mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
feat: add more api logs (#1870)
Adds more detailed API logging using Pino
This commit is contained in:
@ -62,6 +62,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { recipientId } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
recipientId,
|
||||
},
|
||||
});
|
||||
|
||||
return await getRecipientById({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -88,6 +94,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { documentId, recipient } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
documentId,
|
||||
},
|
||||
});
|
||||
|
||||
const createdRecipients = await createDocumentRecipients({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -118,6 +130,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { documentId, recipients } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
documentId,
|
||||
},
|
||||
});
|
||||
|
||||
return await createDocumentRecipients({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -146,6 +164,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { documentId, recipient } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
documentId,
|
||||
},
|
||||
});
|
||||
|
||||
const updatedRecipients = await updateDocumentRecipients({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -176,6 +200,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { documentId, recipients } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
documentId,
|
||||
},
|
||||
});
|
||||
|
||||
return await updateDocumentRecipients({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -203,6 +233,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { recipientId } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
recipientId,
|
||||
},
|
||||
});
|
||||
|
||||
await deleteDocumentRecipient({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -223,6 +259,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { documentId, recipients } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
documentId,
|
||||
},
|
||||
});
|
||||
|
||||
return await setDocumentRecipients({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -259,6 +301,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { recipientId } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
recipientId,
|
||||
},
|
||||
});
|
||||
|
||||
return await getRecipientById({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -285,6 +333,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { templateId, recipient } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
templateId,
|
||||
},
|
||||
});
|
||||
|
||||
const createdRecipients = await createTemplateRecipients({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -314,6 +368,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { templateId, recipients } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
templateId,
|
||||
},
|
||||
});
|
||||
|
||||
return await createTemplateRecipients({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -341,6 +401,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { templateId, recipient } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
templateId,
|
||||
},
|
||||
});
|
||||
|
||||
const updatedRecipients = await updateTemplateRecipients({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -370,6 +436,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { templateId, recipients } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
templateId,
|
||||
},
|
||||
});
|
||||
|
||||
return await updateTemplateRecipients({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -396,6 +468,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { recipientId } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
recipientId,
|
||||
},
|
||||
});
|
||||
|
||||
await deleteTemplateRecipient({
|
||||
recipientId,
|
||||
userId: ctx.user.id,
|
||||
@ -415,6 +493,12 @@ export const recipientRouter = router({
|
||||
const { teamId } = ctx;
|
||||
const { templateId, recipients } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
templateId,
|
||||
},
|
||||
});
|
||||
|
||||
return await setTemplateRecipients({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
@ -438,6 +522,12 @@ export const recipientRouter = router({
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
const { token, documentId, authOptions, nextSigner } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
documentId,
|
||||
},
|
||||
});
|
||||
|
||||
return await completeDocumentWithToken({
|
||||
token,
|
||||
documentId,
|
||||
@ -456,6 +546,12 @@ export const recipientRouter = router({
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
const { token, documentId, reason } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
documentId,
|
||||
},
|
||||
});
|
||||
|
||||
return await rejectDocumentWithToken({
|
||||
token,
|
||||
documentId,
|
||||
|
||||
Reference in New Issue
Block a user