From ba8570317c25dc93bdce471ebe85145ebda8f922 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sun, 11 Dec 2022 12:42:30 -0500 Subject: [PATCH 01/10] feat: new updated examples for `package` and `registry_package` events --- payload-examples/api.github.com/index.json | 374 ++++++++++++++++++ .../package/published.docker.payload.json | 374 ++++++++++++++++++ ...ayload.json => published.npm.payload.json} | 0 .../published.docker.payload.json | 374 ++++++++++++++++++ 4 files changed, 1122 insertions(+) create mode 100644 payload-examples/api.github.com/package/published.docker.payload.json rename payload-examples/api.github.com/package/{published.payload.json => published.npm.payload.json} (100%) create mode 100644 payload-examples/api.github.com/registry_package/published.docker.payload.json diff --git a/payload-examples/api.github.com/index.json b/payload-examples/api.github.com/index.json index 10a815fe1..f83b1fc97 100644 --- a/payload-examples/api.github.com/index.json +++ b/payload-examples/api.github.com/index.json @@ -32287,6 +32287,380 @@ "site_admin": false } }, + { + "action": "published", + "package": { + "id": 10696, + "name": "hello-world-npm", + "namespace": "Codertocat/hello-world", + "description": null, + "ecosystem": "docker", + "package_type": "npm", + "html_url": "https://github.com/Codertocat/hello-world/packages/10696", + "created_at": "2019-05-09T23:28:29Z", + "updated_at": "2019-05-09T23:28:29Z", + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "package_version": { + "id": 57755790, + "version": "sha256:3da1996a8115d7616457760d9920b815241d0a03b34cf5f04e9a0e9d8de37498", + "name": "sha256:3da1996a8115d7616457760d9920b815241d0a03b34cf5f04e9a0e9d8de37498", + "description": "Hello-World in a docker container", + "summary": "Hello-World in a docker container", + "body": { + "repository": { + "repository": { + "id": 185882436, + "node_id": "MDEwOlJlcG9zaXRvcnkxODU4ODI0MzY=", + "name": "hello-world-npm", + "full_name": "Codertocat/hello-world-npm", + "private": true, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/hello-world-npm", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/hello-world-npm", + "forks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/forks", + "keys_url": "https://api.github.com/repos/Codertocat/hello-world-npm/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/hello-world-npm/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/hello-world-npm/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/events", + "assignees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/hello-world-npm/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/hello-world-npm/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/hello-world-npm/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/hello-world-npm/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/hello-world-npm/merges", + "archive_url": "https://api.github.com/repos/Codertocat/hello-world-npm/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/hello-world-npm/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/hello-world-npm/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/hello-world-npm/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/hello-world-npm/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/hello-world-npm/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/hello-world-npm/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/deployments", + "created_at": "2019-05-09T22:53:26Z", + "updated_at": "2019-05-09T23:24:42Z", + "pushed_at": "2019-05-09T23:27:00Z", + "git_url": "git://github.com/Codertocat/hello-world-npm.git", + "ssh_url": "git@github.com:Codertocat/hello-world-npm.git", + "clone_url": "https://github.com/Codertocat/hello-world-npm.git", + "svn_url": "https://github.com/Codertocat/hello-world-npm", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "is_template": false, + "topics": [], + "visibility": "public", + "web_commit_signoff_required": false + } + }, + "info": { + "type": "blob", + "oid": "326b0e08c815245a11be4b399c51e419f334f569", + "mode": 33188, + "name": "README.md", + "path": "README.md", + "size": null, + "collection": true + }, + "attributes": {}, + "_formatted": true + }, + "manifest": "", + "html_url": "https://github.com/Codertocat/container/hello-world/10696", + "target_commitish": "master", + "target_oid": "6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "created_at": "0001-01-01T00:00:00Z", + "updated_at": "0001-01-01T00:00:00Z", + "metadata": [], + "container_metadata": { + "tag": { + "name": "", + "digest": "sha256:6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b" + }, + "labels": { + "description": "Hello-World in a docker container", + "source": "https://github.com/Codertocat/hello-world", + "revision": "", + "image_url": "https://github.com/Codertocat/hello-world", + "licenses": "", + "all_labels": { + "org.opencontainers.image.url": "https://github.com/Codertocat/hello-world", + "org.opencontainers.image.licenses": "", + "org.opencontainers.image.title": "docker-hello-world", + "org.opencontainers.image.revision": "6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "org.opencontainers.image.created": "2019-05-09T23:28:29Z", + "org.opencontainers.image.version": "nightly", + "org.opencontainers.image.description": "Hello-World in a docker container", + "org.opencontainers.image.source": "https://github.com/Codertocat/hello-world" + } + }, + "manifest": { + "digest": "sha256:6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "media_type": "application/vnd.docker.distribution.manifest.v2+json", + "uri": "repositories/Codertocat/hello-world/manifests/sha256:6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "size": 1782, + "config": { + "digest": "sha256:37e1478a8ffb0513113dbbb172bfafdf56ba24014a671921a2593d83da7a0608", + "media_type": "application/vnd.docker.container.image.v1+json", + "size": 7205 + }, + "layers": [ + { + "digest": "sha256:fd18d0201d0ce0c5e103902d894f5d601fc5dde76688aa7dae786840141d23e4", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 26576195 + }, + { + "digest": "sha256:0fa20a868a60ceb7bc8a95981a4bd56fac4c2d9de1f8745eae546146e48a8e0f", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 51166445 + }, + { + "digest": "sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 32 + }, + { + "digest": "sha256:2ad7497455cdab76764a94c36fa2fc898c146b4d996bbd01beda28ca303e8a62", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 130 + }, + { + "digest": "sha256:f09600ea01bd4ba5ef2a7d3690c7d46147b924e680cc9034194263b86f3d6bd7", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 12202 + }, + { + "digest": "sha256:783c2f94749191f27129ee0bb80ff4db26f49af8a82aa67c85fc9444ce189d0c", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 727 + }, + { + "digest": "sha256:3d98f361b22ebdff75986009b3077e5590d90ea81c9df95d0cf9e311436add74", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 41670773 + } + ] + } + }, + "package_files": [], + "installation_command": "docker pull ghcr.io/Codertocat/hello-world:", + "package_url": "ghcr.io/Codertocat/hello-world:" + }, + "registry": { + "about_url": "https://docs.github.com/packages/learn-github-packages/introduction-to-github-packages", + "name": "GitHub CONTAINER registry", + "type": "CONTAINER", + "url": "https://CONTAINER.pkg.github.com/Codertocat", + "vendor": "GitHub Inc" + } + }, + "organization": { + "login": "Octocoders", + "id": 38302899, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4MzAyODk5", + "url": "https://api.github.com/orgs/Octocoders", + "repos_url": "https://api.github.com/orgs/Octocoders/repos", + "events_url": "https://api.github.com/orgs/Octocoders/events", + "hooks_url": "https://api.github.com/orgs/Octocoders/hooks", + "issues_url": "https://api.github.com/orgs/Octocoders/issues", + "members_url": "https://api.github.com/orgs/Octocoders/members{/member}", + "public_members_url": "https://api.github.com/orgs/Octocoders/public_members{/member}", + "avatar_url": "https://avatars1.githubusercontent.com/u/38302899?v=4", + "description": "" + }, + "repository": { + "id": 185882436, + "node_id": "MDEwOlJlcG9zaXRvcnkxODU4ODI0MzY=", + "name": "hello-world-npm", + "full_name": "Codertocat/hello-world-npm", + "private": true, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/hello-world-npm", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/hello-world-npm", + "forks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/forks", + "keys_url": "https://api.github.com/repos/Codertocat/hello-world-npm/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/hello-world-npm/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/hello-world-npm/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/events", + "assignees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/hello-world-npm/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/hello-world-npm/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/hello-world-npm/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/hello-world-npm/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/hello-world-npm/merges", + "archive_url": "https://api.github.com/repos/Codertocat/hello-world-npm/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/hello-world-npm/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/hello-world-npm/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/hello-world-npm/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/hello-world-npm/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/hello-world-npm/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/hello-world-npm/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/deployments", + "created_at": "2019-05-09T22:53:26Z", + "updated_at": "2019-05-09T23:24:42Z", + "pushed_at": "2019-05-09T23:27:00Z", + "git_url": "git://github.com/Codertocat/hello-world-npm.git", + "ssh_url": "git@github.com:Codertocat/hello-world-npm.git", + "clone_url": "https://github.com/Codertocat/hello-world-npm.git", + "svn_url": "https://github.com/Codertocat/hello-world-npm", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "is_template": false, + "topics": [], + "visibility": "public", + "web_commit_signoff_required": false + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } + }, { "action": "published", "package": { diff --git a/payload-examples/api.github.com/package/published.docker.payload.json b/payload-examples/api.github.com/package/published.docker.payload.json new file mode 100644 index 000000000..c0338063d --- /dev/null +++ b/payload-examples/api.github.com/package/published.docker.payload.json @@ -0,0 +1,374 @@ +{ + "action": "published", + "package": { + "id": 10696, + "name": "hello-world-npm", + "namespace": "Codertocat/hello-world", + "description": null, + "ecosystem": "docker", + "package_type": "npm", + "html_url": "https://github.com/Codertocat/hello-world/packages/10696", + "created_at": "2019-05-09T23:28:29Z", + "updated_at": "2019-05-09T23:28:29Z", + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "package_version": { + "id": 57755790, + "version": "sha256:3da1996a8115d7616457760d9920b815241d0a03b34cf5f04e9a0e9d8de37498", + "name": "sha256:3da1996a8115d7616457760d9920b815241d0a03b34cf5f04e9a0e9d8de37498", + "description": "Hello-World in a docker container", + "summary": "Hello-World in a docker container", + "body": { + "repository": { + "repository": { + "id": 185882436, + "node_id": "MDEwOlJlcG9zaXRvcnkxODU4ODI0MzY=", + "name": "hello-world-npm", + "full_name": "Codertocat/hello-world-npm", + "private": true, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/hello-world-npm", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/hello-world-npm", + "forks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/forks", + "keys_url": "https://api.github.com/repos/Codertocat/hello-world-npm/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/hello-world-npm/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/hello-world-npm/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/events", + "assignees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/hello-world-npm/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/hello-world-npm/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/hello-world-npm/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/hello-world-npm/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/hello-world-npm/merges", + "archive_url": "https://api.github.com/repos/Codertocat/hello-world-npm/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/hello-world-npm/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/hello-world-npm/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/hello-world-npm/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/hello-world-npm/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/hello-world-npm/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/hello-world-npm/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/deployments", + "created_at": "2019-05-09T22:53:26Z", + "updated_at": "2019-05-09T23:24:42Z", + "pushed_at": "2019-05-09T23:27:00Z", + "git_url": "git://github.com/Codertocat/hello-world-npm.git", + "ssh_url": "git@github.com:Codertocat/hello-world-npm.git", + "clone_url": "https://github.com/Codertocat/hello-world-npm.git", + "svn_url": "https://github.com/Codertocat/hello-world-npm", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "is_template": false, + "topics": [], + "visibility": "public", + "web_commit_signoff_required": false + } + }, + "info": { + "type": "blob", + "oid": "326b0e08c815245a11be4b399c51e419f334f569", + "mode": 33188, + "name": "README.md", + "path": "README.md", + "size": null, + "collection": true + }, + "attributes": {}, + "_formatted": true + }, + "manifest": "", + "html_url": "https://github.com/Codertocat/container/hello-world/10696", + "target_commitish": "master", + "target_oid": "6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "created_at": "0001-01-01T00:00:00Z", + "updated_at": "0001-01-01T00:00:00Z", + "metadata": [], + "container_metadata": { + "tag": { + "name": "", + "digest": "sha256:6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b" + }, + "labels": { + "description": "Hello-World in a docker container", + "source": "https://github.com/Codertocat/hello-world", + "revision": "", + "image_url": "https://github.com/Codertocat/hello-world", + "licenses": "", + "all_labels": { + "org.opencontainers.image.url": "https://github.com/Codertocat/hello-world", + "org.opencontainers.image.licenses": "", + "org.opencontainers.image.title": "docker-hello-world", + "org.opencontainers.image.revision": "6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "org.opencontainers.image.created": "2019-05-09T23:28:29Z", + "org.opencontainers.image.version": "nightly", + "org.opencontainers.image.description": "Hello-World in a docker container", + "org.opencontainers.image.source": "https://github.com/Codertocat/hello-world" + } + }, + "manifest": { + "digest": "sha256:6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "media_type": "application/vnd.docker.distribution.manifest.v2+json", + "uri": "repositories/Codertocat/hello-world/manifests/sha256:6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "size": 1782, + "config": { + "digest": "sha256:37e1478a8ffb0513113dbbb172bfafdf56ba24014a671921a2593d83da7a0608", + "media_type": "application/vnd.docker.container.image.v1+json", + "size": 7205 + }, + "layers": [ + { + "digest": "sha256:fd18d0201d0ce0c5e103902d894f5d601fc5dde76688aa7dae786840141d23e4", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 26576195 + }, + { + "digest": "sha256:0fa20a868a60ceb7bc8a95981a4bd56fac4c2d9de1f8745eae546146e48a8e0f", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 51166445 + }, + { + "digest": "sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 32 + }, + { + "digest": "sha256:2ad7497455cdab76764a94c36fa2fc898c146b4d996bbd01beda28ca303e8a62", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 130 + }, + { + "digest": "sha256:f09600ea01bd4ba5ef2a7d3690c7d46147b924e680cc9034194263b86f3d6bd7", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 12202 + }, + { + "digest": "sha256:783c2f94749191f27129ee0bb80ff4db26f49af8a82aa67c85fc9444ce189d0c", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 727 + }, + { + "digest": "sha256:3d98f361b22ebdff75986009b3077e5590d90ea81c9df95d0cf9e311436add74", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 41670773 + } + ] + } + }, + "package_files": [], + "installation_command": "docker pull ghcr.io/Codertocat/hello-world:", + "package_url": "ghcr.io/Codertocat/hello-world:" + }, + "registry": { + "about_url": "https://docs.github.com/packages/learn-github-packages/introduction-to-github-packages", + "name": "GitHub CONTAINER registry", + "type": "CONTAINER", + "url": "https://CONTAINER.pkg.github.com/Codertocat", + "vendor": "GitHub Inc" + } + }, + "organization": { + "login": "Octocoders", + "id": 38302899, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4MzAyODk5", + "url": "https://api.github.com/orgs/Octocoders", + "repos_url": "https://api.github.com/orgs/Octocoders/repos", + "events_url": "https://api.github.com/orgs/Octocoders/events", + "hooks_url": "https://api.github.com/orgs/Octocoders/hooks", + "issues_url": "https://api.github.com/orgs/Octocoders/issues", + "members_url": "https://api.github.com/orgs/Octocoders/members{/member}", + "public_members_url": "https://api.github.com/orgs/Octocoders/public_members{/member}", + "avatar_url": "https://avatars1.githubusercontent.com/u/38302899?v=4", + "description": "" + }, + "repository": { + "id": 185882436, + "node_id": "MDEwOlJlcG9zaXRvcnkxODU4ODI0MzY=", + "name": "hello-world-npm", + "full_name": "Codertocat/hello-world-npm", + "private": true, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/hello-world-npm", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/hello-world-npm", + "forks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/forks", + "keys_url": "https://api.github.com/repos/Codertocat/hello-world-npm/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/hello-world-npm/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/hello-world-npm/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/events", + "assignees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/hello-world-npm/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/hello-world-npm/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/hello-world-npm/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/hello-world-npm/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/hello-world-npm/merges", + "archive_url": "https://api.github.com/repos/Codertocat/hello-world-npm/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/hello-world-npm/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/hello-world-npm/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/hello-world-npm/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/hello-world-npm/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/hello-world-npm/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/hello-world-npm/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/deployments", + "created_at": "2019-05-09T22:53:26Z", + "updated_at": "2019-05-09T23:24:42Z", + "pushed_at": "2019-05-09T23:27:00Z", + "git_url": "git://github.com/Codertocat/hello-world-npm.git", + "ssh_url": "git@github.com:Codertocat/hello-world-npm.git", + "clone_url": "https://github.com/Codertocat/hello-world-npm.git", + "svn_url": "https://github.com/Codertocat/hello-world-npm", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "is_template": false, + "topics": [], + "visibility": "public", + "web_commit_signoff_required": false + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/payload-examples/api.github.com/package/published.payload.json b/payload-examples/api.github.com/package/published.npm.payload.json similarity index 100% rename from payload-examples/api.github.com/package/published.payload.json rename to payload-examples/api.github.com/package/published.npm.payload.json diff --git a/payload-examples/api.github.com/registry_package/published.docker.payload.json b/payload-examples/api.github.com/registry_package/published.docker.payload.json new file mode 100644 index 000000000..08b0ddb58 --- /dev/null +++ b/payload-examples/api.github.com/registry_package/published.docker.payload.json @@ -0,0 +1,374 @@ +{ + "action": "published", + "registry_package": { + "id": 10696, + "name": "hello-world-npm", + "namespace": "Codertocat/hello-world", + "description": null, + "ecosystem": "docker", + "package_type": "npm", + "html_url": "https://github.com/Codertocat/hello-world/packages/10696", + "created_at": "2019-05-09T23:28:29Z", + "updated_at": "2019-05-09T23:28:29Z", + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "package_version": { + "id": 57755791, + "version": "sha256:3da1996a8115d7616457760d9920b815241d0a03b34cf5f04e9a0e9d8de37498", + "name": "sha256:3da1996a8115d7616457760d9920b815241d0a03b34cf5f04e9a0e9d8de37498", + "description": "Hello-World in a docker container", + "summary": "Hello-World in a docker container", + "body": { + "repository": { + "repository": { + "id": 185882436, + "node_id": "MDEwOlJlcG9zaXRvcnkxODU4ODI0MzY=", + "name": "hello-world-npm", + "full_name": "Codertocat/hello-world-npm", + "private": true, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/hello-world-npm", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/hello-world-npm", + "forks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/forks", + "keys_url": "https://api.github.com/repos/Codertocat/hello-world-npm/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/hello-world-npm/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/hello-world-npm/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/events", + "assignees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/hello-world-npm/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/hello-world-npm/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/hello-world-npm/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/hello-world-npm/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/hello-world-npm/merges", + "archive_url": "https://api.github.com/repos/Codertocat/hello-world-npm/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/hello-world-npm/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/hello-world-npm/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/hello-world-npm/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/hello-world-npm/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/hello-world-npm/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/hello-world-npm/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/deployments", + "created_at": "2019-05-09T22:53:26Z", + "updated_at": "2019-05-09T23:24:42Z", + "pushed_at": "2019-05-09T23:27:00Z", + "git_url": "git://github.com/Codertocat/hello-world-npm.git", + "ssh_url": "git@github.com:Codertocat/hello-world-npm.git", + "clone_url": "https://github.com/Codertocat/hello-world-npm.git", + "svn_url": "https://github.com/Codertocat/hello-world-npm", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "is_template": false, + "topics": [], + "visibility": "public", + "web_commit_signoff_required": false + } + }, + "info": { + "type": "blob", + "oid": "326b0e08c815245a11be4b399c51e419f334f569", + "mode": 33188, + "name": "README.md", + "path": "README.md", + "size": null, + "collection": true + }, + "attributes": {}, + "_formatted": true + }, + "manifest": "", + "html_url": "https://github.com/orgs/Codertocat/packages/container/hello-world/57755791", + "target_commitish": "master", + "target_oid": "3da1996a8115d7616457760d9920b815241d0a03b34cf5f04e9a0e9d8de37498", + "created_at": "0001-01-01T00:00:00Z", + "updated_at": "0001-01-01T00:00:00Z", + "metadata": [], + "container_metadata": { + "tag": { + "name": "", + "digest": "sha256:6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b" + }, + "labels": { + "description": "Hello-World in a docker container", + "source": "https://github.com/Codertocat/hello-world", + "revision": "", + "image_url": "https://github.com/Codertocat/hello-world", + "licenses": "", + "all_labels": { + "org.opencontainers.image.url": "https://github.com/Codertocat/hello-world", + "org.opencontainers.image.licenses": "", + "org.opencontainers.image.title": "docker-hello-world", + "org.opencontainers.image.revision": "6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "org.opencontainers.image.created": "2019-05-09T23:28:29Z", + "org.opencontainers.image.version": "nightly", + "org.opencontainers.image.description": "Hello-World in a docker container", + "org.opencontainers.image.source": "https://github.com/Codertocat/hello-world" + } + }, + "manifest": { + "digest": "sha256:6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "media_type": "application/vnd.docker.distribution.manifest.v2+json", + "uri": "repositories/Codertocat/hello-world/manifests/sha256:6c62fb45fe66bfb1ea9a66abc38f6a0cc974292b", + "size": 1782, + "config": { + "digest": "sha256:37e1478a8ffb0513113dbbb172bfafdf56ba24014a671921a2593d83da7a0608", + "media_type": "application/vnd.docker.container.image.v1+json", + "size": 7205 + }, + "layers": [ + { + "digest": "sha256:fd18d0201d0ce0c5e103902d894f5d601fc5dde76688aa7dae786840141d23e4", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 26576195 + }, + { + "digest": "sha256:0fa20a868a60ceb7bc8a95981a4bd56fac4c2d9de1f8745eae546146e48a8e0f", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 51166445 + }, + { + "digest": "sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 32 + }, + { + "digest": "sha256:2ad7497455cdab76764a94c36fa2fc898c146b4d996bbd01beda28ca303e8a62", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 130 + }, + { + "digest": "sha256:f09600ea01bd4ba5ef2a7d3690c7d46147b924e680cc9034194263b86f3d6bd7", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 12202 + }, + { + "digest": "sha256:783c2f94749191f27129ee0bb80ff4db26f49af8a82aa67c85fc9444ce189d0c", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 727 + }, + { + "digest": "sha256:3d98f361b22ebdff75986009b3077e5590d90ea81c9df95d0cf9e311436add74", + "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 41670773 + } + ] + } + }, + "package_files": [], + "installation_command": "docker pull ghcr.io/Codertocat/hello-world:", + "package_url": "ghcr.io/Codertocat/hello-world:" + }, + "registry": { + "about_url": "https://docs.github.com/packages/learn-github-packages/introduction-to-github-packages", + "name": "GitHub CONTAINER registry", + "type": "CONTAINER", + "url": "https://CONTAINER.pkg.github.com/Codertocat", + "vendor": "GitHub Inc" + } + }, + "repository": { + "id": 185882436, + "node_id": "MDEwOlJlcG9zaXRvcnkxODU4ODI0MzY=", + "name": "hello-world-npm", + "full_name": "Codertocat/hello-world-npm", + "private": true, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/hello-world-npm", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/hello-world-npm", + "forks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/forks", + "keys_url": "https://api.github.com/repos/Codertocat/hello-world-npm/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/hello-world-npm/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/hello-world-npm/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/hello-world-npm/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/hello-world-npm/events", + "assignees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/hello-world-npm/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/hello-world-npm/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/hello-world-npm/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/hello-world-npm/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/hello-world-npm/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/hello-world-npm/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/hello-world-npm/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/hello-world-npm/merges", + "archive_url": "https://api.github.com/repos/Codertocat/hello-world-npm/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/hello-world-npm/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/hello-world-npm/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/hello-world-npm/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/hello-world-npm/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/hello-world-npm/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/hello-world-npm/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/hello-world-npm/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/hello-world-npm/deployments", + "created_at": "2019-05-09T22:53:26Z", + "updated_at": "2019-05-09T23:24:42Z", + "pushed_at": "2019-05-09T23:27:00Z", + "git_url": "git://github.com/Codertocat/hello-world-npm.git", + "ssh_url": "git@github.com:Codertocat/hello-world-npm.git", + "clone_url": "https://github.com/Codertocat/hello-world-npm.git", + "svn_url": "https://github.com/Codertocat/hello-world-npm", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "is_template": false, + "topics": [], + "visibility": "public", + "web_commit_signoff_required": false + }, + "organization": { + "login": "Octocoders", + "id": 38302899, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4MzAyODk5", + "url": "https://api.github.com/orgs/Octocoders", + "repos_url": "https://api.github.com/orgs/Octocoders/repos", + "events_url": "https://api.github.com/orgs/Octocoders/events", + "hooks_url": "https://api.github.com/orgs/Octocoders/hooks", + "issues_url": "https://api.github.com/orgs/Octocoders/issues", + "members_url": "https://api.github.com/orgs/Octocoders/members{/member}", + "public_members_url": "https://api.github.com/orgs/Octocoders/public_members{/member}", + "avatar_url": "https://avatars1.githubusercontent.com/u/38302899?v=4", + "description": "" + }, + "sender": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "site_admin": false + } +} From 2bc44b00514ea444a18c287e1dd29d512be4e6f6 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sun, 11 Dec 2022 12:43:03 -0500 Subject: [PATCH 02/10] feat: add schemas for `registry_package` event --- .../common/package-npm-metadata.schema.json | 46 +++ .../common/package-nuget-metadata.schema.json | 35 ++ .../registry_package/published.schema.json | 309 +++++++++++++++++ .../registry_package/updated.schema.json | 311 ++++++++++++++++++ 4 files changed, 701 insertions(+) create mode 100644 payload-schemas/api.github.com/common/package-npm-metadata.schema.json create mode 100644 payload-schemas/api.github.com/common/package-nuget-metadata.schema.json create mode 100644 payload-schemas/api.github.com/registry_package/published.schema.json create mode 100644 payload-schemas/api.github.com/registry_package/updated.schema.json diff --git a/payload-schemas/api.github.com/common/package-npm-metadata.schema.json b/payload-schemas/api.github.com/common/package-npm-metadata.schema.json new file mode 100644 index 000000000..062faf806 --- /dev/null +++ b/payload-schemas/api.github.com/common/package-npm-metadata.schema.json @@ -0,0 +1,46 @@ +{ + "$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": { "type": ["object", "null"] }, + "bugs": { "type": ["object", "null"] }, + "dependencies": { "type": "object" }, + "dev_dependencies": { "type": "object" }, + "peer_dependencies": { "type": "object" }, + "optional_dependencies": { "type": "object" }, + "description": { "type": "string" }, + "dist": { "type": ["object", "null"] }, + "git_head": { "type": "string" }, + "homepage": { "type": "string" }, + "license": { "type": "string" }, + "main": { "type": "string" }, + "repository": { "type": ["object", "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" }, + "keywords": { "type": "array", "items": { "type": "string" } }, + "files": { "type": "array", "items": { "type": "string" } }, + "bin": { "type": "object" }, + "man": { "type": "object" }, + "directories": { "type": ["object", "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" +} diff --git a/payload-schemas/api.github.com/common/package-nuget-metadata.schema.json b/payload-schemas/api.github.com/common/package-nuget-metadata.schema.json new file mode 100644 index 000000000..a712b8216 --- /dev/null +++ b/payload-schemas/api.github.com/common/package-nuget-metadata.schema.json @@ -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" +} diff --git a/payload-schemas/api.github.com/registry_package/published.schema.json b/payload-schemas/api.github.com/registry_package/published.schema.json new file mode 100644 index 000000000..4e3ea1b27 --- /dev/null +++ b/payload-schemas/api.github.com/registry_package/published.schema.json @@ -0,0 +1,309 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "registry_package$published", + "type": "object", + "required": ["action", "registry_package", "repository", "sender"], + "properties": { + "action": { "type": "string", "enum": ["published"] }, + "registry_package": { + "type": "object", + "description": "Information about the package.", + "required": [ + "id", + "name", + "namespace", + "description", + "ecosystem", + "package_type", + "html_url", + "created_at", + "updated_at", + "owner", + "package_version", + "registry" + ], + "properties": { + "id": { + "type": "integer", + "description": "Unique identifier of the package." + }, + "name": { "type": "string", "description": "The name of the package." }, + "namespace": { "type": "string" }, + "description": { "type": ["string", "null"] }, + "ecosystem": { "type": "string" }, + "package_type": { + "type": "string", + "enum": ["npm", "maven", "rubygems", "docker", "nuget", "container"], + "description": "The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry." + }, + "html_url": { "type": "string", "format": "uri" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": ["string", "null"], "format": "date-time" }, + "owner": { "$ref": "common/user.schema.json" }, + "package_version": { + "oneOf": [ + { + "type": "object", + "required": [ + "id", + "version", + "summary", + "name", + "description", + "html_url", + "metadata", + "package_files", + "installation_command" + ], + "description": "A version of a software package", + "properties": { + "id": { + "type": "integer", + "description": "Unique identifier of the package version." + }, + "version": { "type": "string" }, + "summary": { "type": "string" }, + "name": { + "type": "string", + "description": "The name of the package version." + }, + "description": { "type": "string" }, + "body": { + "oneOf": [ + { "type": "string" }, + { + "type": "object", + "required": ["repository", "info"], + "properties": { + "repository": { + "type": "object", + "required": ["repository"], + "properties": { + "repository": { + "$ref": "common/repository.schema.json" + } + }, + "additionalProperties": false + }, + "info": { + "type": "object", + "required": [ + "type", + "oid", + "mode", + "name", + "path", + "size", + "collection" + ], + "properties": { + "type": { "type": "string" }, + "oid": { "type": "string" }, + "mode": { "type": "integer" }, + "name": { "type": "string" }, + "path": { "type": "string" }, + "size": { "type": ["integer", "null"] }, + "collection": { "type": "null" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "body_html": { "type": "string" }, + "release": { + "type": "object", + "required": [ + "url", + "html_url", + "id", + "tag_name", + "target_commitish", + "name", + "draft", + "author", + "prerelease", + "created_at", + "published_at" + ], + "properties": { + "url": { "type": "string", "format": "uri" }, + "html_url": { "type": "string", "format": "uri" }, + "id": { "type": "integer" }, + "tag_name": { "type": "string" }, + "target_commitish": { "type": "string" }, + "name": { "type": "string" }, + "draft": { "type": "boolean" }, + "author": { "$ref": "common/user.schema.json" }, + "prerelease": { "type": "boolean" }, + "created_at": { "type": "string", "format": "date-time" }, + "published_at": { "type": "string", "format": "date-time" } + }, + "additionalProperties": false + }, + "manifest": { "type": "string" }, + "html_url": { "type": "string", "format": "uri" }, + "tag_name": { "type": "string" }, + "target_commitish": { "type": "string" }, + "target_oid": { "type": "string" }, + "draft": { "type": "boolean" }, + "prerelease": { "type": "boolean" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" }, + "metadata": { + "type": "array", + "items": {}, + "description": "Package Version Metadata" + }, + "docker_metadata": { "type": "array", "items": {} }, + "container_metadata": { + "type": "object", + "properties": { + "labels": { + "oneOf": [ + { "type": "object", "additionalProperties": false }, + { "type": "null" } + ] + }, + "manifest": { + "oneOf": [ + { "type": "object", "additionalProperties": false }, + { "type": "null" } + ] + }, + "tag": { + "type": "object", + "properties": { + "digest": { "type": "string" }, + "name": { "type": "string" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "npm_metadata": { + "oneOf": [ + { "$ref": "common/package-npm-metadata.schema.json"}, + { "type": "null" } + ] + }, + "nuget_metadata": { + "oneOf": [ + { + "type": "array", + "items": { "$ref": "common/package-nuget-metadata.schema.json" } + }, + { "type": "null" } + ] + }, + "rubygems_metadata": { "type": "array", "items": {} }, + "package_files": { + "type": "array", + "items": { + "type": "object", + "required": [ + "download_url", + "id", + "name", + "sha256", + "sha1", + "md5", + "content_type", + "state", + "size", + "created_at", + "updated_at" + ], + "properties": { + "download_url": { "type": "string", "format": "uri" }, + "id": { "type": "integer" }, + "name": { "type": "string" }, + "sha256": { "type": "string" }, + "sha1": { "type": "string" }, + "md5": { "type": "string" }, + "content_type": { "type": "string" }, + "state": { "type": "string" }, + "size": { "type": "integer" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" } + }, + "additionalProperties": false + } + }, + "author": { + "type": "object", + "required": [ + "login", + "id", + "node_id", + "avatar_url", + "gravatar_id", + "url", + "html_url", + "followers_url", + "following_url", + "gists_url", + "starred_url", + "subscriptions_url", + "organizations_url", + "repos_url", + "events_url", + "received_events_url", + "type", + "site_admin" + ], + "properties": { + "avatar_url": { "type": "string" }, + "events_url": { "type": "string" }, + "followers_url": { "type": "string" }, + "following_url": { "type": "string" }, + "gists_url": { "type": "string" }, + "gravatar_id": { "type": "string" }, + "html_url": { "type": "string" }, + "id": { "type": "integer" }, + "login": { "type": "string" }, + "node_id": { "type": "string" }, + "organizations_url": { "type": "string" }, + "received_events_url": { "type": "string" }, + "repos_url": { "type": "string" }, + "site_admin": { "type": "boolean" }, + "starred_url": { "type": "string" }, + "subscriptions_url": { "type": "string" }, + "type": { "type": "string" }, + "url": { "type": "string" } + }, + "additionalProperties": false + }, + "source_url": { "type": "string" }, + "installation_command": { "type": "string" } + }, + "additionalProperties": false + }, + { "type": "null" } + ] + }, + "registry": { + "type": "object", + "required": ["about_url", "name", "type", "url", "vendor"], + "properties": { + "about_url": { "type": "string", "format": "uri" }, + "name": { "type": "string" }, + "type": { "type": "string" }, + "url": { "type": "string", "format": "uri" }, + "vendor": { "type": "string" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "repository": { "$ref": "common/repository.schema.json" }, + "sender": { "$ref": "common/user.schema.json" }, + "organization": { "$ref": "common/organization.schema.json" } + }, + "additionalProperties": false, + "title": "registry_package published event" +} diff --git a/payload-schemas/api.github.com/registry_package/updated.schema.json b/payload-schemas/api.github.com/registry_package/updated.schema.json new file mode 100644 index 000000000..249e9f889 --- /dev/null +++ b/payload-schemas/api.github.com/registry_package/updated.schema.json @@ -0,0 +1,311 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "registry_package$updated", + "type": "object", + "required": ["action", "registry_package", "repository", "sender"], + "properties": { + "action": { "type": "string", "enum": ["updated"] }, + "registry_package": { + "type": "object", + "description": "Information about the package.", + "required": [ + "id", + "name", + "namespace", + "description", + "ecosystem", + "package_type", + "html_url", + "created_at", + "updated_at", + "owner", + "package_version", + "registry" + ], + "properties": { + "id": { + "type": "integer", + "description": "Unique identifier of the package." + }, + "name": { "type": "string", "description": "The name of the package." }, + "namespace": { "type": "string" }, + "description": { "type": ["string", "null"] }, + "ecosystem": { "type": "string" }, + "package_type": { + "type": "string", + "enum": ["npm", "maven", "rubygems", "docker", "nuget", "container"], + "description": "The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry." + }, + "html_url": { "type": "string", "format": "uri" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": ["string", "null"], "format": "date-time" }, + "owner": { "$ref": "common/user.schema.json" }, + "package_version": { + "oneOf": [ + { + "type": "object", + "required": [ + "id", + "version", + "summary", + "name", + "description", + "html_url", + "metadata", + "package_files", + "installation_command" + ], + "description": "A version of a software package", + "properties": { + "id": { + "type": "integer", + "description": "Unique identifier of the package version." + }, + "version": { "type": "string" }, + "summary": { "type": "string" }, + "name": { + "type": "string", + "description": "The name of the package version." + }, + "description": { "type": "string" }, + "body": { + "oneOf": [ + { "type": "string" }, + { + "type": "object", + "required": ["repository", "info"], + "properties": { + "repository": { + "type": "object", + "required": ["repository"], + "properties": { + "repository": { + "$ref": "common/repository.schema.json" + } + }, + "additionalProperties": false + }, + "info": { + "type": "object", + "required": [ + "type", + "oid", + "mode", + "name", + "path", + "size", + "collection" + ], + "properties": { + "type": { "type": "string" }, + "oid": { "type": "string" }, + "mode": { "type": "integer" }, + "name": { "type": "string" }, + "path": { "type": "string" }, + "size": { "type": ["integer", "null"] }, + "collection": { "type": "null" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "body_html": { "type": "string" }, + "release": { + "type": "object", + "required": [ + "url", + "html_url", + "id", + "tag_name", + "target_commitish", + "name", + "draft", + "author", + "prerelease", + "created_at", + "published_at" + ], + "properties": { + "url": { "type": "string", "format": "uri" }, + "html_url": { "type": "string", "format": "uri" }, + "id": { "type": "integer" }, + "tag_name": { "type": "string" }, + "target_commitish": { "type": "string" }, + "name": { "type": "string" }, + "draft": { "type": "boolean" }, + "author": { "$ref": "common/user.schema.json" }, + "prerelease": { "type": "boolean" }, + "created_at": { "type": "string", "format": "date-time" }, + "published_at": { "type": "string", "format": "date-time" } + }, + "additionalProperties": false + }, + "manifest": { "type": "string" }, + "html_url": { "type": "string", "format": "uri" }, + "tag_name": { "type": "string" }, + "target_commitish": { "type": "string" }, + "target_oid": { "type": "string" }, + "draft": { "type": "boolean" }, + "prerelease": { "type": "boolean" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" }, + "metadata": { + "type": "array", + "items": {}, + "description": "Package Version Metadata" + }, + "docker_metadata": { "type": "array", "items": {} }, + "container_metadata": { + "type": "object", + "properties": { + "labels": { + "oneOf": [ + { "type": "object", "additionalProperties": false }, + { "type": "null" } + ] + }, + "manifest": { + "oneOf": [ + { "type": "object", "additionalProperties": false }, + { "type": "null" } + ] + }, + "tag": { + "type": "object", + "properties": { + "digest": { "type": "string" }, + "name": { "type": "string" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "npm_metadata": { + "oneOf": [ + { "$ref": "common/package-npm-metadata.schema.json" }, + { "type": "null" } + ] + }, + "nuget_metadata": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "common/package-nuget-metadata.schema.json" + } + }, + { "type": "null" } + ] + }, + "rubygems_metadata": { "type": "array", "items": {} }, + "package_files": { + "type": "array", + "items": { + "type": "object", + "required": [ + "download_url", + "id", + "name", + "sha256", + "sha1", + "md5", + "content_type", + "state", + "size", + "created_at", + "updated_at" + ], + "properties": { + "download_url": { "type": "string", "format": "uri" }, + "id": { "type": "integer" }, + "name": { "type": "string" }, + "sha256": { "type": "string" }, + "sha1": { "type": "string" }, + "md5": { "type": "string" }, + "content_type": { "type": "string" }, + "state": { "type": "string" }, + "size": { "type": "integer" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" } + }, + "additionalProperties": false + } + }, + "author": { + "type": "object", + "required": [ + "login", + "id", + "node_id", + "avatar_url", + "gravatar_id", + "url", + "html_url", + "followers_url", + "following_url", + "gists_url", + "starred_url", + "subscriptions_url", + "organizations_url", + "repos_url", + "events_url", + "received_events_url", + "type", + "site_admin" + ], + "properties": { + "avatar_url": { "type": "string" }, + "events_url": { "type": "string" }, + "followers_url": { "type": "string" }, + "following_url": { "type": "string" }, + "gists_url": { "type": "string" }, + "gravatar_id": { "type": "string" }, + "html_url": { "type": "string" }, + "id": { "type": "integer" }, + "login": { "type": "string" }, + "node_id": { "type": "string" }, + "organizations_url": { "type": "string" }, + "received_events_url": { "type": "string" }, + "repos_url": { "type": "string" }, + "site_admin": { "type": "boolean" }, + "starred_url": { "type": "string" }, + "subscriptions_url": { "type": "string" }, + "type": { "type": "string" }, + "url": { "type": "string" } + }, + "additionalProperties": false + }, + "source_url": { "type": "string" }, + "installation_command": { "type": "string" } + }, + "additionalProperties": false + }, + { "type": "null" } + ] + }, + "registry": { + "type": "object", + "required": ["about_url", "name", "type", "url", "vendor"], + "properties": { + "about_url": { "type": "string", "format": "uri" }, + "name": { "type": "string" }, + "type": { "type": "string" }, + "url": { "type": "string", "format": "uri" }, + "vendor": { "type": "string" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "repository": { "$ref": "common/repository.schema.json" }, + "sender": { "$ref": "common/user.schema.json" }, + "organization": { "$ref": "common/organization.schema.json" } + }, + "additionalProperties": false, + "title": "registry_package updated event" +} From 3faa9265534f960e81d5cce448687c7b23203bbc Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sun, 11 Dec 2022 12:45:05 -0500 Subject: [PATCH 03/10] 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 --- .../package/published.schema.json | 301 +++++++++++------- .../package/updated.schema.json | 301 +++++++++++------- 2 files changed, 384 insertions(+), 218 deletions(-) diff --git a/payload-schemas/api.github.com/package/published.schema.json b/payload-schemas/api.github.com/package/published.schema.json index 61e303530..32b7bb487 100644 --- a/payload-schemas/api.github.com/package/published.schema.json +++ b/payload-schemas/api.github.com/package/published.schema.json @@ -41,130 +41,213 @@ "updated_at": { "type": "string", "format": "date-time" }, "owner": { "$ref": "common/user.schema.json" }, "package_version": { - "type": "object", - "required": [ - "id", - "version", - "summary", - "name", - "description", - "body", - "body_html", - "release", - "manifest", - "html_url", - "tag_name", - "target_commitish", - "target_oid", - "draft", - "prerelease", - "created_at", - "updated_at", - "metadata", - "docker_metadata", - "package_files", - "author", - "source_url", - "installation_command" - ], - "description": "A version of a software package", - "properties": { - "id": { - "type": "integer", - "description": "Unique identifier of the package version." - }, - "version": { "type": "string" }, - "summary": { "type": "string" }, - "name": { - "type": "string", - "description": "The name of the package version." - }, - "description": { "type": "string" }, - "body": { "type": "string" }, - "body_html": { "type": "string" }, - "release": { + "oneOf": [ + { "type": "object", "required": [ - "url", - "html_url", "id", - "tag_name", - "target_commitish", + "version", + "summary", "name", - "draft", - "author", - "prerelease", - "created_at", - "published_at" + "description", + "html_url", + "metadata", + "package_files", + "installation_command" ], + "description": "A version of a software package", "properties": { - "url": { "type": "string", "format": "uri" }, + "id": { + "type": "integer", + "description": "Unique identifier of the package version." + }, + "version": { "type": "string" }, + "summary": { "type": "string" }, + "name": { + "type": "string", + "description": "The name of the package version." + }, + "description": { "type": "string" }, + "body": { + "oneOf": [ + { "type": "string" }, + { + "type": "object", + "required": [ + "repository", + "info", + "attributes", + "_formatted" + ], + "properties": { + "repository": { + "type": "object", + "required": ["repository"], + "properties": { + "repository": { + "$ref": "common/repository.schema.json" + } + }, + "additionalProperties": false + }, + "info": { + "type": "object", + "required": [ + "type", + "oid", + "mode", + "name", + "path", + "size", + "collection" + ], + "properties": { + "type": { "type": "string" }, + "oid": { "type": "string" }, + "mode": { "type": "integer" }, + "name": { "type": "string" }, + "path": { "type": "string" }, + "size": { "type": ["integer", "null"] }, + "collection": { "type": "boolean" } + }, + "additionalProperties": false + }, + "attributes": { + "type": "object", + "additionalProperties": false + }, + "_formatted": { "type": "boolean" } + }, + "additionalProperties": false + } + ] + }, + "body_html": { "type": "string" }, + "release": { + "type": "object", + "required": [ + "url", + "html_url", + "id", + "tag_name", + "target_commitish", + "name", + "draft", + "author", + "prerelease", + "created_at", + "published_at" + ], + "properties": { + "url": { "type": "string", "format": "uri" }, + "html_url": { "type": "string", "format": "uri" }, + "id": { "type": "integer" }, + "tag_name": { "type": "string" }, + "target_commitish": { "type": "string" }, + "name": { "type": "string" }, + "draft": { "type": "boolean" }, + "author": { "$ref": "common/user.schema.json" }, + "prerelease": { "type": "boolean" }, + "created_at": { "type": "string", "format": "date-time" }, + "published_at": { "type": "string", "format": "date-time" } + }, + "additionalProperties": false + }, + "manifest": { "type": "string" }, "html_url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, "tag_name": { "type": "string" }, "target_commitish": { "type": "string" }, - "name": { "type": "string" }, + "target_oid": { "type": "string" }, "draft": { "type": "boolean" }, - "author": { "$ref": "common/user.schema.json" }, "prerelease": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, - "published_at": { "type": "string", "format": "date-time" } + "updated_at": { "type": "string", "format": "date-time" }, + "metadata": { + "type": "array", + "items": {}, + "description": "Package Version Metadata" + }, + "container_metadata": { + "oneOf": [ + { + "type": "object", + "properties": { + "labels": { "type": ["object", "null"] }, + "manifest": { "type": ["object", "null"] }, + "tag": { + "type": "object", + "properties": { + "digest": { "type": "string" }, + "name": { "type": "string" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { "type": "null" } + ] + }, + "docker_metadata": { "type": "array", "items": {} }, + "npm_metadata": { + "oneOf": [ + { "$ref": "common/package-npm-metadata.schema.json" }, + { "type": "null" } + ] + }, + "nuget_metadata": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "common/package-nuget-metadata.schema.json" + } + }, + { "type": "null" } + ] + }, + "rubygems_metadata": { "type": "array", "items": {} }, + "package_files": { + "type": "array", + "items": { + "type": "object", + "required": [ + "download_url", + "id", + "name", + "sha256", + "sha1", + "md5", + "content_type", + "state", + "size", + "created_at", + "updated_at" + ], + "properties": { + "download_url": { "type": "string", "format": "uri" }, + "id": { "type": "integer" }, + "name": { "type": "string" }, + "sha256": { "type": "string" }, + "sha1": { "type": "string" }, + "md5": { "type": "string" }, + "content_type": { "type": "string" }, + "state": { "type": "string" }, + "size": { "type": "integer" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" } + }, + "additionalProperties": false + } + }, + "author": { "$ref": "common/user.schema.json" }, + "source_url": { "type": "string" }, + "installation_command": { "type": "string" } }, "additionalProperties": false }, - "manifest": { "type": "string" }, - "html_url": { "type": "string", "format": "uri" }, - "tag_name": { "type": "string" }, - "target_commitish": { "type": "string" }, - "target_oid": { "type": "string" }, - "draft": { "type": "boolean" }, - "prerelease": { "type": "boolean" }, - "created_at": { "type": "string", "format": "date-time" }, - "updated_at": { "type": "string", "format": "date-time" }, - "metadata": { - "type": "array", - "items": {}, - "description": "Package Version Metadata" - }, - "docker_metadata": { "type": "array", "items": {} }, - "package_files": { - "type": "array", - "items": { - "type": "object", - "required": [ - "download_url", - "id", - "name", - "sha256", - "sha1", - "md5", - "content_type", - "state", - "size", - "created_at", - "updated_at" - ], - "properties": { - "download_url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "name": { "type": "string" }, - "sha256": { "type": "string" }, - "sha1": { "type": "string" }, - "md5": { "type": "string" }, - "content_type": { "type": "string" }, - "state": { "type": "string" }, - "size": { "type": "integer" }, - "created_at": { "type": "string", "format": "date-time" }, - "updated_at": { "type": "string", "format": "date-time" } - }, - "additionalProperties": false - } - }, - "author": { "$ref": "common/user.schema.json" }, - "source_url": { "type": "string" }, - "installation_command": { "type": "string" } - }, - "additionalProperties": false + { "type": "null" } + ] }, "registry": { "type": "object", diff --git a/payload-schemas/api.github.com/package/updated.schema.json b/payload-schemas/api.github.com/package/updated.schema.json index 86aa98303..35f66cdda 100644 --- a/payload-schemas/api.github.com/package/updated.schema.json +++ b/payload-schemas/api.github.com/package/updated.schema.json @@ -40,130 +40,213 @@ "updated_at": { "type": "string", "format": "date-time" }, "owner": { "$ref": "common/user.schema.json" }, "package_version": { - "type": "object", - "required": [ - "id", - "version", - "summary", - "name", - "description", - "body", - "body_html", - "release", - "manifest", - "html_url", - "tag_name", - "target_commitish", - "target_oid", - "draft", - "prerelease", - "created_at", - "updated_at", - "metadata", - "docker_metadata", - "package_files", - "author", - "source_url", - "installation_command" - ], - "description": "A version of a software package", - "properties": { - "id": { - "type": "integer", - "description": "Unique identifier of the package version." - }, - "version": { "type": "string" }, - "summary": { "type": "string" }, - "name": { - "type": "string", - "description": "The name of the package version." - }, - "description": { "type": "string" }, - "body": { "type": "string" }, - "body_html": { "type": "string" }, - "release": { + "oneOf": [ + { "type": "object", "required": [ - "url", - "html_url", "id", - "tag_name", - "target_commitish", + "version", + "summary", "name", - "draft", - "author", - "prerelease", - "created_at", - "published_at" + "description", + "html_url", + "metadata", + "package_files", + "installation_command" ], + "description": "A version of a software package", "properties": { - "url": { "type": "string", "format": "uri" }, + "id": { + "type": "integer", + "description": "Unique identifier of the package version." + }, + "version": { "type": "string" }, + "summary": { "type": "string" }, + "name": { + "type": "string", + "description": "The name of the package version." + }, + "description": { "type": "string" }, + "body": { + "oneOf": [ + { "type": "string" }, + { + "type": "object", + "required": [ + "repository", + "info", + "attributes", + "_formatted" + ], + "properties": { + "repository": { + "type": "object", + "required": ["repository"], + "properties": { + "repository": { + "$ref": "common/repository.schema.json" + } + }, + "additionalProperties": false + }, + "info": { + "type": "object", + "required": [ + "type", + "oid", + "mode", + "name", + "path", + "size", + "collection" + ], + "properties": { + "type": { "type": "string" }, + "oid": { "type": "string" }, + "mode": { "type": "integer" }, + "name": { "type": "string" }, + "path": { "type": "string" }, + "size": { "type": ["integer", "null"] }, + "collection": { "type": "boolean" } + }, + "additionalProperties": false + }, + "attributes": { + "type": "object", + "additionalProperties": false + }, + "_formatted": { "type": "boolean" } + }, + "additionalProperties": false + } + ] + }, + "body_html": { "type": "string" }, + "release": { + "type": "object", + "required": [ + "url", + "html_url", + "id", + "tag_name", + "target_commitish", + "name", + "draft", + "author", + "prerelease", + "created_at", + "published_at" + ], + "properties": { + "url": { "type": "string", "format": "uri" }, + "html_url": { "type": "string", "format": "uri" }, + "id": { "type": "integer" }, + "tag_name": { "type": "string" }, + "target_commitish": { "type": "string" }, + "name": { "type": "string" }, + "draft": { "type": "boolean" }, + "author": { "$ref": "common/user.schema.json" }, + "prerelease": { "type": "boolean" }, + "created_at": { "type": "string", "format": "date-time" }, + "published_at": { "type": "string", "format": "date-time" } + }, + "additionalProperties": false + }, + "manifest": { "type": "string" }, "html_url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, "tag_name": { "type": "string" }, "target_commitish": { "type": "string" }, - "name": { "type": "string" }, + "target_oid": { "type": "string" }, "draft": { "type": "boolean" }, - "author": { "$ref": "common/user.schema.json" }, "prerelease": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, - "published_at": { "type": "string", "format": "date-time" } + "updated_at": { "type": "string", "format": "date-time" }, + "metadata": { + "type": "array", + "items": {}, + "description": "Package Version Metadata" + }, + "container_metadata": { + "oneOf": [ + { + "type": "object", + "properties": { + "labels": { "type": ["object", "null"] }, + "manifest": { "type": ["object", "null"] }, + "tag": { + "type": "object", + "properties": { + "digest": { "type": "string" }, + "name": { "type": "string" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { "type": "null" } + ] + }, + "docker_metadata": { "type": "array", "items": {} }, + "npm_metadata": { + "oneOf": [ + { "$ref": "common/package-npm-metadata.schema.json" }, + { "type": "null" } + ] + }, + "nuget_metadata": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "common/package-nuget-metadata.schema.json" + } + }, + { "type": "null" } + ] + }, + "rubygems_metadata": { "type": "array", "items": {} }, + "package_files": { + "type": "array", + "items": { + "type": "object", + "required": [ + "download_url", + "id", + "name", + "sha256", + "sha1", + "md5", + "content_type", + "state", + "size", + "created_at", + "updated_at" + ], + "properties": { + "download_url": { "type": "string", "format": "uri" }, + "id": { "type": "integer" }, + "name": { "type": "string" }, + "sha256": { "type": "string" }, + "sha1": { "type": "string" }, + "md5": { "type": "string" }, + "content_type": { "type": "string" }, + "state": { "type": "string" }, + "size": { "type": "integer" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" } + }, + "additionalProperties": false + } + }, + "author": { "$ref": "common/user.schema.json" }, + "source_url": { "type": "string" }, + "installation_command": { "type": "string" } }, "additionalProperties": false }, - "manifest": { "type": "string" }, - "html_url": { "type": "string", "format": "uri" }, - "tag_name": { "type": "string" }, - "target_commitish": { "type": "string" }, - "target_oid": { "type": "string" }, - "draft": { "type": "boolean" }, - "prerelease": { "type": "boolean" }, - "created_at": { "type": "string", "format": "date-time" }, - "updated_at": { "type": "string", "format": "date-time" }, - "metadata": { - "type": "array", - "items": {}, - "description": "Package Version Metadata" - }, - "docker_metadata": { "type": "array", "items": {} }, - "package_files": { - "type": "array", - "items": { - "type": "object", - "required": [ - "download_url", - "id", - "name", - "sha256", - "sha1", - "md5", - "content_type", - "state", - "size", - "created_at", - "updated_at" - ], - "properties": { - "download_url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "name": { "type": "string" }, - "sha256": { "type": "string" }, - "sha1": { "type": "string" }, - "md5": { "type": "string" }, - "content_type": { "type": "string" }, - "state": { "type": "string" }, - "size": { "type": "integer" }, - "created_at": { "type": "string", "format": "date-time" }, - "updated_at": { "type": "string", "format": "date-time" } - }, - "additionalProperties": false - } - }, - "author": { "$ref": "common/user.schema.json" }, - "source_url": { "type": "string" }, - "installation_command": { "type": "string" } - }, - "additionalProperties": false + { "type": "null" } + ] }, "registry": { "type": "object", From 5b7a15509396f901ebef2e453b1d48025ecc8be2 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sun, 11 Dec 2022 12:45:24 -0500 Subject: [PATCH 04/10] build: generate types --- payload-types/schema.d.ts | 515 +++++++++++++++++++++++++++++++++++--- 1 file changed, 479 insertions(+), 36 deletions(-) diff --git a/payload-types/schema.d.ts b/payload-types/schema.d.ts index 93291e295..1d4b196fe 100644 --- a/payload-types/schema.d.ts +++ b/payload-types/schema.d.ts @@ -48,6 +48,7 @@ export type Schema = | PullRequestReviewCommentEvent | PullRequestReviewThreadEvent | PushEvent + | RegistryPackageEvent | ReleaseEvent | RepositoryEvent | RepositoryDispatchEvent @@ -357,6 +358,9 @@ export type PullRequestReviewCommentEvent = export type PullRequestReviewThreadEvent = | PullRequestReviewThreadResolvedEvent | PullRequestReviewThreadUnresolvedEvent; +export type RegistryPackageEvent = + | RegistryPackagePublishedEvent + | RegistryPackageUpdatedEvent; export type ReleaseEvent = | ReleaseCreatedEvent | ReleaseDeletedEvent @@ -4592,9 +4596,6 @@ export interface PackagePublishedEvent { created_at: string; updated_at: string; owner: User; - /** - * A version of a software package - */ package_version: { /** * Unique identifier of the package version. @@ -4607,9 +4608,26 @@ export interface PackagePublishedEvent { */ name: string; description: string; - body: string; - body_html: string; - release: { + body?: + | string + | { + repository: { + repository: Repository; + }; + info: { + type: string; + oid: string; + mode: number; + name: string; + path: string; + size: number | null; + collection: boolean; + }; + attributes: {}; + _formatted: boolean; + }; + body_html?: string; + release?: { url: string; html_url: string; id: number; @@ -4622,20 +4640,35 @@ export interface PackagePublishedEvent { created_at: string; published_at: string; }; - manifest: string; + manifest?: string; html_url: string; - tag_name: string; - target_commitish: string; - target_oid: string; - draft: boolean; - prerelease: boolean; - created_at: string; - updated_at: string; + tag_name?: string; + target_commitish?: string; + target_oid?: string; + draft?: boolean; + prerelease?: boolean; + created_at?: string; + updated_at?: string; /** * Package Version Metadata */ metadata: unknown[]; - docker_metadata: unknown[]; + container_metadata?: { + labels?: { + [k: string]: unknown; + } | null; + manifest?: { + [k: string]: unknown; + } | null; + tag?: { + digest?: string; + name?: string; + }; + } | null; + docker_metadata?: unknown[]; + npm_metadata?: PackageNPMMetadata | null; + nuget_metadata?: PackageNugetMetadata[] | null; + rubygems_metadata?: unknown[]; package_files: { download_url: string; id: number; @@ -4649,10 +4682,10 @@ export interface PackagePublishedEvent { created_at: string; updated_at: string; }[]; - author: User; - source_url: string; + author?: User; + source_url?: string; installation_command: string; - }; + } | null; registry: { about_url: string; name: string; @@ -4665,6 +4698,94 @@ export interface PackagePublishedEvent { sender: User; organization?: Organization; } +export interface PackageNPMMetadata { + name?: string; + version?: string; + npm_user?: string; + author?: { + [k: string]: unknown; + } | null; + bugs?: { + [k: string]: unknown; + } | null; + dependencies?: { + [k: string]: unknown; + }; + dev_dependencies?: { + [k: string]: unknown; + }; + peer_dependencies?: { + [k: string]: unknown; + }; + optional_dependencies?: { + [k: string]: unknown; + }; + description?: string; + dist?: { + [k: string]: unknown; + } | null; + git_head?: string; + homepage?: string; + license?: string; + main?: string; + repository?: { + [k: string]: unknown; + } | null; + scripts?: { + [k: string]: unknown; + }; + id?: string; + node_version?: string; + npm_version?: string; + has_shrinkwrap?: boolean; + maintainers?: { + [k: string]: unknown; + }[]; + contributors?: { + [k: string]: unknown; + }[]; + engines?: { + [k: string]: unknown; + }; + keywords?: string[]; + files?: string[]; + bin?: { + [k: string]: unknown; + }; + man?: { + [k: string]: unknown; + }; + directories?: { + [k: string]: unknown; + } | null; + os?: string[]; + cpu?: string[]; + readme?: string; + installation_command?: string; + release_id?: number; + commit_oid?: string; + published_via_actions?: boolean; + deleted_by_id?: number; +} +export interface PackageNugetMetadata { + id?: + | string + | { + [k: string]: unknown; + } + | number; + name?: string; + value?: + | boolean + | string + | number + | { + url?: string; + branch?: string; + commit?: string; + type?: string; + }; +} export interface PackageUpdatedEvent { action: "updated"; /** @@ -4693,9 +4814,6 @@ export interface PackageUpdatedEvent { created_at: string; updated_at: string; owner: User; - /** - * A version of a software package - */ package_version: { /** * Unique identifier of the package version. @@ -4708,9 +4826,26 @@ export interface PackageUpdatedEvent { */ name: string; description: string; - body: string; - body_html: string; - release: { + body?: + | string + | { + repository: { + repository: Repository; + }; + info: { + type: string; + oid: string; + mode: number; + name: string; + path: string; + size: number | null; + collection: boolean; + }; + attributes: {}; + _formatted: boolean; + }; + body_html?: string; + release?: { url: string; html_url: string; id: number; @@ -4723,20 +4858,35 @@ export interface PackageUpdatedEvent { created_at: string; published_at: string; }; - manifest: string; + manifest?: string; html_url: string; - tag_name: string; - target_commitish: string; - target_oid: string; - draft: boolean; - prerelease: boolean; - created_at: string; - updated_at: string; + tag_name?: string; + target_commitish?: string; + target_oid?: string; + draft?: boolean; + prerelease?: boolean; + created_at?: string; + updated_at?: string; /** * Package Version Metadata */ metadata: unknown[]; - docker_metadata: unknown[]; + container_metadata?: { + labels?: { + [k: string]: unknown; + } | null; + manifest?: { + [k: string]: unknown; + } | null; + tag?: { + digest?: string; + name?: string; + }; + } | null; + docker_metadata?: unknown[]; + npm_metadata?: PackageNPMMetadata | null; + nuget_metadata?: PackageNugetMetadata[] | null; + rubygems_metadata?: unknown[]; package_files: { download_url: string; id: number; @@ -4750,10 +4900,10 @@ export interface PackageUpdatedEvent { created_at: string; updated_at: string; }[]; - author: User; - source_url: string; + author?: User; + source_url?: string; installation_command: string; - }; + } | null; registry: { about_url: string; name: string; @@ -6084,6 +6234,298 @@ export interface Commit { */ removed: string[]; } +export interface RegistryPackagePublishedEvent { + action: "published"; + /** + * Information about the package. + */ + registry_package: { + /** + * Unique identifier of the package. + */ + id: number; + /** + * The name of the package. + */ + name: string; + namespace: string; + description: string | null; + ecosystem: string; + /** + * The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. + */ + package_type: + | "npm" + | "maven" + | "rubygems" + | "docker" + | "nuget" + | "container"; + html_url: string; + created_at: string; + updated_at: string | null; + owner: User; + package_version: { + /** + * Unique identifier of the package version. + */ + id: number; + version: string; + summary: string; + /** + * The name of the package version. + */ + name: string; + description: string; + body?: + | string + | { + repository: { + repository: Repository; + }; + info: { + type: string; + oid: string; + mode: number; + name: string; + path: string; + size: number | null; + collection: null; + }; + }; + body_html?: string; + release?: { + url: string; + html_url: string; + id: number; + tag_name: string; + target_commitish: string; + name: string; + draft: boolean; + author: User; + prerelease: boolean; + created_at: string; + published_at: string; + }; + manifest?: string; + html_url: string; + tag_name?: string; + target_commitish?: string; + target_oid?: string; + draft?: boolean; + prerelease?: boolean; + created_at?: string; + updated_at?: string; + /** + * Package Version Metadata + */ + metadata: unknown[]; + docker_metadata?: unknown[]; + container_metadata?: { + labels?: {} | null; + manifest?: {} | null; + tag?: { + digest?: string; + name?: string; + }; + }; + npm_metadata?: PackageNPMMetadata | null; + nuget_metadata?: PackageNugetMetadata[] | null; + rubygems_metadata?: unknown[]; + package_files: { + download_url: string; + id: number; + name: string; + sha256: string; + sha1: string; + md5: string; + content_type: string; + state: string; + size: number; + created_at: string; + updated_at: string; + }[]; + author?: { + avatar_url: string; + events_url: string; + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string; + html_url: string; + id: number; + login: string; + node_id: string; + organizations_url: string; + received_events_url: string; + repos_url: string; + site_admin: boolean; + starred_url: string; + subscriptions_url: string; + type: string; + url: string; + }; + source_url?: string; + installation_command: string; + } | null; + registry: { + about_url: string; + name: string; + type: string; + url: string; + vendor: string; + }; + }; + repository: Repository; + sender: User; + organization?: Organization; +} +export interface RegistryPackageUpdatedEvent { + action: "updated"; + /** + * Information about the package. + */ + registry_package: { + /** + * Unique identifier of the package. + */ + id: number; + /** + * The name of the package. + */ + name: string; + namespace: string; + description: string | null; + ecosystem: string; + /** + * The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. + */ + package_type: + | "npm" + | "maven" + | "rubygems" + | "docker" + | "nuget" + | "container"; + html_url: string; + created_at: string; + updated_at: string | null; + owner: User; + package_version: { + /** + * Unique identifier of the package version. + */ + id: number; + version: string; + summary: string; + /** + * The name of the package version. + */ + name: string; + description: string; + body?: + | string + | { + repository: { + repository: Repository; + }; + info: { + type: string; + oid: string; + mode: number; + name: string; + path: string; + size: number | null; + collection: null; + }; + }; + body_html?: string; + release?: { + url: string; + html_url: string; + id: number; + tag_name: string; + target_commitish: string; + name: string; + draft: boolean; + author: User; + prerelease: boolean; + created_at: string; + published_at: string; + }; + manifest?: string; + html_url: string; + tag_name?: string; + target_commitish?: string; + target_oid?: string; + draft?: boolean; + prerelease?: boolean; + created_at?: string; + updated_at?: string; + /** + * Package Version Metadata + */ + metadata: unknown[]; + docker_metadata?: unknown[]; + container_metadata?: { + labels?: {} | null; + manifest?: {} | null; + tag?: { + digest?: string; + name?: string; + }; + }; + npm_metadata?: PackageNPMMetadata | null; + nuget_metadata?: PackageNugetMetadata[] | null; + rubygems_metadata?: unknown[]; + package_files: { + download_url: string; + id: number; + name: string; + sha256: string; + sha1: string; + md5: string; + content_type: string; + state: string; + size: number; + created_at: string; + updated_at: string; + }[]; + author?: { + avatar_url: string; + events_url: string; + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string; + html_url: string; + id: number; + login: string; + node_id: string; + organizations_url: string; + received_events_url: string; + repos_url: string; + site_admin: boolean; + starred_url: string; + subscriptions_url: string; + type: string; + url: string; + }; + source_url?: string; + installation_command: string; + } | null; + registry: { + about_url: string; + name: string; + type: string; + url: string; + vendor: string; + }; + }; + repository: Repository; + sender: User; + organization?: Organization; +} export interface ReleaseCreatedEvent { action: "created"; release: Release; @@ -7440,6 +7882,7 @@ export interface EventPayloadMap { pull_request_review_comment: PullRequestReviewCommentEvent; pull_request_review_thread: PullRequestReviewThreadEvent; push: PushEvent; + registry_package: RegistryPackageEvent; release: ReleaseEvent; repository: RepositoryEvent; repository_dispatch: RepositoryDispatchEvent; From 3e72ede425b65ebf20143b5a11a2c56b25dda56b Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sun, 11 Dec 2022 12:56:42 -0500 Subject: [PATCH 05/10] fix: the `package_type` is now in caps for containers --- .../api.github.com/package/published.schema.json | 2 +- .../api.github.com/package/updated.schema.json | 2 +- .../api.github.com/registry_package/published.schema.json | 2 +- .../api.github.com/registry_package/updated.schema.json | 2 +- payload-types/schema.d.ts | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/payload-schemas/api.github.com/package/published.schema.json b/payload-schemas/api.github.com/package/published.schema.json index 32b7bb487..34ac2a997 100644 --- a/payload-schemas/api.github.com/package/published.schema.json +++ b/payload-schemas/api.github.com/package/published.schema.json @@ -33,7 +33,7 @@ "ecosystem": { "type": "string" }, "package_type": { "type": "string", - "enum": ["npm", "maven", "rubygems", "docker", "nuget", "container"], + "enum": ["npm", "maven", "rubygems", "docker", "nuget", "CONTAINER"], "description": "The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry." }, "html_url": { "type": "string", "format": "uri" }, diff --git a/payload-schemas/api.github.com/package/updated.schema.json b/payload-schemas/api.github.com/package/updated.schema.json index 35f66cdda..4ea22b516 100644 --- a/payload-schemas/api.github.com/package/updated.schema.json +++ b/payload-schemas/api.github.com/package/updated.schema.json @@ -33,7 +33,7 @@ "ecosystem": { "type": "string" }, "package_type": { "type": "string", - "enum": ["npm", "maven", "rubygems", "docker", "nuget", "container"] + "enum": ["npm", "maven", "rubygems", "docker", "nuget", "CONTAINER"] }, "html_url": { "type": "string", "format": "uri" }, "created_at": { "type": "string", "format": "date-time" }, diff --git a/payload-schemas/api.github.com/registry_package/published.schema.json b/payload-schemas/api.github.com/registry_package/published.schema.json index 4e3ea1b27..a542ee7cf 100644 --- a/payload-schemas/api.github.com/registry_package/published.schema.json +++ b/payload-schemas/api.github.com/registry_package/published.schema.json @@ -33,7 +33,7 @@ "ecosystem": { "type": "string" }, "package_type": { "type": "string", - "enum": ["npm", "maven", "rubygems", "docker", "nuget", "container"], + "enum": ["npm", "maven", "rubygems", "docker", "nuget", "CONTAINER"], "description": "The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry." }, "html_url": { "type": "string", "format": "uri" }, diff --git a/payload-schemas/api.github.com/registry_package/updated.schema.json b/payload-schemas/api.github.com/registry_package/updated.schema.json index 249e9f889..460391327 100644 --- a/payload-schemas/api.github.com/registry_package/updated.schema.json +++ b/payload-schemas/api.github.com/registry_package/updated.schema.json @@ -33,7 +33,7 @@ "ecosystem": { "type": "string" }, "package_type": { "type": "string", - "enum": ["npm", "maven", "rubygems", "docker", "nuget", "container"], + "enum": ["npm", "maven", "rubygems", "docker", "nuget", "CONTAINER"], "description": "The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry." }, "html_url": { "type": "string", "format": "uri" }, diff --git a/payload-types/schema.d.ts b/payload-types/schema.d.ts index 1d4b196fe..7bbe6c40d 100644 --- a/payload-types/schema.d.ts +++ b/payload-types/schema.d.ts @@ -4591,7 +4591,7 @@ export interface PackagePublishedEvent { | "rubygems" | "docker" | "nuget" - | "container"; + | "CONTAINER"; html_url: string; created_at: string; updated_at: string; @@ -4809,7 +4809,7 @@ export interface PackageUpdatedEvent { | "rubygems" | "docker" | "nuget" - | "container"; + | "CONTAINER"; html_url: string; created_at: string; updated_at: string; @@ -6260,7 +6260,7 @@ export interface RegistryPackagePublishedEvent { | "rubygems" | "docker" | "nuget" - | "container"; + | "CONTAINER"; html_url: string; created_at: string; updated_at: string | null; @@ -6406,7 +6406,7 @@ export interface RegistryPackageUpdatedEvent { | "rubygems" | "docker" | "nuget" - | "container"; + | "CONTAINER"; html_url: string; created_at: string; updated_at: string | null; From f17cc3edfaafd55b467acad714e4e0901f8a98ea Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sun, 11 Dec 2022 13:14:47 -0500 Subject: [PATCH 06/10] fix: add `package_url` property to `package` event --- payload-schemas/api.github.com/package/published.schema.json | 1 + payload-schemas/api.github.com/package/updated.schema.json | 1 + 2 files changed, 2 insertions(+) diff --git a/payload-schemas/api.github.com/package/published.schema.json b/payload-schemas/api.github.com/package/published.schema.json index 34ac2a997..9d883b16c 100644 --- a/payload-schemas/api.github.com/package/published.schema.json +++ b/payload-schemas/api.github.com/package/published.schema.json @@ -240,6 +240,7 @@ "additionalProperties": false } }, + "package_url": { "type": "string" }, "author": { "$ref": "common/user.schema.json" }, "source_url": { "type": "string" }, "installation_command": { "type": "string" } diff --git a/payload-schemas/api.github.com/package/updated.schema.json b/payload-schemas/api.github.com/package/updated.schema.json index 4ea22b516..3e48628a0 100644 --- a/payload-schemas/api.github.com/package/updated.schema.json +++ b/payload-schemas/api.github.com/package/updated.schema.json @@ -239,6 +239,7 @@ "additionalProperties": false } }, + "package_url": { "type": "string" }, "author": { "$ref": "common/user.schema.json" }, "source_url": { "type": "string" }, "installation_command": { "type": "string" } From 1d5192c05ee0b973dcbfd1ff50a55fdd2eed93a4 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sun, 11 Dec 2022 13:28:50 -0500 Subject: [PATCH 07/10] fix: add missing properties to `registry_package` event --- .../registry_package/published.schema.json | 63 ++++++++++++++++--- .../registry_package/updated.schema.json | 57 +++++++++++++++-- 2 files changed, 108 insertions(+), 12 deletions(-) diff --git a/payload-schemas/api.github.com/registry_package/published.schema.json b/payload-schemas/api.github.com/registry_package/published.schema.json index a542ee7cf..424f7e203 100644 --- a/payload-schemas/api.github.com/registry_package/published.schema.json +++ b/payload-schemas/api.github.com/registry_package/published.schema.json @@ -41,6 +41,7 @@ "updated_at": { "type": ["string", "null"], "format": "date-time" }, "owner": { "$ref": "common/user.schema.json" }, "package_version": { + "description": "A version of a software package", "oneOf": [ { "type": "object", @@ -55,7 +56,6 @@ "package_files", "installation_command" ], - "description": "A version of a software package", "properties": { "id": { "type": "integer", @@ -103,10 +103,12 @@ "name": { "type": "string" }, "path": { "type": "string" }, "size": { "type": ["integer", "null"] }, - "collection": { "type": "null" } + "collection": { "type": ["boolean", "null"] } }, "additionalProperties": false - } + }, + "attributes": { "type": "object", "properties": {} }, + "_formatted": { "type": "boolean" } }, "additionalProperties": false } @@ -163,13 +165,57 @@ "properties": { "labels": { "oneOf": [ - { "type": "object", "additionalProperties": false }, + { + "type": "object", + "properties": { + "description": { "type": "string" }, + "source": { "type": "string", "format": "uri" }, + "revision": { "type": "string" }, + "image_url": { "type": "string", "format": "uri" }, + "licenses": { "type": "string" }, + "all_labels": { + "type": "object", + "additionalProperties": { "type": "string" } + } + }, + "additionalProperties": false + }, { "type": "null" } ] }, "manifest": { "oneOf": [ - { "type": "object", "additionalProperties": false }, + { + "type": "object", + "properties": { + "digest": { "type": "string" }, + "media_type": { "type": "string" }, + "uri": { "type": "string" }, + "size": { "type": "integer" }, + "config": { + "type": "object", + "properties": { + "digest": { "type": "string" }, + "media_type": { "type": "string" }, + "size": { "type": "integer" } + }, + "additionalProperties": false + }, + "layers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "digest": { "type": "string" }, + "media_type": { "type": "string" }, + "size": { "type": "integer" } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, { "type": "null" } ] }, @@ -186,7 +232,7 @@ }, "npm_metadata": { "oneOf": [ - { "$ref": "common/package-npm-metadata.schema.json"}, + { "$ref": "common/package-npm-metadata.schema.json" }, { "type": "null" } ] }, @@ -194,7 +240,9 @@ "oneOf": [ { "type": "array", - "items": { "$ref": "common/package-nuget-metadata.schema.json" } + "items": { + "$ref": "common/package-nuget-metadata.schema.json" + } }, { "type": "null" } ] @@ -233,6 +281,7 @@ "additionalProperties": false } }, + "package_url": { "type": "string" }, "author": { "type": "object", "required": [ diff --git a/payload-schemas/api.github.com/registry_package/updated.schema.json b/payload-schemas/api.github.com/registry_package/updated.schema.json index 460391327..19a83a0c7 100644 --- a/payload-schemas/api.github.com/registry_package/updated.schema.json +++ b/payload-schemas/api.github.com/registry_package/updated.schema.json @@ -41,6 +41,7 @@ "updated_at": { "type": ["string", "null"], "format": "date-time" }, "owner": { "$ref": "common/user.schema.json" }, "package_version": { + "description": "A version of a software package", "oneOf": [ { "type": "object", @@ -55,7 +56,6 @@ "package_files", "installation_command" ], - "description": "A version of a software package", "properties": { "id": { "type": "integer", @@ -103,10 +103,12 @@ "name": { "type": "string" }, "path": { "type": "string" }, "size": { "type": ["integer", "null"] }, - "collection": { "type": "null" } + "collection": { "type": ["boolean", "null"] } }, "additionalProperties": false - } + }, + "attributes": { "type": "object", "properties": {} }, + "_formatted": { "type": "boolean" } }, "additionalProperties": false } @@ -163,13 +165,57 @@ "properties": { "labels": { "oneOf": [ - { "type": "object", "additionalProperties": false }, + { + "type": "object", + "properties": { + "description": { "type": "string" }, + "source": { "type": "string", "format": "uri" }, + "revision": { "type": "string" }, + "image_url": { "type": "string", "format": "uri" }, + "licenses": { "type": "string" }, + "all_labels": { + "type": "object", + "additionalProperties": { "type": "string" } + } + }, + "additionalProperties": false + }, { "type": "null" } ] }, "manifest": { "oneOf": [ - { "type": "object", "additionalProperties": false }, + { + "type": "object", + "properties": { + "digest": { "type": "string" }, + "media_type": { "type": "string" }, + "uri": { "type": "string" }, + "size": { "type": "integer" }, + "config": { + "type": "object", + "properties": { + "digest": { "type": "string" }, + "media_type": { "type": "string" }, + "size": { "type": "integer" } + }, + "additionalProperties": false + }, + "layers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "digest": { "type": "string" }, + "media_type": { "type": "string" }, + "size": { "type": "integer" } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, { "type": "null" } ] }, @@ -235,6 +281,7 @@ "additionalProperties": false } }, + "package_url": { "type": "string" }, "author": { "type": "object", "required": [ From 19c7bcbb9f4f550bc6951fd7eb89f18867402ce5 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sun, 11 Dec 2022 13:29:14 -0500 Subject: [PATCH 08/10] fix: move the `description` to be outside the `oneOf` --- payload-schemas/api.github.com/package/published.schema.json | 2 +- payload-schemas/api.github.com/package/updated.schema.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/payload-schemas/api.github.com/package/published.schema.json b/payload-schemas/api.github.com/package/published.schema.json index 9d883b16c..1ae326876 100644 --- a/payload-schemas/api.github.com/package/published.schema.json +++ b/payload-schemas/api.github.com/package/published.schema.json @@ -41,6 +41,7 @@ "updated_at": { "type": "string", "format": "date-time" }, "owner": { "$ref": "common/user.schema.json" }, "package_version": { + "description": "A version of a software package", "oneOf": [ { "type": "object", @@ -55,7 +56,6 @@ "package_files", "installation_command" ], - "description": "A version of a software package", "properties": { "id": { "type": "integer", diff --git a/payload-schemas/api.github.com/package/updated.schema.json b/payload-schemas/api.github.com/package/updated.schema.json index 3e48628a0..8bbc59a2c 100644 --- a/payload-schemas/api.github.com/package/updated.schema.json +++ b/payload-schemas/api.github.com/package/updated.schema.json @@ -40,6 +40,7 @@ "updated_at": { "type": "string", "format": "date-time" }, "owner": { "$ref": "common/user.schema.json" }, "package_version": { + "description": "A version of a software package", "oneOf": [ { "type": "object", @@ -54,7 +55,6 @@ "package_files", "installation_command" ], - "description": "A version of a software package", "properties": { "id": { "type": "integer", From 402ecdc30ab3c7195356457735eed33888fbfe62 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sun, 11 Dec 2022 13:29:25 -0500 Subject: [PATCH 09/10] build: generate types --- payload-types/schema.d.ts | 84 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 78 insertions(+), 6 deletions(-) diff --git a/payload-types/schema.d.ts b/payload-types/schema.d.ts index 7bbe6c40d..9f030bd9c 100644 --- a/payload-types/schema.d.ts +++ b/payload-types/schema.d.ts @@ -4596,6 +4596,9 @@ export interface PackagePublishedEvent { created_at: string; updated_at: string; owner: User; + /** + * A version of a software package + */ package_version: { /** * Unique identifier of the package version. @@ -4682,6 +4685,7 @@ export interface PackagePublishedEvent { created_at: string; updated_at: string; }[]; + package_url?: string; author?: User; source_url?: string; installation_command: string; @@ -4814,6 +4818,9 @@ export interface PackageUpdatedEvent { created_at: string; updated_at: string; owner: User; + /** + * A version of a software package + */ package_version: { /** * Unique identifier of the package version. @@ -4900,6 +4907,7 @@ export interface PackageUpdatedEvent { created_at: string; updated_at: string; }[]; + package_url?: string; author?: User; source_url?: string; installation_command: string; @@ -6265,6 +6273,9 @@ export interface RegistryPackagePublishedEvent { created_at: string; updated_at: string | null; owner: User; + /** + * A version of a software package + */ package_version: { /** * Unique identifier of the package version. @@ -6290,8 +6301,12 @@ export interface RegistryPackagePublishedEvent { name: string; path: string; size: number | null; - collection: null; + collection: boolean | null; }; + attributes?: { + [k: string]: unknown; + }; + _formatted?: boolean; }; body_html?: string; release?: { @@ -6322,8 +6337,32 @@ export interface RegistryPackagePublishedEvent { metadata: unknown[]; docker_metadata?: unknown[]; container_metadata?: { - labels?: {} | null; - manifest?: {} | null; + labels?: { + description?: string; + source?: string; + revision?: string; + image_url?: string; + licenses?: string; + all_labels?: { + [k: string]: string; + }; + } | null; + manifest?: { + digest?: string; + media_type?: string; + uri?: string; + size?: number; + config?: { + digest?: string; + media_type?: string; + size?: number; + }; + layers?: { + digest?: string; + media_type?: string; + size?: number; + }[]; + } | null; tag?: { digest?: string; name?: string; @@ -6345,6 +6384,7 @@ export interface RegistryPackagePublishedEvent { created_at: string; updated_at: string; }[]; + package_url?: string; author?: { avatar_url: string; events_url: string; @@ -6411,6 +6451,9 @@ export interface RegistryPackageUpdatedEvent { created_at: string; updated_at: string | null; owner: User; + /** + * A version of a software package + */ package_version: { /** * Unique identifier of the package version. @@ -6436,8 +6479,12 @@ export interface RegistryPackageUpdatedEvent { name: string; path: string; size: number | null; - collection: null; + collection: boolean | null; + }; + attributes?: { + [k: string]: unknown; }; + _formatted?: boolean; }; body_html?: string; release?: { @@ -6468,8 +6515,32 @@ export interface RegistryPackageUpdatedEvent { metadata: unknown[]; docker_metadata?: unknown[]; container_metadata?: { - labels?: {} | null; - manifest?: {} | null; + labels?: { + description?: string; + source?: string; + revision?: string; + image_url?: string; + licenses?: string; + all_labels?: { + [k: string]: string; + }; + } | null; + manifest?: { + digest?: string; + media_type?: string; + uri?: string; + size?: number; + config?: { + digest?: string; + media_type?: string; + size?: number; + }; + layers?: { + digest?: string; + media_type?: string; + size?: number; + }[]; + } | null; tag?: { digest?: string; name?: string; @@ -6491,6 +6562,7 @@ export interface RegistryPackageUpdatedEvent { created_at: string; updated_at: string; }[]; + package_url?: string; author?: { avatar_url: string; events_url: string; From 8ece2ebe4416e808e98e8111d1e1e1c87f7ac925 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Tue, 13 Dec 2022 19:50:26 -0500 Subject: [PATCH 10/10] fix: specify `additionalProperties` to be type `string` --- .../common/package-npm-metadata.schema.json | 60 +++++++++++++++---- payload-types/schema.d.ts | 20 +++---- 2 files changed, 60 insertions(+), 20 deletions(-) diff --git a/payload-schemas/api.github.com/common/package-npm-metadata.schema.json b/payload-schemas/api.github.com/common/package-npm-metadata.schema.json index 062faf806..cae28c177 100644 --- a/payload-schemas/api.github.com/common/package-npm-metadata.schema.json +++ b/payload-schemas/api.github.com/common/package-npm-metadata.schema.json @@ -6,19 +6,51 @@ "name": { "type": "string" }, "version": { "type": "string" }, "npm_user": { "type": "string" }, - "author": { "type": ["object", "null"] }, - "bugs": { "type": ["object", "null"] }, - "dependencies": { "type": "object" }, - "dev_dependencies": { "type": "object" }, - "peer_dependencies": { "type": "object" }, - "optional_dependencies": { "type": "object" }, + "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": { "type": ["object", "null"] }, + "dist": { + "oneOf": [ + { "type": "object", "additionalProperties": { "type": "string" } }, + { "type": "null" } + ] + }, "git_head": { "type": "string" }, "homepage": { "type": "string" }, "license": { "type": "string" }, "main": { "type": "string" }, - "repository": { "type": ["object", "null"] }, + "repository": { + "oneOf": [ + { "type": "object", "additionalProperties": { "type": "string" } }, + { "type": "null" } + ] + }, "scripts": { "type": "object" }, "id": { "type": "string" }, "node_version": { "type": "string" }, @@ -26,12 +58,20 @@ "has_shrinkwrap": { "type": "boolean" }, "maintainers": { "type": "array", "items": { "type": "object" } }, "contributors": { "type": "array", "items": { "type": "object" } }, - "engines": { "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": { "type": ["object", "null"] }, + "directories": { + "oneOf": [ + { "type": "object", "additionalProperties": { "type": "string" } }, + { "type": "null" } + ] + }, "os": { "type": "array", "items": { "type": "string" } }, "cpu": { "type": "array", "items": { "type": "string" } }, "readme": { "type": "string" }, diff --git a/payload-types/schema.d.ts b/payload-types/schema.d.ts index 9f030bd9c..5d47dc684 100644 --- a/payload-types/schema.d.ts +++ b/payload-types/schema.d.ts @@ -4707,33 +4707,33 @@ export interface PackageNPMMetadata { version?: string; npm_user?: string; author?: { - [k: string]: unknown; + [k: string]: string; } | null; bugs?: { - [k: string]: unknown; + [k: string]: string; } | null; dependencies?: { - [k: string]: unknown; + [k: string]: string; }; dev_dependencies?: { - [k: string]: unknown; + [k: string]: string; }; peer_dependencies?: { - [k: string]: unknown; + [k: string]: string; }; optional_dependencies?: { - [k: string]: unknown; + [k: string]: string; }; description?: string; dist?: { - [k: string]: unknown; + [k: string]: string; } | null; git_head?: string; homepage?: string; license?: string; main?: string; repository?: { - [k: string]: unknown; + [k: string]: string; } | null; scripts?: { [k: string]: unknown; @@ -4749,7 +4749,7 @@ export interface PackageNPMMetadata { [k: string]: unknown; }[]; engines?: { - [k: string]: unknown; + [k: string]: string; }; keywords?: string[]; files?: string[]; @@ -4760,7 +4760,7 @@ export interface PackageNPMMetadata { [k: string]: unknown; }; directories?: { - [k: string]: unknown; + [k: string]: string; } | null; os?: string[]; cpu?: string[];