{"id":15813569,"url":"https://github.com/alexkravets/schema","last_synced_at":"2026-02-13T07:35:22.886Z","repository":{"id":42836105,"uuid":"264568426","full_name":"alexkravets/schema","owner":"alexkravets","description":"Advanced JSON schema manipulation and validation library.","archived":false,"fork":false,"pushed_at":"2026-01-30T08:45:25.000Z","size":616,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-31T00:27:01.261Z","etag":null,"topics":["json","json-ld","schema","validator","verifiable-credentials"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/alexkravets.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-17T02:31:05.000Z","updated_at":"2026-01-30T08:45:28.000Z","dependencies_parsed_at":"2025-09-25T22:37:12.570Z","dependency_job_id":null,"html_url":"https://github.com/alexkravets/schema","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.04761904761904767,"last_synced_commit":"b2738ce5954300d8b13a904067e169c9f6563ca2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexkravets/schema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexkravets%2Fschema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexkravets%2Fschema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexkravets%2Fschema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexkravets%2Fschema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexkravets","download_url":"https://codeload.github.com/alexkravets/schema/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexkravets%2Fschema/sbom","scorecard":{"id":181954,"data":{"date":"2025-08-11","repo":{"name":"github.com/alexkravets/schema","commit":"255f88cf1e704f039549dd7dd1be704c7e4cb396"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"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":"Maintained","score":0,"reason":"1 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":"Code-Review","score":0,"reason":"Found 0/26 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":"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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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 'main'"],"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 4 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":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7"],"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-16T19:00:22.740Z","repository_id":42836105,"created_at":"2025-08-16T19:00:22.740Z","updated_at":"2025-08-16T19:00:22.740Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29398652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["json","json-ld","schema","validator","verifiable-credentials"],"created_at":"2024-10-05T04:03:11.580Z","updated_at":"2026-02-13T07:35:22.879Z","avatar_url":"https://github.com/alexkravets.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @kravc/schema\n\nAdvanced JSON schema manipulation and validation library written in TypeScript,\nbased on [z-schema](https://github.com/zaggino/z-schema).\n\n## Get Started\n\nInstall npm dependency:\n\n```sh\nnpm i --save @kravc/schema\n```\n\n```ts\nimport { Schema, Validator } from '@kravc/schema'\n\nconst userSchema = new Schema({\n  firstName: { required: true },\n  lastName:  { required: true }\n}, 'User')\n\nconst profileSchema = userSchema\n  .extend({\n    status: {\n      enum: [ 'Pending', 'Active' ],\n      default: 'Pending'\n    }\n  }, 'Profile')\n\nconst validator = new Validator([ profileSchema ])\n\nconst profile = validator.validate({ firstName: 'John', lastName: 'Doe' }, 'Profile')\nconsole.log(profile)\n```\n\nExpected output:\n\n```\n{ firstName: 'John', lastName: 'Doe', status: 'Pending' }\n```\n\nOther `Schema` and `Validator` usage examples:\n\n- [Schema](./src/__tests__/Schema.test.ts)\n- [Validator](./src/__tests__/Validator.test.ts)\n\n\n## Verifiable Credentials\n\nClass `CredentialFactory` allows to build a verifiable credential with embeded\nlinked data context. Common json schema types and formats (`integer`,\n`date-time`, etc.) are mapped to [schema.org](https://schema.org) types.\n\nDefine schema for a credential subject:\n\n```ts\nimport { Schema } from '@kravc/schema'\n\nconst accountSchema = new Schema({\n  id:          { required: true },\n  username:    { required: true },\n  createdAt:   { format: 'date-time', required: true },\n  dateOfBirth: { format: 'date' }\n}, 'Account')\n```\n\nInitialize credential factory by providing credential URI and credential subject\nschemas:\n\n```ts\nimport { CredentialFactory } from '@kravc/schema'\n\nconst factory = new CredentialFactory('https://example.com/schema/AccountV1', [ accountSchema ])\n```\n\nCreate a credential for a specific subject, `createCredential` method validates\nthe input and populates any defaults defined by schema:\n\n```ts\nconst holder    = 'did:HOLDER_ID'\nconst username  = 'USER'\nconst createdAt =  new Date().toISOString()\nconst credentialId = 'https://example.com/credentials/CREDENTIAL_ID'\n\nconst subject = {\n  id: holder,\n  username,\n  createdAt\n}\n\nconst credential = factory.createCredential(credentialId, holder, subject)\nconsole.log(JSON.stringify(credential, null, 2))\n```\n\nExpected JSON-LD output (could be verified using [JSON-LD Playground](https://json-ld.org/playground/)):\n\n```json\n{\n  \"@context\": [\n    \"https://www.w3.org/2018/credentials/v1\",\n    {\n      \"AccountV1\": {\n        \"@id\": \"https://example.com/schema/AccountV1\"\n      },\n      \"Account\": {\n        \"@id\": \"https://example.com/schema/AccountV1#Account\",\n        \"@context\": {\n          \"@vocab\": \"https://example.com/schema/AccountV1#\",\n          \"@version\": 1.1,\n          \"@protected\": true,\n          \"schema\": \"https://schema.org/\",\n          \"username\": {\n            \"@id\": \"username\"\n          },\n          \"createdAt\": {\n            \"@id\": \"createdAt\",\n            \"@type\": \"schema:DateTime\"\n          },\n          \"dateOfBirth\": {\n            \"@id\": \"dateOfBirth\",\n            \"@type\": \"schema:Date\"\n          }\n        }\n      }\n    }\n  ],\n  \"id\": \"https://example.com/credentials/CREDENTIAL_ID\",\n  \"type\": [\n    \"VerifiableCredential\",\n    \"AccountV1\"\n  ],\n  \"holder\": \"did:HOLDER_ID\",\n  \"credentialSubject\": {\n    \"id\": \"did:HOLDER_ID\",\n    \"username\": \"USER\",\n    \"createdAt\": \"2020-11-11T11:11:11.111Z\",\n    \"type\": \"Account\"\n  }\n}\n```\n\nAttributes `issuer`, `issuanceDate` and `proof` are intentionally skipped and\nto be set by issuing function (e.g [@kravc/identity](http://github.com/alexkravets/identity)).\n\nOther `CredentialFactory` examples:\n\n- [createAccountCredential](./examples/credentials/createAccountCredential.ts)\n- [createMineSweeperScoreCredential](./examples/credentials/createMineSweeperScoreCredential.ts)\n\n---\n\nRevision: January 27, 2026\u003cbr/\u003e\nBy: Alex Kravets (@alexkravets)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexkravets%2Fschema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexkravets%2Fschema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexkravets%2Fschema/lists"}