Skip to content

Commit

Permalink
feat: add schemas for registry_package event, update package even…
Browse files Browse the repository at this point in the history
…t with new information (#747)

* feat: new updated examples for `package` and `registry_package` events

* feat: add schemas for `registry_package` event

* feat: update `package` event schemas

updates taken from https://github.com/github/rest-api-description/blob/d25cb45e5887715dd1b0d57a07de4b9e76ec5ec1/descriptions-next/api.github.com/api.github.com.json

* build: generate types

* fix: the `package_type` is now in caps for containers

* fix: add `package_url` property to `package` event

* fix: add missing properties to `registry_package` event

* fix: move the `description` to be outside the `oneOf`

* build: generate types

* fix: specify `additionalProperties` to be type `string`
  • Loading branch information
wolfy1339 committed Dec 14, 2022
1 parent 04608f5 commit b7b5d9d
Show file tree
Hide file tree
Showing 11 changed files with 2,892 additions and 250 deletions.
374 changes: 374 additions & 0 deletions payload-examples/api.github.com/index.json

Large diffs are not rendered by default.

374 changes: 374 additions & 0 deletions payload-examples/api.github.com/package/published.docker.payload.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "common/package-npm-metadata.schema.json",
"type": "object",
"properties": {
"name": { "type": "string" },
"version": { "type": "string" },
"npm_user": { "type": "string" },
"author": {
"oneOf": [
{ "type": "object", "additionalProperties": { "type": "string" } },
{ "type": "null" }
]
},
"bugs": {
"oneOf": [
{ "type": "object", "additionalProperties": { "type": "string" } },
{ "type": "null" }
]
},
"dependencies": {
"type": "object",
"additionalProperties": { "type": "string" }
},
"dev_dependencies": {
"type": "object",
"additionalProperties": { "type": "string" }
},
"peer_dependencies": {
"type": "object",
"additionalProperties": { "type": "string" }
},
"optional_dependencies": {
"type": "object",
"additionalProperties": { "type": "string" }
},
"description": { "type": "string" },
"dist": {
"oneOf": [
{ "type": "object", "additionalProperties": { "type": "string" } },
{ "type": "null" }
]
},
"git_head": { "type": "string" },
"homepage": { "type": "string" },
"license": { "type": "string" },
"main": { "type": "string" },
"repository": {
"oneOf": [
{ "type": "object", "additionalProperties": { "type": "string" } },
{ "type": "null" }
]
},
"scripts": { "type": "object" },
"id": { "type": "string" },
"node_version": { "type": "string" },
"npm_version": { "type": "string" },
"has_shrinkwrap": { "type": "boolean" },
"maintainers": { "type": "array", "items": { "type": "object" } },
"contributors": { "type": "array", "items": { "type": "object" } },
"engines": {
"type": "object",
"additionalProperties": { "type": "string" }
},
"keywords": { "type": "array", "items": { "type": "string" } },
"files": { "type": "array", "items": { "type": "string" } },
"bin": { "type": "object" },
"man": { "type": "object" },
"directories": {
"oneOf": [
{ "type": "object", "additionalProperties": { "type": "string" } },
{ "type": "null" }
]
},
"os": { "type": "array", "items": { "type": "string" } },
"cpu": { "type": "array", "items": { "type": "string" } },
"readme": { "type": "string" },
"installation_command": { "type": "string" },
"release_id": { "type": "integer" },
"commit_oid": { "type": "string" },
"published_via_actions": { "type": "boolean" },
"deleted_by_id": { "type": "integer" }
},
"additionalProperties": false,
"title": "Package NPM Metadata"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "common/package-nuget-metadata.schema.json",
"type": "object",
"required": [],
"properties": {
"id": {
"oneOf": [
{ "type": "string" },
{ "type": "object" },
{ "type": "integer" }
]
},
"name": { "type": "string" },
"value": {
"oneOf": [
{ "type": "boolean" },
{ "type": "string" },
{ "type": "integer" },
{
"type": "object",
"properties": {
"url": { "type": "string" },
"branch": { "type": "string" },
"commit": { "type": "string" },
"type": { "type": "string" }
},
"additionalProperties": false
}
]
}
},
"additionalProperties": false,
"title": "Package Nuget Metadata"
}
Loading

0 comments on commit b7b5d9d

Please sign in to comment.