{"id":28396220,"url":"https://github.com/ssbc/ssb-schema-definitions","last_synced_at":"2025-06-23T06:31:55.464Z","repository":{"id":32719541,"uuid":"140488431","full_name":"ssbc/ssb-schema-definitions","owner":"ssbc","description":"Standardised schema definitions for ssb message types using is-my-json-valid","archived":false,"fork":false,"pushed_at":"2022-03-24T12:44:29.000Z","size":134,"stargazers_count":3,"open_issues_count":8,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-09T15:53:35.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ssbc.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}},"created_at":"2018-07-10T21:21:17.000Z","updated_at":"2020-07-03T02:28:09.000Z","dependencies_parsed_at":"2022-08-07T18:01:00.811Z","dependency_job_id":null,"html_url":"https://github.com/ssbc/ssb-schema-definitions","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/ssbc/ssb-schema-definitions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-schema-definitions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-schema-definitions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-schema-definitions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-schema-definitions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssbc","download_url":"https://codeload.github.com/ssbc/ssb-schema-definitions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-schema-definitions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260090034,"owners_count":22957169,"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","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-05-31T21:37:26.400Z","updated_at":"2025-06-23T06:31:55.456Z","avatar_url":"https://github.com/ssbc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSB Schema Definitions\n\nStandardised schema definitions for SSB messages when using [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid).\n\n## Example Usage\n\n```js\nconst Definitions = require('ssb-schema-definitions')\nconst Validator = require('is-my-json-valid')\n\nconst schema = {\n  $schema: 'http://json-schema.org/schema#',\n  type: 'object',\n  required: ['type', 'tangles'],\n  properties: {\n    type: {\n      type: 'string',\n      pattern: '^profile/.*$'\n    },\n    preferredName: { type: 'string' },\n    avatarImage: { $ref: '#/definitions/image' }, // \u003c\u003c reference a definition\n    tangles: {\n      group: { $ref: '#/definitions/tangle/any' },\n      profile: { $ref: '#/definitions/tangle/root' }\n    },\n    recps: { $ref: '#/definitions/recipients/box2' }\n  },\n  additionalProperties: false,\n  definitions: Definitions() // attach the definitions\n}\n\nconst isValid = Validator(schema)\n\n// isValid(msgContent) =\u003e Boolean\n// isValid.errors =\u003e null | [Errors]\n```\n\n## API\n\n### `Definitions() =\u003e Object`\n\nThe definitions is a getter (function) so that you can pull it and mutate it awithout getting into trouble.\n\nTo see what definitions are available check out `index.js`.\n\nYou can also see examples of how to use most of the definitions in the `tests/` folder.\nAt time of writing there's good test coverage here for fields:\n- `contentWarning`\n- `image`\n- `mentions`\n- `tangle`\n- `tombstone`\n- `recps` (box1, box2/ envelope)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbc%2Fssb-schema-definitions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssbc%2Fssb-schema-definitions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbc%2Fssb-schema-definitions/lists"}