{"id":22008918,"url":"https://github.com/letsfullstack/loopback-soft-delete-mixin","last_synced_at":"2025-09-17T21:52:19.659Z","repository":{"id":91552422,"uuid":"268081387","full_name":"letsfullstack/loopback-soft-delete-mixin","owner":"letsfullstack","description":"Forked mixin to soft delete models on Loopback.","archived":false,"fork":false,"pushed_at":"2020-06-04T21:18:33.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-23T07:30:04.072Z","etag":null,"topics":["es6","eslint","eslint-airbnb","loopback","loopback-mixin","mocha"],"latest_commit_sha":null,"homepage":"","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/letsfullstack.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-30T13:06:48.000Z","updated_at":"2020-06-04T21:21:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"b18c44c8-7cb4-4670-ac83-d8fbd7b9b8e9","html_url":"https://github.com/letsfullstack/loopback-soft-delete-mixin","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/letsfullstack/loopback-soft-delete-mixin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfullstack%2Floopback-soft-delete-mixin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfullstack%2Floopback-soft-delete-mixin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfullstack%2Floopback-soft-delete-mixin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfullstack%2Floopback-soft-delete-mixin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letsfullstack","download_url":"https://codeload.github.com/letsfullstack/loopback-soft-delete-mixin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfullstack%2Floopback-soft-delete-mixin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275672776,"owners_count":25507465,"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","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["es6","eslint","eslint-airbnb","loopback","loopback-mixin","mocha"],"created_at":"2024-11-30T02:07:45.171Z","updated_at":"2025-09-17T21:52:19.640Z","avatar_url":"https://github.com/letsfullstack.png","language":"JavaScript","readme":"![Publish Github Package](https://github.com/letsfullstack/loopback-soft-delete-mixin/workflows/Publish%20Github%20Package/badge.svg)\n\n# Loopback SoftDelete Mixin\n\nThis module is designed for the [Strongloop Loopback](https://github.com/strongloop/loopback) framework. It allows entities of any Model to be \"soft deleted\" by adding `deletedAt` and `_isDeleted` attributes. Queries following the standard format will no return these entities; they can only be accessed by adding `{ deleted: true }` to the query object (at the same level as `where`, `include` etc).\n\nTo implement copy this file to mixins folder or clone this private repository (requires adding the package folder path to mixins inside model-config json file), and add \"SoftDelete\": true in mixins on YourModel.json file.\n\nTo delete a row or data, don't use destroyAll etc., use YourModel.delete\n\nTo find data that is considered deleted, add includeDeleted: true in where filter\n\nOriginal author: Saggaf Arsyad\n\nNode version used for development: **v10.13.0**\n\n## Contributing\n\n:boom: In case you are making a commit for this package repository, **MAKE SURE TO READ AND UNDERSTAND THE FOLLOWING TOPICS**:\n\n1\\. Every commit that runs on the [master branch](https://github.com/letsfullstack/loopback-soft-delete-mixin/tree/master) runs through the Publish Github Package Workflow on Github Actions. So **be sure to check if your code is well written and tested**, since it'll be published if the code passes the Continuous Integration (CI) unit tests.\n\n2\\. If the commit passes through the Github Actions workflow, the module will be released as a package in the Github Packages Registry. This workflow has an [underlying command](https://github.com/phips28/gh-action-bump-version) that **increments/bumps the version from the latest release based on commit messages**, such as:\n\n- If the string \"BREAKING CHANGE\" or \"major\" is found anywhere in any of the commit messages or descriptions, the **major version** will be incremented (i.e. 1.X.X).\n\n- If a commit message begins with the string \"feat\" or includes \"minor\" then the **minor version** will be increased (i.e. X.1.X). This works for most common commit metadata for feature additions: \"feat: new API\" and \"feature: new API\".\n\n- All other changes will increment the **patch version** (i.e. X.X.1).\n\n3\\. Furthermore, the workflow has also an underlying command that deploys automatically a new release when a success test/deployment takes places. These releases can be found [here](https://github.com/letsfullstack/loopback-soft-delete-mixin/releases).\n\n## Installation\n\nIn your application root directory, enter this command to install the connector:\n\n```shell\n$ npm install @letsfullstack/loopback-soft-delete-mixin\n```\n\n## Configure\n\nTo use with your Models add the `mixins` attribute to the definition object of your model config.\n\n```json\n  {\n    \"name\": \"Widget\",\n    \"properties\": {\n      \"name\": {\n        \"type\": \"string\",\n      },\n    },\n    \"mixins\": {\n      \"SoftDelete\" : true,\n    },\n  },\n```\n\nThere are a number of configurable options to the mixin. You can specify alternative property names for `deletedAt` and `_isDeleted`, as well as configuring deletion to \"scrub\" the entity. If true, this sets all but the \"id\" fields to null. If an array, it will only scrub properties with those names.\n\n```json\n  \"mixins\": {\n    \"SoftDelete\": {\n      \"deletedAt\": \"deletedOn\",\n      \"_isDeleted\": \"isDeleted\",\n      \"scrub\": true,\n    },\n  },\n```\n\n## Retrieving deleted entities\n\nTo run queries that include deleted items in the response, add `{ deleted: true }` to the query object (at the same level as `where`, `include` etc).\n\n## Testing\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsfullstack%2Floopback-soft-delete-mixin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletsfullstack%2Floopback-soft-delete-mixin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsfullstack%2Floopback-soft-delete-mixin/lists"}