{"id":49359102,"url":"https://github.com/aqualaguna/firestore-model","last_synced_at":"2026-04-27T15:03:05.601Z","repository":{"id":57236797,"uuid":"173873899","full_name":"aqualaguna/firestore-model","owner":"aqualaguna","description":"ORM for firestore","archived":false,"fork":false,"pushed_at":"2019-12-09T07:00:40.000Z","size":55,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T06:27:45.196Z","etag":null,"topics":["firebase","firestore","model","orm","typescript"],"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/aqualaguna.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-03-05T04:34:00.000Z","updated_at":"2019-12-09T07:00:42.000Z","dependencies_parsed_at":"2022-08-26T15:11:27.333Z","dependency_job_id":null,"html_url":"https://github.com/aqualaguna/firestore-model","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aqualaguna/firestore-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aqualaguna%2Ffirestore-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aqualaguna%2Ffirestore-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aqualaguna%2Ffirestore-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aqualaguna%2Ffirestore-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aqualaguna","download_url":"https://codeload.github.com/aqualaguna/firestore-model/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aqualaguna%2Ffirestore-model/sbom","scorecard":{"id":204611,"data":{"date":"2025-08-11","repo":{"name":"github.com/aqualaguna/firestore-model","commit":"7d99cb1f74d33ace94d20b61692830b6e678c6ab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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-16T23:27:06.668Z","repository_id":57236797,"created_at":"2025-08-16T23:27:06.668Z","updated_at":"2025-08-16T23:27:06.668Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32341455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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":["firebase","firestore","model","orm","typescript"],"created_at":"2026-04-27T15:02:43.486Z","updated_at":"2026-04-27T15:03:05.593Z","avatar_url":"https://github.com/aqualaguna.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firestore-model\nORM for firestore. very simple class for easing your workflow.\n\nfor start this library still lacking many feature such as :\n* there is no support for subcollection.\n* there is no query as yet.\n\nbellow is example how to use the model class.\n```\nclass UserDetail extends FirestoreModel {\n    attribute = {\n        name: '',\n        email: '',\n        password: '',\n        description: ''\n    };\n    constructor() {\n        super();\n        this.init();\n    }\n}\n```\n\nthe constructor of the class have to be set if not there will be unexpected behavior.\n## Instalation\n1. install from npm\n```\nnpm install firestore-class\n```\n2. clone this github\n```\ngit clone https://github.com/aqualaguna/firestore-model.git\n```\n\n## Example\n0. Authentication\n```\nimport { Authentication } from \"firestore-class/lib/authentication\";\nimport credential = require('./credential.json');\n// or\nconst credential = require('./credential.json');\n//this is the same thing.\nAuthentication.authenticate(credential)\n```\n1. Create a document\n```\nlet user = new UserDetail();\nlet t = new UserDetail();\nt.name = 'test';\nt.email = \"test@example.com\";\nt.password = \"hahaha\";\nt.description = \"desc\";\nawait t.save(); // return promise\u003cboolean\u003e\n\n// love using object ? \nlet temp = new UserDetail();\ntemp.fill({\n  name: 'second',\n  email: 'test@mail.com',\n  description: 'okay',\n  password: 'secret'\n})\nawait temp.save(); // promise boolean\n\n// dont want using the class ? \nlet obj = temp.toObject();\nconsole.log(obj)\n\nOutput :\n{\n  name: 'second',\n  email: 'test@mail.com',\n  description: 'okay',\n  password: 'secret'\n}\n```\n\n2. Update document\n\n```\nuser.name = \"changed\";\nawait user.save() // promise boolean\n\n// or second method\n\nawait user.update({\n  name: \"hello world\"\n}) // promise boolean\n```\n3. deleting a document\n\n```\nawait user.delete(); // promise Boolean\n```\n\n4. fast create dummy data\n\nthis feature you must implement factory method in class you created.\n```\nclass Factory extends FirestoreModel {\n    attribute = {\n        name: '',\n        description: ''\n    };\n    factory() {\n        return {\n            name: Factory.faker.company.companyName(),\n            description: Factory.faker.random.words(),\n        };\n    }\n    constructor() {\n        super();\n        this.init();\n    }\n}\n```\n\nI'm using faker libary from https://github.com/marak/Faker.js/ . for more faker method look at the documentation.\nand to use this class:\n\n```\n// param default to 1 if not specified\nawait Factory.createDummyData(3).then(data =\u003e {\n// what to do to the data\n// data is type of Array\u003cFactory\u003e\n});\n```\n\n5. static method and variable\n\n```\n// get collection name {class}.getCollectionName()\nUserDetail.getCollectionName()\nexport enum CollectionCaseType {\n    /**\n     * ConstantCase = 'USER_DETAIL'\n     */\n\n    ConstantCase ='constant',\n    /**\n     * SnakeCase = 'user_detail'\n     */\n    SnakeCase = 'snake',\n    /**\n     * CamelCase = 'userDetail'\n     */\n    CamelCase = 'camel',\n    /**\n     * HeaderCase = 'Header-Case'\n     */\n    HeaderCase = 'header',\n    /**\n     * ParamCase = 'user-detail'\n     */\n    ParamCase = 'param',\n    /**\n     * CamelCase = 'ParamCase'\n     */\n    PascalCase = 'pascal'\n}\n\n// collection naming style can be changed\nFactory.collectionStyle = CollectionCaseType.PascalCase;\n// or set it in class\n\nclass Example extends FirestoreModel {\n  static collectionStyle = CollectionCaseType.PascalCase;\n  timestamp = false; // set to false if don't want auto timestamp\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faqualaguna%2Ffirestore-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faqualaguna%2Ffirestore-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faqualaguna%2Ffirestore-model/lists"}