feat(apihits): so i can see if what end points are being used and when and how often

This commit is contained in:
2025-05-15 20:55:17 -05:00
parent 12ea23c9fb
commit 9d9a2683fa
86 changed files with 15710 additions and 496 deletions

View File

@@ -3,6 +3,7 @@ import { responses } from "../../../globalUtils/routeDefs/responses.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";
import { getINV } from "../controller/getinventory.js";
import { getFakeEDI } from "../controller/fakeEDIUpdate.js";
import { apiHit } from "../../../globalUtils/apiHits.js";
const app = new OpenAPIHono({ strict: false });
const Body = z.object({
@@ -27,7 +28,7 @@ app.openapi(
const address: string = c.req.query("address") ?? "";
// make sure we have a vaid user being accessed thats really logged in
//apiHit(c, { endpoint: `api/logger/logs/id` });
apiHit(c, { endpoint: "/fakeediupdate" });
const { data, error } = await tryCatch(
getFakeEDI(address.toString() ?? "")
);

View File

@@ -22,7 +22,7 @@ app.openapi(
async (c) => {
//const body = await c.req.json();
// make sure we have a vaid user being accessed thats really logged in
//apiHit(c, { endpoint: `api/logger/logs/id` });
apiHit(c, { endpoint: "/getarticles" });
try {
return c.json(
{

View File

@@ -1,5 +1,6 @@
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { responses } from "../../../globalUtils/routeDefs/responses.js";
import { apiHit } from "../../../globalUtils/apiHits.js";
const app = new OpenAPIHono({ strict: false });
const current: any = [
@@ -108,7 +109,7 @@ app.openapi(
async (c) => {
//const body = await c.req.json();
// make sure we have a vaid user being accessed thats really logged in
//apiHit(c, { endpoint: `api/logger/logs/id` });
apiHit(c, { endpoint: "/getavalibleaquerys" });
return c.json({
success: true,

View File

@@ -3,6 +3,7 @@ import { responses } from "../../../globalUtils/routeDefs/responses.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";
import { getINV } from "../controller/getinventory.js";
import { getCurrentCustomerInv } from "../controller/getCustomerInventory.js";
import { apiHit } from "../../../globalUtils/apiHits.js";
const app = new OpenAPIHono({ strict: false });
const Body = z.object({
@@ -27,7 +28,7 @@ app.openapi(
const customer: string = c.req.query("customer") ?? "";
// make sure we have a vaid user being accessed thats really logged in
//apiHit(c, { endpoint: `api/logger/logs/id` });
apiHit(c, { endpoint: "/getcustomerinventory" });
const { data, error } = await tryCatch(
getCurrentCustomerInv(customer ? customer : null)
);

View File

@@ -2,6 +2,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { responses } from "../../../globalUtils/routeDefs/responses.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";
import { getDeliveryByDateRange } from "../controller/getDeliveryByDateRange.js";
import { apiHit } from "../../../globalUtils/apiHits.js";
const app = new OpenAPIHono({ strict: false });
const Body = z.object({
@@ -26,7 +27,7 @@ app.openapi(
const delivery: any = c.req.queries();
// make sure we have a vaid user being accessed thats really logged in
//apiHit(c, { endpoint: `api/logger/logs/id` });
apiHit(c, { endpoint: "/deliverybydaterange" });
const { data, error } = await tryCatch(
getDeliveryByDateRange(delivery ? delivery : null)
);

View File

@@ -2,6 +2,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { responses } from "../../../globalUtils/routeDefs/responses.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";
import { getINV } from "../controller/getinventory.js";
import { apiHit } from "../../../globalUtils/apiHits.js";
const app = new OpenAPIHono({ strict: false });
const Body = z.object({
@@ -27,7 +28,7 @@ app.openapi(
c.req.query("includeRunnningNumbers") ?? "";
// make sure we have a vaid user being accessed thats really logged in
//apiHit(c, { endpoint: `api/logger/logs/id` });
apiHit(c, { endpoint: "/getinventory" });
const { data, error } = await tryCatch(
getINV(includeRunnningNumbers?.length > 0 ? true : false)
);

View File

@@ -2,6 +2,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { responses } from "../../../globalUtils/routeDefs/responses.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";
import { getOpenOrders } from "../controller/getOpenOrders.js";
import { apiHit } from "../../../globalUtils/apiHits.js";
const app = new OpenAPIHono({ strict: false });
// const Body = z.object({
@@ -26,7 +27,7 @@ app.openapi(
const customer: any = c.req.queries();
// make sure we have a vaid user being accessed thats really logged in
//apiHit(c, { endpoint: `api/logger/logs/id` });
apiHit(c, { endpoint: "/getopenorders" });
const { data, error } = await tryCatch(
getOpenOrders(customer ? customer : null)
);