@adminforth/audit-log
Advanced tools
Comparing version 1.0.0-next.4 to 1.0.0-next.5
@@ -102,3 +102,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
diffColumn.showIn = ['show']; | ||
diffColumn.showIn = { | ||
show: true, | ||
list: false, | ||
edit: false, | ||
create: false, | ||
filter: false, | ||
}; | ||
diffColumn.components = { | ||
@@ -117,12 +123,11 @@ show: { | ||
; | ||
['edit', 'delete'].forEach((hook) => { | ||
resource.hooks[hook].afterSave.push((_a) => __awaiter(this, [_a], void 0, function* ({ resource, updates, adminUser, oldRecord, extra }) { | ||
return yield this.createLogRecord(resource, hook, updates, adminUser, oldRecord, extra); | ||
})); | ||
}); | ||
['create'].forEach((hook) => { | ||
resource.hooks[hook].afterSave.push((_a) => __awaiter(this, [_a], void 0, function* ({ resource, record, adminUser, extra }) { | ||
return yield this.createLogRecord(resource, hook, record, adminUser, undefined, extra); | ||
})); | ||
}); | ||
resource.hooks.edit.afterSave.push((_a) => __awaiter(this, [_a], void 0, function* ({ resource, updates, adminUser, oldRecord, extra }) { | ||
return yield this.createLogRecord(resource, 'edit', updates, adminUser, oldRecord, extra); | ||
})); | ||
resource.hooks.delete.afterSave.push((_a) => __awaiter(this, [_a], void 0, function* ({ resource, record, adminUser, extra }) { | ||
return yield this.createLogRecord(resource, 'delete', record, adminUser, record, extra); | ||
})); | ||
resource.hooks.create.afterSave.push((_a) => __awaiter(this, [_a], void 0, function* ({ resource, record, adminUser, extra }) { | ||
return yield this.createLogRecord(resource, 'create', record, adminUser, undefined, extra); | ||
})); | ||
}); | ||
@@ -129,0 +134,0 @@ } |
24
index.ts
@@ -134,3 +134,9 @@ import type { | ||
diffColumn.showIn = ['show'] | ||
diffColumn.showIn = { | ||
show: true, | ||
list: false, | ||
edit: false, | ||
create: false, | ||
filter: false, | ||
}; | ||
diffColumn.components = { | ||
@@ -152,13 +158,13 @@ show: { | ||
['edit', 'delete'].forEach((hook) => { | ||
resource.hooks[hook].afterSave.push(async ({resource, updates, adminUser, oldRecord, extra}) => { | ||
return await this.createLogRecord(resource, hook as AllowedActionsEnum, updates, adminUser, oldRecord, extra) | ||
}) | ||
resource.hooks.edit.afterSave.push(async ({ resource, updates, adminUser, oldRecord, extra }) => { | ||
return await this.createLogRecord(resource, 'edit' as AllowedActionsEnum, updates, adminUser, oldRecord, extra) | ||
}); | ||
['create'].forEach((hook) => { | ||
resource.hooks[hook].afterSave.push(async ({resource, record, adminUser, extra}) => { | ||
return await this.createLogRecord(resource, hook as AllowedActionsEnum, record, adminUser, undefined, extra) | ||
}) | ||
resource.hooks.delete.afterSave.push(async ({ resource, record, adminUser, extra }) => { | ||
return await this.createLogRecord(resource, 'delete' as AllowedActionsEnum, record, adminUser, record, extra) | ||
}); | ||
resource.hooks.create.afterSave.push(async ({ resource, record, adminUser, extra }) => { | ||
return await this.createLogRecord(resource, 'create' as AllowedActionsEnum, record, adminUser, undefined, extra) | ||
}); | ||
@@ -165,0 +171,0 @@ }) |
{ | ||
"name": "@adminforth/audit-log", | ||
"version": "1.0.0-next.4", | ||
"version": "1.0.0-next.5", | ||
"description": "AdminForth plugin for logging all actions (who did what and when)", | ||
@@ -8,2 +8,6 @@ "main": "dist/index.js", | ||
"type": "module", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/devforth/adminforth-audit-log.git" | ||
}, | ||
"scripts": { | ||
@@ -10,0 +14,0 @@ "rollout": "tsc && rsync -av --exclude 'node_modules' custom dist/ && npm version patch && npm publish --access public", |
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
36754
13
423
0