@objectstack/plugin-audit 7.2.1 → 7.4.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.
- package/dist/index.d.mts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +1415 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1423 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -18,11 +18,43 @@ declare class AuditPlugin implements Plugin {
|
|
|
18
18
|
start(ctx: PluginContext): Promise<void>;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Minimal structural view of `NotificationService.emit` (ADR-0030). Declared
|
|
23
|
+
* locally so plugin-audit takes no runtime dependency on service-messaging — it
|
|
24
|
+
* resolves whatever object is registered under the `messaging` service at hook
|
|
25
|
+
* time and routes collaboration notifications through the single ingress.
|
|
26
|
+
*/
|
|
27
|
+
interface MessagingEmitSurface {
|
|
28
|
+
emit(input: {
|
|
29
|
+
topic: string;
|
|
30
|
+
audience: string[];
|
|
31
|
+
payload?: Record<string, unknown>;
|
|
32
|
+
severity?: 'info' | 'warning' | 'critical';
|
|
33
|
+
dedupKey?: string;
|
|
34
|
+
source?: {
|
|
35
|
+
object: string;
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
actorId?: string;
|
|
39
|
+
organizationId?: string;
|
|
40
|
+
}): Promise<unknown>;
|
|
41
|
+
}
|
|
42
|
+
/** Options for {@link installAuditWriters}. */
|
|
43
|
+
interface AuditWriterOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Lazily resolve the messaging service so collaboration `@mention` /
|
|
46
|
+
* assignment notifications go through the ADR-0030 single ingress rather than
|
|
47
|
+
* writing `sys_notification` directly. Returns `undefined` when messaging is
|
|
48
|
+
* not installed — those notifications are then skipped (no pipeline, no bell),
|
|
49
|
+
* matching the `notify` node's degradation.
|
|
50
|
+
*/
|
|
51
|
+
getMessaging?(): MessagingEmitSurface | undefined;
|
|
52
|
+
}
|
|
21
53
|
/**
|
|
22
54
|
* Install audit + activity writers on the given engine. Idempotent per
|
|
23
55
|
* `packageId` — calling twice with the same id replaces the previous
|
|
24
56
|
* registration.
|
|
25
57
|
*/
|
|
26
|
-
declare function installAuditWriters(engine: any, packageId?: string): void;
|
|
58
|
+
declare function installAuditWriters(engine: any, packageId?: string, opts?: AuditWriterOptions): void;
|
|
27
59
|
|
|
28
60
|
export { AuditPlugin, installAuditWriters };
|
package/dist/index.d.ts
CHANGED
|
@@ -18,11 +18,43 @@ declare class AuditPlugin implements Plugin {
|
|
|
18
18
|
start(ctx: PluginContext): Promise<void>;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Minimal structural view of `NotificationService.emit` (ADR-0030). Declared
|
|
23
|
+
* locally so plugin-audit takes no runtime dependency on service-messaging — it
|
|
24
|
+
* resolves whatever object is registered under the `messaging` service at hook
|
|
25
|
+
* time and routes collaboration notifications through the single ingress.
|
|
26
|
+
*/
|
|
27
|
+
interface MessagingEmitSurface {
|
|
28
|
+
emit(input: {
|
|
29
|
+
topic: string;
|
|
30
|
+
audience: string[];
|
|
31
|
+
payload?: Record<string, unknown>;
|
|
32
|
+
severity?: 'info' | 'warning' | 'critical';
|
|
33
|
+
dedupKey?: string;
|
|
34
|
+
source?: {
|
|
35
|
+
object: string;
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
actorId?: string;
|
|
39
|
+
organizationId?: string;
|
|
40
|
+
}): Promise<unknown>;
|
|
41
|
+
}
|
|
42
|
+
/** Options for {@link installAuditWriters}. */
|
|
43
|
+
interface AuditWriterOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Lazily resolve the messaging service so collaboration `@mention` /
|
|
46
|
+
* assignment notifications go through the ADR-0030 single ingress rather than
|
|
47
|
+
* writing `sys_notification` directly. Returns `undefined` when messaging is
|
|
48
|
+
* not installed — those notifications are then skipped (no pipeline, no bell),
|
|
49
|
+
* matching the `notify` node's degradation.
|
|
50
|
+
*/
|
|
51
|
+
getMessaging?(): MessagingEmitSurface | undefined;
|
|
52
|
+
}
|
|
21
53
|
/**
|
|
22
54
|
* Install audit + activity writers on the given engine. Idempotent per
|
|
23
55
|
* `packageId` — calling twice with the same id replaces the previous
|
|
24
56
|
* registration.
|
|
25
57
|
*/
|
|
26
|
-
declare function installAuditWriters(engine: any, packageId?: string): void;
|
|
58
|
+
declare function installAuditWriters(engine: any, packageId?: string, opts?: AuditWriterOptions): void;
|
|
27
59
|
|
|
28
60
|
export { AuditPlugin, installAuditWriters };
|