@replayio-app-building/netlify-recorder 0.38.0 → 0.40.0

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1390,6 +1390,10 @@ async function ensureRequestRecording(sql, requestId, options) {
1390
1390
  }
1391
1391
 
1392
1392
  // src/databaseAudit.ts
1393
+ function sqlRaw(sql, query) {
1394
+ const strings = Object.assign([query], { raw: [query] });
1395
+ return sql(strings);
1396
+ }
1393
1397
  async function databaseAuditEnsureLogTable(sql) {
1394
1398
  await sql`
1395
1399
  CREATE TABLE IF NOT EXISTS audit_log (
@@ -1468,10 +1472,12 @@ async function databaseAuditMonitorTable(sql, tableName, primaryKeyColumn = "id"
1468
1472
  throw new Error(`Invalid primary key column name: ${primaryKeyColumn}`);
1469
1473
  }
1470
1474
  const triggerName = `audit_trigger_${tableName}`;
1471
- await sql(
1475
+ await sqlRaw(
1476
+ sql,
1472
1477
  `DROP TRIGGER IF EXISTS ${triggerName} ON "${tableName}"`
1473
1478
  );
1474
- await sql(
1479
+ await sqlRaw(
1480
+ sql,
1475
1481
  `CREATE TRIGGER ${triggerName} AFTER INSERT OR UPDATE OR DELETE ON "${tableName}" FOR EACH ROW EXECUTE FUNCTION audit_trigger_function('${primaryKeyColumn}')`
1476
1482
  );
1477
1483
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replayio-app-building/netlify-recorder",
3
- "version": "0.38.0",
3
+ "version": "0.40.0",
4
4
  "description": "Capture and replay Netlify function executions as Replay recordings",
5
5
  "type": "module",
6
6
  "exports": {