av6-core 1.2.6 → 1.2.7

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/index.js CHANGED
@@ -1537,6 +1537,9 @@ var commonService = (serviceDeps) => {
1537
1537
  const currentUser = store?.user?.id ?? null;
1538
1538
  const shortCodeData = createParams.shortCodeData;
1539
1539
  const cfg = shortCodeData.config;
1540
+ if (!cfg) {
1541
+ throw new ErrorHandler(500, `Configuration not found for short code: ${shortCodeData.shortCode}`);
1542
+ }
1540
1543
  const ctx = { userId: currentUser ?? void 0, vars: {} };
1541
1544
  const schema = buildJoiSchemaForOp(cfg, "create");
1542
1545
  const validated = await schema.validateAsync(createParams.body);
@@ -1573,6 +1576,9 @@ var commonService = (serviceDeps) => {
1573
1576
  const currentUser = store?.user?.id ?? null;
1574
1577
  const shortCodeData = updateParams.shortCodeData;
1575
1578
  const cfg = shortCodeData.config;
1579
+ if (!cfg) {
1580
+ throw new ErrorHandler(500, `Configuration not found for short code: ${shortCodeData.shortCode}`);
1581
+ }
1576
1582
  const ctx = { userId: currentUser ?? void 0, vars: {} };
1577
1583
  const schema = buildJoiSchemaForOp(cfg, "update");
1578
1584
  const validated = await schema.validateAsync(updateParams.body);
@@ -2526,6 +2532,9 @@ var AuditLogger = class {
2526
2532
  const { service, method, payload } = params;
2527
2533
  const prisma = this.core.getPrisma();
2528
2534
  const { userId, traceId, module: module2 } = this.core.getContext();
2535
+ if (method.includes("get")) {
2536
+ return;
2537
+ }
2529
2538
  try {
2530
2539
  const config = await prisma.auditConfig.findFirst({
2531
2540
  where: {
package/dist/index.mjs CHANGED
@@ -1487,6 +1487,9 @@ var commonService = (serviceDeps) => {
1487
1487
  const currentUser = store?.user?.id ?? null;
1488
1488
  const shortCodeData = createParams.shortCodeData;
1489
1489
  const cfg = shortCodeData.config;
1490
+ if (!cfg) {
1491
+ throw new ErrorHandler(500, `Configuration not found for short code: ${shortCodeData.shortCode}`);
1492
+ }
1490
1493
  const ctx = { userId: currentUser ?? void 0, vars: {} };
1491
1494
  const schema = buildJoiSchemaForOp(cfg, "create");
1492
1495
  const validated = await schema.validateAsync(createParams.body);
@@ -1523,6 +1526,9 @@ var commonService = (serviceDeps) => {
1523
1526
  const currentUser = store?.user?.id ?? null;
1524
1527
  const shortCodeData = updateParams.shortCodeData;
1525
1528
  const cfg = shortCodeData.config;
1529
+ if (!cfg) {
1530
+ throw new ErrorHandler(500, `Configuration not found for short code: ${shortCodeData.shortCode}`);
1531
+ }
1526
1532
  const ctx = { userId: currentUser ?? void 0, vars: {} };
1527
1533
  const schema = buildJoiSchemaForOp(cfg, "update");
1528
1534
  const validated = await schema.validateAsync(updateParams.body);
@@ -2476,6 +2482,9 @@ var AuditLogger = class {
2476
2482
  const { service, method, payload } = params;
2477
2483
  const prisma = this.core.getPrisma();
2478
2484
  const { userId, traceId, module } = this.core.getContext();
2485
+ if (method.includes("get")) {
2486
+ return;
2487
+ }
2479
2488
  try {
2480
2489
  const config = await prisma.auditConfig.findFirst({
2481
2490
  where: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "av6-core",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",