@explita/prisma-audit-log 0.2.2 → 0.2.3

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.
@@ -2,4 +2,4 @@ import type { AuditLogOptions } from "../types.js";
2
2
  /**
3
3
  * Creates a Prisma extension that adds audit logging
4
4
  */
5
- export declare function auditLogExtension(options?: AuditLogOptions): (client: any) => import("@prisma/client/extension").PrismaClientExtends<import("@prisma/client/runtime/client").InternalArgs<{}, {}, {}, {}> & import("@prisma/client/runtime/client").DefaultArgs>;
5
+ export declare function auditLogExtension(opts?: AuditLogOptions): (client: any) => import("@prisma/client/extension").PrismaClientExtends<import("@prisma/client/runtime/client").InternalArgs<{}, {}, {}, {}> & import("@prisma/client/runtime/client").DefaultArgs>;
@@ -13,7 +13,8 @@ const upsert_js_1 = require("../core/upsert.js");
13
13
  /**
14
14
  * Creates a Prisma extension that adds audit logging
15
15
  */
16
- function auditLogExtension(options = { enabled: true }) {
16
+ function auditLogExtension(opts = {}) {
17
+ const options = { enabled: true, ...opts };
17
18
  return extension_1.Prisma.defineExtension((prisma) => {
18
19
  return prisma.$extends({
19
20
  name: "auditLogExtension",
@@ -39,6 +39,9 @@ function maskAndTruncate(value, opts, keyPath = []) {
39
39
  const limited = maxArrayLength ? value.slice(0, maxArrayLength) : value;
40
40
  return limited.map((v, i) => maskAndTruncate(v, opts, [...keyPath, String(i)]));
41
41
  }
42
+ if (typeof value === "bigint") {
43
+ return value.toString();
44
+ }
42
45
  // Handle Decimal type from Prisma
43
46
  if (value &&
44
47
  typeof value === "object" &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explita/prisma-audit-log",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "A Prisma extension for automatic audit logging",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",