@murumets-ee/logging 0.16.4 → 0.16.5

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/plugin.d.mts CHANGED
@@ -6,11 +6,20 @@ interface LoggingPlugin {
6
6
  server: {
7
7
  tables: Record<string, PgTable<any>>;
8
8
  };
9
+ shared: {
10
+ pluginResources: Array<{
11
+ name: string;
12
+ actions: readonly string[];
13
+ }>;
14
+ };
9
15
  }
10
16
  /**
11
17
  * Logging plugin — registers the `toolkit_audit_logs` table so it shows up
12
- * in generated migrations. Zero runtime behavior; the audit logger is wired
13
- * up separately via `createAuditLogger()`.
18
+ * in generated migrations AND contributes the `audit-logs` permission
19
+ * resource so admins can grant audit-log read access via the Permissions
20
+ * UI without hand-declaring the resource in their app's pluginResources
21
+ * array. The audit logger itself is wired up separately via
22
+ * `createAuditLogger()`.
14
23
  *
15
24
  * @example
16
25
  * ```typescript
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;UAKU,aAAA;EACR,IAAA;EACA,MAAA;IAEE,MAAA,EAAQ,MAAA,SAAe,OAAA;EAAA;AAAA;;;;;;;;AAkB3B;;;;;;;iBAAgB,OAAA,CAAA,GAAW,aAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;UAKU,aAAA;EACR,IAAA;EACA,MAAA;IAEE,MAAA,EAAQ,MAAA,SAAe,OAAA;EAAA;EAEzB,MAAA;IAKE,eAAA,EAAiB,KAAA;MAAQ,IAAA;MAAc,OAAA;IAAA;EAAA;AAAA;;;;;;;;;;;AAqB3C;;;;;;;iBAAgB,OAAA,CAAA,GAAW,aAAA"}
package/dist/plugin.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{n as e}from"./audit-table-CrPP2ZZ9.mjs";function t(){return{name:`@murumets-ee/logging`,server:{tables:{toolkitAuditLogs:e}}}}export{t as logging};
1
+ import{n as e}from"./audit-table-CrPP2ZZ9.mjs";function t(){return{name:`@murumets-ee/logging`,server:{tables:{toolkitAuditLogs:e}},shared:{pluginResources:[{name:`audit-logs`,actions:[`view`]}]}}}export{t as logging};
2
2
  //# sourceMappingURL=plugin.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { PgTable } from 'drizzle-orm/pg-core'\nimport { toolkitAuditLogs } from './audit-table.js'\n\n// Structural Plugin shape — kept in sync with @murumets-ee/core. Not imported\n// from core because core depends on logging (circular dep would fail).\ninterface LoggingPlugin {\n name: string\n server: {\n // biome-ignore lint/suspicious/noExplicitAny: structural PgTable union from drizzle-orm — concrete row shape varies per table\n tables: Record<string, PgTable<any>>\n }\n}\n\n/**\n * Logging plugin — registers the `toolkit_audit_logs` table so it shows up\n * in generated migrations. Zero runtime behavior; the audit logger is wired\n * up separately via `createAuditLogger()`.\n *\n * @example\n * ```typescript\n * import { logging } from '@murumets-ee/logging/plugin'\n *\n * export default defineLumiConfig({\n * plugins: [logging()],\n * })\n * ```\n */\nexport function logging(): LoggingPlugin {\n return {\n name: '@murumets-ee/logging',\n server: {\n tables: { toolkitAuditLogs },\n },\n }\n}\n"],"mappings":"+CA2BA,SAAgB,GAAyB,CACvC,MAAO,CACL,KAAM,uBACN,OAAQ,CACN,OAAQ,CAAE,mBAAkB,CAC7B,CACF"}
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { PgTable } from 'drizzle-orm/pg-core'\nimport { toolkitAuditLogs } from './audit-table.js'\n\n// Structural Plugin shape — kept in sync with @murumets-ee/core. Not imported\n// from core because core depends on logging (circular dep would fail).\ninterface LoggingPlugin {\n name: string\n server: {\n // biome-ignore lint/suspicious/noExplicitAny: structural PgTable union from drizzle-orm — concrete row shape varies per table\n tables: Record<string, PgTable<any>>\n }\n shared: {\n // Mutable array to match the Plugin contract from @murumets-ee/core\n // (`pluginResources?: PluginResource[]`). Using `ReadonlyArray` here\n // would make `LoggingPlugin` non-assignable to `Plugin` because of\n // TypeScript's variance rules on mutable array properties.\n pluginResources: Array<{ name: string; actions: readonly string[] }>\n }\n}\n\n/**\n * Logging plugin — registers the `toolkit_audit_logs` table so it shows up\n * in generated migrations AND contributes the `audit-logs` permission\n * resource so admins can grant audit-log read access via the Permissions\n * UI without hand-declaring the resource in their app's pluginResources\n * array. The audit logger itself is wired up separately via\n * `createAuditLogger()`.\n *\n * @example\n * ```typescript\n * import { logging } from '@murumets-ee/logging/plugin'\n *\n * export default defineLumiConfig({\n * plugins: [logging()],\n * })\n * ```\n */\nexport function logging(): LoggingPlugin {\n return {\n name: '@murumets-ee/logging',\n server: {\n tables: { toolkitAuditLogs },\n },\n shared: {\n pluginResources: [{ name: 'audit-logs', actions: ['view'] }],\n },\n }\n}\n"],"mappings":"+CAqCA,SAAgB,GAAyB,CACvC,MAAO,CACL,KAAM,uBACN,OAAQ,CACN,OAAQ,CAAE,mBAAkB,CAC7B,CACD,OAAQ,CACN,gBAAiB,CAAC,CAAE,KAAM,aAAc,QAAS,CAAC,OAAO,CAAE,CAAC,CAC7D,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@murumets-ee/logging",
3
- "version": "0.16.4",
3
+ "version": "0.16.5",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -24,7 +24,7 @@
24
24
  "drizzle-orm": "^0.45.2",
25
25
  "pino": "^9.5.0",
26
26
  "zod": "^3.24.1",
27
- "@murumets-ee/db": "0.16.4"
27
+ "@murumets-ee/db": "0.16.5"
28
28
  },
29
29
  "devDependencies": {
30
30
  "tsdown": "^0.21.10",