@intelligo-dev/audit 1.0.0-beta.1 → 1.0.0-beta.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.
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +6 -2
- package/dist/db/schema.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/dist/db/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,WAAW,CAAC,YAAY,CAAC;AACzD,MAAM,MAAM,gBAAgB,GAAG,OAAO,WAAW,CAAC,YAAY,CAAC"}
|
package/dist/db/schema.js
CHANGED
|
@@ -15,9 +15,13 @@ import { pgTable, text, timestamp, jsonb, index } from "drizzle-orm/pg-core";
|
|
|
15
15
|
import { organization, users } from "@intelligo-dev/core/db/schema";
|
|
16
16
|
export const auditEvents = pgTable("audit_events", {
|
|
17
17
|
id: text("id").primaryKey(),
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Null for platform-level events with no tenant — and, since
|
|
20
|
+
* migration 0041, for events whose workspace was since deleted:
|
|
21
|
+
* the trail outlives the tenant (set null, not cascade).
|
|
22
|
+
*/
|
|
19
23
|
workspaceId: text("workspace_id").references(() => organization.id, {
|
|
20
|
-
onDelete: "
|
|
24
|
+
onDelete: "set null",
|
|
21
25
|
}),
|
|
22
26
|
/** Null for system actors (cron, webhook, job runner). */
|
|
23
27
|
actorId: text("actor_id").references(() => users.id, {
|
package/dist/db/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAChC,cAAc,EACd;IACE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAChC,cAAc,EACd;IACE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UA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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export declare function queryAuditEvents(options?: QueryAuditEventsOptions): Pro
|
|
|
96
96
|
metadata: Record<string, unknown> | null;
|
|
97
97
|
createdAt: Date;
|
|
98
98
|
}[]>;
|
|
99
|
-
export { auditEvents } from "./db/schema";
|
|
100
|
-
export type { AuditEvent, InsertAuditEvent } from "./db/schema";
|
|
101
|
-
export type { AuditTargetKind as MemoryAuditTargetKind, AuditAction as MemoryAuditAction, AuditActorKind as MemoryAuditActorKind, UserMemoryAuditRow, InsertUserMemoryAudit, RecordMemoryAuditInput, } from "./memory-audit";
|
|
99
|
+
export { auditEvents } from "./db/schema.js";
|
|
100
|
+
export type { AuditEvent, InsertAuditEvent } from "./db/schema.js";
|
|
101
|
+
export type { AuditTargetKind as MemoryAuditTargetKind, AuditAction as MemoryAuditAction, AuditActorKind as MemoryAuditActorKind, UserMemoryAuditRow, InsertUserMemoryAudit, RecordMemoryAuditInput, } from "./memory-audit.js";
|
|
102
102
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { db } from "@intelligo-dev/core/db";
|
|
10
10
|
import { createLogger } from "@intelligo-dev/core/logger";
|
|
11
11
|
import { and, desc, eq, lt } from "drizzle-orm";
|
|
12
|
-
import { auditEvents } from "./db/schema";
|
|
12
|
+
import { auditEvents } from "./db/schema.js";
|
|
13
13
|
const log = createLogger("Audit");
|
|
14
14
|
const sinks = new Map();
|
|
15
15
|
/** Register (or replace) a sink under a stable name. */
|
|
@@ -106,5 +106,5 @@ export async function queryAuditEvents(options = {}) {
|
|
|
106
106
|
.orderBy(desc(auditEvents.createdAt))
|
|
107
107
|
.limit(Math.min(options.limit ?? 50, 500));
|
|
108
108
|
}
|
|
109
|
-
export { auditEvents } from "./db/schema";
|
|
109
|
+
export { auditEvents } from "./db/schema.js";
|
|
110
110
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intelligo-dev/audit",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"drizzle-orm": "^0.45.1",
|
|
27
|
-
"@intelligo-dev/core": "1.0.0-beta.
|
|
27
|
+
"@intelligo-dev/core": "1.0.0-beta.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^22.0.0",
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
"scripts": {
|
|
40
40
|
"type-check": "tsc --noEmit",
|
|
41
41
|
"lint": "eslint .",
|
|
42
|
-
"build": "tsc -p tsconfig.build.json"
|
|
42
|
+
"build": "tsc -p tsconfig.build.json && node ../../scripts/fix-esm-extensions.mjs dist"
|
|
43
43
|
}
|
|
44
44
|
}
|