{"id":23256662,"url":"https://github.com/aliatech/loopback-component-traceability","last_synced_at":"2025-06-30T19:32:41.848Z","repository":{"id":47981055,"uuid":"201335832","full_name":"aliatech/loopback-component-traceability","owner":"aliatech","description":"Module for Loopback Framework that allows to keep a persisted traceability of custom operations over models","archived":false,"fork":false,"pushed_at":"2022-12-10T05:30:24.000Z","size":981,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-06-17T15:58:03.138Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aliatech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-08T20:53:03.000Z","updated_at":"2020-04-19T15:30:03.000Z","dependencies_parsed_at":"2023-01-25T22:00:39.550Z","dependency_job_id":null,"html_url":"https://github.com/aliatech/loopback-component-traceability","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aliatech/loopback-component-traceability","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliatech%2Floopback-component-traceability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliatech%2Floopback-component-traceability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliatech%2Floopback-component-traceability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliatech%2Floopback-component-traceability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliatech","download_url":"https://codeload.github.com/aliatech/loopback-component-traceability/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliatech%2Floopback-component-traceability/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262838348,"owners_count":23372512,"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-12-19T12:18:40.287Z","updated_at":"2025-06-30T19:32:41.815Z","avatar_url":"https://github.com/aliatech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loopback Component Traceability\n\nModule for Loopback Framework that allows to keep a persisted traceability of custom operations over models\n\n## Installation\n\n```\nnpm i -S github:aliatech/loopback-component-traceability.git#develop\n```\n\nEnable and configure component in *component-config.json*\n\n```\n\"loopback-component-traceability\": {\n  \"userModel\": \"User\" // Model to use as events' author \n}\n```\n\nEnable model files in *model-config.json*:\n\n```\n\"models\": [\n  ...,\n  \"../node_modules/@aliatech7loopback-component-traceability/models\"\n]\n```\n\nEnable mixin files in *model-config.json*:\n\n```\n\"mixins\": [\n  ...,\n  \"../node_modules/@aliatech/loopback-component-traceability/mixins\"\n]\n```\n\nConfigure models in *model-config.json*:\n\n```\n...\n\"ModelEvent\": {\n  \"dataSource\": \"db\",\n  \"public\": false\n},\n...\n```\n\n\u003e Example: Change collection name in MongoDB\n\n```\n\"ModelEvent\": {\n  \"dataSource\": \"db\",\n  \"public\": true,\n  \"options\": {\n    \"mongodb\": {\n      \"collection\": \"Event\"\n    }\n  }\n},\n```\n\n### Notes\n\nEnable ACL in your Loopback project if you haven't yet.\nTo achieve it, create the file *server/boot/authentication.js* with the following code:\n\n```\n'use strict';\n\nmodule.exports = function enableAuthentication(server) {\n  // enable authentication\n  server.enableAuth();\n};\n\n```\n\n### Development\n\nInstall development dependences from module root directory only if you want to execute module tests\n\n```\ncd node_modules/@aliatech/loopback-component-traceability\nnpm i --only=dev\n```\n\n## Usage\n\nConfigure the Traceable mixin in those models that require a traceability.\nAdd this in the model json file, under \"mixins\":\n\n```\n\"mixins\": [\n  ...,\n  \"Traceable\": true\n]\n```  \n\nYou also can set options:\n\n```\n\"mixins\": [\n  ...,\n  \"Traceable\": {\n    \"displayProperty\": \"name\", // Property used as display of the object\n    \"events\": {\n      \"create\": true, // Enables automatic event create\n      \"update\": true, // Enables automatic event update\n      \"remove\": true // Enables automatic event remove\n    }\n  }\n]\n```  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliatech%2Floopback-component-traceability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliatech%2Floopback-component-traceability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliatech%2Floopback-component-traceability/lists"}