{"id":16788855,"url":"https://github.com/narumincho/typed-admin-firestore","last_synced_at":"2026-01-24T04:36:54.309Z","repository":{"id":36473008,"uuid":"227047284","full_name":"narumincho/typed-admin-firestore","owner":"narumincho","description":"stronger type declaration for firebase admin firestore.","archived":false,"fork":false,"pushed_at":"2023-07-20T05:02:48.000Z","size":1631,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T12:00:59.781Z","etag":null,"topics":["firebase","firebase-admin","firestore","type-declarations"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/narumincho.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-10T06:41:35.000Z","updated_at":"2025-02-07T08:58:46.000Z","dependencies_parsed_at":"2024-12-18T14:45:54.555Z","dependency_job_id":"8999cb26-9303-4228-9b93-cadde22a921e","html_url":"https://github.com/narumincho/typed-admin-firestore","commit_stats":{"total_commits":95,"total_committers":5,"mean_commits":19.0,"dds":"0.28421052631578947","last_synced_commit":"ed624cc44c0275b922c8905a7e464142cf1c2bed"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/narumincho/typed-admin-firestore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumincho%2Ftyped-admin-firestore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumincho%2Ftyped-admin-firestore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumincho%2Ftyped-admin-firestore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumincho%2Ftyped-admin-firestore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/narumincho","download_url":"https://codeload.github.com/narumincho/typed-admin-firestore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumincho%2Ftyped-admin-firestore/sbom","scorecard":{"id":674719,"data":{"date":"2025-08-11","repo":{"name":"github.com/narumincho/typed-admin-firestore","commit":"ed624cc44c0275b922c8905a7e464142cf1c2bed"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/11 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":"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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":10,"reason":"no dangerous workflow patterns detected","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":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/narumincho/typed-admin-firestore/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/narumincho/typed-admin-firestore/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/narumincho/typed-admin-firestore/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/narumincho/typed-admin-firestore/main.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"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":"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":"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: Apache License 2.0: 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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-7v5v-9h63-cj86","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-hhhv-q57g-882q","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-h755-8qp9-cq85","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-f9xv-q969-pqx4"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T21:07:59.929Z","repository_id":36473008,"created_at":"2025-08-21T21:07:59.930Z","updated_at":"2025-08-21T21:07:59.930Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28711700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T23:51:44.727Z","status":"online","status_checked_at":"2026-01-24T02:00:06.909Z","response_time":89,"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","firebase-admin","firestore","type-declarations"],"created_at":"2024-10-13T08:25:04.502Z","updated_at":"2026-01-24T04:36:54.293Z","avatar_url":"https://github.com/narumincho.png","language":"TypeScript","readme":"# typed-admin-firestore\n\n[![npm version](https://badge.fury.io/js/typed-admin-firestore.svg)](https://badge.fury.io/js/typed-admin-firestore)\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/narumincho/typed-admin-firestore)\n\nstronger type declaration for firebase admin firestore.\n\n[type-firestore](https://github.com/narumincho/typed-firestore)\n\n## admin\n\n```ts\nimport * as admin from \"firebase-admin\";\nimport type * as typedAdminFirestore from \"typed-admin-firestore\";\n\nconst app = admin.initializeApp();\n\nconst firestoreInstance = (app.firestore() as unknown) as typedAdminFirestore.Firestore\u003c{\n  user: { key: UserId; value: User; subCollections: {} };\n  music: { key: MusicId; value: Music; subCollections: {} };\n  project: {\n    key: ProjectId;\n    value: Project;\n    subCollections: {\n      data:\n        | {\n            key: \"Body\";\n            value: { text: string };\n            subCollections: {};\n          }\n        | {\n            key: \"Comments\";\n            value: Comments;\n            subCollections: {};\n          };\n    };\n  };\n}\u003e;\n\ntype UserId = string \u0026 { _userId: never };\n\ntype User = {\n  name: string;\n  age: number;\n  openIdConnect: {\n    providerName: string;\n    idInProvider: string;\n  };\n  likedMusics: Array\u003cMusicId\u003e;\n  createdAt: admin.firestore.Timestamp;\n};\n\ntype MusicId = string \u0026 { _musicId: never };\n\ntype Music = {\n  title: string;\n  artist: UserId;\n};\n\ntype ProjectId = string \u0026 { _projectId: never };\n\ntype Project = {\n  name: string;\n  createdBy: UserId;\n};\n\ntype Comments = {\n  comments: ReadonlyArray\u003c{\n    body: string;\n    createdBy: UserId;\n    createdAt: admin.firestore.Timestamp;\n  }\u003e;\n};\n\n(async () =\u003e {\n  const userQuerySnapshotArray = await firestoreInstance\n    .collection(\"user\")\n    .where(\"age\", \"\u003c=\", 20)\n    .get();\n\n  for (const userQueryDocumentSnapshot of userQuerySnapshotArray.docs) {\n    const data = userQueryDocumentSnapshot.data();\n    console.log(\"name\", data.name); // Type hint !!!!!\n    console.log(\"providerName\", data.openIdConnect.providerName); // Type hint !!!!!\n\n    for (const likedMusicId of data.likedMusics) {\n      firestoreInstance.collection(\"music\").doc(likedMusicId); // no error !!!\n      firestoreInstance.collection(\"user\").doc(likedMusicId); // error !!!\n    }\n  }\n\n  const commentDoc = await firestoreInstance\n    .collection(\"project\") // autocomplete\n    .doc(\"6b9495528e9a12186b9c210448bdc90b\" as ProjectId)\n    .collection(\"data\") // autocomplete\n    .doc(\"Comments\") // autocomplete\n    .get(); // returns DocumentSnapshot of Comments\n})();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarumincho%2Ftyped-admin-firestore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarumincho%2Ftyped-admin-firestore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarumincho%2Ftyped-admin-firestore/lists"}