{"id":31213787,"url":"https://github.com/celrenheit/sukeru","last_synced_at":"2025-09-21T08:47:05.495Z","repository":{"id":27384838,"uuid":"30860856","full_name":"celrenheit/sukeru","owner":"celrenheit","description":"Sukeru - Riak Object Document Mapper","archived":false,"fork":false,"pushed_at":"2015-03-09T21:44:21.000Z","size":192,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-16T15:27:20.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/celrenheit.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":"2015-02-16T09:09:09.000Z","updated_at":"2015-04-29T07:33:38.000Z","dependencies_parsed_at":"2022-08-20T07:50:22.148Z","dependency_job_id":null,"html_url":"https://github.com/celrenheit/sukeru","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/celrenheit/sukeru","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fsukeru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fsukeru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fsukeru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fsukeru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/celrenheit","download_url":"https://codeload.github.com/celrenheit/sukeru/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fsukeru/sbom","scorecard":{"id":270638,"data":{"date":"2025-08-11","repo":{"name":"github.com/celrenheit/sukeru","commit":"268f9a3cfa0122b17581254a3e67b26200fd32c6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T13:15:28.941Z","repository_id":27384838,"created_at":"2025-08-17T13:15:28.942Z","updated_at":"2025-08-17T13:15:28.942Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275847638,"owners_count":25539428,"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-18T02:00:09.552Z","response_time":77,"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":[],"created_at":"2025-09-21T08:46:59.864Z","updated_at":"2025-09-21T08:47:00.910Z","avatar_url":"https://github.com/celrenheit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\nSukeru is an Object Document Mapper for Riak.\n\n# Installation\n\n```shell\n$ npm install sukeru\n```\n\n# Usage\n\nFirst we need to connect to the database (localhost by default):\n\n```javascript\nsukeru.connect(function() {\n    // Inside this we can define our models and do our queries...    \n});\n```\n\n## Model definition\n\nLet's define a basic User model:\n\n```javascript\nvar User = sukeru.model('User', function() {\n    this.string('name');\n    this.string('email');\n    this.string('password'); \n});\n```\n\n## Data types\n\nThe currently available data types are:\n* string\n* boolean\n* date\n\n## Accessing a Model\n\n```javascript\nvar User = sukeru.model('User');\n```\n\n## Methods\n\nNow that the User model is created, we can create a new user and than save it to the database:\n\n```javascript\nvar john = new User();\njohn.name = \"John\";\njohn.email = \"john@example.com\";\njohn.password = \"my secret password\";\njohn.save(function(err) {\n    if(err)\n        return console.log(err);\n    console.log(\"The user has been successfully created\", john);\n    console.log(\"It should have a new generated id:\", john.id);\n});\n```\n\nLet's find a user by id:\n\n```javascript\nUser.findById(\"aNIdToFind\", function(err, user) {\n    if(err)\n        return console.log(err);\n    console.log(\"A user was found\", user);\n});\n```\n\nTo delete this user: \n```javascript\njohn.remove(function(err) {\n   console.log(\"John should not exist anymore in the database\");\n});\n```\n\nTo delete a user by its id: \n```javascript\nUser.delete(\"aNIdToDelete\", function(err) {\n   console.log(\"This user should not exist anymore in the database\");\n});\n```\n\n\n## Validation\n\nYou can specify validation rules for each field this way:\n\n```javascript\nvar User = sukeru.model('User', function() {\n    this.string('name').required();\n    this.string('email').required()\n                        .email();\n    this.string('password').required()\n                           .minLength(6)\n                           .maxLength(16); \n    this.date('birthday').required()\n                           .after(new Date(2012, 01, 01))\n                           .before(new Date(2015, 01, 01));\n});\n```\n\nYou can also pass a default value as a second argument of the property type:\n\n```javascript\nthis.date('birthday', new Date());\nthis.string('name', 'John');\n```\n\n## Defining methods and statics\n\n```javascript\nvar User = sukeru.model('User', function() {\n    this.string('name_s');\n    this.string('email');\n    this.string('password'); \n    \n    this.methods.comparePassword = function(password) {\n        return (this.password === password);\n    };\n    this.statics.findByName = function(name, callback) {\n        this.search({\n            q: \"name_s:\"+name\n        }, cb);\n    };\n});\n\n// Example usage\n\n// Static function\nUser.findByName(\"John\", function(err, users) {\n    // Do something here with your users\n});\n\n// Instance level methods\nvar user = new User();\nuser.email = \"test\";\nuser.password = \"secret\";\nuser.comparePassword(\"falsepassword\"); // should be false\nuser.comparePassword(\"secret\"); // should be true\n\n```\n\n\n## Search\n\n### Configuring Riak\n\nCreate a search index (replace **user** by the name you choose for your search index):\n```shell\n$ curl -XPUT $RIAK_HOST/search/index/user -H 'Content-Type: application/json'  -d '{\"schema\":\"_yz_default\"}'\n```\n\nCreate a bucket-type (if it is not already):\n```shell\n$ riak-admin bucket-type create searchable '{\"props\": {\"search_index\":\"user\"}}'\n```\n\nActivate this bucket-type:\n```shell\n$ riak-admin bucket-type activate searchable\n```\n\n### Using search\n\nRiak has a built-in Solr search engine. \n\nSolr needs a schema to define each fields name and types. By default, Riak provides us a default schema.\nFor strings to be indexed (using default schema) we need to add the suffixe: \"_s\".\n\n\n\u003e ***Note :*** For now you are only able to use the default search schema for Solr provided by Riak's Team  (thus the suffix \"_s\")\n\u003e You case use a custom schema but you will have to create it yourself.\n\nLet's say we want to be able to search for the name of a user. We can modify the model definition like this:\n```javascript\nvar User = sukeru.model('User', function() {\n    this.string('name_s')\n    this.string('email');\n    this.string('password'); \n});\n```\n\nTo search for an object we can run a Solr query:\n```javascript\nUser.search({\n    q: \"name_s:John\",\n    rows: 10\n}, function(err, users) {\n    console.log(\"Here we have our results\", users)\n});\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelrenheit%2Fsukeru","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcelrenheit%2Fsukeru","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelrenheit%2Fsukeru/lists"}