@frigear-nu/audit-log 0.0.0-stage → 0.0.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 (40) hide show
  1. package/README.md +28 -2
  2. package/dist/module.d.mts +122 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +96 -0
  5. package/dist/runtime/access.d.ts +1 -0
  6. package/dist/runtime/access.js +17 -0
  7. package/dist/runtime/app/pages/admin.d.vue.ts +3 -0
  8. package/dist/runtime/app/pages/admin.vue +285 -0
  9. package/dist/runtime/app/pages/admin.vue.d.ts +3 -0
  10. package/dist/runtime/app/widgets/RecentActivity.d.vue.ts +6 -0
  11. package/dist/runtime/app/widgets/RecentActivity.vue +73 -0
  12. package/dist/runtime/app/widgets/RecentActivity.vue.d.ts +6 -0
  13. package/dist/runtime/i18n/lang/da.json +80 -0
  14. package/dist/runtime/i18n/lang/en.json +80 -0
  15. package/dist/runtime/menus/admin.d.ts +2 -0
  16. package/dist/runtime/menus/admin.js +18 -0
  17. package/dist/runtime/server/db/schema.postgresql.d.ts +179 -0
  18. package/dist/runtime/server/db/schema.postgresql.js +26 -0
  19. package/dist/runtime/server/db/schema.sqlite.d.ts +195 -0
  20. package/dist/runtime/server/db/schema.sqlite.js +26 -0
  21. package/dist/runtime/server/routes/admin/audit.get.d.ts +2 -0
  22. package/dist/runtime/server/routes/admin/audit.get.js +21 -0
  23. package/dist/runtime/server/routes/admin/export.get.d.ts +2 -0
  24. package/dist/runtime/server/routes/admin/export.get.js +48 -0
  25. package/dist/runtime/server/routes/admin/modules.get.d.ts +2 -0
  26. package/dist/runtime/server/routes/admin/modules.get.js +8 -0
  27. package/dist/runtime/server/tasks/prune.d.ts +2 -0
  28. package/dist/runtime/server/tasks/prune.js +10 -0
  29. package/dist/runtime/server/utils/audit-schemas.d.ts +68 -0
  30. package/dist/runtime/server/utils/audit-schemas.js +30 -0
  31. package/dist/runtime/server/utils/audit.d.ts +48 -0
  32. package/dist/runtime/server/utils/audit.js +110 -0
  33. package/dist/runtime/utils/api.d.ts +13 -0
  34. package/dist/runtime/utils/api.js +14 -0
  35. package/dist/runtime/utils/index.d.ts +1 -0
  36. package/dist/runtime/utils/index.js +1 -0
  37. package/dist/runtime/utils/kinds.d.ts +21 -0
  38. package/dist/runtime/utils/kinds.js +16 -0
  39. package/dist/types.d.mts +3 -0
  40. package/package.json +97 -3
@@ -0,0 +1,48 @@
1
+ import { db, schema } from "@nuxthub/db";
2
+ import { desc } from "drizzle-orm";
3
+ import { setResponseHeaders } from "h3";
4
+ import { toCsv } from "@frigear-nu/module-kit/server";
5
+ import { auditAccess } from "../../../access.js";
6
+ import { AUDIT_EXPORT_MAX_ROWS, AUDIT_MODULE } from "../../../utils/kinds.js";
7
+ const BATCH = 1e3;
8
+ const HEADER = ["Time", "Action", "Kind", "Module", "Actor ID", "Actor", "Credential", "Target type", "Target ID", "Data"];
9
+ export default defineEventHandler(async (event) => {
10
+ await authorize(event, auditAccess.permissions["audit-export:pii"]);
11
+ const query = await getValidatedQuery(event, auditExportQuery.parse);
12
+ const log = schema.auditLog;
13
+ const where = auditWhere(query);
14
+ const rows = [];
15
+ for (let offset = 0; offset < AUDIT_EXPORT_MAX_ROWS; offset += BATCH) {
16
+ const batch = await db.select().from(log).where(where).orderBy(desc(log.createdAt), desc(log.id)).limit(Math.min(BATCH, AUDIT_EXPORT_MAX_ROWS - offset)).offset(offset);
17
+ const actors = await auditActorRefs(batch.map((row) => row.actorId));
18
+ for (const row of batch) {
19
+ const entry = toAuditEntryDto(row, row.actorId ? actors.get(row.actorId) ?? null : null);
20
+ rows.push([
21
+ entry.createdAt,
22
+ entry.action,
23
+ entry.kind,
24
+ entry.module,
25
+ entry.actorId ?? "",
26
+ entry.actor?.name ?? "",
27
+ entry.credential,
28
+ entry.targetType ?? "",
29
+ entry.targetId ?? "",
30
+ entry.data ? JSON.stringify(entry.data) : ""
31
+ ]);
32
+ }
33
+ if (batch.length < BATCH) break;
34
+ }
35
+ await recordDownload(event, {
36
+ action: "audit.exported",
37
+ module: AUDIT_MODULE,
38
+ format: "csv",
39
+ rowCount: rows.length,
40
+ filters: auditExportFilters(query)
41
+ });
42
+ setResponseHeaders(event, {
43
+ "content-type": "text/csv; charset=utf-8",
44
+ "content-disposition": 'attachment; filename="audit-log.csv"',
45
+ "cache-control": "no-store"
46
+ });
47
+ return toCsv([HEADER, ...rows]);
48
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { db, schema } from "@nuxthub/db";
2
+ import { asc } from "drizzle-orm";
3
+ import { auditAccess } from "../../../access.js";
4
+ export default defineEventHandler(async (event) => {
5
+ await authorize(event, auditAccess.permissions.pii);
6
+ const rows = await db.selectDistinct({ module: schema.auditLog.module }).from(schema.auditLog).orderBy(asc(schema.auditLog.module));
7
+ return rows.map((row) => row.module);
8
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ export default defineTask({
2
+ meta: {
3
+ name: "audit:prune",
4
+ description: "Delete audit log entries older than the retention period."
5
+ },
6
+ async run({ payload }) {
7
+ const now = typeof payload?.now === "string" && !Number.isNaN(Date.parse(payload.now)) ? new Date(payload.now) : void 0;
8
+ return { result: await auditPrune({ now }) };
9
+ }
10
+ });
@@ -0,0 +1,68 @@
1
+ import { z } from 'zod';
2
+ /** The filters of the list and the export, which match the same rows. */
3
+ export declare const auditFilters: {
4
+ kind: z.ZodOptional<z.ZodEnum<{
5
+ change: "change";
6
+ other: "other";
7
+ download: "download";
8
+ access: "access";
9
+ security: "security";
10
+ }>>;
11
+ module: z.ZodOptional<z.ZodString>;
12
+ action: z.ZodOptional<z.ZodString>;
13
+ actorId: z.ZodOptional<z.ZodString>;
14
+ /** From this moment on (inclusive). */
15
+ from: z.ZodOptional<z.ZodString>;
16
+ /** Up to this moment; a bare date includes the whole day. */
17
+ to: z.ZodOptional<z.ZodString>;
18
+ };
19
+ /** `GET /api/admin/audit`: newest first, 50 a page. */
20
+ export declare const auditListQuery: z.ZodObject<{
21
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
22
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
23
+ q: z.ZodOptional<z.ZodString>;
24
+ sort: z.ZodDefault<z.ZodEnum<{
25
+ createdAt: "createdAt";
26
+ }>>;
27
+ order: z.ZodDefault<z.ZodEnum<{
28
+ asc: "asc";
29
+ desc: "desc";
30
+ }>>;
31
+ kind: z.ZodOptional<z.ZodEnum<{
32
+ change: "change";
33
+ other: "other";
34
+ download: "download";
35
+ access: "access";
36
+ security: "security";
37
+ }>>;
38
+ module: z.ZodOptional<z.ZodString>;
39
+ action: z.ZodOptional<z.ZodString>;
40
+ actorId: z.ZodOptional<z.ZodString>;
41
+ from: z.ZodOptional<z.ZodString>;
42
+ to: z.ZodOptional<z.ZodString>;
43
+ }, z.core.$strip>;
44
+ /** `GET /api/admin/audit/export`: the list's filters and search, no page. */
45
+ export declare const auditExportQuery: z.ZodObject<{
46
+ kind: z.ZodOptional<z.ZodEnum<{
47
+ change: "change";
48
+ other: "other";
49
+ download: "download";
50
+ access: "access";
51
+ security: "security";
52
+ }>>;
53
+ module: z.ZodOptional<z.ZodString>;
54
+ action: z.ZodOptional<z.ZodString>;
55
+ actorId: z.ZodOptional<z.ZodString>;
56
+ from: z.ZodOptional<z.ZodString>;
57
+ to: z.ZodOptional<z.ZodString>;
58
+ q: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$strip>;
60
+ export type AuditFilterQuery = z.infer<typeof auditExportQuery>;
61
+ /** The bounds of `from` / `to` as dates: `to` as an exclusive end (the next day for a bare date). */
62
+ export declare function auditDateRange(query: {
63
+ from?: string;
64
+ to?: string;
65
+ }): {
66
+ from?: Date;
67
+ before?: Date;
68
+ };
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ import { pageQuery } from "@frigear-nu/module-kit/server";
3
+ import { AUDIT_KINDS } from "../../utils/kinds.js";
4
+ const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
5
+ const DAY_MS = 24 * 60 * 60 * 1e3;
6
+ const isoDateParam = z.string().trim().max(40).refine((value) => !Number.isNaN(Date.parse(value)), { message: "Expected an ISO date" });
7
+ export const auditFilters = {
8
+ kind: z.enum(AUDIT_KINDS).optional(),
9
+ module: z.string().trim().min(1).max(64).optional(),
10
+ action: z.string().trim().min(1).max(128).optional(),
11
+ actorId: z.string().trim().min(1).max(64).optional(),
12
+ /** From this moment on (inclusive). */
13
+ from: isoDateParam.optional(),
14
+ /** Up to this moment; a bare date includes the whole day. */
15
+ to: isoDateParam.optional()
16
+ };
17
+ export const auditListQuery = pageQuery({
18
+ sort: ["createdAt"],
19
+ defaultPageSize: 50,
20
+ filters: auditFilters
21
+ });
22
+ export const auditExportQuery = z.object({
23
+ q: z.string().trim().max(200).optional(),
24
+ ...auditFilters
25
+ });
26
+ export function auditDateRange(query) {
27
+ const from = query.from ? new Date(query.from) : void 0;
28
+ const before = query.to ? new Date(new Date(query.to).getTime() + (DATE_ONLY.test(query.to) ? DAY_MS : 1)) : void 0;
29
+ return { from, before };
30
+ }
@@ -0,0 +1,48 @@
1
+ import type { H3Event } from 'h3';
2
+ import { schema } from '@nuxthub/db';
3
+ import type { SQL } from 'drizzle-orm';
4
+ import type { AuditActorDto, AuditCredential, AuditDownloadInput, AuditEntryDto, AuditEntryInput } from '../../../types.js';
5
+ import type { AuditFilterQuery } from './audit-schemas.js';
6
+ /** A row of `audit_log`. */
7
+ export type AuditLogRow = typeof schema.auditLog.$inferSelect;
8
+ /** An entry as `audit:pii` holders get it; `actor` is the user the row names, when they still exist. */
9
+ export declare function toAuditEntryDto(row: AuditLogRow, actor?: AuditActorDto | null): AuditEntryDto;
10
+ /** The names of the actors among `ids`, by id, in one batch (`loadUserRefs` of `@frigear-nu/users`). */
11
+ export declare function auditActorRefs(ids: Array<string | null | undefined>): Promise<Map<string, AuditActorDto>>;
12
+ /** Who called and how, from the auth context of `event` (`getAuth`): the user's id and the credential kind. */
13
+ export declare function auditCallerOf(event: H3Event | undefined): Promise<{
14
+ actorId: string | null;
15
+ credential: AuditCredential;
16
+ }>;
17
+ /**
18
+ * Records that the caller of `event` did something: the actor and how they called (session, token, OAuth) come from the
19
+ * request's auth context. A failure is logged and never fails the request, since the action it records has happened.
20
+ * Calls the `audit:recorded` Nitro hook with the stored entry. Answers the entry, or `null` when it was not written.
21
+ *
22
+ * await recordAudit(event, { action: 'teams.member.removed', kind: 'change', module: 'teams', target: { type: 'team', id: team.id } })
23
+ */
24
+ export declare function recordAudit(event: H3Event, input: AuditEntryInput): Promise<AuditEntryDto | null>;
25
+ /** Records something the system did, without a request: a task, a webhook. The actor is `null` unless given. */
26
+ export declare function recordSystemAudit(input: AuditEntryInput): Promise<AuditEntryDto | null>;
27
+ /**
28
+ * Records a download (`kind: 'download'`) with the same `data` for every module: `{ format, rowCount, filters }`. Every
29
+ * route that sends people's data as a file calls it. Keep free-text search terms out of `filters`.
30
+ *
31
+ * await recordDownload(event, { action: 'subscriptions.members.exported', module: 'subscriptions', format: 'csv', rowCount: rows.length, filters })
32
+ */
33
+ export declare function recordDownload(event: H3Event, input: AuditDownloadInput): Promise<AuditEntryDto | null>;
34
+ /** The `where` of the list and the export: every filter that is set, and `q` on the action or the target id. */
35
+ export declare function auditWhere(query: AuditFilterQuery): SQL | undefined;
36
+ /** The filters an export applied, for its own entry: the search term itself is left out (`searched: true`). */
37
+ export declare function auditExportFilters(query: AuditFilterQuery): Record<string, unknown>;
38
+ /**
39
+ * Deletes the entries older than `days` (`auditLog.retentionDays` unless given) and records the prune
40
+ * (`audit.pruned`, with the count and the cutoff) when it removed any. Does nothing without a retention period.
41
+ */
42
+ export declare function auditPrune(options?: {
43
+ now?: Date;
44
+ days?: number;
45
+ }): Promise<{
46
+ deleted: number;
47
+ before: string | null;
48
+ }>;
@@ -0,0 +1,110 @@
1
+ import { db, schema } from "@nuxthub/db";
2
+ import { and, count, eq, gte, lt, or } from "drizzle-orm";
3
+ import { isoDate, likeContains } from "@frigear-nu/module-kit/server";
4
+ import { newId } from "@frigear-nu/module-kit/id";
5
+ import { AUDIT_MODULE } from "../../utils/kinds.js";
6
+ import { auditDateRange } from "./audit-schemas.js";
7
+ const DAY_MS = 24 * 60 * 60 * 1e3;
8
+ export function toAuditEntryDto(row, actor = null) {
9
+ return {
10
+ id: row.id,
11
+ action: row.action,
12
+ kind: row.kind,
13
+ module: row.module,
14
+ actorId: row.actorId ?? null,
15
+ actor,
16
+ credential: row.credential,
17
+ targetType: row.targetType ?? null,
18
+ targetId: row.targetId ?? null,
19
+ data: row.data ?? null,
20
+ createdAt: isoDate(row.createdAt)
21
+ };
22
+ }
23
+ export async function auditActorRefs(ids) {
24
+ const refs = /* @__PURE__ */ new Map();
25
+ for (const ref of (await loadUserRefs(ids)).values()) refs.set(String(ref.id), { id: ref.id, name: ref.name });
26
+ return refs;
27
+ }
28
+ export async function auditCallerOf(event) {
29
+ if (!event) return { actorId: null, credential: "system" };
30
+ const principal = await getAuth(event);
31
+ if (!principal?.user) return { actorId: null, credential: "anonymous" };
32
+ const credential = principal.kind === "user-token" ? "token" : principal.kind === "oauth" ? "oauth" : "session";
33
+ return { actorId: String(principal.user.id), credential };
34
+ }
35
+ async function writeAudit(event, input) {
36
+ let entry;
37
+ try {
38
+ const caller = await auditCallerOf(event);
39
+ const actorId = input.actorId === void 0 ? caller.actorId : input.actorId === null ? null : String(input.actorId);
40
+ const [row] = await db.insert(schema.auditLog).values({
41
+ id: newId("aud"),
42
+ action: input.action,
43
+ kind: input.kind,
44
+ module: input.module,
45
+ actorId,
46
+ credential: caller.credential,
47
+ targetType: input.target?.type ?? null,
48
+ targetId: input.target ? String(input.target.id) : null,
49
+ data: input.data ?? null
50
+ }).returning();
51
+ entry = toAuditEntryDto(row);
52
+ } catch (error) {
53
+ console.error(`[audit-log] could not record "${input.action}"`, error);
54
+ return null;
55
+ }
56
+ try {
57
+ await useNitroApp().hooks.callHook("audit:recorded", { entry });
58
+ } catch (error) {
59
+ console.error(`[audit-log] an audit:recorded listener failed for "${input.action}"`, error);
60
+ }
61
+ return entry;
62
+ }
63
+ export function recordAudit(event, input) {
64
+ return writeAudit(event, input);
65
+ }
66
+ export function recordSystemAudit(input) {
67
+ return writeAudit(void 0, input);
68
+ }
69
+ export function recordDownload(event, input) {
70
+ return writeAudit(event, {
71
+ action: input.action,
72
+ kind: "download",
73
+ module: input.module,
74
+ target: input.target,
75
+ data: { ...input.data, format: input.format, rowCount: input.rowCount, filters: input.filters ?? {} }
76
+ });
77
+ }
78
+ export function auditWhere(query) {
79
+ const log = schema.auditLog;
80
+ const conditions = [];
81
+ if (query.kind) conditions.push(eq(log.kind, query.kind));
82
+ if (query.module) conditions.push(eq(log.module, query.module));
83
+ if (query.action) conditions.push(eq(log.action, query.action));
84
+ if (query.actorId) conditions.push(eq(log.actorId, query.actorId));
85
+ const { from, before } = auditDateRange(query);
86
+ if (from) conditions.push(gte(log.createdAt, from));
87
+ if (before) conditions.push(lt(log.createdAt, before));
88
+ if (query.q) conditions.push(or(likeContains(log.action, query.q), likeContains(log.targetId, query.q)));
89
+ return conditions.length ? and(...conditions) : void 0;
90
+ }
91
+ export function auditExportFilters(query) {
92
+ const { q, ...filters } = query;
93
+ const applied = Object.fromEntries(Object.entries(filters).filter(([, value]) => value !== void 0 && value !== ""));
94
+ if (q) applied.searched = true;
95
+ return applied;
96
+ }
97
+ export async function auditPrune(options = {}) {
98
+ const config = useRuntimeConfig().auditLog;
99
+ const days = Math.floor(options.days ?? Number(config?.retentionDays ?? 0));
100
+ if (!Number.isFinite(days) || days <= 0) return { deleted: 0, before: null };
101
+ const before = new Date((options.now ?? /* @__PURE__ */ new Date()).getTime() - days * DAY_MS);
102
+ const where = lt(schema.auditLog.createdAt, before);
103
+ const [totals] = await db.select({ total: count() }).from(schema.auditLog).where(where);
104
+ const deleted = Number(totals?.total ?? 0);
105
+ if (deleted) {
106
+ await db.delete(schema.auditLog).where(where);
107
+ await recordSystemAudit({ action: "audit.pruned", kind: "change", module: AUDIT_MODULE, data: { count: deleted, days, before: before.toISOString() } });
108
+ }
109
+ return { deleted, before: before.toISOString() };
110
+ }
@@ -0,0 +1,13 @@
1
+ export declare const auditApi: {
2
+ readonly admin: {
3
+ /**
4
+ * `GET` one page of entries, newest first (`audit:pii`): `page`, `pageSize`, `q` (action or target id), `kind`,
5
+ * `module`, `action`, `actorId`, `from` and `to` (ISO dates; a bare `to` date includes that day).
6
+ */
7
+ readonly list: "/api/admin/audit";
8
+ /** `GET` the modules that recorded entries, for the module filter (`audit:pii`). */
9
+ readonly modules: "/api/admin/audit/modules";
10
+ /** `GET` every entry the same filters match, as CSV (`audit-export:pii`). The export is recorded itself. */
11
+ readonly export: "/api/admin/audit/export";
12
+ };
13
+ };
@@ -0,0 +1,14 @@
1
+ const ADMIN_BASE = "/api/admin/audit";
2
+ export const auditApi = {
3
+ admin: {
4
+ /**
5
+ * `GET` one page of entries, newest first (`audit:pii`): `page`, `pageSize`, `q` (action or target id), `kind`,
6
+ * `module`, `action`, `actorId`, `from` and `to` (ISO dates; a bare `to` date includes that day).
7
+ */
8
+ list: ADMIN_BASE,
9
+ /** `GET` the modules that recorded entries, for the module filter (`audit:pii`). */
10
+ modules: `${ADMIN_BASE}/modules`,
11
+ /** `GET` every entry the same filters match, as CSV (`audit-export:pii`). The export is recorded itself. */
12
+ export: `${ADMIN_BASE}/export`
13
+ }
14
+ };
@@ -0,0 +1 @@
1
+ export * from './kinds.js';
@@ -0,0 +1 @@
1
+ export * from "./kinds.js";
@@ -0,0 +1,21 @@
1
+ /** Every kind, `download` first: the viewer's kind filter lists them in this order. */
2
+ export declare const AUDIT_KINDS: readonly ["download", "change", "access", "security", "other"];
3
+ export declare const AUDIT_CREDENTIALS: readonly ["session", "token", "oauth", "system", "anonymous"];
4
+ /** The badge colour of each kind in the viewer. */
5
+ export declare const AUDIT_KIND_COLORS: {
6
+ readonly download: "info";
7
+ readonly change: "neutral";
8
+ readonly access: "neutral";
9
+ readonly security: "warning";
10
+ readonly other: "neutral";
11
+ };
12
+ /** The module name the audit log records its own entries under (`audit.exported`, `audit.pruned`). */
13
+ export declare const AUDIT_MODULE = "audit-log";
14
+ /** The most rows one CSV export holds; the rest of a larger match is left out (narrow the filters). */
15
+ export declare const AUDIT_EXPORT_MAX_ROWS = 50000;
16
+ /**
17
+ * An action id as words, for an action no module labelled: the module segment dropped (it shows next to it), the rest
18
+ * split on dots, dashes, underscores and camel case, first letter capitalised. `teams.member.removed` is
19
+ * "Member removed", `forms.submissionsExported` is "Submissions exported".
20
+ */
21
+ export declare function auditActionWords(action: string): string;
@@ -0,0 +1,16 @@
1
+ export const AUDIT_KINDS = ["download", "change", "access", "security", "other"];
2
+ export const AUDIT_CREDENTIALS = ["session", "token", "oauth", "system", "anonymous"];
3
+ export const AUDIT_KIND_COLORS = {
4
+ download: "info",
5
+ change: "neutral",
6
+ access: "neutral",
7
+ security: "warning",
8
+ other: "neutral"
9
+ };
10
+ export const AUDIT_MODULE = "audit-log";
11
+ export const AUDIT_EXPORT_MAX_ROWS = 5e4;
12
+ export function auditActionWords(action) {
13
+ const parts = action.split(".").filter(Boolean);
14
+ const words = (parts.length > 1 ? parts.slice(1) : parts).join(" ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[-_\s]+/g, " ").trim().toLowerCase();
15
+ return words ? words.charAt(0).toUpperCase() + words.slice(1) : action;
16
+ }
@@ -0,0 +1,3 @@
1
+ export { default } from './module.mjs'
2
+
3
+ export { type AuditActorDto, type AuditCredential, type AuditData, type AuditDownloadInput, type AuditEntryDto, type AuditEntryInput, type AuditKind, type AuditRecordedContext, type AuditRuntimeConfig, type AuditTarget, type ModuleOptions, type PublicModuleOptions } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,100 @@
1
1
  {
2
2
  "name": "@frigear-nu/audit-log",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.0",
4
+ "description": "An append-only audit log for the frigear ecosystem: modules record who downloaded, changed or reached what with one server call, and staff review and export the log at /admin/audit-log.",
5
+ "keywords": [
6
+ "frigear-module",
7
+ "nuxt-module"
8
+ ],
9
+ "homepage": "https://docs.frigear.dev/modules/platform/audit-log",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/Frigear-nu/frigear-nu.git",
13
+ "directory": "packages/audit-log"
14
+ },
15
+ "license": "MIT",
16
+ "type": "module",
17
+ "main": "./dist/module.mjs",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/types.d.mts",
21
+ "import": "./dist/module.mjs",
22
+ "default": "./dist/module.mjs"
23
+ },
24
+ "./utils": {
25
+ "types": "./dist/runtime/utils/index.d.ts",
26
+ "import": "./dist/runtime/utils/index.js",
27
+ "default": "./dist/runtime/utils/index.js"
28
+ },
29
+ "./api": {
30
+ "types": "./dist/runtime/utils/api.d.ts",
31
+ "import": "./dist/runtime/utils/api.js",
32
+ "default": "./dist/runtime/utils/api.js"
33
+ }
34
+ },
35
+ "files": [
36
+ "dist"
37
+ ],
38
+ "dependencies": {
39
+ "@frigear-nu/auth": "^0.6.10",
40
+ "@frigear-nu/module-kit": "^1.3.13",
41
+ "@frigear-nu/ui": "^0.2.12",
42
+ "@frigear-nu/users": "^3.1.6",
43
+ "@libsql/client": "^0.18.0",
44
+ "@nuxt/kit": "^4.6.4",
45
+ "drizzle-kit": "^0.31.11",
46
+ "drizzle-orm": "^0.45.4",
47
+ "h3": "^1.15.11",
48
+ "zod": "^4.6.7"
49
+ },
50
+ "peerDependencies": {
51
+ "@frigear-nu/admin": "^0.5.3",
52
+ "@frigear-nu/menu": "^0.4.2",
53
+ "@nuxt/ui": "^4.12.0",
54
+ "@nuxthub/core": "^0.10.12"
55
+ },
56
+ "peerDependenciesMeta": {
57
+ "@frigear-nu/admin": {
58
+ "optional": true
59
+ },
60
+ "@frigear-nu/menu": {
61
+ "optional": true
62
+ },
63
+ "@nuxt/ui": {
64
+ "optional": true
65
+ }
66
+ },
67
+ "devDependencies": {
68
+ "@frigear-nu/admin": "^0.5.3",
69
+ "@frigear-nu/menu": "^0.4.2",
70
+ "@frigear-nu/widget": "^0.4.4",
71
+ "@nuxt/devtools": "^4.2.0",
72
+ "@nuxt/eslint-config": "^1.17.0",
73
+ "@nuxt/module-builder": "^1.0.4",
74
+ "@nuxt/schema": "^4.6.4",
75
+ "@nuxt/test-utils": "^4.4.0",
76
+ "@nuxt/ui": "^4.12.0",
77
+ "@nuxthub/core": "^0.10.12",
78
+ "@types/node": "^26.6.6",
79
+ "eslint": "^10.15.0",
80
+ "nuxt": "^4.6.4",
81
+ "typescript": "^6.0.3",
82
+ "vitest": "^5.1.0",
83
+ "vue-tsc": "^3.3.14"
84
+ },
85
+ "scripts": {
86
+ "dev:stub": "nuxt-module-build build --stub && nuxt prepare",
87
+ "build": "nuxt-module-build build",
88
+ "lint": "eslint .",
89
+ "lint:fix": "eslint . --fix",
90
+ "test": "vitest run",
91
+ "test:watch": "vitest watch"
92
+ },
93
+ "typesVersions": {
94
+ "*": {
95
+ ".": [
96
+ "./dist/types.d.mts"
97
+ ]
98
+ }
99
+ }
6
100
  }