{"id":21878060,"url":"https://github.com/eden-js/audit","last_synced_at":"2026-05-10T09:53:02.088Z","repository":{"id":50243370,"uuid":"170229047","full_name":"eden-js/audit","owner":"eden-js","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-31T17:31:34.000Z","size":199,"stargazers_count":0,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T18:17:27.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eden-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-12T01:10:47.000Z","updated_at":"2019-07-15T02:16:12.000Z","dependencies_parsed_at":"2022-09-18T16:03:16.066Z","dependency_job_id":null,"html_url":"https://github.com/eden-js/audit","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eden-js%2Faudit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eden-js%2Faudit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eden-js%2Faudit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eden-js%2Faudit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eden-js","download_url":"https://codeload.github.com/eden-js/audit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244885532,"owners_count":20526293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T08:11:33.750Z","updated_at":"2026-05-10T09:52:57.060Z","avatar_url":"https://github.com/eden-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EdenJS - Audit\n[![TravisCI](https://travis-ci.com/eden-js/audit.svg?branch=master)](https://travis-ci.com/eden-js/audit)\n[![Issues](https://img.shields.io/github/issues/eden-js/audit.svg)](https://github.com/eden-js/audit/issues)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/eden-js/audit)\n[![Awesome](https://img.shields.io/badge/awesome-true-green.svg)](https://github.com/eden-js/audit)\n[![Discord](https://img.shields.io/discord/583845970433933312.svg)](https://discord.gg/5u3f3up)\n\nAuditing base logic component for [EdenJS](https://github.com/edenjs-cli)\n\n`@edenjs/audit` automatically tracks all model specific actions in the system. By including any model you want to track in config `@edenjs/audit` will track every `update`, `remove`, and `create`, and if possible who/what was changed.\n\n## Setup\n\n### Install\n\n```\nnpm i --save @edenjs/audit\n```\n\n### Configure\n\n```js\nconfig.audit = {\n  models : ['user', 'product'], // which models do we want to track\n};\n```\n\n## Models\n\n### `Audit` _[Usage](https://github.com/eden-js/audit/blob/master/bundles/audit/models/audit.js)_\n\nAudit model consists of a single tracking item, each instance in the database corresponds to a single `update`, `remove`, or `create` of any tracked model.\n\n#### Example\n\n```js\nconst Audit = model('audit');\n```\n\n## Hooks\n\n### `audit.check` _[Usage](https://github.com/eden-js/audit/blob/master/bundles/audit/daemons/audit.js#L60)_\n\n\nAuditing logic allows us to hook and prevent creation of an audit item, or alter the updates/by fields.\n\n#### Example\n\n```js\nthis.eden.pre('audit.check', (data) =\u003e {\n  // extract variables\n  const { by, updates, subject } = data;\n\n  // prevent audit creation by setting prevent : true\n  data.prevent = true;\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feden-js%2Faudit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feden-js%2Faudit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feden-js%2Faudit/lists"}