@murumets-ee/logging 0.1.1 → 0.1.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/chunk-3M2SQ6QE.js +17 -0
- package/dist/plugin.cjs +17 -0
- package/dist/plugin.d.cts +17 -0
- package/dist/plugin.d.ts +17 -0
- package/dist/plugin.js +1 -0
- package/dist/schema-codegen.cjs +17 -0
- package/dist/schema-codegen.d.cts +7 -0
- package/dist/schema-codegen.d.ts +7 -0
- package/dist/schema-codegen.js +1 -0
- package/package.json +11 -7
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function t(){return`export const toolkitAuditLogs = pgTable('toolkit_audit_logs', {
|
|
2
|
+
id: uuid('id').primaryKey().defaultRandom(),
|
|
3
|
+
action: varchar('action', { length: 100 }).notNull(),
|
|
4
|
+
entityType: varchar('entity_type', { length: 100 }),
|
|
5
|
+
entityId: varchar('entity_id', { length: 255 }),
|
|
6
|
+
userId: varchar('user_id', { length: 255 }),
|
|
7
|
+
userName: varchar('user_name', { length: 255 }),
|
|
8
|
+
changes: jsonb('changes'),
|
|
9
|
+
metadata: jsonb('metadata'),
|
|
10
|
+
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
|
|
11
|
+
}, (table) => ({
|
|
12
|
+
entityTypeCreatedAtIdx: index('audit_entity_type_created_at_idx').on(table.entityType, table.createdAt),
|
|
13
|
+
userIdCreatedAtIdx: index('audit_user_id_created_at_idx').on(table.userId, table.createdAt),
|
|
14
|
+
actionCreatedAtIdx: index('audit_action_created_at_idx').on(table.action, table.createdAt),
|
|
15
|
+
createdAtIdx: index('audit_created_at_idx').on(table.createdAt),
|
|
16
|
+
entityIdIdx: index('audit_entity_id_idx').on(table.entityId),
|
|
17
|
+
}))`}export{t as a};
|
package/dist/plugin.cjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var d in e)i(t,d,{get:e[d],enumerable:!0})},g=(t,e,d,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of u(e))!c.call(t,a)&&a!==d&&i(t,a,{get:()=>e[a],enumerable:!(n=o(e,a))||n.enumerable});return t};var _=t=>g(i({},"__esModule",{value:!0}),t);var s={};l(s,{logging:()=>m});module.exports=_(s);function r(){return`export const toolkitAuditLogs = pgTable('toolkit_audit_logs', {
|
|
2
|
+
id: uuid('id').primaryKey().defaultRandom(),
|
|
3
|
+
action: varchar('action', { length: 100 }).notNull(),
|
|
4
|
+
entityType: varchar('entity_type', { length: 100 }),
|
|
5
|
+
entityId: varchar('entity_id', { length: 255 }),
|
|
6
|
+
userId: varchar('user_id', { length: 255 }),
|
|
7
|
+
userName: varchar('user_name', { length: 255 }),
|
|
8
|
+
changes: jsonb('changes'),
|
|
9
|
+
metadata: jsonb('metadata'),
|
|
10
|
+
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
|
|
11
|
+
}, (table) => ({
|
|
12
|
+
entityTypeCreatedAtIdx: index('audit_entity_type_created_at_idx').on(table.entityType, table.createdAt),
|
|
13
|
+
userIdCreatedAtIdx: index('audit_user_id_created_at_idx').on(table.userId, table.createdAt),
|
|
14
|
+
actionCreatedAtIdx: index('audit_action_created_at_idx').on(table.action, table.createdAt),
|
|
15
|
+
createdAtIdx: index('audit_created_at_idx').on(table.createdAt),
|
|
16
|
+
entityIdIdx: index('audit_entity_id_idx').on(table.entityId),
|
|
17
|
+
}))`}function m(){return{name:"@murumets-ee/logging",schemaCode:r()}}0&&(module.exports={logging});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Plugin } from '@murumets-ee/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Logging plugin — registers the audit log table schema for migration generation.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { logging } from '@murumets-ee/logging/plugin'
|
|
9
|
+
*
|
|
10
|
+
* export default defineConfig({
|
|
11
|
+
* plugins: [logging()],
|
|
12
|
+
* })
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare function logging(): Plugin;
|
|
16
|
+
|
|
17
|
+
export { logging };
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Plugin } from '@murumets-ee/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Logging plugin — registers the audit log table schema for migration generation.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { logging } from '@murumets-ee/logging/plugin'
|
|
9
|
+
*
|
|
10
|
+
* export default defineConfig({
|
|
11
|
+
* plugins: [logging()],
|
|
12
|
+
* })
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare function logging(): Plugin;
|
|
16
|
+
|
|
17
|
+
export { logging };
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-3M2SQ6QE.js";function o(){return{name:"@murumets-ee/logging",schemaCode:e()}}export{o as logging};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var c=(e,t)=>{for(var d in t)i(e,d,{get:t[d],enumerable:!0})},l=(e,t,d,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of o(t))!_.call(e,a)&&a!==d&&i(e,a,{get:()=>t[a],enumerable:!(n=r(t,a))||n.enumerable});return e};var u=e=>l(i({},"__esModule",{value:!0}),e);var y={};c(y,{generateLoggingSchemaCode:()=>x});module.exports=u(y);function x(){return`export const toolkitAuditLogs = pgTable('toolkit_audit_logs', {
|
|
2
|
+
id: uuid('id').primaryKey().defaultRandom(),
|
|
3
|
+
action: varchar('action', { length: 100 }).notNull(),
|
|
4
|
+
entityType: varchar('entity_type', { length: 100 }),
|
|
5
|
+
entityId: varchar('entity_id', { length: 255 }),
|
|
6
|
+
userId: varchar('user_id', { length: 255 }),
|
|
7
|
+
userName: varchar('user_name', { length: 255 }),
|
|
8
|
+
changes: jsonb('changes'),
|
|
9
|
+
metadata: jsonb('metadata'),
|
|
10
|
+
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
|
|
11
|
+
}, (table) => ({
|
|
12
|
+
entityTypeCreatedAtIdx: index('audit_entity_type_created_at_idx').on(table.entityType, table.createdAt),
|
|
13
|
+
userIdCreatedAtIdx: index('audit_user_id_created_at_idx').on(table.userId, table.createdAt),
|
|
14
|
+
actionCreatedAtIdx: index('audit_action_created_at_idx').on(table.action, table.createdAt),
|
|
15
|
+
createdAtIdx: index('audit_created_at_idx').on(table.createdAt),
|
|
16
|
+
entityIdIdx: index('audit_entity_id_idx').on(table.entityId),
|
|
17
|
+
}))`}0&&(module.exports={generateLoggingSchemaCode});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-3M2SQ6QE.js";export{a as generateLoggingSchemaCode};
|
package/package.json
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@murumets-ee/logging",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
-
"import": "./dist/index.js"
|
|
10
|
-
"require": "./dist/index.cjs"
|
|
9
|
+
"import": "./dist/index.js"
|
|
11
10
|
},
|
|
12
11
|
"./schema": {
|
|
13
12
|
"types": "./dist/schema.d.ts",
|
|
14
|
-
"import": "./dist/schema.js"
|
|
15
|
-
"require": "./dist/schema.cjs"
|
|
13
|
+
"import": "./dist/schema.js"
|
|
16
14
|
},
|
|
17
15
|
"./admin": {
|
|
18
16
|
"types": "./dist/admin.d.ts",
|
|
19
|
-
"import": "./dist/admin.js"
|
|
20
|
-
|
|
17
|
+
"import": "./dist/admin.js"
|
|
18
|
+
},
|
|
19
|
+
"./plugin": {
|
|
20
|
+
"types": "./dist/plugin.d.ts",
|
|
21
|
+
"import": "./dist/plugin.js"
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
@@ -33,6 +34,9 @@
|
|
|
33
34
|
"typescript": "^5.7.2",
|
|
34
35
|
"vitest": "^2.1.8"
|
|
35
36
|
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@murumets-ee/core": "^0.1.0"
|
|
39
|
+
},
|
|
36
40
|
"scripts": {
|
|
37
41
|
"build": "tsup",
|
|
38
42
|
"dev": "tsup --watch",
|