@murumets-ee/logging 0.1.1 → 0.1.2

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.
@@ -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};
@@ -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 };
@@ -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,7 @@
1
+ /**
2
+ * Returns Drizzle table definition code as a string for logging plugin tables.
3
+ * Used by the CLI generate command to inline into generated/schema.ts.
4
+ */
5
+ declare function generateLoggingSchemaCode(): string;
6
+
7
+ export { generateLoggingSchemaCode };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Returns Drizzle table definition code as a string for logging plugin tables.
3
+ * Used by the CLI generate command to inline into generated/schema.ts.
4
+ */
5
+ declare function generateLoggingSchemaCode(): string;
6
+
7
+ export { generateLoggingSchemaCode };
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-3M2SQ6QE.js";export{a as generateLoggingSchemaCode};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@murumets-ee/logging",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -18,6 +18,11 @@
18
18
  "types": "./dist/admin.d.ts",
19
19
  "import": "./dist/admin.js",
20
20
  "require": "./dist/admin.cjs"
21
+ },
22
+ "./plugin": {
23
+ "types": "./dist/plugin.d.ts",
24
+ "import": "./dist/plugin.js",
25
+ "require": "./dist/plugin.cjs"
21
26
  }
22
27
  },
23
28
  "files": [
@@ -33,6 +38,9 @@
33
38
  "typescript": "^5.7.2",
34
39
  "vitest": "^2.1.8"
35
40
  },
41
+ "peerDependencies": {
42
+ "@murumets-ee/core": "^0.1.0"
43
+ },
36
44
  "scripts": {
37
45
  "build": "tsup",
38
46
  "dev": "tsup --watch",