mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-15 19:30:04 -05:00
feat: pino logger for formbricks (#2296)
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
This commit is contained in:
committed by
GitHub
parent
b72cda05c1
commit
dadc337955
3
.gitignore
vendored
3
.gitignore
vendored
@@ -54,3 +54,6 @@ Zone.Identifier
|
||||
|
||||
# uploads
|
||||
packages/lib/uploads
|
||||
|
||||
# Pino Logs
|
||||
formbricks.log
|
||||
@@ -5,6 +5,7 @@ import { getServerSession } from "next-auth";
|
||||
import { canUserAccessAttributeClass } from "@formbricks/lib/attributeClass/auth";
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { getSegmentsByAttributeClassName } from "@formbricks/lib/segment/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { TAttributeClass } from "@formbricks/types/attributeClasses";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
|
||||
@@ -36,7 +37,7 @@ export const getSegmentsByAttributeClassAction = async (
|
||||
|
||||
return { activeSurveys, inactiveSurveys };
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
logger.error(`Error getting segments by attribute class: ${err}`);
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ import { deleteInvite, getInvite } from "@formbricks/lib/invite/service";
|
||||
import { verifyInviteToken } from "@formbricks/lib/jwt";
|
||||
import { createMembership } from "@formbricks/lib/membership/service";
|
||||
import { updateUser } from "@formbricks/lib/user/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
|
||||
import {
|
||||
ExpiredContent,
|
||||
@@ -49,7 +50,7 @@ export default async function InvitePage({ searchParams }) {
|
||||
return <RightAccountContent />;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
logger.error(e);
|
||||
return <InvitationNotFound />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
|
||||
import { getShortUrl } from "@formbricks/lib/shortUrl/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { ZShortUrlId } from "@formbricks/types/shortUrl";
|
||||
|
||||
export default async function ShortUrlPage({ params }) {
|
||||
@@ -18,7 +19,7 @@ export default async function ShortUrlPage({ params }) {
|
||||
try {
|
||||
shortUrl = await getShortUrl(params.shortUrlId);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
}
|
||||
|
||||
if (shortUrl) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
getMonthlyTeamResponseCount,
|
||||
getTeamsWithPaidPlan,
|
||||
} from "@formbricks/lib/team/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { TTeam } from "@formbricks/types/teams";
|
||||
|
||||
async function reportTeamUsage(team: TTeam) {
|
||||
@@ -65,7 +66,7 @@ export async function POST(): Promise<Response> {
|
||||
|
||||
return responses.successResponse({}, true);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse("Unable to handle the request: " + error.message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { getServerSession } from "next-auth";
|
||||
import { NextRequest } from "next/server";
|
||||
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
const session = await getServerSession(authOptions);
|
||||
@@ -29,7 +30,7 @@ export async function POST(request: NextRequest) {
|
||||
try {
|
||||
csv = await parser.parse(json).promise();
|
||||
} catch (err) {
|
||||
console.log({ err });
|
||||
logger.error(err);
|
||||
throw new Error("Failed to convert to CSV");
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import { getProductByEnvironmentId } from "@formbricks/lib/product/service";
|
||||
import { getResponseCountBySurveyId } from "@formbricks/lib/response/service";
|
||||
import { getSurvey, updateSurvey } from "@formbricks/lib/survey/service";
|
||||
import { convertDatesInObject } from "@formbricks/lib/time";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { checkForRecallInHeadline } from "@formbricks/lib/utils/recall";
|
||||
import { ZPipelineInput } from "@formbricks/types/pipelines";
|
||||
import { TUserNotificationSettings } from "@formbricks/types/user";
|
||||
@@ -28,7 +29,7 @@ export async function POST(request: Request) {
|
||||
const inputValidation = ZPipelineInput.safeParse(jsonInput);
|
||||
|
||||
if (!inputValidation.success) {
|
||||
console.error(inputValidation.error);
|
||||
logger.error(inputValidation.error);
|
||||
return responses.badRequestResponse(
|
||||
"Fields are missing or incorrectly formatted",
|
||||
transformErrorToDetails(inputValidation.error),
|
||||
@@ -125,7 +126,7 @@ export async function POST(request: Request) {
|
||||
|
||||
if (usersWithNotifications.length > 0) {
|
||||
if (!survey) {
|
||||
console.error(`Pipeline: Survey with id ${surveyId} not found`);
|
||||
logger.error(`Pipeline: Survey with id ${surveyId} not found`);
|
||||
return new Response("Survey not found", {
|
||||
status: 404,
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@ import { getProductByEnvironmentId } from "@formbricks/lib/product/service";
|
||||
import { surveyCache } from "@formbricks/lib/survey/cache";
|
||||
import { getSyncSurveys } from "@formbricks/lib/survey/service";
|
||||
import { getTeamByEnvironmentId } from "@formbricks/lib/team/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { TJsStateSync, ZJsPeopleAttributeInput } from "@formbricks/types/js";
|
||||
|
||||
interface Context {
|
||||
@@ -96,7 +97,7 @@ export async function POST(req: Request, context: Context): Promise<Response> {
|
||||
|
||||
return responses.successResponse({ ...state }, true);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(`Unable to complete request: ${error.message}`, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { responses } from "@/app/lib/api/response";
|
||||
import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
|
||||
import { updateDisplayLegacy } from "@formbricks/lib/display/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { ZDisplayLegacyUpdateInput } from "@formbricks/types/displays";
|
||||
|
||||
export async function OPTIONS(): Promise<Response> {
|
||||
@@ -30,7 +31,7 @@ export async function PUT(
|
||||
const display = await updateDisplayLegacy(displayId, inputValidation.data);
|
||||
return responses.successResponse(display, true);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
import { createDisplayLegacy } from "@formbricks/lib/display/service";
|
||||
import { capturePosthogEnvironmentEvent } from "@formbricks/lib/posthogServer";
|
||||
import { getSurvey } from "@formbricks/lib/survey/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { TDisplay, ZDisplayLegacyCreateInput } from "@formbricks/types/displays";
|
||||
import { InvalidInputError } from "@formbricks/types/errors";
|
||||
|
||||
@@ -38,7 +39,7 @@ export async function POST(request: Request): Promise<Response> {
|
||||
if (error instanceof InvalidInputError) {
|
||||
return responses.badRequestResponse(error.message);
|
||||
} else {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +56,7 @@ export async function POST(request: Request): Promise<Response> {
|
||||
if (error instanceof InvalidInputError) {
|
||||
return responses.badRequestResponse(error.message);
|
||||
} else {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { getProductByEnvironmentId } from "@formbricks/lib/product/service";
|
||||
import { surveyCache } from "@formbricks/lib/survey/cache";
|
||||
import { getSyncSurveys } from "@formbricks/lib/survey/service";
|
||||
import { getTeamByEnvironmentId } from "@formbricks/lib/team/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { TJsStateSync, ZJsPeopleAttributeInput } from "@formbricks/types/js";
|
||||
|
||||
interface Context {
|
||||
@@ -95,7 +96,7 @@ export async function POST(req: Request, context: Context): Promise<Response> {
|
||||
|
||||
return responses.successResponse({ ...state }, true);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(`Unable to complete request: ${error.message}`, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { sendToPipeline } from "@/app/lib/pipelines";
|
||||
|
||||
import { updateResponse } from "@formbricks/lib/response/service";
|
||||
import { getSurvey } from "@formbricks/lib/survey/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { DatabaseError, InvalidInputError, ResourceNotFoundError } from "@formbricks/types/errors";
|
||||
import { ZResponseUpdateInput } from "@formbricks/types/responses";
|
||||
|
||||
@@ -45,7 +46,7 @@ export async function PUT(
|
||||
return responses.badRequestResponse(error.message);
|
||||
}
|
||||
if (error instanceof DatabaseError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message);
|
||||
}
|
||||
}
|
||||
@@ -59,7 +60,7 @@ export async function PUT(
|
||||
return responses.badRequestResponse(error.message);
|
||||
}
|
||||
if (error instanceof DatabaseError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { UAParser } from "ua-parser-js";
|
||||
import { capturePosthogEnvironmentEvent } from "@formbricks/lib/posthogServer";
|
||||
import { createResponseLegacy } from "@formbricks/lib/response/service";
|
||||
import { getSurvey } from "@formbricks/lib/survey/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { InvalidInputError } from "@formbricks/types/errors";
|
||||
import { TResponse, ZResponseLegacyInput } from "@formbricks/types/responses";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
@@ -47,7 +48,7 @@ export async function POST(request: Request): Promise<Response> {
|
||||
if (error instanceof InvalidInputError) {
|
||||
return responses.badRequestResponse(error.message);
|
||||
} else {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message);
|
||||
}
|
||||
}
|
||||
@@ -79,7 +80,7 @@ export async function POST(request: Request): Promise<Response> {
|
||||
if (error instanceof InvalidInputError) {
|
||||
return responses.badRequestResponse(error.message);
|
||||
} else {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { createAttributeClass, getAttributeClassByName } from "@formbricks/lib/a
|
||||
import { personCache } from "@formbricks/lib/person/cache";
|
||||
import { getPerson, updatePersonAttribute } from "@formbricks/lib/person/service";
|
||||
import { surveyCache } from "@formbricks/lib/survey/cache";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { ZJsPeopleLegacyAttributeInput } from "@formbricks/types/js";
|
||||
import { TPersonClient } from "@formbricks/types/people";
|
||||
|
||||
@@ -77,7 +78,7 @@ export async function POST(req: Request, { params }): Promise<Response> {
|
||||
|
||||
return responses.successResponse({ ...state, person }, true);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(`Unable to complete request: ${error.message}`, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { responses } from "@/app/lib/api/response";
|
||||
import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
|
||||
import { createPerson, getPersonByUserId } from "@formbricks/lib/person/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { ZJsPeopleUserIdInput } from "@formbricks/types/js";
|
||||
|
||||
export async function OPTIONS(): Promise<Response> {
|
||||
@@ -39,7 +40,7 @@ export async function POST(req: Request): Promise<Response> {
|
||||
const state = await getUpdatedState(environmentId, person.id);
|
||||
return responses.successResponse({ ...state, person: personClient }, true);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse("Unable to handle the request: " + error.message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { getUpdatedState } from "@/app/api/v1/(legacy)/js/sync/lib/sync";
|
||||
import { responses } from "@/app/lib/api/response";
|
||||
import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { ZJsSyncLegacyInput } from "@formbricks/types/js";
|
||||
import { TPersonClient } from "@formbricks/types/people";
|
||||
|
||||
@@ -38,7 +39,7 @@ export async function POST(req: Request): Promise<Response> {
|
||||
|
||||
return responses.successResponse({ ...state, person }, true);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse("Unable to handle the request: " + error.message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { responses } from "@/app/lib/api/response";
|
||||
import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
|
||||
import { createAction } from "@formbricks/lib/action/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { ZActionInput } from "@formbricks/types/actions";
|
||||
|
||||
interface Context {
|
||||
@@ -36,7 +37,7 @@ export async function POST(req: Request, context: Context): Promise<Response> {
|
||||
|
||||
return responses.successResponse({}, true);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse("Unable to handle the request: " + error.message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { responses } from "@/app/lib/api/response";
|
||||
import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
|
||||
import { updateDisplay } from "@formbricks/lib/display/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { ZDisplayUpdateInput } from "@formbricks/types/displays";
|
||||
|
||||
interface Context {
|
||||
@@ -35,7 +36,7 @@ export async function PUT(request: Request, context: Context): Promise<Response>
|
||||
await updateDisplay(displayId, inputValidation.data);
|
||||
return responses.successResponse({}, true);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
|
||||
import { createDisplay } from "@formbricks/lib/display/service";
|
||||
import { capturePosthogEnvironmentEvent } from "@formbricks/lib/posthogServer";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { ZDisplayCreateInput } from "@formbricks/types/displays";
|
||||
import { InvalidInputError } from "@formbricks/types/errors";
|
||||
|
||||
@@ -41,7 +42,7 @@ export async function POST(request: Request, context: Context): Promise<Response
|
||||
if (error instanceof InvalidInputError) {
|
||||
return responses.badRequestResponse(error.message);
|
||||
} else {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
getMonthlyTeamResponseCount,
|
||||
getTeamByEnvironmentId,
|
||||
} from "@formbricks/lib/team/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { isVersionGreaterThanOrEqualTo } from "@formbricks/lib/utils/version";
|
||||
import { TLegacySurvey } from "@formbricks/types/LegacySurvey";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
@@ -197,7 +198,7 @@ export async function GET(
|
||||
"public, s-maxage=100, max-age=110, stale-while-revalidate=100, stale-if-error=100"
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse("Unable to handle the request: " + error.message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import { getProductByEnvironmentId } from "@formbricks/lib/product/service";
|
||||
import { COLOR_DEFAULTS } from "@formbricks/lib/styling/constants";
|
||||
import { createSurvey, getSurveys, transformToLegacySurvey } from "@formbricks/lib/survey/service";
|
||||
import { getMonthlyTeamResponseCount, getTeamByEnvironmentId } from "@formbricks/lib/team/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { isVersionGreaterThanOrEqualTo } from "@formbricks/lib/utils/version";
|
||||
import { TLegacySurvey } from "@formbricks/types/LegacySurvey";
|
||||
import { TJsStateSync, ZJsPublicSyncInput } from "@formbricks/types/js";
|
||||
@@ -141,7 +142,7 @@ export async function GET(
|
||||
"public, s-maxage=600, max-age=840, stale-while-revalidate=600, stale-if-error=600"
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(`Unable to complete response: ${error.message}`, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { responses } from "@/app/lib/api/response";
|
||||
import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
|
||||
import { createPerson, getPersonByUserId, updatePerson } from "@formbricks/lib/person/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { ZPersonUpdateInput } from "@formbricks/types/people";
|
||||
|
||||
interface Context {
|
||||
@@ -69,7 +70,7 @@ export async function POST(req: Request, context: Context): Promise<Response> {
|
||||
true
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(`Unable to complete request: ${error.message}`, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { sendToPipeline } from "@/app/lib/pipelines";
|
||||
import { getPerson } from "@formbricks/lib/person/service";
|
||||
import { updateResponse } from "@formbricks/lib/response/service";
|
||||
import { getSurvey } from "@formbricks/lib/survey/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { DatabaseError, InvalidInputError, ResourceNotFoundError } from "@formbricks/types/errors";
|
||||
import { ZResponseUpdateInput } from "@formbricks/types/responses";
|
||||
|
||||
@@ -53,7 +54,7 @@ export async function PUT(
|
||||
return responses.badRequestResponse(error.message);
|
||||
}
|
||||
if (error instanceof DatabaseError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message);
|
||||
}
|
||||
}
|
||||
@@ -67,7 +68,7 @@ export async function PUT(
|
||||
return responses.badRequestResponse(error.message);
|
||||
}
|
||||
if (error instanceof DatabaseError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { getPerson } from "@formbricks/lib/person/service";
|
||||
import { capturePosthogEnvironmentEvent } from "@formbricks/lib/posthogServer";
|
||||
import { createResponse } from "@formbricks/lib/response/service";
|
||||
import { getSurvey } from "@formbricks/lib/survey/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { ZId } from "@formbricks/types/environment";
|
||||
import { InvalidInputError } from "@formbricks/types/errors";
|
||||
import { TResponse, ZResponseInput } from "@formbricks/types/responses";
|
||||
@@ -96,7 +97,7 @@ export async function POST(request: Request, context: Context): Promise<Response
|
||||
if (error instanceof InvalidInputError) {
|
||||
return responses.badRequestResponse(error.message);
|
||||
} else {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return responses.internalServerErrorResponse(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { connectAirtable, fetchAirtableAuthToken } from "@formbricks/lib/airtabl
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { AIRTABLE_CLIENT_ID, WEBAPP_URL } from "@formbricks/lib/constants";
|
||||
import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
|
||||
async function getEmail(token: string) {
|
||||
const req_ = await fetch("https://api.airtable.com/v0/meta/whoami", {
|
||||
@@ -72,7 +73,7 @@ export async function GET(req: NextRequest) {
|
||||
});
|
||||
return Response.redirect(`${WEBAPP_URL}/environments/${environmentId}/integrations/airtable`);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
responses.internalServerErrorResponse(error);
|
||||
}
|
||||
responses.badRequestResponse("unknown error occurred");
|
||||
|
||||
@@ -2,6 +2,7 @@ import { responses } from "@/app/lib/api/response";
|
||||
import { headers } from "next/headers";
|
||||
|
||||
import { getApiKeyFromKey } from "@formbricks/lib/apiKey/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { deleteWebhook, getWebhook } from "@formbricks/lib/webhook/service";
|
||||
|
||||
export async function GET(_: Request, { params }: { params: { webhookId: string } }) {
|
||||
@@ -49,7 +50,7 @@ export async function DELETE(_: Request, { params }: { params: { webhookId: stri
|
||||
const webhook = await deleteWebhook(params.webhookId);
|
||||
return responses.successResponse(webhook);
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
logger.error(e.message);
|
||||
return responses.notFoundResponse("Webhook", params.webhookId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { ONBOARDING_DISABLED } from "@formbricks/lib/constants";
|
||||
import { getFirstEnvironmentByUserId } from "@formbricks/lib/environment/service";
|
||||
import { getTeamsByUserId } from "@formbricks/lib/team/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import ClientLogout from "@formbricks/ui/ClientLogout";
|
||||
|
||||
export default async function Home() {
|
||||
@@ -21,7 +22,7 @@ export default async function Home() {
|
||||
|
||||
const teams = await getTeamsByUserId(session.user.id);
|
||||
if (!teams || teams.length === 0) {
|
||||
console.error("Failed to get teams, redirecting to create-first-team");
|
||||
logger.error("Failed to get teams, redirecting to create-first-team");
|
||||
return redirect("/create-first-team");
|
||||
}
|
||||
|
||||
@@ -36,11 +37,11 @@ export default async function Home() {
|
||||
throw new Error("No environment found");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("error getting environment", error);
|
||||
logger.error(`error getting environment: ${error}`);
|
||||
}
|
||||
|
||||
if (!environment) {
|
||||
console.error("Failed to get first environment of user; signing out");
|
||||
logger.error("Failed to get first environment of user; signing out");
|
||||
return <ClientLogout />;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
import { TResponseData } from "@formbricks/types/responses";
|
||||
import { TSurveyQuestionType } from "@formbricks/types/surveys";
|
||||
import { TSurvey, TSurveyQuestion } from "@formbricks/types/surveys";
|
||||
@@ -31,7 +32,7 @@ export function getPrefillResponseData(
|
||||
return answerObj;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
logger.error(error);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import { NodeSDK } from "@opentelemetry/sdk-node";
|
||||
import { SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
||||
import { SEMRESATTRS_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
|
||||
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
|
||||
export function startInstrumentationForNode(url: string) {
|
||||
try {
|
||||
const exporter = new OTLPTraceExporter({
|
||||
@@ -22,6 +24,6 @@ export function startInstrumentationForNode(url: string) {
|
||||
|
||||
sdk.start();
|
||||
} catch (err) {
|
||||
console.error("Unable to setup Telemetry:", err);
|
||||
logger.error(`Unable to setup Telemetry: ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
|
||||
import { RATE_LIMITING_DISABLED, WEBAPP_URL } from "@formbricks/lib/constants";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
|
||||
export async function middleware(request: NextRequest) {
|
||||
const token = await getToken({ req: request });
|
||||
@@ -31,7 +32,6 @@ export async function middleware(request: NextRequest) {
|
||||
if (token && callbackUrl) {
|
||||
return NextResponse.redirect(WEBAPP_URL + callbackUrl);
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== "production" || RATE_LIMITING_DISABLED) {
|
||||
return NextResponse.next();
|
||||
}
|
||||
@@ -62,7 +62,7 @@ export async function middleware(request: NextRequest) {
|
||||
}
|
||||
return res;
|
||||
} catch (_e) {
|
||||
console.log("Rate Limiting IP: ", ip);
|
||||
logger.info(`Rate Limiting IP: ${ip}`);
|
||||
|
||||
return NextResponse.json({ error: "Too many requests, Please try after a while!" }, { status: 429 });
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ const nextConfig = {
|
||||
assetPrefix: process.env.ASSET_PREFIX_URL || undefined,
|
||||
output: "standalone",
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: ["@aws-sdk"],
|
||||
serverComponentsExternalPackages: ["@aws-sdk","pino"],
|
||||
instrumentationHook: true,
|
||||
outputFileTracingIncludes: {
|
||||
"app/api/js": ["../../packages/**/*"],
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Stripe from "stripe";
|
||||
|
||||
import { env } from "@formbricks/lib/env";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
|
||||
import { handleCheckoutSessionCompleted } from "../handlers/checkoutSessionCompleted";
|
||||
import { handleSubscriptionUpdatedOrCreated } from "../handlers/subscriptionCreatedOrUpdated";
|
||||
@@ -19,7 +20,7 @@ const webhookHandler = async (requestBody: string, stripeSignature: string) => {
|
||||
event = stripe.webhooks.constructEvent(requestBody, stripeSignature, webhookSecret);
|
||||
} catch (err) {
|
||||
const errorMessage = err instanceof Error ? err.message : "Unknown error";
|
||||
if (err! instanceof Error) console.log(err);
|
||||
if (err! instanceof Error) logger.error(err);
|
||||
return { status: 400, message: `Webhook Error: ${errorMessage}` };
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
getTeam,
|
||||
updateTeam,
|
||||
} from "@formbricks/lib/team/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
|
||||
import { ProductFeatureKeys, StripePriceLookupKeys, StripeProductNames } from "../lib/constants";
|
||||
import { reportUsage } from "../lib/reportUsage";
|
||||
@@ -45,7 +46,7 @@ export const handleSubscriptionUpdatedOrCreated = async (event: Stripe.Event) =>
|
||||
}
|
||||
|
||||
if (!teamId) {
|
||||
console.error("No teamId found in subscription");
|
||||
logger.error("No teamId found in subscription");
|
||||
return { status: 400, message: "skipping, no teamId found" };
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import Stripe from "stripe";
|
||||
|
||||
import { env } from "@formbricks/lib/env";
|
||||
import { getTeam, updateTeam } from "@formbricks/lib/team/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
|
||||
import { ProductFeatureKeys, StripeProductNames } from "../lib/constants";
|
||||
import { unsubscribeCoreAndAppSurveyFeatures, unsubscribeLinkSurveyProFeatures } from "../lib/downgradePlan";
|
||||
@@ -15,7 +16,7 @@ export const handleSubscriptionDeleted = async (event: Stripe.Event) => {
|
||||
const stripeSubscriptionObject = event.data.object as Stripe.Subscription;
|
||||
const teamId = stripeSubscriptionObject.metadata.teamId;
|
||||
if (!teamId) {
|
||||
console.error("No teamId found in subscription");
|
||||
logger.error("No teamId found in subscription");
|
||||
return { status: 400, message: "skipping, no teamId found" };
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import Stripe from "stripe";
|
||||
import { WEBAPP_URL } from "@formbricks/lib/constants";
|
||||
import { env } from "@formbricks/lib/env";
|
||||
import { getTeam } from "@formbricks/lib/team/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
|
||||
import { StripePriceLookupKeys } from "./constants";
|
||||
|
||||
@@ -177,7 +178,7 @@ export const createSubscription = async (
|
||||
url: "",
|
||||
};
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
logger.error(err);
|
||||
return {
|
||||
status: 500,
|
||||
data: "Something went wrong!",
|
||||
|
||||
@@ -3,6 +3,7 @@ import Stripe from "stripe";
|
||||
import { WEBAPP_URL } from "@formbricks/lib/constants";
|
||||
import { env } from "@formbricks/lib/env";
|
||||
import { getTeam, updateTeam } from "@formbricks/lib/team/service";
|
||||
import { logger } from "@formbricks/lib/utils/logger";
|
||||
|
||||
import { StripePriceLookupKeys } from "./constants";
|
||||
import { getFirstOfNextMonthTimestamp } from "./createSubscription";
|
||||
@@ -112,7 +113,7 @@ export const removeSubscription = async (
|
||||
url: "",
|
||||
};
|
||||
} catch (err) {
|
||||
console.log("Error in removing subscription:", err);
|
||||
logger.error(`Error in removing subscription: ${err}`);
|
||||
|
||||
return {
|
||||
status: 500,
|
||||
|
||||
@@ -18,6 +18,7 @@ import { DatabaseError, ResourceNotFoundError } from "@formbricks/types/errors";
|
||||
|
||||
import { ITEMS_PER_PAGE, SERVICES_REVALIDATION_INTERVAL } from "../constants";
|
||||
import { formatDateFields } from "../utils/datetime";
|
||||
import { logger } from "../utils/logger";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
import { actionClassCache } from "./cache";
|
||||
|
||||
@@ -176,7 +177,7 @@ export const createActionClass = async (
|
||||
|
||||
return actionClassPrisma;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(`Database error when creating an action for environment ${environmentId}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
|
||||
import { AIRTABLE_CLIENT_ID } from "../constants";
|
||||
import { createOrUpdateIntegration, deleteIntegration, getIntegrationByType } from "../integration/service";
|
||||
import { logger } from "../utils/logger";
|
||||
|
||||
interface ConnectAirtableOptions {
|
||||
environmentId: string;
|
||||
@@ -95,7 +96,7 @@ export const fetchAirtableAuthToken = async (formData: Record<string, any>) => {
|
||||
const parsedToken = ZIntegrationAirtableTokenSchema.safeParse(tokenRes);
|
||||
|
||||
if (!parsedToken.success) {
|
||||
console.error(parsedToken.error);
|
||||
logger.error(parsedToken.error);
|
||||
throw new Error(parsedToken.error.message);
|
||||
}
|
||||
const { access_token, refresh_token, expires_in } = parsedToken.data;
|
||||
@@ -255,6 +256,6 @@ export const writeData = async (
|
||||
}
|
||||
await addRecords(key, configData.baseId, configData.tableId, data);
|
||||
} catch (error: any) {
|
||||
console.error(error?.message);
|
||||
logger.error(error?.message);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,6 +31,7 @@ import { createMembership } from "./membership/service";
|
||||
import { createProduct } from "./product/service";
|
||||
import { createTeam, getTeam } from "./team/service";
|
||||
import { createUser, getUserByEmail, updateUser } from "./user/service";
|
||||
import { logger } from "./utils/logger";
|
||||
|
||||
export const authOptions: NextAuthOptions = {
|
||||
providers: [
|
||||
@@ -63,7 +64,7 @@ export const authOptions: NextAuthOptions = {
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
logger.error(e);
|
||||
throw Error("Internal server error. Please try again later");
|
||||
}
|
||||
|
||||
@@ -115,7 +116,7 @@ export const authOptions: NextAuthOptions = {
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
logger.error(e);
|
||||
throw new Error("Either a user does not match the provided token or the token is invalid");
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import { TPerson } from "@formbricks/types/people";
|
||||
import { ITEMS_PER_PAGE, SERVICES_REVALIDATION_INTERVAL } from "../constants";
|
||||
import { createPerson, getPersonByUserId } from "../person/service";
|
||||
import { formatDateFields } from "../utils/datetime";
|
||||
import { logger } from "../utils/logger";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
import { displayCache } from "./cache";
|
||||
|
||||
@@ -111,7 +112,7 @@ export const updateDisplay = async (
|
||||
|
||||
return display;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
@@ -152,7 +153,7 @@ export const updateDisplayLegacy = async (
|
||||
|
||||
return display;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import { getProductByEnvironmentId } from "../product/service";
|
||||
import { getQuestionResponseMapping } from "../responses";
|
||||
import { getOriginalFileNameFromUrl } from "../storage/utils";
|
||||
import { getTeamByEnvironmentId } from "../team/service";
|
||||
import { logger } from "../utils/logger";
|
||||
import { withEmailTemplate } from "./email-template";
|
||||
|
||||
const nodemailer = require("nodemailer");
|
||||
@@ -65,7 +66,7 @@ export const sendEmail = async (emailData: sendEmailData) => {
|
||||
};
|
||||
await transporter.sendMail({ ...emailDefaults, ...emailData });
|
||||
} else {
|
||||
console.error(`Could not Email :: SMTP not configured :: ${emailData.subject}`);
|
||||
logger.error(`Could not Email :: SMTP not configured :: ${emailData.subject}`);
|
||||
}
|
||||
} catch (error) {
|
||||
throw error;
|
||||
|
||||
@@ -22,6 +22,7 @@ import { SERVICES_REVALIDATION_INTERVAL } from "../constants";
|
||||
import { getProducts } from "../product/service";
|
||||
import { getTeamsByUserId } from "../team/service";
|
||||
import { formatDateFields } from "../utils/datetime";
|
||||
import { logger } from "../utils/logger";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
import { environmentCache } from "./cache";
|
||||
|
||||
@@ -39,7 +40,7 @@ export const getEnvironment = async (environmentId: string): Promise<TEnvironmen
|
||||
return environment;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
|
||||
@@ -90,7 +91,7 @@ export const getEnvironments = async (productId: string): Promise<TEnvironment[]
|
||||
return environments;
|
||||
} catch (error) {
|
||||
if (error instanceof z.ZodError) {
|
||||
console.error(JSON.stringify(error.errors, null, 2));
|
||||
logger.error(JSON.stringify(error.errors, null, 2));
|
||||
}
|
||||
throw new ValidationError("Data validation of environments array failed");
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
|
||||
import { ITEMS_PER_PAGE, SERVICES_REVALIDATION_INTERVAL } from "../constants";
|
||||
import { formatDateFields } from "../utils/datetime";
|
||||
import { logger } from "../utils/logger";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
import { integrationCache } from "./cache";
|
||||
|
||||
@@ -50,7 +51,7 @@ export async function createOrUpdateIntegration(
|
||||
return integration;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
throw error;
|
||||
|
||||
@@ -3,6 +3,7 @@ import jwt, { JwtPayload } from "jsonwebtoken";
|
||||
import { prisma } from "@formbricks/database";
|
||||
|
||||
import { env } from "./env";
|
||||
import { logger } from "./utils/logger";
|
||||
|
||||
export function createToken(userId: string, userEmail: string, options = {}): string {
|
||||
return jwt.sign({ id: userId }, env.NEXTAUTH_SECRET + userEmail, options);
|
||||
@@ -59,7 +60,7 @@ export const verifyInviteToken = (token: string): { inviteId: string; email: str
|
||||
email,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error verifying invite token:", error);
|
||||
logger.error(`Error verifying invite token: ${error}`);
|
||||
throw new Error("Invalid or expired invite token");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
|
||||
import { productCache } from "../product/cache";
|
||||
import { surveyCache } from "../survey/cache";
|
||||
import { logger } from "../utils/logger";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
|
||||
const languageSelect = {
|
||||
@@ -53,7 +54,7 @@ export const createLanguage = async (
|
||||
return language;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
throw error;
|
||||
@@ -81,7 +82,7 @@ export const getSurveysUsingGivenLanguage = async (languageId: string): Promise<
|
||||
return surveyNames;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
throw error;
|
||||
@@ -116,7 +117,7 @@ export const deleteLanguage = async (environmentId: string, languageId: string):
|
||||
return language;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
throw error;
|
||||
@@ -156,7 +157,7 @@ export const updateLanguage = async (
|
||||
return language;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
throw error;
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
"nanoid": "^5.0.6",
|
||||
"next-auth": "^4.24.7",
|
||||
"nodemailer": "^6.9.12",
|
||||
"pino": "^8.19.0",
|
||||
"pino-pretty": "^10.3.1",
|
||||
"posthog-node": "^3.6.3",
|
||||
"server-only": "^0.0.1",
|
||||
"tailwind-merge": "^2.2.1"
|
||||
|
||||
@@ -16,6 +16,7 @@ import { environmentCache } from "../environment/cache";
|
||||
import { createEnvironment } from "../environment/service";
|
||||
import { deleteLocalFilesByEnvironmentId, deleteS3FilesByEnvironmentId } from "../storage/service";
|
||||
import { formatDateFields } from "../utils/datetime";
|
||||
import { logger } from "../utils/logger";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
import { productCache } from "./cache";
|
||||
|
||||
@@ -90,7 +91,7 @@ export const getProductByEnvironmentId = async (environmentId: string): Promise<
|
||||
return productPrisma;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
throw error;
|
||||
@@ -149,7 +150,7 @@ export const updateProduct = async (
|
||||
return product;
|
||||
} catch (error) {
|
||||
if (error instanceof z.ZodError) {
|
||||
console.error(JSON.stringify(error.errors, null, 2));
|
||||
logger.error(JSON.stringify(error.errors, null, 2));
|
||||
}
|
||||
throw new ValidationError("Data validation of product failed");
|
||||
}
|
||||
@@ -204,7 +205,7 @@ export const deleteProduct = async (productId: string): Promise<TProduct> => {
|
||||
await Promise.all(s3FilesPromises);
|
||||
} catch (err) {
|
||||
// fail silently because we don't want to throw an error if the files are not deleted
|
||||
console.error(err);
|
||||
logger.error(err);
|
||||
}
|
||||
} else {
|
||||
const localFilesPromises = product.environments.map(async (environment) => {
|
||||
@@ -215,7 +216,7 @@ export const deleteProduct = async (productId: string): Promise<TProduct> => {
|
||||
await Promise.all(localFilesPromises);
|
||||
} catch (err) {
|
||||
// fail silently because we don't want to throw an error if the files are not deleted
|
||||
console.error(err);
|
||||
logger.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import { TResponseNote, ZResponseNote } from "@formbricks/types/responses";
|
||||
import { SERVICES_REVALIDATION_INTERVAL } from "../constants";
|
||||
import { responseCache } from "../response/cache";
|
||||
import { formatDateFields } from "../utils/datetime";
|
||||
import { logger } from "../utils/logger";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
import { responseNoteCache } from "./cache";
|
||||
|
||||
@@ -64,7 +65,7 @@ export const createResponseNote = async (
|
||||
});
|
||||
return responseNote;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
@@ -85,7 +86,7 @@ export const getResponseNote = async (responseNoteId: string): Promise<TResponse
|
||||
});
|
||||
return responseNote;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
@@ -116,7 +117,7 @@ export const getResponseNotes = async (responseId: string): Promise<TResponseNot
|
||||
}
|
||||
return responseNotes;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
@@ -158,7 +159,7 @@ export const updateResponseNote = async (responseNoteId: string, text: string):
|
||||
|
||||
return updatedResponseNote;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
@@ -194,7 +195,7 @@ export const resolveResponseNote = async (responseNoteId: string): Promise<TResp
|
||||
|
||||
return responseNote;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { TResponseUpdate } from "@formbricks/types/responses";
|
||||
|
||||
import SurveyState from "./surveyState";
|
||||
import { delay } from "./utils";
|
||||
import { logger } from "./utils/logger";
|
||||
|
||||
interface QueueConfig {
|
||||
apiHost: string;
|
||||
@@ -55,14 +56,14 @@ export class ResponseQueue {
|
||||
this.queue.shift(); // remove the successfully sent response from the queue
|
||||
break; // exit the retry loop
|
||||
}
|
||||
console.error("Formbricks: Failed to send response. Retrying...", attempts);
|
||||
logger.error(`Formbricks: Failed to send response. Retrying... ${attempts}`);
|
||||
await delay(1000); // wait for 1 second before retrying
|
||||
attempts++;
|
||||
}
|
||||
|
||||
if (attempts >= this.config.retryAttempts) {
|
||||
// Inform the user after 2 failed attempts
|
||||
console.error("Failed to send response after 2 attempts.");
|
||||
logger.error("Failed to send response after 2 attempts.");
|
||||
// If the response fails finally, inform the user
|
||||
if (this.config.onResponseSendingFailed) {
|
||||
this.config.onResponseSendingFailed(responseUpdate);
|
||||
@@ -97,7 +98,7 @@ export class ResponseQueue {
|
||||
responseId: response.data.id,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Failed to update display, proceeding with the response.", error);
|
||||
logger.error(`Failed to update display, proceeding with the response. ${error}`);
|
||||
}
|
||||
}
|
||||
this.surveyState.updateResponseId(response.data.id);
|
||||
@@ -107,7 +108,7 @@ export class ResponseQueue {
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
} from "../constants";
|
||||
import { generateLocalSignedUrl } from "../crypto";
|
||||
import { env } from "../env";
|
||||
import { logger } from "../utils/logger";
|
||||
import { storageCache } from "./cache";
|
||||
|
||||
// S3Client Singleton
|
||||
@@ -66,7 +67,7 @@ export const testS3BucketAccess = async () => {
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error("Failed to access S3 bucket:", error);
|
||||
logger.error(`Failed to access S3 bucket: ${error}`);
|
||||
throw new Error(`S3 Bucket Access Test Failed: ${error}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { logger } from "../utils/logger";
|
||||
|
||||
export const getOriginalFileNameFromUrl = (fileURL: string) => {
|
||||
try {
|
||||
const fileNameFromURL = fileURL.startsWith("/storage/")
|
||||
@@ -16,6 +18,6 @@ export const getOriginalFileNameFromUrl = (fileURL: string) => {
|
||||
const fileName = originalFileName ? decodeURIComponent(`${originalFileName}.${fileExt}` || "") : "";
|
||||
return fileName;
|
||||
} catch (error) {
|
||||
console.error("Error parsing file URL:", error);
|
||||
logger.error(`Error parsing file URL: ${error}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -29,6 +29,7 @@ import { createSegment, evaluateSegment, getSegment, updateSegment } from "../se
|
||||
import { transformSegmentFiltersToAttributeFilters } from "../segment/utils";
|
||||
import { subscribeTeamMembersToSurveyResponses } from "../team/service";
|
||||
import { diffInDays, formatDateFields } from "../utils/datetime";
|
||||
import { logger } from "../utils/logger";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
import { surveyCache } from "./cache";
|
||||
import { anySurveyHasFilters } from "./util";
|
||||
@@ -187,10 +188,9 @@ export const getSurvey = async (surveyId: string): Promise<TSurvey | null> => {
|
||||
});
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ export const getSurveys = async (
|
||||
});
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ export const getSurveyCount = async (environmentId: string): Promise<number> =>
|
||||
return surveyCount;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ export const updateSurvey = async (updatedSurvey: TSurvey): Promise<TSurvey> =>
|
||||
try {
|
||||
await updateSegment(segment.id, segment);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new Error("Error updating survey");
|
||||
}
|
||||
}
|
||||
@@ -512,7 +512,7 @@ export const updateSurvey = async (updatedSurvey: TSurvey): Promise<TSurvey> =>
|
||||
return modifiedSurvey;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import { environmentCache } from "../environment/cache";
|
||||
import { getProducts } from "../product/service";
|
||||
import { getUsersWithTeam, updateUser } from "../user/service";
|
||||
import { formatDateFields } from "../utils/datetime";
|
||||
import { logger } from "../utils/logger";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
import { teamCache } from "./cache";
|
||||
|
||||
@@ -100,7 +101,7 @@ export const getTeamByEnvironmentId = async (environmentId: string): Promise<TTe
|
||||
return team;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
throw new DatabaseError(error.message);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
and we cannot trace anything back to you or your customers. If you still want to
|
||||
disable telemetry, set the environment variable TELEMETRY_DISABLED=1 */
|
||||
import { env } from "./env";
|
||||
import { logger } from "./utils/logger";
|
||||
|
||||
export const captureTelemetry = async (eventName: string, properties = {}) => {
|
||||
if (env.TELEMETRY_DISABLED !== "1" && process.env.NODE_ENV === "production" && process.env.INSTANCE_ID) {
|
||||
@@ -21,7 +22,7 @@ export const captureTelemetry = async (eventName: string, properties = {}) => {
|
||||
}),
|
||||
});
|
||||
} catch (error) {
|
||||
console.log("error sending telemetry:", error);
|
||||
logger.error(`error sending telemetry: ${error}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import z from "zod";
|
||||
|
||||
import { logger } from "./logger";
|
||||
|
||||
// Helper function to calculate difference in days between two dates
|
||||
export const diffInDays = (date1: Date, date2: Date) => {
|
||||
const diffTime = Math.abs(date2.getTime() - date1.getTime());
|
||||
@@ -35,7 +37,7 @@ export function formatDateFields<T extends z.ZodRawShape>(
|
||||
(formattedObject as any)[key] = new Date(dateStr);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error parsing date for key ${key}:`, error);
|
||||
logger.error(`Error parsing date for key ${key}:`, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { AsyncParser } from "@json2csv/node";
|
||||
import * as xlsx from "xlsx";
|
||||
|
||||
import { logger } from "./logger";
|
||||
|
||||
export const convertToCsv = async (fields: string[], jsonData: Record<string, string | number>[]) => {
|
||||
let csv: string = "";
|
||||
|
||||
@@ -11,7 +13,7 @@ export const convertToCsv = async (fields: string[], jsonData: Record<string, st
|
||||
try {
|
||||
csv = await parser.parse(jsonData).promise();
|
||||
} catch (err) {
|
||||
console.log({ err });
|
||||
logger.error({ err });
|
||||
throw new Error("Failed to convert to CSV");
|
||||
}
|
||||
return csv;
|
||||
|
||||
22
packages/lib/utils/logger.ts
Normal file
22
packages/lib/utils/logger.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import pino from "pino";
|
||||
|
||||
export const logger = pino({
|
||||
level: "info",
|
||||
timestamp: pino.stdTimeFunctions.isoTime,
|
||||
transport: {
|
||||
targets: [
|
||||
{
|
||||
level: "info",
|
||||
target: "pino-pretty",
|
||||
options: {
|
||||
colorize: true,
|
||||
levelFirst: true,
|
||||
translateTime: "yyyy-dd-mm, h:MM:ss TT",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
formatters: {
|
||||
bindings: () => ({}),
|
||||
},
|
||||
});
|
||||
@@ -2,6 +2,8 @@ import z from "zod";
|
||||
|
||||
import { ValidationError } from "@formbricks/types/errors";
|
||||
|
||||
import { logger } from "./logger";
|
||||
|
||||
type ValidationPair = [any, z.ZodSchema<any>];
|
||||
|
||||
export const validateInputs = (...pairs: ValidationPair[]): void => {
|
||||
@@ -9,7 +11,7 @@ export const validateInputs = (...pairs: ValidationPair[]): void => {
|
||||
const inputValidation = schema.safeParse(value);
|
||||
|
||||
if (!inputValidation.success) {
|
||||
console.error(
|
||||
logger.error(
|
||||
`Validation failed for ${JSON.stringify(value)} and ${JSON.stringify(schema)}: ${inputValidation.error.message}`
|
||||
);
|
||||
throw new ValidationError("Validation failed");
|
||||
|
||||
159
pnpm-lock.yaml
generated
159
pnpm-lock.yaml
generated
@@ -284,7 +284,7 @@ importers:
|
||||
version: 8.0.2(typescript@5.3.3)
|
||||
vite:
|
||||
specifier: ^5.1.6
|
||||
version: 5.1.6(@types/node@20.11.24)
|
||||
version: 5.1.6(terser@5.29.1)
|
||||
|
||||
apps/web:
|
||||
dependencies:
|
||||
@@ -678,6 +678,12 @@ importers:
|
||||
nodemailer:
|
||||
specifier: ^6.9.12
|
||||
version: 6.9.12
|
||||
pino:
|
||||
specifier: ^8.19.0
|
||||
version: 8.19.0
|
||||
pino-pretty:
|
||||
specifier: ^10.3.1
|
||||
version: 10.3.1
|
||||
posthog-node:
|
||||
specifier: ^3.6.3
|
||||
version: 3.6.3
|
||||
@@ -4332,7 +4338,7 @@ packages:
|
||||
magic-string: 0.27.0
|
||||
react-docgen-typescript: 2.2.2(typescript@5.3.3)
|
||||
typescript: 5.3.3
|
||||
vite: 5.1.6(@types/node@20.11.24)
|
||||
vite: 5.1.6(terser@5.29.1)
|
||||
dev: true
|
||||
|
||||
/@jridgewell/gen-mapping@0.3.3:
|
||||
@@ -8603,7 +8609,7 @@ packages:
|
||||
magic-string: 0.30.5
|
||||
ts-dedent: 2.2.0
|
||||
typescript: 5.3.3
|
||||
vite: 5.1.6(@types/node@20.11.24)
|
||||
vite: 5.1.6(terser@5.29.1)
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
- supports-color
|
||||
@@ -8834,7 +8840,7 @@ packages:
|
||||
react-dom: 18.2.0(react@18.2.0)
|
||||
resolve: 1.22.8
|
||||
tsconfig-paths: 4.2.0
|
||||
vite: 5.1.6(@types/node@20.11.24)
|
||||
vite: 5.1.6(terser@5.29.1)
|
||||
transitivePeerDependencies:
|
||||
- '@preact/preset-vite'
|
||||
- encoding
|
||||
@@ -10075,7 +10081,7 @@ packages:
|
||||
'@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.6)
|
||||
'@types/babel__core': 7.20.5
|
||||
react-refresh: 0.14.0
|
||||
vite: 5.1.6(@types/node@20.11.24)
|
||||
vite: 5.1.6(terser@5.29.1)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
@@ -10325,6 +10331,13 @@ packages:
|
||||
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
|
||||
dev: false
|
||||
|
||||
/abort-controller@3.0.0:
|
||||
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
|
||||
engines: {node: '>=6.5'}
|
||||
dependencies:
|
||||
event-target-shim: 5.0.1
|
||||
dev: false
|
||||
|
||||
/accepts@1.3.8:
|
||||
resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==}
|
||||
engines: {node: '>= 0.6'}
|
||||
@@ -10750,6 +10763,11 @@ packages:
|
||||
/asynckit@0.4.0:
|
||||
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
|
||||
|
||||
/atomic-sleep@1.0.0:
|
||||
resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}
|
||||
engines: {node: '>=8.0.0'}
|
||||
dev: false
|
||||
|
||||
/autoprefixer@10.4.14(postcss@8.4.35):
|
||||
resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
@@ -11439,7 +11457,6 @@ packages:
|
||||
|
||||
/colorette@2.0.20:
|
||||
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
|
||||
dev: true
|
||||
|
||||
/colors@1.2.5:
|
||||
resolution: {integrity: sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==}
|
||||
@@ -11793,6 +11810,10 @@ packages:
|
||||
resolution: {integrity: sha512-Akz4R8J9MXBsOgF1QeWeCsbv6pntT5KCPjU0Q9prBxVmWJYPLhwAIsNg3b0QAdr0ttiozYLD3L/af7Ra0jqYXw==}
|
||||
dev: false
|
||||
|
||||
/dateformat@4.6.3:
|
||||
resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==}
|
||||
dev: false
|
||||
|
||||
/de-indent@1.0.2:
|
||||
resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==}
|
||||
dev: true
|
||||
@@ -12832,6 +12853,11 @@ packages:
|
||||
engines: {node: '>= 0.6'}
|
||||
dev: true
|
||||
|
||||
/event-target-shim@5.0.1:
|
||||
resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==}
|
||||
engines: {node: '>=6'}
|
||||
dev: false
|
||||
|
||||
/eventemitter3@5.0.1:
|
||||
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
|
||||
dev: true
|
||||
@@ -12927,6 +12953,10 @@ packages:
|
||||
tmp: 0.0.33
|
||||
dev: false
|
||||
|
||||
/fast-copy@3.0.2:
|
||||
resolution: {integrity: sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==}
|
||||
dev: false
|
||||
|
||||
/fast-deep-equal@3.1.3:
|
||||
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
|
||||
|
||||
@@ -12950,6 +12980,15 @@ packages:
|
||||
resolution: {integrity: sha512-8EZzEP0eKkEEVX+drtd9mtuQ+/QrlfW/5MlwcwK5Nds6EkZ/tRzEexkzUY2mIssnAyVLT+TKHuRXmFNNXYUd6g==}
|
||||
dev: false
|
||||
|
||||
/fast-redact@3.5.0:
|
||||
resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==}
|
||||
engines: {node: '>=6'}
|
||||
dev: false
|
||||
|
||||
/fast-safe-stringify@2.1.1:
|
||||
resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==}
|
||||
dev: false
|
||||
|
||||
/fast-shallow-equal@1.0.0:
|
||||
resolution: {integrity: sha512-HPtaa38cPgWvaCFmRNhlc6NG7pv6NUHqjPgVAkWGoB9mQMwYB27/K0CvOM5Czy+qpT3e8XJ6Q4aPAnzpNpzNaw==}
|
||||
dev: false
|
||||
@@ -13717,6 +13756,10 @@ packages:
|
||||
readable-stream: 3.6.2
|
||||
dev: false
|
||||
|
||||
/help-me@5.0.0:
|
||||
resolution: {integrity: sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==}
|
||||
dev: false
|
||||
|
||||
/hex-rgb@4.3.0:
|
||||
resolution: {integrity: sha512-Ox1pJVrDCyGHMG9CFg1tmrRUMRPRsAWYc/PinY0XzJU4K7y7vjNoLKIQ7BR5UJMCxNN8EM1MNDmHWA/B3aZUuw==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -14376,7 +14419,6 @@ packages:
|
||||
/joycon@3.1.1:
|
||||
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/js-beautify@1.14.11:
|
||||
resolution: {integrity: sha512-rPogWqAfoYh1Ryqqh2agUpVfbxAhbjuN1SmU86dskQUKouRiggUTCO4+2ym9UPXllc2WAp0J+T5qxn7Um3lCdw==}
|
||||
@@ -16251,6 +16293,11 @@ packages:
|
||||
engines: {node: ^10.13.0 || >=12.0.0}
|
||||
dev: false
|
||||
|
||||
/on-exit-leak-free@2.1.2:
|
||||
resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
dev: false
|
||||
|
||||
/on-finished@2.4.1:
|
||||
resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
|
||||
engines: {node: '>= 0.8'}
|
||||
@@ -16582,6 +16629,54 @@ packages:
|
||||
engines: {node: '>=6'}
|
||||
dev: false
|
||||
|
||||
/pino-abstract-transport@1.1.0:
|
||||
resolution: {integrity: sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==}
|
||||
dependencies:
|
||||
readable-stream: 4.5.2
|
||||
split2: 4.2.0
|
||||
dev: false
|
||||
|
||||
/pino-pretty@10.3.1:
|
||||
resolution: {integrity: sha512-az8JbIYeN/1iLj2t0jR9DV48/LQ3RC6hZPpapKPkb84Q+yTidMCpgWxIT3N0flnBDilyBQ1luWNpOeJptjdp/g==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
colorette: 2.0.20
|
||||
dateformat: 4.6.3
|
||||
fast-copy: 3.0.2
|
||||
fast-safe-stringify: 2.1.1
|
||||
help-me: 5.0.0
|
||||
joycon: 3.1.1
|
||||
minimist: 1.2.8
|
||||
on-exit-leak-free: 2.1.2
|
||||
pino-abstract-transport: 1.1.0
|
||||
pump: 3.0.0
|
||||
readable-stream: 4.5.2
|
||||
secure-json-parse: 2.7.0
|
||||
sonic-boom: 3.8.0
|
||||
strip-json-comments: 3.1.1
|
||||
dev: false
|
||||
|
||||
/pino-std-serializers@6.2.2:
|
||||
resolution: {integrity: sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==}
|
||||
dev: false
|
||||
|
||||
/pino@8.19.0:
|
||||
resolution: {integrity: sha512-oswmokxkav9bADfJ2ifrvfHUwad6MLp73Uat0IkQWY3iAw5xTRoznXbXksZs8oaOUMpmhVWD+PZogNzllWpJaA==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
atomic-sleep: 1.0.0
|
||||
fast-redact: 3.5.0
|
||||
on-exit-leak-free: 2.1.2
|
||||
pino-abstract-transport: 1.1.0
|
||||
pino-std-serializers: 6.2.2
|
||||
process-warning: 3.0.0
|
||||
quick-format-unescaped: 4.0.4
|
||||
real-require: 0.2.0
|
||||
safe-stable-stringify: 2.4.3
|
||||
sonic-boom: 3.8.0
|
||||
thread-stream: 2.4.1
|
||||
dev: false
|
||||
|
||||
/pirates@4.0.6:
|
||||
resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==}
|
||||
engines: {node: '>= 6'}
|
||||
@@ -16935,6 +17030,10 @@ packages:
|
||||
/process-nextick-args@2.0.1:
|
||||
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
|
||||
|
||||
/process-warning@3.0.0:
|
||||
resolution: {integrity: sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==}
|
||||
dev: false
|
||||
|
||||
/process@0.11.10:
|
||||
resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==}
|
||||
engines: {node: '>= 0.6.0'}
|
||||
@@ -17063,6 +17162,10 @@ packages:
|
||||
/queue-microtask@1.2.3:
|
||||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||
|
||||
/quick-format-unescaped@4.0.4:
|
||||
resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==}
|
||||
dev: false
|
||||
|
||||
/quick-lru@4.0.1:
|
||||
resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -17613,6 +17716,17 @@ packages:
|
||||
string_decoder: 1.3.0
|
||||
util-deprecate: 1.0.2
|
||||
|
||||
/readable-stream@4.5.2:
|
||||
resolution: {integrity: sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
dependencies:
|
||||
abort-controller: 3.0.0
|
||||
buffer: 6.0.3
|
||||
events: 3.3.0
|
||||
process: 0.11.10
|
||||
string_decoder: 1.3.0
|
||||
dev: false
|
||||
|
||||
/readdir-glob@1.1.3:
|
||||
resolution: {integrity: sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==}
|
||||
dependencies:
|
||||
@@ -17625,6 +17739,11 @@ packages:
|
||||
dependencies:
|
||||
picomatch: 2.3.1
|
||||
|
||||
/real-require@0.2.0:
|
||||
resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==}
|
||||
engines: {node: '>= 12.13.0'}
|
||||
dev: false
|
||||
|
||||
/recast@0.23.6:
|
||||
resolution: {integrity: sha512-9FHoNjX1yjuesMwuthAmPKabxYQdOgihFYmT5ebXfYGBcnqXZf3WOVz+5foEZ8Y83P4ZY6yQD5GMmtV+pgCCAQ==}
|
||||
engines: {node: '>= 4'}
|
||||
@@ -18029,6 +18148,11 @@ packages:
|
||||
get-intrinsic: 1.2.2
|
||||
is-regex: 1.1.4
|
||||
|
||||
/safe-stable-stringify@2.4.3:
|
||||
resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==}
|
||||
engines: {node: '>=10'}
|
||||
dev: false
|
||||
|
||||
/safer-buffer@2.1.2:
|
||||
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
|
||||
|
||||
@@ -18086,6 +18210,10 @@ packages:
|
||||
resolution: {integrity: sha512-Orrsjf9trHHxFRuo9/rzm0KIWmgzE8RMlZMzuhZOJ01Rnz3D0YBAe+V6473t6/H6c7irs6Lt48brULAiRWb3Vw==}
|
||||
dev: false
|
||||
|
||||
/secure-json-parse@2.7.0:
|
||||
resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==}
|
||||
dev: false
|
||||
|
||||
/selderee@0.11.0:
|
||||
resolution: {integrity: sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==}
|
||||
dependencies:
|
||||
@@ -18419,6 +18547,12 @@ packages:
|
||||
- utf-8-validate
|
||||
dev: false
|
||||
|
||||
/sonic-boom@3.8.0:
|
||||
resolution: {integrity: sha512-ybz6OYOUjoQQCQ/i4LU8kaToD8ACtYP+Cj5qd2AO36bwbdewxWJ3ArmJ2cr6AvxlL2o0PqnCcPGUgkILbfkaCA==}
|
||||
dependencies:
|
||||
atomic-sleep: 1.0.0
|
||||
dev: false
|
||||
|
||||
/sonner@1.3.1(react-dom@18.2.0)(react@18.2.0):
|
||||
resolution: {integrity: sha512-+rOAO56b2eI3q5BtgljERSn2umRk63KFIvgb2ohbZ5X+Eb5u+a/7/0ZgswYqgBMg8dyl7n6OXd9KasA8QF9ToA==}
|
||||
peerDependencies:
|
||||
@@ -18507,6 +18641,11 @@ packages:
|
||||
readable-stream: 3.6.2
|
||||
dev: false
|
||||
|
||||
/split2@4.2.0:
|
||||
resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==}
|
||||
engines: {node: '>= 10.x'}
|
||||
dev: false
|
||||
|
||||
/sprintf-js@1.0.3:
|
||||
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
|
||||
|
||||
@@ -19051,6 +19190,12 @@ packages:
|
||||
engines: {node: '>=0.2.6'}
|
||||
dev: false
|
||||
|
||||
/thread-stream@2.4.1:
|
||||
resolution: {integrity: sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==}
|
||||
dependencies:
|
||||
real-require: 0.2.0
|
||||
dev: false
|
||||
|
||||
/throttle-debounce@3.0.1:
|
||||
resolution: {integrity: sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
Reference in New Issue
Block a user