@murumets-ee/logging 0.18.0 → 0.20.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/plugin.d.mts +35 -30
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +1 -1
- package/dist/plugin.mjs.map +1 -1
- package/package.json +4 -3
package/dist/plugin.d.mts
CHANGED
|
@@ -1,36 +1,41 @@
|
|
|
1
|
-
import { PgTable } from "drizzle-orm/pg-core";
|
|
2
|
-
|
|
3
1
|
//#region src/plugin.d.ts
|
|
4
|
-
|
|
5
|
-
name:
|
|
6
|
-
server: {
|
|
7
|
-
tables:
|
|
2
|
+
declare function logging(): {
|
|
3
|
+
readonly name: "@murumets-ee/logging";
|
|
4
|
+
readonly server: {
|
|
5
|
+
readonly tables: {
|
|
6
|
+
readonly toolkitAuditLogs: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
7
|
+
name: string;
|
|
8
|
+
schema: undefined;
|
|
9
|
+
columns: {
|
|
10
|
+
[x: string]: import("drizzle-orm/pg-core").PgColumn<{
|
|
11
|
+
name: string;
|
|
12
|
+
tableName: string;
|
|
13
|
+
dataType: import("drizzle-orm").ColumnDataType;
|
|
14
|
+
columnType: string;
|
|
15
|
+
data: unknown;
|
|
16
|
+
driverParam: unknown;
|
|
17
|
+
notNull: false;
|
|
18
|
+
hasDefault: false;
|
|
19
|
+
isPrimaryKey: false;
|
|
20
|
+
isAutoincrement: false;
|
|
21
|
+
hasRuntimeDefault: false;
|
|
22
|
+
enumValues: string[] | undefined;
|
|
23
|
+
baseColumn: never;
|
|
24
|
+
identity: undefined;
|
|
25
|
+
generated: undefined;
|
|
26
|
+
}, {}, {}>;
|
|
27
|
+
};
|
|
28
|
+
dialect: "pg";
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
8
31
|
};
|
|
9
|
-
shared: {
|
|
10
|
-
pluginResources:
|
|
11
|
-
name:
|
|
12
|
-
actions: readonly
|
|
13
|
-
}
|
|
32
|
+
readonly shared: {
|
|
33
|
+
readonly pluginResources: readonly [{
|
|
34
|
+
readonly name: "audit-logs";
|
|
35
|
+
readonly actions: readonly ["view"];
|
|
36
|
+
}];
|
|
14
37
|
};
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Logging plugin — registers the `toolkit_audit_logs` table so it shows up
|
|
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()`.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* import { logging } from '@murumets-ee/logging/plugin'
|
|
27
|
-
*
|
|
28
|
-
* export default defineLumiConfig({
|
|
29
|
-
* plugins: [logging()],
|
|
30
|
-
* })
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
declare function logging(): LoggingPlugin;
|
|
38
|
+
};
|
|
34
39
|
//#endregion
|
|
35
40
|
export { logging };
|
|
36
41
|
//# sourceMappingURL=plugin.d.mts.map
|
package/dist/plugin.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";iBAkDgB,OAAA,CAAA;EAAA"}
|
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}},shared:{pluginResources:[{name:`audit-logs`,actions:[`view`]}]}}}export{
|
|
1
|
+
import{n as e}from"./audit-table-CrPP2ZZ9.mjs";function t(e){return e}function n(){return t({name:`@murumets-ee/logging`,server:{tables:{toolkitAuditLogs:e}},shared:{pluginResources:[{name:`audit-logs`,actions:[`view`]}]}})}export{n as logging};
|
|
2
2
|
//# sourceMappingURL=plugin.mjs.map
|
package/dist/plugin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { Table } from 'drizzle-orm'\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).\n//\n// `Table` (the dialect-agnostic base from `drizzle-orm`) is used instead of\n// `PgTable<any>` because `PgTable<any>` is invariant on its config (the\n// `<any>` kills covariant variance through `_.config`), and narrow\n// `PgTableWithColumns<{...}>` literals captured by `<const P>` inference\n// in `definePlugin` would fail to assign to it. `Table` is drizzle's own\n// canonical accept-type — see drizzle-zod's `createSelectSchema(entity:\n// Table)` and `getTableColumns<T extends Table>`. `readonly` arrays match\n// the widened `Plugin.shared.pluginResources?` so the literal-tuple\n// preservation reaches the `ResolvedPermissions` reader. Issue #357 PR 2.\ninterface LoggingPlugin {\n name: string\n server: {\n tables: Record<string, Table>\n }\n shared: {\n pluginResources: readonly { 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 */\n// Local `<const T>` identity helper — same pattern as `definePlugin` in\n// `@murumets-ee/core`, inlined here because logging can't import from\n// core (circular dep). Captures the literal types of `name` and\n// `pluginResources` for `ResolvedPermissions<C>` (#357 PR 2).\nfunction defineLoggingPlugin<const T extends LoggingPlugin>(plugin: T): T {\n return plugin\n}\n\nexport function logging() {\n return defineLoggingPlugin({\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":"+CA8CA,SAAS,EAAmD,EAAc,CACxE,OAAO,EAGT,SAAgB,GAAU,CACxB,OAAO,EAAoB,CACzB,KAAM,uBACN,OAAQ,CACN,OAAQ,CAAE,mBAAkB,CAC7B,CACD,OAAQ,CACN,gBAAiB,CAAC,CAAE,KAAM,aAAc,QAAS,CAAC,OAAO,CAAE,CAAC,CAC7D,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@murumets-ee/logging",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
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.
|
|
27
|
+
"@murumets-ee/db": "0.20.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"tsdown": "^0.21.10",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsdown",
|
|
39
39
|
"dev": "tsdown --watch",
|
|
40
|
-
"test": "vitest"
|
|
40
|
+
"test": "vitest run",
|
|
41
|
+
"test:watch": "vitest"
|
|
41
42
|
}
|
|
42
43
|
}
|