{"id":13602784,"url":"https://github.com/keplr-team/typed-ajv","last_synced_at":"2026-01-16T16:51:45.382Z","repository":{"id":35234937,"uuid":"172525028","full_name":"keplr-team/typed-ajv","owner":"keplr-team","description":"Define TypeScript types and JSON Schema schemas from the same declarations","archived":false,"fork":false,"pushed_at":"2024-03-01T07:35:05.000Z","size":1542,"stargazers_count":18,"open_issues_count":19,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-05T18:45:50.808Z","etag":null,"topics":["backend"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/keplr-team.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}},"created_at":"2019-02-25T14:49:59.000Z","updated_at":"2024-02-20T22:55:15.000Z","dependencies_parsed_at":"2023-01-15T16:46:01.075Z","dependency_job_id":"abe3bed2-9308-40a3-aae2-2fc658172a4f","html_url":"https://github.com/keplr-team/typed-ajv","commit_stats":{"total_commits":368,"total_committers":10,"mean_commits":36.8,"dds":"0.42934782608695654","last_synced_commit":"e347a40bd20cc4930e41ddf5e1e1b5dce13a9b23"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/keplr-team/typed-ajv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keplr-team%2Ftyped-ajv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keplr-team%2Ftyped-ajv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keplr-team%2Ftyped-ajv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keplr-team%2Ftyped-ajv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keplr-team","download_url":"https://codeload.github.com/keplr-team/typed-ajv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keplr-team%2Ftyped-ajv/sbom","scorecard":{"id":555915,"data":{"date":"2025-08-11","repo":{"name":"github.com/keplr-team/typed-ajv","commit":"e347a40bd20cc4930e41ddf5e1e1b5dce13a9b23"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"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":"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":7,"reason":"dependency not pinned by hash detected -- score normalized to 7","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/keplr-team/typed-ajv/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/keplr-team/typed-ajv/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/keplr-team/typed-ajv/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/keplr-team/typed-ajv/publish.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned","Info:   2 out of   2 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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.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":"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":"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":"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":"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":"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 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":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","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-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-20T12:19:20.365Z","repository_id":35234937,"created_at":"2025-08-20T12:19:20.365Z","updated_at":"2025-08-20T12:19:20.365Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["backend"],"created_at":"2024-08-01T18:01:37.804Z","updated_at":"2026-01-16T16:51:45.364Z","avatar_url":"https://github.com/keplr-team.png","language":"TypeScript","funding_links":[],"categories":["backend"],"sub_categories":[],"readme":"# typed-ajv\n\nDefine TypeScript types and JSON Schema schemas from the same declaration.\n\n## Getting started\n\nDefine your schema:\n\n```typescript\nconst cs = CS.Object({\n  a: CS.String(true),\n  b: CS.Number(false),\n});\n```\n\nGet the type:\n\n```typescript\ntype Type = typeof cs.type; // { a: string, b?: number }\n```\n\n\n\n\nGet the json schema:\n\n```typescript\nconst jsonSchema = cs.getJsonSchema(); // { type: 'object', properties: [...] }\n```\n\nValidate your input data and type it :\n\n```typescript\nif (ajv.validate(jsonSchema, inputData)) {\n  const data: Type = inputData;\n}\n```\n\n## Supported primitive types\n\n| Type    | Description                 |\n| ------- | --------------------------- |\n| Any     | Anything                    |\n| Boolean |\n| Const   | Constant of any type        |\n| Integer | An integer type as `number` |\n| Number  |\n| String  |\n| Unknown | Anything typed as `unknown` |\n| Null    | Only `null`                 |\n\n## Supported compound types\n\n| Type         | Description                                                                |\n| ------------ | -------------------------------------------------------------------------- |\n| AnyOf        | Any type within a selection of definitions                                 |\n| Array        | An array of a type                                                         |\n| Enum         | A string with enumerated values                                            |\n| Object       | An object with typed properties                                            |\n| MergeObjects | Merge two object definitions into one object containing all the properties |\n\n## Helpers\n\n| Type     | Description                                   | Example                                           |\n| -------- | --------------------------------------------- | ------------------------------------------------- |\n| Required | Changes the type of the schema to be required | CS.Required(CS.String(false)) === CS.String(true) |\n| Optional | Changes the type of the schema to be optional | CS.Optional(CS.String(true)) === CS.String(false) |\n\n## Using AnyOf with objects and `removeAdditional: true`\n\n`AnyOf`, when ajv is configured with `removeAdditional: true`, doesn't behave the expected way. For example :\n\n```ts\nCS.AnyOf(\n  [\n    CS.Object(\n      { type: CS.Enum(['car'] as const, true), wheels: CS.Number(true) },\n      true,\n    ),\n    CS.Object(\n      { type: CS.Enum(['horse'] as const, true), legs: CS.Number(true) },\n      true,\n    ),\n  ],\n  true,\n);\n```\n\nThe above schema will unexpectedly fail to validate `{type: 'horse', legs: 4}` because, when evaluating the 'car' option, ajv will remove all the properties except `type` and `wheels`. Thus the 'horse' option will be evaluated with the `legs` property removed and fail to validate.\n\nFor the above schema to work as expected, use the discriminator option:\n\n```ts\nCS.AnyOf(\n  [\n    CS.Object(\n      { type: CS.Enum(['car'] as const, true), wheels: CS.Number(true) },\n      true,\n    ),\n    CS.Object(\n      { type: CS.Enum(['horse'] as const, true), legs: CS.Number(true) },\n      true,\n    ),\n  ],\n  true,\n  { discriminator: 'type' },\n);\n```\n\nAjv will also need to be initialized with the `discriminator: true` option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeplr-team%2Ftyped-ajv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeplr-team%2Ftyped-ajv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeplr-team%2Ftyped-ajv/lists"}