From 6fc666a95a2cebe28581e09f12105945fdee106f Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Tue, 30 Mar 2021 21:42:55 -0400 Subject: [PATCH 1/2] fix: type of `InstallationCreatedEvent#requester` should be `User` and not `null` Fixes #427 --- index.json | 100 ++++++++++++++++++ .../created.with-requester.payload.json | 100 ++++++++++++++++++ .../schemas/installation/created.schema.json | 2 +- schema.d.ts | 2 +- 4 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 payload-examples/api.github.com/installation/created.with-requester.payload.json diff --git a/index.json b/index.json index 4d8760266..5a397a61f 100644 --- a/index.json +++ b/index.json @@ -10632,6 +10632,106 @@ "site_admin": false } }, + { + "action": "created", + "installation": { + "id": 957387, + "account": { + "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 + }, + "repository_selection": "selected", + "access_tokens_url": "https://api.github.com/app/installations/957387/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/settings/installations/957387", + "app_id": 29310, + "target_id": 21031067, + "target_type": "User", + "permissions": { + "administration": "write", + "checks": "write", + "contents": "write", + "deployments": "write", + "issues": "write", + "pages": "write", + "pull_requests": "write", + "repository_hooks": "write", + "repository_projects": "write", + "statuses": "write", + "metadata": "read", + "vulnerability_alerts": "read" + }, + "events": [], + "created_at": 1557933591, + "updated_at": 1557933591, + "single_file_name": null + }, + "repositories": [ + { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false + } + ], + "requester": { + "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 + }, + "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": "deleted", "installation": { diff --git a/payload-examples/api.github.com/installation/created.with-requester.payload.json b/payload-examples/api.github.com/installation/created.with-requester.payload.json new file mode 100644 index 000000000..29e66ea8f --- /dev/null +++ b/payload-examples/api.github.com/installation/created.with-requester.payload.json @@ -0,0 +1,100 @@ +{ + "action": "created", + "installation": { + "id": 957387, + "account": { + "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 + }, + "repository_selection": "selected", + "access_tokens_url": "https://api.github.com/app/installations/957387/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/settings/installations/957387", + "app_id": 29310, + "target_id": 21031067, + "target_type": "User", + "permissions": { + "administration": "write", + "checks": "write", + "contents": "write", + "deployments": "write", + "issues": "write", + "pages": "write", + "pull_requests": "write", + "repository_hooks": "write", + "repository_projects": "write", + "statuses": "write", + "metadata": "read", + "vulnerability_alerts": "read" + }, + "events": [], + "created_at": 1557933591, + "updated_at": 1557933591, + "single_file_name": null + }, + "repositories": [ + { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false + } + ], + "requester": { + "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 + }, + "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-schemas/schemas/installation/created.schema.json b/payload-schemas/schemas/installation/created.schema.json index e15399877..c3a79d5b3 100644 --- a/payload-schemas/schemas/installation/created.schema.json +++ b/payload-schemas/schemas/installation/created.schema.json @@ -31,7 +31,7 @@ "additionalProperties": false } }, - "requester": { "type": "null" }, + "requester": { "$ref": "common/user.schema.json" }, "sender": { "$ref": "common/user.schema.json" } }, "additionalProperties": false, diff --git a/schema.d.ts b/schema.d.ts index e482301df..8c105616d 100644 --- a/schema.d.ts +++ b/schema.d.ts @@ -1938,7 +1938,7 @@ export interface InstallationCreatedEvent { */ private: boolean; }[]; - requester?: null; + requester?: User; sender: User; } /** From 5ebf04f0fc2f3861c7fc44a278549fd0f16ec4db Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Tue, 30 Mar 2021 22:00:40 -0400 Subject: [PATCH 2/2] fix: add `requester` property to `InstallationRepositoriesEvent` --- .../schemas/installation_repositories/added.schema.json | 1 + schema.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/payload-schemas/schemas/installation_repositories/added.schema.json b/payload-schemas/schemas/installation_repositories/added.schema.json index 0f8e255b1..bda19db10 100644 --- a/payload-schemas/schemas/installation_repositories/added.schema.json +++ b/payload-schemas/schemas/installation_repositories/added.schema.json @@ -68,6 +68,7 @@ }, "maxItems": 0 }, + "requester": { "$ref": "common/user.schema.json" }, "sender": { "$ref": "common/user.schema.json" } }, "additionalProperties": false, diff --git a/schema.d.ts b/schema.d.ts index 8c105616d..050a621e2 100644 --- a/schema.d.ts +++ b/schema.d.ts @@ -2119,6 +2119,7 @@ export interface InstallationRepositoriesAddedEvent { * An array of repository objects, which were removed from the installation. */ repositories_removed: []; + requester?: User; sender: User; } export interface InstallationRepositoriesRemovedEvent {