{"id":16367952,"url":"https://github.com/ephys/graphql-joi-directives","last_synced_at":"2025-09-02T17:18:49.175Z","repository":{"id":57111780,"uuid":"383535906","full_name":"ephys/graphql-joi-directives","owner":"ephys","description":"GraphQL directives for joi-powedered constraint validation","archived":false,"fork":false,"pushed_at":"2022-02-08T12:56:43.000Z","size":119,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-04T09:39:17.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ephys.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":"2021-07-06T16:38:11.000Z","updated_at":"2023-03-04T06:14:59.000Z","dependencies_parsed_at":"2022-08-21T00:00:20.298Z","dependency_job_id":null,"html_url":"https://github.com/ephys/graphql-joi-directives","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ephys/graphql-joi-directives","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephys%2Fgraphql-joi-directives","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephys%2Fgraphql-joi-directives/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephys%2Fgraphql-joi-directives/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephys%2Fgraphql-joi-directives/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ephys","download_url":"https://codeload.github.com/ephys/graphql-joi-directives/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephys%2Fgraphql-joi-directives/sbom","scorecard":{"id":378968,"data":{"date":"2025-08-11","repo":{"name":"github.com/ephys/graphql-joi-directives","commit":"be2d86f57f3ccd6ae0850bcef441bc629f9972d3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"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":"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":"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/10 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":"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":"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":"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":"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":"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":"Vulnerabilities","score":0,"reason":"36 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-c2jc-4fpr-4vhg","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-qm7x-rc44-rrqw","Warn: Project is vulnerable to: GHSA-2p3c-p3qw-69r4","Warn: Project is vulnerable to: GHSA-j5g3-5c8r-7qfx","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-7gc6-qh9x-w6h8","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","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-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-v39p-96qg-c8rf","Warn: Project is vulnerable to: GHSA-8v63-cqqc-6r2c","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","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-18T14:57:05.379Z","repository_id":57111780,"created_at":"2025-08-18T14:57:05.379Z","updated_at":"2025-08-18T14:57:05.379Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273318862,"owners_count":25084286,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"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":[],"created_at":"2024-10-11T02:51:16.505Z","updated_at":"2025-09-02T17:18:49.087Z","avatar_url":"https://github.com/ephys.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphql-joi-directives\n\nAdd constraint validation to your GraphQL Inputs using [Joi](https://www.npmjs.com/package/joi)\n\n## Install\n\nAdd the package using [`npm i @ephys/graphql-joi-directives`](https://www.npmjs.com/package/@ephys/graphql-joi-directives)\n\n*This package was built with graphql-tools and supports Apollo.*\n\nAdd the directives and the type definitions to your GraphQL schema:\n\n```typescript\nimport { joiConstraintDirectives, joiContraintDirectivesTypedefs } from '@ephys/graphql-joi-directives';\n\n// ...\n\nconst schema = makeExecutableSchema({\n  //            V this is an array\n  typeDefs: [...joiContraintDirectivesTypedefs],\n  schemaDirectives: {\n    // V this is an object\n    ...joiConstraintDirectives,\n  },\n});\n\nconst server = new ApolloServer({ schema });\n\n// ...\n```\n\n## The directives\n\nBy default, the following directives are exposed.\n\nThey can be used on **fields in inputs** \u0026 on **arguments definitions**\n\n### Strings: @str\n\nCan be used on the `String` \u0026 `[String]` types\n\n```graphql\ndirective @str(\n  # requires a minimum length of {min}\n  min: Int,\n  # requires a maximum length of {max}\n  max: Int,\n  # requires a length of exactly {length}\n  length: Int,\n  # trims the string before validation\n  trim: Boolean,\n  # ensure the string matches the provided regexp.\n  # example\n  # | pattern: \"/[a-zA-Z0-9]/i\"\n  pattern: String,\n  # requires the string to match a credit card format\n  creditCard: Boolean,\n  # converts casing, can be 'UPPER' or 'LOWER'\n  case: JoiDirectiveCaseEnum\n  # format must be a valid ISO date\n  isoDate: Boolean,\n  # format must be a valid ISO duration\n  isoDuration: Boolean,\n) on INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION\n\nenum JoiDirectiveCaseEnum {\n  UPPER\n  LOWER\n}\n```\n\n### Ints: @int\n\nCan be used on the `Int` \u0026 `[Int]` types\n\n```graphql\ndirective @int(\n  min: Int,\n  max: Int\n) on INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION\n```\n\n### Floats: @float\n\nCan be used on the `Float` \u0026 `[Float]` types\n\n```graphql\ndirective @float(\n  # value must be greater than or equal to {min}\n  min: Float,\n  # value must be less than or equal to {max}\n  max: Float,\n  # value must be greater than {minExclusive}\n  # Joi: number.greater - https://joi.dev/api/?v=17.4.0#numbergreaterlimit\n  minExclusive: Float,\n  # value must be less than {maxExclusive}\n  # Joi: number.less - https://joi.dev/api/?v=17.4.0#numberlesslimit\n  maxExclusive: Float,\n  # sets a maximum number of decimal places allowed\n  precision: Int,\n) on INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION\n```\n\n### Lists: @list\n\nCan be used on any list type\n\n```graphql\ndirective @list(\n  # requires a minimum of {min} items in the list\n  min: Int,\n  # requires a maximum of {max} items in the list\n  max: Int,\n  # requires exactly {length} items in the list\n  length: Int,\n  # removes duplicate items from the list\n  unique: Boolean,\n) on INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fephys%2Fgraphql-joi-directives","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fephys%2Fgraphql-joi-directives","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fephys%2Fgraphql-joi-directives/lists"}