@sourceloop/audit-log
Advanced tools
Comparing version 1.3.0 to 2.0.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./component"), exports); | ||
tslib_1.__exportStar(require("./mixins"), exports); | ||
tslib_1.__exportStar(require("./types"), exports); | ||
tslib_1.__exportStar(require("./models"), exports); | ||
tslib_1.__exportStar(require("./repositories"), exports); | ||
(0, tslib_1.__exportStar)(require("./component"), exports); | ||
(0, tslib_1.__exportStar)(require("./mixins"), exports); | ||
(0, tslib_1.__exportStar)(require("./types"), exports); | ||
(0, tslib_1.__exportStar)(require("./models"), exports); | ||
(0, tslib_1.__exportStar)(require("./repositories"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
async create(dataObject, options) { | ||
var _a; | ||
var _a, _b; | ||
const created = await super.create(dataObject, options); | ||
@@ -23,3 +23,3 @@ if (this.getCurrentUser && !(options === null || options === void 0 ? void 0 : options.noAudit)) { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
actor: (_a = (user === null || user === void 0 ? void 0 : user.id).toString()) !== null && _a !== void 0 ? _a : '0', | ||
actor: (_b = (_a = user === null || user === void 0 ? void 0 : user.id) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '0', | ||
action: models_1.Action.INSERT_ONE, | ||
@@ -76,3 +76,3 @@ after: created.toJSON(), | ||
const toUpdate = await this.find({ where }); | ||
const beforeMap = lodash_1.keyBy(toUpdate, d => d.getId()); | ||
const beforeMap = (0, lodash_1.keyBy)(toUpdate, d => d.getId()); | ||
const updatedCount = await super.updateAll(dataObject, where, options); | ||
@@ -115,3 +115,3 @@ const updated = await this.find({ where }); | ||
const toDelete = await this.find({ where }); | ||
const beforeMap = lodash_1.keyBy(toDelete, d => d.getId()); | ||
const beforeMap = (0, lodash_1.keyBy)(toDelete, d => d.getId()); | ||
const deletedCount = await super.deleteAll(where, options); | ||
@@ -118,0 +118,0 @@ if (this.getCurrentUser) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./audit.mixin"), exports); | ||
(0, tslib_1.__exportStar)(require("./audit.mixin"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -20,4 +20,4 @@ "use strict"; | ||
}; | ||
tslib_1.__decorate([ | ||
repository_1.property({ | ||
(0, tslib_1.__decorate)([ | ||
(0, repository_1.property)({ | ||
type: 'string', | ||
@@ -27,13 +27,13 @@ id: true, | ||
}), | ||
tslib_1.__metadata("design:type", String) | ||
(0, tslib_1.__metadata)("design:type", String) | ||
], AuditLog.prototype, "id", void 0); | ||
tslib_1.__decorate([ | ||
repository_1.property({ | ||
(0, tslib_1.__decorate)([ | ||
(0, repository_1.property)({ | ||
type: 'string', | ||
required: true, | ||
}), | ||
tslib_1.__metadata("design:type", String) | ||
(0, tslib_1.__metadata)("design:type", String) | ||
], AuditLog.prototype, "action", void 0); | ||
tslib_1.__decorate([ | ||
repository_1.property({ | ||
(0, tslib_1.__decorate)([ | ||
(0, repository_1.property)({ | ||
name: 'acted_at', | ||
@@ -43,13 +43,13 @@ type: 'date', | ||
}), | ||
tslib_1.__metadata("design:type", Date) | ||
(0, tslib_1.__metadata)("design:type", Date) | ||
], AuditLog.prototype, "actedAt", void 0); | ||
tslib_1.__decorate([ | ||
repository_1.property({ | ||
(0, tslib_1.__decorate)([ | ||
(0, repository_1.property)({ | ||
name: 'acted_on', | ||
type: 'string', | ||
}), | ||
tslib_1.__metadata("design:type", String) | ||
(0, tslib_1.__metadata)("design:type", String) | ||
], AuditLog.prototype, "actedOn", void 0); | ||
tslib_1.__decorate([ | ||
repository_1.property({ | ||
(0, tslib_1.__decorate)([ | ||
(0, repository_1.property)({ | ||
name: 'action_key', | ||
@@ -59,6 +59,6 @@ type: 'string', | ||
}), | ||
tslib_1.__metadata("design:type", String) | ||
(0, tslib_1.__metadata)("design:type", String) | ||
], AuditLog.prototype, "actionKey", void 0); | ||
tslib_1.__decorate([ | ||
repository_1.property({ | ||
(0, tslib_1.__decorate)([ | ||
(0, repository_1.property)({ | ||
name: 'entity_id', | ||
@@ -68,25 +68,25 @@ type: 'string', | ||
}), | ||
tslib_1.__metadata("design:type", String) | ||
(0, tslib_1.__metadata)("design:type", String) | ||
], AuditLog.prototype, "entityId", void 0); | ||
tslib_1.__decorate([ | ||
repository_1.property({ | ||
(0, tslib_1.__decorate)([ | ||
(0, repository_1.property)({ | ||
type: 'string', | ||
required: true, | ||
}), | ||
tslib_1.__metadata("design:type", String) | ||
(0, tslib_1.__metadata)("design:type", String) | ||
], AuditLog.prototype, "actor", void 0); | ||
tslib_1.__decorate([ | ||
repository_1.property({ | ||
(0, tslib_1.__decorate)([ | ||
(0, repository_1.property)({ | ||
type: 'object', | ||
}), | ||
tslib_1.__metadata("design:type", Object) | ||
(0, tslib_1.__metadata)("design:type", Object) | ||
], AuditLog.prototype, "before", void 0); | ||
tslib_1.__decorate([ | ||
repository_1.property({ | ||
(0, tslib_1.__decorate)([ | ||
(0, repository_1.property)({ | ||
type: 'object', | ||
}), | ||
tslib_1.__metadata("design:type", Object) | ||
(0, tslib_1.__metadata)("design:type", Object) | ||
], AuditLog.prototype, "after", void 0); | ||
AuditLog = tslib_1.__decorate([ | ||
repository_1.model({ | ||
AuditLog = (0, tslib_1.__decorate)([ | ||
(0, repository_1.model)({ | ||
name: 'audit_logs', | ||
@@ -97,5 +97,5 @@ settings: { | ||
}), | ||
tslib_1.__metadata("design:paramtypes", [Object]) | ||
(0, tslib_1.__metadata)("design:paramtypes", [Object]) | ||
], AuditLog); | ||
exports.AuditLog = AuditLog; | ||
//# sourceMappingURL=audit-log.model.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./audit-log.model"), exports); | ||
(0, tslib_1.__exportStar)(require("./audit-log.model"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -14,7 +14,7 @@ "use strict"; | ||
}; | ||
AuditLogRepository = tslib_1.__decorate([ | ||
tslib_1.__param(0, core_1.inject(`datasources.${types_1.AuditDbSourceName}`)), | ||
tslib_1.__metadata("design:paramtypes", [repository_1.juggler.DataSource]) | ||
AuditLogRepository = (0, tslib_1.__decorate)([ | ||
(0, tslib_1.__param)(0, (0, core_1.inject)(`datasources.${types_1.AuditDbSourceName}`)), | ||
(0, tslib_1.__metadata)("design:paramtypes", [repository_1.juggler.DataSource]) | ||
], AuditLogRepository); | ||
exports.AuditLogRepository = AuditLogRepository; | ||
//# sourceMappingURL=audit.repository.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./audit.repository"), exports); | ||
(0, tslib_1.__exportStar)(require("./audit.repository"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@sourceloop/audit-log", | ||
"version": "1.3.0", | ||
"version": "2.0.0", | ||
"description": "Audit Log extension", | ||
@@ -29,7 +29,9 @@ "keywords": [ | ||
"pretest": "npm run build", | ||
"test": "echo 'No Tests'", | ||
"test": "lb-mocha --allow-console-logs \"dist/__tests__\"", | ||
"posttest": "npm run lint", | ||
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest", | ||
"clean": "lb-clean dist *.tsbuildinfo .eslintcache", | ||
"prepublishOnly": "npm run build && npm run lint" | ||
"prepublishOnly": "npm run build && npm run lint", | ||
"prepare": "husky install", | ||
"coverage": "lb-nyc npm run test" | ||
}, | ||
@@ -45,22 +47,53 @@ "author": "", | ||
"dependencies": { | ||
"@loopback/boot": "^3.4.0", | ||
"@loopback/core": "^2.16.0", | ||
"@loopback/boot": "^3.4.4", | ||
"@loopback/core": "^2.18.0", | ||
"lodash": "^4.17.21", | ||
"tslib": "^2.2.0" | ||
"tslib": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@loopback/build": "^6.4.0", | ||
"@loopback/eslint-config": "^10.2.0", | ||
"@loopback/testlab": "^3.4.0", | ||
"@types/lodash": "^4.14.165", | ||
"@types/node": "^10.17.59", | ||
"@typescript-eslint/eslint-plugin": "^4.22.0", | ||
"@typescript-eslint/parser": "^4.22.0", | ||
"eslint": "^7.25.0", | ||
"source-map-support": "^0.5.19", | ||
"typescript": "~4.2.4" | ||
"@commitlint/cli": "^13.1.0", | ||
"@commitlint/config-conventional": "^13.1.0", | ||
"@loopback/build": "^7.0.2", | ||
"@loopback/eslint-config": "^11.0.2", | ||
"@loopback/testlab": "^3.4.4", | ||
"@semantic-release/changelog": "^5.0.1", | ||
"@semantic-release/git": "^9.0.0", | ||
"@types/lodash": "^4.14.176", | ||
"@types/node": "^16.11.7", | ||
"@types/uuid": "^8.3.1", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"commitizen": "^4.2.4", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"cz-customizable": "^6.3.0", | ||
"cz-customizable-ghooks": "^2.0.0", | ||
"eslint": "^7.32.0", | ||
"fs-extra": "^10.0.0", | ||
"husky": "^7.0.1", | ||
"semantic-release": "^17.4.4", | ||
"source-map-support": "^0.5.20", | ||
"typescript": "~4.4.4" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org/" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "./node_modules/cz-customizable" | ||
} | ||
}, | ||
"release": { | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/npm", | ||
"@semantic-release/github", | ||
"@semantic-release/changelog", | ||
"@semantic-release/git" | ||
], | ||
"repositoryUrl": "git@github.com:sourcefuse/loopback4-audit-log.git" | ||
} | ||
} |
@@ -20,3 +20,3 @@ import {MixinTarget} from '@loopback/core'; | ||
UserID, | ||
R extends MixinTarget<EntityCrudRepository<M, ID, Relations>> | ||
R extends MixinTarget<EntityCrudRepository<M, ID, Relations>>, | ||
>(superClass: R, opts: IAuditMixinOptions) { | ||
@@ -43,3 +43,3 @@ class MixedRepository extends superClass implements IAuditMixin<UserID> { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
actor: (user?.id as any).toString() ?? '0', | ||
actor: (user?.id as any)?.toString() ?? '0', | ||
action: Action.INSERT_ONE, | ||
@@ -46,0 +46,0 @@ after: created.toJSON(), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
70667
1
22
50
Updated@loopback/boot@^3.4.4
Updated@loopback/core@^2.18.0
Updatedtslib@^2.0.0